Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.0.8.0
- * @ Author : DeZender
- * @ Release on : 25.09.2017
- * @ Official site : http://DeZender.Net
- *
- */
- define( 'ADMINAREA', true );
- require '../init.php';
- if ($action == 'edit') {
- $reqperm = 'Edit Transaction';
- }
- else {
- $reqperm = 'List Transactions';
- }
- $aInt = new WHMCS\Admin( $reqperm );
- $aInt->title = $aInt->lang( 'transactions', 'title' );
- $aInt->sidebar = 'billing';
- $aInt->icon = 'transactions';
- $aInt->requiredFiles( array(
- 'gatewayfunctions',
- 'invoicefunctions'
- ) );
- $jquerycode = '';
- if ($action == 'add') {
- check_token( 'WHMCS.admin.default' );
- checkPermission( 'Add Transaction' );
- $paymentMethod = $whmcs->get_req_var( 'paymentmethod' );
- $transactionID = $whmcs->get_req_var( 'transid' );
- $amountIn = $whmcs->get_req_var( 'amountin' );
- $fees = $whmcs->get_req_var( 'fees' );
- $date = $whmcs->get_req_var( 'date' );
- $amountOut = $whmcs->get_req_var( 'amountout' );
- $description = $whmcs->get_req_var( 'description' );
- $addCredit = $whmcs->get_req_var( 'addcredit' );
- $currency = $whmcs->get_req_var( 'currency' );
- $client = $whmcs->get_req_var( 'client' );
- $cleanedInvoiceIDs = array( );
- $userInputInvoiceIDs = trim( $whmcs->get_req_var( 'invoiceids' ) );
- if ($userInputInvoiceIDs) {
- $userInputInvoiceIDs = explode( ',', $userInputInvoiceIDs );
- foreach ($userInputInvoiceIDs as $tmpInvID) {
- $tmpInvID = trim( $tmpInvID );
- if (is_numeric( $tmpInvID )) {
- $cleanedInvoiceIDs[] = (int) $tmpInvID;
- }
- }
- }
- $validationError = false;
- $validationErrorDescription = array( );
- if ($client) {
- $currency = 0;
- }
- if ($amountIn < 0) {
- $validationError = true;
- $validationErrorDescription[] = $aInt->lang( 'transactions', 'amountInLessThanZero' ) . PHP_EOL;
- }
- if ($amountOut < 0) {
- $validationError = true;
- $validationErrorDescription[] = $aInt->lang( 'transactions', 'amountOutLessThanZero' ) . PHP_EOL;
- }
- if ((count( $cleanedInvoiceIDs ) == 0) && !($description)) {
- $validationError = true;
- $validationErrorDescription[] = $aInt->lang( 'transactions', 'invoiceIdOrDescriptionRequired' ) . PHP_EOL;
- }
- if ((!($amountOut) || ($amountOut == 0)) && (!($amountIn) || ($amountIn == 0)) && (!($fees) || ($fees == 0))) {
- $validationError = true;
- $validationErrorDescription[] = $aInt->lang( 'transactions', 'amountInOutOrFeeRequired' ) . PHP_EOL;
- }
- .............................................................................
- .......................................
- ..................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement