Advertisement
Guest User

Untitled

a guest
Apr 6th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.0.8.0
  8. * @ Author : DeZender
  9. * @ Release on : 25.09.2017
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. define( 'ADMINAREA', true );
  15. require '../init.php';
  16.  
  17. if ($action == 'edit') {
  18. $reqperm = 'Edit Transaction';
  19. }
  20. else {
  21. $reqperm = 'List Transactions';
  22. }
  23.  
  24. $aInt = new WHMCS\Admin( $reqperm );
  25. $aInt->title = $aInt->lang( 'transactions', 'title' );
  26. $aInt->sidebar = 'billing';
  27. $aInt->icon = 'transactions';
  28. $aInt->requiredFiles( array(
  29. 'gatewayfunctions',
  30. 'invoicefunctions'
  31. ) );
  32. $jquerycode = '';
  33.  
  34. if ($action == 'add') {
  35. check_token( 'WHMCS.admin.default' );
  36. checkPermission( 'Add Transaction' );
  37. $paymentMethod = $whmcs->get_req_var( 'paymentmethod' );
  38. $transactionID = $whmcs->get_req_var( 'transid' );
  39. $amountIn = $whmcs->get_req_var( 'amountin' );
  40. $fees = $whmcs->get_req_var( 'fees' );
  41. $date = $whmcs->get_req_var( 'date' );
  42. $amountOut = $whmcs->get_req_var( 'amountout' );
  43. $description = $whmcs->get_req_var( 'description' );
  44. $addCredit = $whmcs->get_req_var( 'addcredit' );
  45. $currency = $whmcs->get_req_var( 'currency' );
  46. $client = $whmcs->get_req_var( 'client' );
  47. $cleanedInvoiceIDs = array( );
  48. $userInputInvoiceIDs = trim( $whmcs->get_req_var( 'invoiceids' ) );
  49.  
  50. if ($userInputInvoiceIDs) {
  51. $userInputInvoiceIDs = explode( ',', $userInputInvoiceIDs );
  52.  
  53. foreach ($userInputInvoiceIDs as $tmpInvID) {
  54. $tmpInvID = trim( $tmpInvID );
  55.  
  56. if (is_numeric( $tmpInvID )) {
  57. $cleanedInvoiceIDs[] = (int) $tmpInvID;
  58. }
  59. }
  60. }
  61.  
  62. $validationError = false;
  63. $validationErrorDescription = array( );
  64.  
  65. if ($client) {
  66. $currency = 0;
  67. }
  68.  
  69. if ($amountIn < 0) {
  70. $validationError = true;
  71. $validationErrorDescription[] = $aInt->lang( 'transactions', 'amountInLessThanZero' ) . PHP_EOL;
  72. }
  73.  
  74. if ($amountOut < 0) {
  75. $validationError = true;
  76. $validationErrorDescription[] = $aInt->lang( 'transactions', 'amountOutLessThanZero' ) . PHP_EOL;
  77. }
  78.  
  79. if ((count( $cleanedInvoiceIDs ) == 0) && !($description)) {
  80. $validationError = true;
  81. $validationErrorDescription[] = $aInt->lang( 'transactions', 'invoiceIdOrDescriptionRequired' ) . PHP_EOL;
  82. }
  83.  
  84. if ((!($amountOut) || ($amountOut == 0)) && (!($amountIn) || ($amountIn == 0)) && (!($fees) || ($fees == 0))) {
  85. $validationError = true;
  86. $validationErrorDescription[] = $aInt->lang( 'transactions', 'amountInOutOrFeeRequired' ) . PHP_EOL;
  87. }
  88. .............................................................................
  89. .......................................
  90. ..................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement