Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function _BALANCE($user, $type, $mycur) {
- global $trans;
- global $_TXT;
- global $url;
- global $input;
- global $regexp;
- global $match;
- global $matches;
- global $site_url;
- if ($type == "all") {
- $finalRefunds = mysql_fetch_row(mysql_query("SELECT SUM(total) FROM xt_trans WHERE tr_by={$user} AND tr_to='8' AND status='rf' AND secondarystatus='refunded' AND currency='{$mycur}'"));
- $r1 = mysql_fetch_row(mysql_query("SELECT SUM(total) FROM xt_trans WHERE (status='f' OR status='p' OR status='h') AND (tr_to='{$user}' OR (tr_to='2' AND tr_by='{$user}')) AND currency='{$mycur}'"));
- $r1_2 = mysql_fetch_row(mysql_query("SELECT SUM(total) FROM xt_trans WHERE (status='f' OR status='p' OR status='h') AND tr_to='{$user}' AND (tr_by='8' OR tr_by='11') AND transfer_type != 'bal' AND currency='{$Var_936}'"));
- $r2 = mysql_fetch_row(mysql_query("SELECT SUM(total) FROM xt_trans WHERE (status='f' OR status='p' OR status='h' OR status='esc' OR status='o') AND transfer_type='bal' AND tr_by={$user} AND system_comment != 'curconverted' AND currency='{$mycur}'"));
- $r3 = mysql_fetch_row(mysql_query("SELECT SUM(fees) FROM xt_trans WHERE (status='f' OR status='prf' OR status='rf' OR status='p' OR status='h') AND (tr_to='{$user}' OR (tr_to='2' AND tr_by='{$user}')) AND currency='{$mycur}'"));
- $r4 = mysql_fetch_row(mysql_query("SELECT SUM(total) FROM xt_trans WHERE (status='f' OR status='i') AND (tr_to='3' AND tr_by='{$user}') AND currency='{$mycur}' AND secondarystatus != 'converted'"));
- $r5 = mysql_fetch_row(mysql_query("SELECT SUM(total),extended_comment FROM xt_trans WHERE (status='prf' OR status='rf') AND ((tr_by='11' OR tr_by='8') AND tr_to='{$user}') AND currency='{$mycur}' AND transfer_type='bal'"));
- $r6 = mysql_fetch_row(mysql_query("SELECT SUM(total) FROM xt_trans WHERE id='{$r5[1]}' AND (status='prf' OR status='rf') AND tr_by='{$user}' AND currency='{$mycur}' AND transfer_type='bal'"));
- $r7 = mysql_fetch_row(mysql_query("SELECT SUM(total),extended_comment FROM xt_trans WHERE (status='prf' OR status='rf') AND ((tr_to='11' OR tr_to='8') AND tr_by='{$Var_1992}') AND currency='{$mycur}'"));
- return $r1[0] - $r1_2[0] - $r2[0] - $r3[0] - $r4[0] - $r6[0] - $r7[0] - $finalRefunds[0];
- }
- if ($type == "reserve") {
- $resBalance = mysql_fetch_row(mysql_query("SELECT SUM(amount) FROM reserve_hold WHERE released='f' AND user={$user} AND currency='{$mycur}'"));
- return $resBalance[0];
- }
- if ($type == "available") {
- $resBalance = mysql_fetch_row(mysql_query("SELECT SUM(held_amount) FROM xt_reserves WHERE released='f' AND user={$user} AND currency='{$mycur}'"));
- $pendingRefunds = mysql_fetch_row(mysql_query("SELECT SUM(total) FROM xt_trans WHERE tr_by={$user} AND tr_to='11' AND status='prf' AND secondarystatus='refunded' AND currency=''"));
- return _BALANCE($user, all, $mycur) - $pendingRefunds[0] - $resBalance[0];
- }
- if ($type == "side") {
- $endDate = $trans->date;
- $optional = " AND pending=0";
- $r1 = mysql_fetch_row(mysql_query("SELECT SUM(total) FROM xt_trans WHERE (status='f' OR status='p' OR status='h') AND date <= '{$endDate}' AND (tr_to='{$user}' OR (tr_to='2' AND tr_by='{$user}')) AND currency='{$mycur}'"));
- $r2 = mysql_fetch_row(mysql_query("SELECT SUM(total) FROM xt_trans WHERE (status='f' OR status='p' OR status='h' OR status='esc') AND date <= '{$endDate}' AND transfer_type='bal' AND tr_by='{$user}' AND currency='{$mycur}'"));
- $r3 = mysql_fetch_row(mysql_query("SELECT SUM(fees) FROM xt_trans WHERE (status='f' OR status='p' OR status='h') AND date <= '{$endDate}' AND (tr_to='{$user}' OR (tr_to='2' AND tr_by='{$user}')) AND currency='{$mycur}'"));
- $r4 = mysql_fetch_row(mysql_query("SELECT SUM(total) FROM xt_trans WHERE (status='f' OR status='i') AND date <= '{$endDate}' AND ((tr_to='3' AND tr_by='{$user}')) AND currency='{$mycur}'"));
- return $r1[0] - $r2[0] - $r3[0] - $r4[0];
- }
- }
- function TR_MONEY($by, $to, $amount, $fee, $status, $chargetocurrency, $debug) {
- global $_TXT;
- global $sales_tax;
- global $send_i;
- global $send_r;
- global $referral_payout;
- global $affil_on;
- global $_POST;
- global $user;
- global $ccID;
- global $data;
- global $a_resheld;
- global $a_reshper;
- global $_SESSION;
- global $a_reshdays;
- global $isSubscription;
- global $myrow;
- global $_REQUEST;
- global $_trans_id;
- global $_SESSION;
- global $curtrans;
- global $newconvert;
- global $_CHARGE_TOTAL;
- global $tr_percent;
- global $tr_flat;
- global $key1;
- global $key2;
- global $origconvamount;
- global $_trans_key;
- $key1 = GENERATE_ID("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "12");
- $origconvamount = _ADMIN_SHOW("xt_config_currency WHERE id='{$chargetocurrency}'", cur_convert);
- $trans = DB_ADD("xt_trans SET transnum='{$key1}', tr_by='{$by}',tr_to='{$to}',date=NOW(),total='{$amount}',cur_total='{$_REQUEST['cur_total']}',status='{$status}',currency='{$chargetocurrency}',fees='{$fee}',shipAddy='{$_REQUEST['ship_to']}',cart_item='{$_REQUEST['cart_item']}',payment_for='{$_REQUEST['payment_for']}',transfer_type='{$_REQUEST['funding']}',user_comment='" . addslashes($_REQUEST['memo']) . "',trtype_id='{$_REQUEST['fund_id']}',system_comment='{$_REQUEST['system_comment']}',extended_comment='{$_REQUEST['extended_comment']}',ccgwtransid='{$_REQUEST['ccgwtransid']}',origtransid='{$_REQUEST['origtransid']}',secondarystatus='{$_REQUEST['secondarystatus']}',origconvertion='{$origconvamount}',transrefid='{$_REQUEST['transrefid']}'", $debug);
- $trans = 1;
- $_trans_id = mysql_insert_id();
- $_trans_key = $key1;
- $_REQUEST['default_currency'] = _ADMIN_SHOW("xt_config_currency WHERE cur_default='t' AND cur_status='t' ORDER BY id ASC LIMIT 1", id);
- if ($_REQUEST['default_currency'] != $chargetocurrency) {
- $newconvert = _CONVERT_CURRENCY($amount, $chargetocurrency, $_REQUEST['default_currency']);
- if (_ADMIN_SHOW("xt_members WHERE id='{$to}'", account_type) == "per") {
- $tr_flat = _GET_TRFEE(per_flat, $_REQUEST['default_currency']);
- $tr_percent = _GET_TRFEE(per_percent, $_REQUEST['default_currency']);
- } else if (_ADMIN_SHOW("xt_members WHERE id='{$to}'", account_type) == "biz") {
- $tr_flat = _GET_TRFEE(bus_flat, $_REQUEST['default_currency']);
- $tr_percent = _GET_TRFEE();
- } else if (_ADMIN_SHOW("xt_members WHERE id='{$to}'", account_type) == "pre") {
- $tr_flat = _GET_TRFEE(pre_flat, $_REQUEST['default_currency']);
- $tr_percent = _GET_TRFEE();
- }
- $fee = TR_FEE($_CHARGE_TOTAL, $tr_percent, $tr_flat);
- $key2 = GENERATE_ID("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "12");
- $origconvamount = _ADMIN_SHOW("xt_config_currency WHERE id='{$Var_4824['default_currency']}'", cur_convert);
- $trans = DB_ADD("xt_trans SET transnum='{$key2}', tr_by='{$by}',tr_to='{$to}',date=NOW(),total='{$_CHARGE_TOTAL}',cur_total='{$_REQUEST['cur_total']}',status='i',currency='{$_REQUEST['default_currency']}',fees='{$fee}',shipAddy='{$_REQUEST['ship_to']}',cart_item='{$_REQUEST['cart_item']}',payment_for='{$_REQUEST['payment_for']}',transfer_type='{$_REQUEST['funding']}',user_comment='" . addslashes($_REQUEST['memo']) . "',trtype_id='{$_REQUEST['fund_id']}',system_comment='{$_REQUEST['system_comment']}',extended_comment='{$_REQUEST['extended_comment']}',ccgwtransid='{$_REQUEST['ccgwtransid']}',origtransid='{$_trans_id}',secondarystatus='converted',origconvertion='{$origconvamount}',transrefid='{$_REQUEST['transrefid']}'", $debug);
- }
- return $_trans_id;
- }
- function CONVERT_MONEY($by, $to, $amount, $fee, $status, $chargetocurrency, $debug) {
- global $_TXT;
- global $sales_tax;
- global $send_i;
- global $send_r;
- global $referral_payout;
- global $affil_on;
- global $_POST;
- global $user;
- global $ccID;
- global $data;
- global $a_resheld;
- global $a_reshper;
- global $_SESSION;
- global $a_reshdays;
- global $isSubscription;
- global $myrow;
- global $_REQUEST;
- global $_trans_id;
- global $_SESSION;
- global $curtrans;
- global $newconvert;
- global $_CHARGE_TOTAL;
- global $tr_percent;
- global $tr_flat;
- global $key2;
- global $_convert_id;
- $key2 = GENERATE_ID("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "12");
- $origconvamount = _ADMIN_SHOW("xt_config_currency WHERE id='{$chargetocurrency}'", cur_convert);
- $trans = DB_ADD($Tmp_69 . "xt_trans SET transnum='{$key2}',tr_by='{$by}',tr_to='{$to}',date=NOW(),total='{$amount}',cur_total='{$_REQUEST['conver_cur_total']}',status='{$status}',currency='{$chargetocurrency}',fees='{$fee}',shipAddy='{$_REQUEST['conver_ship_to']}',cart_item='{$_REQUEST['conver_cart_item']}',payment_for='{$_REQUEST['conver_payment_for']}',transfer_type='{$_REQUEST['conver_funding']}',user_comment='" . addslashes($_REQUEST['conver_memo']) . "',trtype_id='{$_REQUEST['conver_fund_id']}',system_comment='{$_REQUEST['conver_system_comment']}',extended_comment='{$_REQUEST['conver_extended_comment']}',ccgwtransid='{$_REQUEST['conver_ccgwtransid']}',origtransid='{$_REQUEST['conver_origtransid']}',secondarystatus='{$_REQUEST['conver_secondarystatus']}',origconvertion='{$origconvamount}',transrefid='{$_REQUEST['transrefid']}'", $debug);
- $trans = 1;
- $_convert_id = mysql_insert_id();
- return $_convert_id;
- }
- function hexBin($data) {
- $len = strlen($data);
- return pack("H" . $len, $data);
- }
- function _encryptLIC($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "301778a94a97f1441c6fc56112e92000";
- $cipher_alg = MCRYPT_RIJNDAEL_256;
- $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg, MCRYPT_MODE_ECB), MCRYPT_RAND);
- $encrypted_string = mcrypt_encrypt($cipher_alg, $cckey, $theString, MCRYPT_MODE_CBC, $iv);
- return bin2hex($iv) . bin2hex($encrypted_string);
- }
- function _decryptLIC($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "301778a94a97f1441c6fc56112e92000";
- if (strlen($theString) < 1) {
- return "<font color=red>Unable to decrypt string. [error: 0314]</font>";
- }
- $iv = substr($theString, 0, 64);
- $theStringwoiv = substr($theString, 64);
- $cipher_alg = MCRYPT_RIJNDAEL_256;
- $theStringBin = hexbin($theStringwoiv);
- return mcrypt_decrypt($cipher_alg, $cckey, $theStringBin, MCRYPT_MODE_CBC, hexbin($iv));
- }
- function _encryptPW($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "deiwlksdf5e485w1dsf2s58wlsdlkwoielsdflkweingf2859045lsfnlsdiw93p";
- $cipher_alg = MCRYPT_RIJNDAEL_256;
- $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg, MCRYPT_MODE_ECB), MCRYPT_RAND);
- $encrypted_string = mcrypt_encrypt($cipher_alg, $cckey, $theString, MCRYPT_MODE_CBC, $iv);
- return bin2hex($iv) . bin2hex($encrypted_string);
- }
- function _decryptPW($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "deiwlksdf5e485w1dsf2s58wlsdlkwoielsdflkweingf2859045lsfnlsdiw93p";
- if (strlen($theString) < 1) {
- return "<font color=red>Unable to decrypt string. [error: 0311]</font>";
- }
- $iv = substr($theString, 0, 64);
- $theStringwoiv = substr($theString, 64);
- $cipher_alg = MCRYPT_RIJNDAEL_256;
- $theStringBin = hexbin($theStringwoiv);
- return mcrypt_decrypt($cipher_alg, $cckey, $theStringBin, MCRYPT_MODE_CBC, hexbin($iv));
- }
- function _encryptData($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "R13C7EN3UVFRWDG5T5EHMLFZ4FWO4JAVKD8QSVSMR9DOMUSGY8XLSDKVTGKW1VRK";
- $cipher_alg = MCRYPT_RIJNDAEL_256;
- $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg, MCRYPT_MODE_ECB), MCRYPT_RAND);
- $encrypted_string = mcrypt_encrypt($cipher_alg, $cckey, $theString, MCRYPT_MODE_CBC, $iv);
- return bin2hex($iv) . bin2hex($encrypted_string);
- }
- function _decryptData($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "R13C7EN3UVFRWDG5T5EHMLFZ4FWO4JAVKD8QSVSMR9DOMUSGY8XLSDKVTGKW1VRK";
- if (strlen($theString) < 1) {
- return "<font color=red>Unable to decrypt string. [error: 0311]</font>";
- }
- $iv = substr();
- $theStringwoiv = substr($theString, 64);
- $cipher_alg = MCRYPT_RIJNDAEL_256;
- $theStringBin = hexbin($theStringwoiv);
- return mcrypt_decrypt($cipher_alg, $cckey, $theStringBin, MCRYPT_MODE_CBC, hexbin($iv));
- }
- function _bankEncrypt($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "mmvtd6ssnxe7bm08nvr7myzw461005nlh06l5o4ib8fcke0x1qucfkz9fq8eklqs";
- $cipher_alg = MCRYPT_RIJNDAEL_256;
- $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg, MCRYPT_MODE_ECB), MCRYPT_RAND);
- $encrypted_string = mcrypt_encrypt($cipher_alg, $cckey, $theString, MCRYPT_MODE_CBC, $iv);
- return bin2hex($iv) . bin2hex($encrypted_string);
- }
- function _bankDecrypt($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "mmvtd6ssnxe7bm08nvr7myzw461005nlh06l5o4ib8fcke0x1qucfkz9fq8eklqs";
- if (strlen($theString) < 1) {
- return "<font color=red>Unable to decrypt string. [error: 0311]</font>";
- }
- $iv = substr($theString, 0, 64);
- $theStringwoiv = substr($theString, 64);
- $cipher_alg = MCRYPT_RIJNDAEL_256;
- $theStringBin = hexbin($theStringwoiv);
- return mcrypt_decrypt($cipher_alg, $cckey, $theStringBin, MCRYPT_MODE_CBC, hexbin($iv));
- }
- function _ccEncrypt($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "74655255d1c61fcb9db237785005807db5720c965d449214859c46579d636491";
- $cipher_alg = MCRYPT_RIJNDAEL_256;
- $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg, MCRYPT_MODE_ECB), MCRYPT_RAND);
- $encrypted_string = mcrypt_encrypt($cipher_alg, $cckey, $theString, MCRYPT_MODE_CBC, $iv);
- return bin2hex($iv) . bin2hex($encrypted_string);
- }
- function _ccDecrypt($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "74655255d1c61fcb9db237785005807db5720c965d449214859c46579d636491";
- if (strlen($theString) < 1) {
- return "<font color=red>Unable to decrypt string. [error: 0211]</font>";
- }
- $iv = substr($theString, 0, 64);
- $theStringwoiv = substr($theString, 64);
- $cipher_alg = MCRYPT_RIJNDAEL_256;
- $theStringBin = hexbin($theStringwoiv);
- return mcrypt_decrypt($cipher_alg, $cckey, $theStringBin, MCRYPT_MODE_CBC, hexbin($iv));
- }
- function _formEncrypt($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "74655255d1c61fcb9db237785005807db5720c965d449214859c46579d636491";
- $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg, MCRYPT_MODE_ECB), MCRYPT_RAND);
- $encrypted_string = mcrypt_encrypt($cipher_alg, $cckey, $theString, MCRYPT_MODE_CBC, $iv);
- return bin2hex($iv) . bin2hex($encrypted_string);
- }
- function _formDecrypt($theString) {
- global $_TXT;
- global $cckey;
- global $encrypted_string;
- global $cipher_alg;
- global $iv;
- $cckey = "74655255d1c61fcb9db237785005807db5720c965d449214859c46579d636491";
- if (strlen($theString) < 1) {
- return "<font color=red>Unable to decrypt string. [error: 0211]</font>";
- }
- $iv = substr($theString, 0, 64);
- $theStringwoiv = substr($theString, 64);
- $cipher_alg = MCRYPT_RIJNDAEL_256;
- $theStringBin = hexbin($theStringwoiv);
- return mcrypt_decrypt($cipher_alg, $cckey, $theStringBin, MCRYPT_MODE_CBC, hexbin($iv));
- }
- function _validateCC($cardnumber, $cardname, &$errornumber, &$errortext) {
- $cards = array(array("name" => "American Express", "length" => "15", "prefixes" => "34,37", "checkdigit" => true), array("name" => "Carte Blanche", "length" => "14", "prefixes" => "300,301,302,303,304,305,36,38", "checkdigit" => true), array("name" => "Diners Club", "length" => "14", "prefixes" => "300,301,302,303,304,305,36,38", "checkdigit" => true), array("name" => "Discover", "length" => "16", "prefixes" => "6011", "checkdigit" => true), array("name" => "Enroute", "length" => "15", "prefixes" => "2014,2149", "checkdigit" => true), array("name" => "JCB", "length" => "15,16", "prefixes" => "3,1800,2131", "checkdigit" => true), array("name" => "Maestro", "length" => "16", "prefixes" => "5020,6", "checkdigit" => true), array("name" => "MasterCard", "length" => "16", "prefixes" => "51,52,53,54,55", "checkdigit" => true), array("name" => "Solo", "length" => "16,18,19", "prefixes" => "6334, 6767", "checkdigit" => true), array("name" => "Switch", "length" => "16,18,19", "prefixes" => "4903,4905,4911,4936,564182,633110,6333,6759", "checkdigit" => true), array("name" => "Visa", "length" => "13,16", "prefixes" => "4", "checkdigit" => true), array("name" => "Visa Electron", "length" => "16", "prefixes" => "417500,4917,4913", "checkdigit" => true));
- $ccErrorNo = 0;
- $ccErrors[0] = "Unknown card type";
- $ccErrors[1] = "No card number provided";
- $ccErrors[2] = "Credit card number has invalid format";
- $ccErrors[3] = "Credit card number is invalid";
- $ccErrors[4] = "Credit card number is wrong length";
- $cardType = 0 - 1;
- $i = 0;
- while ($i < sizeof($cards)) {
- if (strtolower($cardname) == strtolower($cards[$i]['name'])) {
- $cardType = $i;
- break;
- }
- ++$i;
- }
- if ($cardType == 0 - 1) {
- $errornumber = 0;
- $Var_1800 = $ccErrors[$errornumber];
- return false;
- }
- if (strlen($cardnumber) == 0) {
- $errornumber = 1;
- $errortext = $ccErrors[$errornumber];
- return false;
- }
- $cardNo = str_replace(" ", "", $cardnumber);
- if (!eregi("^[0-9]{13,19}\$", $cardNo)) {
- $errornumber = 2;
- $errortext = $ccErrors[$errornumber];
- return false;
- }
- if ($cards[$cardType]['checkdigit']) {
- $checksum = 0;
- $mychar = "";
- $j = 1;
- $i = strlen($cardNo) - 1;
- while (0 <= $i) {
- $calc = $Var_3096 * $j;
- if (9 < $calc) {
- $checksum = $checksum + 1;
- $calc = $calc - 10;
- }
- $checksum = $checksum + $calc;
- if ($j == 1) {
- $j = 2;
- } else {
- $j = 1;
- }
- --$i;
- }
- if ($checksum % 10 != 0) {
- $errornumber = 3;
- $errortext = $ccErrors[$errornumber];
- return false;
- }
- }
- $prefix = split(",", $cards[$cardType]['prefixes']);
- $PrefixValid = false;
- $i = 0;
- while ($Var_4248 < sizeof($prefix)) {
- $exp = "^" . $prefix[$i];
- if (ereg($exp, $cardNo)) {
- $PrefixValid = true;
- break;
- }
- ++$i;
- }
- if (!$PrefixValid) {
- $errornumber = 3;
- $errortext = $ccErrors[$errornumber];
- return false;
- }
- $LengthValid = false;
- $lengths = split(",", $cards[$cardType]['length']);
- $j = 0;
- while ($j < sizeof($lengths)) {
- if (strlen($cardNo) == $lengths[$j]) {
- $LengthValid = true;
- break;
- }
- ++$j;
- }
- if (!$LengthValid) {
- $errornumber = 4;
- $errortext = $ccErrors[$errornumber];
- return false;
- }
- return true;
- }
- function _ifExists($do, $string) {
- global $_TXT;
- global $resultcc;
- global $myrow;
- global $data;
- if ($do == "cc") {
- $resultcc = mysql_query("SELECT * FROM xt_cc");
- do {
- if (!($myrow = mysql_fetch_array())) {
- break;
- } else {
- $myrow['ccNum'] = trim(_ccdecrypt($myrow['ccNum']));
- }
- }
- while (!($myrow['ccNum'] == $string));
- return 1;
- }
- if ($do == "bank") {
- $resultbank = mysql_query("SELECT * FROM xt_banks");
- do {
- if (!($mybank = mysql_fetch_array($resultbank))) {
- break;
- } else {
- $mybank['acct'] = trim(_bankdecrypt($mybank['acct']));
- }
- }
- while (!($mybank['acct'] == $string));
- return 1;
- }
- }
- function _showIndividuals($user, $what, $id, $option, $dec) {
- global $_TXT;
- global $cards;
- global $cards1;
- global $ccType;
- global $ccString;
- global $bank;
- global $bank1;
- global $bankString;
- if ($what == "card") {
- $cards1 = mysql_query("SELECT * FROM xt_cc WHERE user='{$user}' AND id='{$id}'");
- $cards = mysql_fetch_object($Var_720);
- if ($dec == "f") {
- $ccString = trim(_ccdecrypt($cards->ccNum));
- } else {
- $ccString = trim(_ccdecrypt($cards->ccNum));
- $ccString = substr($ccString, 0, 1) . XXXX . substr($ccString, 0 - 2, 2);
- }
- $ccType = $cards->ccType;
- if ($option) {
- return "{$ccType} {$ccString}";
- }
- return "{$ccString}";
- }
- if ($what == "bank") {
- $bank1 = mysql_query("SELECT * FROM xt_banks WHERE user='{$user}' AND id='{$id}'");
- $bank = mysql_fetch_object($bank1);
- if ($dec == "f") {
- $bankString = trim(_bankdecrypt($bank->acct));
- } else {
- $bankString = trim(_bankdecrypt($bank->acct));
- $bankString = substr($bankString, 0, 1) . XX . substr($bankString, 0 - 2, 2);
- }
- if ($option) {
- return "{$bank->bank_name} {$bankString}";
- }
- return "{$bankString}";
- }
- }
- function _showIndividuals_ADMIN($user, $what, $id, $option, $dec) {
- global $_TXT;
- global $cards;
- global $cards1;
- global $ccType;
- global $ccString;
- global $bank;
- global $bank1;
- global $bankString;
- if ($what == "card") {
- $cards1 = mysql_query("SELECT * FROM xt_cc WHERE id='{$id}'");
- $cards = mysql_fetch_object($cards1);
- if ($dec == "f") {
- $ccString = trim(_ccdecrypt($cards->ccNum));
- } else {
- $ccString = trim(_ccdecrypt($cards->ccNum));
- $ccString = substr($ccString, 0, 1) . XXXX . substr($ccString, 0 - 2, 2);
- }
- $ccType = $cards->ccType;
- if ($option) {
- return "{$ccType} {$ccString}";
- }
- return "{$ccString}";
- }
- if ($what == "bank") {
- $bank1 = mysql_query("SELECT * FROM xt_banks WHERE id='{$id}'");
- $bank = mysql_fetch_object($bank1);
- if ($dec == "f") {
- $bankString = trim(_bankdecrypt($bank->acct));
- } else {
- $bankString = trim(_bankdecrypt($bank->acct));
- $bankString = substr($bankString, 0, 1) . XX . substr($bankString, 0 - 2, 2);
- }
- if ($option) {
- }
- return "{$bankString}";
- }
- }
- function _GETMYID($t, $what) {
- global $_TXT;
- $show = mysql_fetch_object(mysql_query("SELECT * FROM xt_emails WHERE email='{$t}' LIMIT 1"));
- return $show->$what;
- }
- function _GETIDNAME($t, $what, $showemail) {
- global $_TXT;
- global $fname;
- global $lname;
- global $email;
- global $company;
- global $show;
- global $showemail;
- global $_ustatus;
- global $showemail;
- $show = mysql_fetch_object(mysql_query("SELECT * FROM xt_members WHERE id='{$t}' LIMIT 1"));
- if (_USERTATS($t) == "u") {
- $_ustatus = "{$_TXT['global_unverified']}";
- } else if (_USERTATS($t) == "v") {
- $_ustatus = "{$_TXT['global_verified']}";
- } else {
- $_ustatus = $_TXT['global_unregisterd'];
- }
- if ($show->account_type == "per") {
- $fname = _ADMIN_SHOW("xt_personal WHERE user='{$t}'", fname);
- $lname = _ADMIN_SHOW("xt_personal WHERE user='{$t}'", lname);
- if ($showemail) {
- $email = _ADMIN_SHOW("xt_members WHERE id='{$t}'", email);
- $showemail = "({$email})";
- }
- if ($what) {
- return "<a href='show.php?inc=member&mid=" . $show->user_unique . "" . $show->id . "' target=_blank>{$fname} {$lname}</a> {$_ustatus} " . _ACCOUNT_RATING() . " {$showemail}";
- }
- return "{$fname} {$lname} {$_ustatus} {$showemail}";
- }
- if ($show->account_type == "biz" || $show->account_type == "pre") {
- $company = _ADMIN_SHOW("xt_company WHERE user='{$t}'", company);
- if ($showemail) {
- $email = _ADMIN_SHOW("xt_company WHERE user='{$t}'", email);
- $showemail = "({$email})";
- }
- if ($what) {
- return "<a href='show.php?inc=member&mid=" . $show->user_unique . "" . $show->id . "' target=_blank>{$company}</a> {$_ustatus} " . _ACCOUNT_RATING($show->id) . " {$showemail}";
- }
- return "{$company} {$_ustatus} {$showemail}";
- }
- return "{$_REQUEST['showthisemail']} {$_ustatus}";
- }
- function TR_FEE($x, $y, $z) {
- global $_TXT;
- return round($x * $y / 100, 2) + $z;
- }
- function _ROUTE($routing, $what) {
- global $_TXT;
- $show = mysql_fetch_object(mysql_query("SELECT * FROM xt_fedrouting WHERE routing='{$routing}'"));
- return $show->$what;
- }
- function _POSTAL($postal, $what) {
- global $_TXT;
- $show = mysql_fetch_object(mysql_query("SELECT * FROM xt_countryzip WHERE postal='{$postal}'"));
- return $show->$what;
- }
- function _SHOWCOUNTRIES($what, $selected) {
- global $_TXT;
- global $countries;
- $countries1 = mysql_query("SELECT * FROM xt_countrylist WHERE status='{$what}' ORDER BY country ASC");
- while ($countries = mysql_fetch_object($countries1)) {
- echo "<option value=\"{$countries->country}\"";
- if ($selected == $countries->country) {
- echo " SELECTED";
- }
- echo ">{$countries->country}</option>";
- }
- }
- function _SHOWCALLINGCODES($what, $selected) {
- global $_TXT;
- global $countries;
- $countries1 = mysql_query("SELECT * FROM xt_countrylist WHERE status='{$what}' ORDER BY calling_code ASC");
- while ($countries = mysql_fetch_object($countries1)) {
- echo "<option value=\"{$countries->calling_code}\"";
- if ($Var_432 == $countries->country) {
- echo " SELECTED";
- }
- echo ">+{$countries->calling_code}</option>";
- }
- }
- function _incrementTries($type, $id) {
- global $_TXT;
- global $data;
- global $increment;
- if ($type == "bank") {
- $update1 = "UPDATE xt_banks SET tries=tries+ WHERE id='{$id}' LIMIT 1";
- DB_UPDATE("{$update1}", 0);
- }
- if ($type == "cc") {
- $update1 = "UPDATE xt_cc SET tries=tries+ WHERE id='{$id}' LIMIT 1";
- DB_UPDATE("{$update1}", 0);
- }
- }
- function _DISPLAY_CUR($cur, $type) {
- global $_TXT;
- global $currency_0;
- global $currency_1;
- global $_SESSION;
- $currency_0 = _ADMIN_SHOW("xt_config_currency WHERE id='{$cur}'", cur_symbol);
- $currency_1 = _ADMIN_SHOW("xt_config_currency WHERE id='{$cur}'", cur_code);
- if ($type) {
- }
- return $currency_0;
- }
- function _CREATE_SUBS($user, $duration, $freq, $freq_end, $_trans_id) {
- global $_TXT;
- global $freq_add;
- global $interval;
- global $key1;
- if ($duration == "d") {
- $interval = $freq * 1;
- $interval = "{$interval} DAY";
- }
- if ($duration == "w") {
- $interval = $freq * 7;
- $interval = "{$interval} DAY";
- }
- if ($duration == "m") {
- $interval = $freq * 30;
- $interval = "{$interval} DAY";
- }
- if ($duration == "y") {
- $when = $freq * 363;
- $interval = "{$interval} DAY";
- }
- $key1 = GENERATE_ID("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "12");
- $freq_add = "xt_subs SET uniqueid='{$key1}', user='{$user}',trans_id='{$_trans_id}',duration='{$duration}',freq='{$freq}',start=NOW(),next=(NOW() + INTERVAL {$interval}),charge='0', end='{$freq_end}',status='t'";
- DB_ADD($freq_add, 0);
- }
- function _GETCBSTATUS($cb, $t, $what) {
- global $_TXT;
- $show = mysql_fetch_object(mysql_query("SELECT * FROM {$cb} WHERE id='{$t}' LIMIT 1"));
- return $show->$what;
- }
- function _showTransPage($start, $end) {
- global $data;
- global $trans1;
- global $trans;
- global $sentby;
- global $tr_status;
- global $tr_email;
- global $tr_balanceside;
- global $tr_ttotal;
- global $tr_gemail;
- global $user;
- global $_SESSION;
- global $memberlogo;
- global $logoid;
- global $_TXT;
- global $thiscurrency;
- global $thistrtype;
- $trans2 = "SELECT * \nFROM `xt_trans` \n(tr_by='{$data->id}' OR tr_to='{$data->id}') AND status != 'sms_p' AND secondarystatus != 'converted' AND 'date' LIKE '{$start} %:%:%' ORDER BY id ASC";
- if (!$start || !$end) {
- $trans1 = mysql_query($Tmp_47 . "SELECT * FROM xt_trans WHERE (tr_by='{$data->id}' OR tr_to='{$data->id}') AND status != 'sms_p' AND secondarystatus != 'converted' ORDER BY id DESC LIMIT 0,10");
- $count_trans = mysql_num_rows(mysql_query("SELECT * FROM xt_trans WHERE (tr_by='{$data->id}' OR tr_to='{$data->id}') AND status != 'sms_p' AND secondarystatus != 'converted' ORDER BY id DESC LIMIT 0,10"));
- } else {
- if (0 < $_REQUEST['currency']) {
- $thiscurrency = "AND currency='{$_REQUEST['currency']}'";
- }
- if (0 <= $_REQUEST['transtype']) {
- if ($_REQUEST['transtype'] == 1000) {
- $thistrtype = "AND (tr_by > 1000 AND tr_to > 1000)";
- } else if ($_REQUEST['transtype'] == "0") {
- $thistrtype = "AND (status='mreq' OR status='c' AND payment_for='mreq')";
- } else if ($_REQUEST['transtype'] == "1") {
- $thistrtype = "AND tr_to='1'";
- } else if ($_REQUEST['transtype'] == "2") {
- $thistrtype = "AND (tr_to='2' OR tr_by='2')";
- } else if ($_REQUEST['transtype'] == "3") {
- $thistrtype = "AND (tr_to='3' OR tr_by='3')";
- } else if ($_REQUEST['transtype'] == "4") {
- $thistrtype = "AND (tr_to='4' OR tr_by='4')";
- } else if ($_REQUEST['transtype'] == "5") {
- $thistrtype = "AND tr_by='5'";
- } else if ($_REQUEST['transtype'] == "6") {
- $thistrtype = "AND tr_by='6'";
- } else if ($_REQUEST['transtype'] == "7") {
- $thistrtype = "AND (tr_to='7' OR tr_by='7')";
- } else if ($_REQUEST['transtype'] == "8") {
- $thistrtype = "AND (tr_to='8' OR tr_by='8')";
- } else if ($_REQUEST['transtype'] == "9") {
- $thistrtype = "AND (tr_to='9' OR tr_by='9')";
- } else if ($_REQUEST['transtype'] == "10") {
- $thistrtype = "AND (tr_to='10' OR tr_by='10')";
- } else if ($_REQUEST['transtype'] == "11") {
- $thistrtype = "AND (tr_to='11' OR tr_by='11')";
- } else if ($_REQUEST['transtype'] == "13") {
- $thistrtype = "AND (tr_to='13' OR tr_by='13')";
- } else if ($_REQUEST['transtype'] == "14") {
- $thistrtype = "AND tr_by='14'";
- } else if ($_REQUEST['transtype'] == "15") {
- $thistrtype = "AND tr_by='15'";
- }
- }
- $trans1 = mysql_query("SELECT * FROM xt_trans WHERE (tr_by ='' OR tr_to ='{$data->id}') AND status != 'sms_p' AND secondarystatus != 'converted' AND date BETWEEN '{$start}' AND ('{$end}' + INTERVAL 1 DAY) {$thiscurrency} {$thistrtype} ORDER BY date DESC");
- $count_trans = mysql_num_rows(mysql_query("SELECT * FROM xt_trans WHERE (tr_by ='{$data->id}' OR tr_to ='{$data->id}') AND status != 'sms_p' AND secondarystatus != 'converted' AND date BETWEEN '{$start}' AND ('{$end}' + INTERVAL 1 DAY) {$thiscurrency} {$thistrtype} ORDER BY date DESC"));
- }
- $i = 1;
- while ($trans = mysql_fetch_object($trans1)) {
- if ($trans->tr_to == "2") {
- $trans->total = $trans->total;
- $sentby = $_TXT['global_to'];
- } else if ($trans->tr_to != $user || $trans->tr_to == "3") {
- $trans->total = 0 - $trans->total;
- $sentby = $_TXT['global_to'];
- } else {
- $sentby = $_TXT['global_from'];
- }
- $holds = mysql_fetch_object(mysql_query("SELECT * FROM xt_hold WHERE trans_id='{$trans->id}' LIMIT 0,1"));
- $mreqs = mysql_fetch_object(mysql_query("SELECT * FROM xt_moneyreqs WHERE trans_id='{$trans->id}' LIMIT 0,1"));
- $tr_status = "<a href=\"show.php?inc=emails-verify&y={$trans->extended_comment}&trans=" . $trans->transnum . "" . $trans->id . "\">{$Var_6000}</a>";
- if ($trans->status == "p" && 1 < strlen($trans->extended_comment) && $trans->tr_to == $user) {
- $tr_status = "<a href=\"show.php?inc=emails-verify&y={$trans->extended_comment}&trans=" . $trans->transnum . "" . $trans->id . "\">{$_TXT['transtb_accept']}</a>";
- } else if ($trans->status == "rf") {
- $tr_status = $_TXT['global_st_rf'];
- } else if ($trans->status == "esc") {
- $tr_status = $_TXT['global_st_esc'];
- } else if ($trans->status == "prf") {
- $tr_status = $_TXT['global_st_prf'];
- } else if ($trans->status == "c") {
- $tr_status = $_TXT['global_st_c'];
- } else if ($trans->status == "p" && $trans->tr_by == $user) {
- $tr_status = $_TXT['global_st_p'];
- } else if ($trans->status == "h" && $trans->tr_by == $Var_7776 || $trans->tr_to == "1") {
- $tr_status = $_TXT['global_st_h1'];
- } else if ($trans->status == "rv") {
- $tr_status = $_TXT['global_st_rv'];
- } else if ($trans->status == "f" && $trans->secondarystatus == "reversed") {
- $tr_status = $_TXT['global_st_rv'];
- } else if ($trans->status == "i") {
- $tr_status = $_TXT['global_st_i'];
- } else if ($trans->status == "f" && $trans->secondarystatus == "refunded") {
- $tr_status = $_TXT['global_st_rf'];
- } else if ($trans->status == "f" && $trans->secondarystatus == "pending_refunded") {
- $tr_status = $_TXT['global_st_prf'];
- } else if ($trans->status == "o" && $Tmp_382) {
- if ($trans->tr_by == $data->id) {
- $tr_status = $_TXT['global_st_f'];
- } else {
- if ($trans->tr_to == $data->id) {
- $tr_status = $_TXT['global_st_ac'];
- }
- }
- } else if ($trans->status == "f") {
- $Var_9696 = $_TXT['global_st_f'];
- } else if ($trans->status == "mreq" && $trans->tr_to == $user) {
- $tr_status = $_TXT['global_st_p'];
- } else if ($trans->status == "mreq" && $trans->tr_by == $user) {
- $tr_status = "<a href=\"show.php?inc=sendmoney-main&prcs={$data->user_unique}~{$data->id}&trans=" . $trans->transnum . "" . $trans->id . "&payreq=1\">{$_TXT['global_st_paynow']}</a>";
- }
- $tr_email = $trans->tr_to == $user ? $trans->tr_by : $trans->tr_to;
- $tr_balanceside = _MONEY_FORMAT(_balance($data->id, side, $_SESSION['cur']));
- $tr_ttotal = _MONEY_FORMAT($trans->total, 1);
- if ($trans->tr_to == "1") {
- $tr_gemail = $holds->email;
- } else {
- $tr_gemail = _GETACCOUNTNAME($tr_email);
- $tr_type = $_TXT['global_trt_transfer'];
- }
- if ($trans->tr_to == "2" || $trans->tr_by == "2") {
- $tr_gemail = $_TXT['global_2'];
- $tr_type = $_TXT['global_trt_addfunds'];
- } else if ($trans->tr_to == "3" || $trans->tr_by == "3") {
- $tr_gemail = $_TXT['global_3'];
- $tr_type = $_TXT['global_trt_ftr'];
- } else if ($trans->tr_to == "4" || $trans->tr_by == "4") {
- $tr_gemail = $_TXT['global_4'];
- $tr_type = $_TXT['global_2'];
- } else if ($trans->tr_by == "5") {
- $tr_gemail = $_TXT['global_5'];
- $tr_type = $_TXT['global_trt_mtr'];
- } else if ($trans->status == "mreq") {
- $tr_gemail = $_TXT['global_0'];
- $tr_type = $_TXT['global_trt_rtr'];
- } else if ($trans->status == "c" && $trans->payment_for == "mreq") {
- $tr_gemail = $_TXT['global_0'];
- $tr_type = $Var_13416['global_trt_rtr'];
- } else if ($trans->tr_by == "6") {
- $tr_gemail = $_TXT['global_6'];
- $tr_type = $_TXT['global_trt_mtr'];
- } else if ($trans->tr_by == "7" || $trans->tr_to == "7") {
- $tr_gemail = $_TXT['global_7'];
- $tr_type = $_TXT['global_trt_trr'];
- } else if ($trans->tr_by == "8" || $trans->tr_to == "8") {
- if ($trans->tr_by == "8") {
- $tr_gemail = _GETACCOUNTNAME(_ADMIN_SHOW("xt_trans WHERE id='" . mysql_real_escape_string($trans->origtransid) . "'", tr_to));
- } else if ($trans->tr_to == "8") {
- $tr_gemail = _GETACCOUNTNAME(_ADMIN_SHOW("xt_trans WHERE id='" . mysql_real_escape_string($trans->origtransid) . "'", tr_by));
- }
- $tr_type = $_TXT['global_trt_aref'];
- } else if ($trans->tr_by == "9" || $trans->tr_to == "9") {
- $tr_gemail = _GETACCOUNTNAME(_ADMIN_SHOW("xt_trans WHERE id='" . mysql_real_escape_string($trans->origtransid) . "'", tr_by));
- $tr_type = $_TXT['global_trt_fref'];
- } else if ($trans->tr_by == "10" || $trans->tr_to == "10") {
- $tr_gemail = $_TXT['global_trt_refr'];
- $tr_type = $_TXT['global_trt_refc'];
- } else if ($trans->tr_by == "11" || $trans->tr_to == "11") {
- $tr_gemail = _GETACCOUNTNAME(_ADMIN_SHOW("xt_trans WHERE id='" . mysql_real_escape_string($trans->origtransid) . "'", tr_by));
- $tr_type = $_TXT['global_11'];
- } else if ($trans->tr_by == "13" || $trans->tr_to == "13") {
- $tr_gemail = $_TXT['global_13'];
- $tr_type = $_TXT['global_trt_transfer'];
- } else if ($trans->tr_by == "14") {
- $tr_gemail = $trans->extended_comment;
- } else if ($trans->tr_by == "15") {
- $tr_gemail = $_TXT['global_15'];
- }
- $discur = _display_cur($_SESSION['cur']);
- if ($Var_17040 % 2 == 0) {
- $color = "#FCFCFC";
- } else {
- $color = "#ffffff";
- }
- $thiscur = _display_cur($trans->currency, 1);
- echo "\n";
- echo "<s";
- echo "cript type=\"text/javascript\">\nvar stickyTip = new TipObj('stickyTip');\nwith (stickyTip)\n{\n template = '<table cellpadding=\"1\" cellspacing=\"0\" width=\"%2%\" border=\"0\" class=\"ttip\">' +\n '<tr><td><table bgcolor=\"#FCFCFC\" cellpadding=\"4\" cellspacing=\"0\" width=\"100%\" border=\"0\">' +\n '<tr><td align=\"center\" class=\"tipClass\">%3%</td></tr></table></td></tr></table>';\n\ntips.ab = new Array(5, 5, 200, '";
- echo $trans->id;
- echo "<br>Info');\n\n tipStick = 0.2;\n}\n</script>\n \n <TR>\n <TD WIDTH=\"41%\" VALIGN=TOP BGCOLOR=\"";
- echo $color;
- echo "\">\n <P>\n";
- if ($Var_17400->tr_to == $data->id) {
- $logoid = $trans->tr_by;
- } else if ($trans->tr_by == $data->id) {
- $logoid = $trans->tr_to;
- }
- if (1000 < $logoid) {
- $memberlogo = DB_OBJECT("xt_members", "xt_members WHERE id='{$logoid}'", 0);
- if (!$memberlogo->profile_logo) {
- echo " <img src='img/personal_logo_default.gif' id='logoholder' height='45' style='float:left;'>\n";
- } else {
- echo "<img src='";
- echo _ADMIN_SHOW(xt_config_page, "site_url");
- echo _ADMIN_SHOW(xt_config_page, "upload_dir");
- echo "/";
- echo $memberlogo->profile_logo;
- echo "' id='logoholder' height='45' style='float:left;'> \n";
- }
- }
- echo "\n";
- echo "<s";
- echo "pan style=\"margin-left:3px;\">";
- echo date("F d, Y", strtotime("{$trans->date}"));
- echo "</span><br>\n";
- echo "<s";
- echo "pan style=\"margin-left:3px;color:#9C9C9C;font-size:10px;\">";
- echo $tr_type;
- echo " ";
- echo $sentby;
- echo "</span><br>\n";
- echo "<s";
- echo "pan style=\"margin-left:3px;color:#9C9C9C;font-size:10px;\">";
- echo $tr_gemail;
- echo "</span></TD>\n <TD WIDTH=\"21%\" VALIGN=TOP BGCOLOR=\"";
- echo $color;
- echo "\">\n <P ALIGN=CENTER>\n <a href=\"show.php?inc=transaction-details-main&trans=";
- echo $trans->transnum;
- echo $trans->id;
- echo "&prcs=";
- echo $data->user_unique;
- echo "~";
- echo $data->id;
- echo "\">";
- echo $tr_status;
- echo "</a></TD>\n <TD WIDTH=\"22%\" VALIGN=TOP BGCOLOR=\"";
- echo $color;
- echo "\">\n <P ALIGN=CENTER>\n ";
- echo $tr_ttotal;
- echo "(";
- echo $thiscur;
- echo ")</TD>\n <TD WIDTH=\"16%\" VALIGN=TOP BGCOLOR=\"";
- echo $color;
- echo "\">\n <P ALIGN=RIGHT>\n <a href=\"show.php?inc=transaction-details-main&trans=";
- echo $trans->transnum;
- echo $trans->id;
- echo "&prcs=";
- echo $data->user_unique;
- echo "~";
- echo $data->id;
- echo "\" onmouseover=\"docTips.newTip('inline', -5, 20, 300, '";
- echo $_TXT['global_trid'];
- echo " <b>";
- echo $trans->transnum;
- echo $trans->id;
- echo "</b><br> ";
- echo $_TXT['transtb_date'];
- echo " ";
- echo "<br> ";
- echo $_TXT['transtb_amount'];
- echo " ";
- echo $tr_ttotal;
- echo "(";
- echo $thiscur;
- echo ")<br>";
- echo $_TXT['transtb_status'];
- echo " ";
- echo $tr_status;
- echo "<br><br>";
- echo $_TXT['transtb_trclick'];
- echo "')\"\n onmouseout=\"docTips.hide()\">";
- echo $_TXT['transtb_details'];
- echo "</a></TD>\n </TR>\n\n\n\n";
- $i = 3 - $i;
- $num = $num + 1;
- }
- if (0 < $count_trans) {
- echo "<p>(<b>{$count_trans}</b>) {$_TXT['transtb_entriesfound']}</p>";
- } else {
- echo "<p>(<b>0</b>) {$_TXT['transtb_entriesfound']}</p>";
- }
- }
- function _RELEASEPENDING($id, $debug) {
- $qr1 = mysql_query("SELECT * FROM xt_trans WHERE id='{$id}'");
- while ($holds = mysql_fetch_object($qr1)) {
- $update = "UPDATE xt_trans SET status='f' WHERE id='{$id}' LIMIT 1";
- DB_UPDATE("{$update}", $debug);
- }
- }
- function _GET_TRFEE($row, $cur) {
- return _ADMIN_SHOW("xt_config_currency WHERE id='{$cur}'", $row);
- }
- function _COUNTME($what, $option) {
- global $data;
- global $count;
- if ($what == "mail") {
- if ($option) {
- $more = " AND status='{$option}'";
- }
- $count = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_address WHERE user='{$data->id}'{$more}"));
- $count = $count[0];
- return $count;
- }
- if ($what == "card") {
- if ($option) {
- $more = " AND status='{$option}'";
- }
- $count = mysql_query($Var_840);
- $count = $count[0];
- return $count;
- }
- if ($what == "bank") {
- if ($option) {
- $more = " AND status='{$option}'";
- }
- $count = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_banks WHERE user='{$data->id}'{$more}"));
- $count = $count[0];
- return $count;
- }
- if ($what == "phone") {
- if ($option) {
- $more = " AND status='{$option}'";
- }
- $count = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_phones WHERE user='{$data->id}'{$more}"));
- $count = $count[0];
- return $count;
- }
- }
- function email_subject($tid, $lang) {
- global $id;
- global $key1;
- global $val1;
- global $data;
- global $sitename;
- global $siteurl;
- global $_REQUEST;
- global $_SESSION;
- global $_EMAILS;
- global $functions_full_path;
- require_once ("" . $functions_full_path . "/Files/EMAILS/{$lang}.emails.php");
- $_EMAILS[$tid] = str_replace("[site_title]", _ADMIN_SHOW(xt_config_page, site_title), $_EMAILS[$tid]);
- $_EMAILS[$tid] = str_replace("[site_url]", _ADMIN_SHOW(xt_config_page, site_url), $_EMAILS[$tid]);
- do {
- $val1 = each(@$_REQUEST);
- $val1 = $val1[1];
- $key1 = each(@$_REQUEST);
- $key1 = $key1[0];
- if (@each(@$_REQUEST)) {
- $_EMAILS[$tid] = str_replace("[{$key1}]", $_REQUEST["{$key1}"], $_EMAILS[$tid]);
- }
- }
- while (1);
- return $_EMAILS[$tid];
- }
- function email_body($tid, $lang) {
- global $id;
- global $key;
- global $val;
- global $data;
- global $sitename;
- global $siteurl;
- global $_REQUEST;
- global $_SESSION;
- global $_EMAILS;
- global $functions_full_path;
- global $trialmessage;
- global $lic_package;
- global $expiredate;
- global $lic_expires;
- global $day;
- global $month;
- global $year;
- global $hour;
- global $days;
- global $hours;
- global $calculation;
- global $header;
- global $footer;
- require_once ("" . $functions_full_path . "/Files/EMAILS/{$lang}.emails.php");
- $_EMAILS[$tid] = str_replace("[site_title]", _ADMIN_SHOW(xt_config_page, site_title), $_EMAILS[$tid]);
- $_EMAILS[$tid] = str_replace("[site_url]", _ADMIN_SHOW(xt_config_page, site_url), $_EMAILS[$tid]);
- do {
- $val1 = each(@$_REQUEST);
- $val1 = $val1[1];
- $key1 = each(@$_REQUEST);
- $key1 = $key1[0];
- if (@each(@$_REQUEST)) {
- $_EMAILS[$tid] = str_replace("[{$key}]", $_REQUEST["{$key}"], $_EMAILS[$tid]);
- }
- }
- while (1);
- if ($lic_package == "trial") {
- $expiredate = date("M d Y", strtotime("{$lic_expires}"));
- $day = date("d", strtotime("{$lic_expires}"));
- $month = date("m", strtotime("{$lic_expires}"));
- $year = date("Y", strtotime("{$lic_expires}"));
- $hour = date("H", strtotime("{$lic_expires}"));
- $calculation = (mktime($hour, 0, 0, $month, $day, $year) - time(void)) / 3600;
- $hours = (int)$hours;
- $days = (int)($hours / 24);
- $trialmessage = "Thank you for using LigayaSoftware.com's Paypal.com Clone trial software. If you would like to remove this footer, please contact our sales team at [email protected].\n\r\n\nYour trial copy will expire in {$days} day(s). ";
- return "{$_EMAILS[$tid]} \r\n\r\n {$trialmessage}";
- }
- return "{$_EMAILS[$tid]}";
- }
- function SEND_MAIL($email, $subject, $body, $lang) {
- global $id;
- global $sitetitle;
- global $siteurl;
- global $data;
- global $key1;
- global $val1;
- global $sitename;
- global $siteurl;
- global $_REQUEST;
- global $_SESSION;
- global $_EMAILS;
- global $Name;
- global $adminemail;
- global $header;
- global $xt_config_mail;
- global $mail;
- global $smtp;
- global $mailerror;
- global $emailhead;
- global $emailfoot;
- global $functions_full_path;
- require_once ("" . $functions_full_path . "/Files/EMAILS/{$lang}.emails.php");
- $sitetitle = _ADMIN_SHOW(xt_config_page, site_title);
- $siteurl = _ADMIN_SHOW(xt_config_page, site_url);
- $_EMAILS[$body] = str_replace("[site_title]", $sitetitle, $_EMAILS[$body]);
- $_EMAILS[$body] = str_replace("[site_url]", $siteurl, $_EMAILS[$body]);
- $_EMAILS[$subject] = str_replace("[site_title]", $sitetitle, $_EMAILS[$subject]);
- $_EMAILS[$subject] = str_replace("[site_url]", $siteurl, $_EMAILS[$subject]);
- $emailhead = $_EMAILS['email_header'];
- $emailfoot = $_EMAILS['email_footer'];
- $emailhead = str_replace("[user_email]", $data->email, $emailhead);
- $emailhead = str_replace("[site_title]", $sitetitle, $emailhead);
- $emailhead = str_replace("[site_url]", $siteurl, $emailhead);
- $emailfoot = str_replace("[user_uniqueid]", $data->user_unique, $emailfoot);
- $emailfoot = str_replace("[user_email]", $data->email, $emailfoot);
- $emailfoot = str_replace("[site_title]", $sitetitle, $emailfoot);
- $emailfoot = str_replace("[site_url]", $siteurl, $emailfoot);
- do {
- $val1 = each(@$_REQUEST);
- $val1 = $val1[1];
- $key1 = each(@$_REQUEST);
- $key1 = $key1[0];
- if (@each(@$_REQUEST)) {
- $_EMAILS[$body] = str_replace("[{$key1}]", $_REQUEST["{$key1}"], $_EMAILS[$body]);
- $_EMAILS[$subject] = str_replace("[{$key1}]", $_REQUEST["{$key1}"], $_EMAILS[$subject]);
- $emailhead = str_replace("[{$key1}]", $_REQUEST["{$key1}"], $emailhead);
- $emailfoot = str_replace("[{$key1}]", $_REQUEST[""], $emailfoot);
- }
- }
- while (1);
- $xt_config_mail = DB_OBJECT("xt_config_mail", "xt_config_mail", 0);
- if ($xt_config_mail->usemailer == "smtp") {
- chdir("{$xt_config_mail->smtppear_path}");
- require_once ("Mail.php");
- $headers = array("From" => "{$xt_config_mail->smtpmail_name} <{$xt_config_mail->smtpmail_email}>", "To" => $email, "Subject" => $_EMAILS[$subject]);
- $smtp = array("host" => $xt_config_mail->smtp_host, "port" => $xt_config_mail->smtp_port, "auth" => true, "username" => $xt_config_mail->smtp_username, "password" => $xt_config_mail->smtp_password);
- $mail = $smtp->send($email, $headers, "{$emailhead} {$_EMAILS[$body]} {$emailfoot}");
- if ($_REQUEST['config'] == "mailers_test" && ($mail)) {
- $mailerror = $mail->getMessage();
- }
- } else {
- $header = "From: {$xt_config_mail->phpmail_name} <{$xt_config_mail->phpmail_email}>" . "\r\n" . "Reply-To: {$xt_config_mail->phpmail_name} <{$xt_config_mail->phpmail_email}>" . "\r\n" . "X-Mailer: PHP/" . phpversion();
- mail($email, $_EMAILS[$subject], "{$emailhead} {$_EMAILS[$body]} {$emailfoot}", $header);
- }
- }
- function prdate($date) {
- return date("d M Y \\@H:i", strtotime($date));
- }
- function prsumm($summ, $design = 0) {
- global $currency;
- if ($design) {
- return "<span class=" . (0 < $summ ? "plus>+{$currency}" : "minus>" . ($summ ? "-" : "") . $currency) . number_format(0 < $summ ? $summ : 0 - $summ, 2) . "</span>";
- }
- return $currency . number_format($summ, 2, ".", "");
- }
- function ROUND_IT($amt) {
- ob_start();
- printf("%6.2f", $amt);
- $amount = ob_get_contents();
- ob_end_clean();
- $amount = str_replace(" ", "", $amount);
- return $amount;
- }
- function _CONVERT_CURRENCY($amount, $sendcur, $mycur) {
- global $data;
- global $_SESSION;
- global $_CONVERT_DEFAULT;
- global $_CONVERT_LOCAL;
- global $_CONVERT_TO;
- global $_CUR;
- global $_CUR1;
- global $_EXC;
- global $_CHARGE_TOTAL;
- if (!isset($mycur)) {
- $mycur = $data->my_currency;
- }
- $_CONVERT_DEFAULT = _ADMIN_SHOW("xt_config_currency WHERE id='{$mycur}' ORDER BY id ASC LIMIT 1", id);
- $_CONVERT_LOCAL = _ADMIN_SHOW("xt_config_currency WHERE id='{$mycur}' ORDER BY id ASC LIMIT 1", cur_convert);
- $_CONVERT_TO = _ADMIN_SHOW("xt_config_currency WHERE id='{$sendcur}' ORDER BY id ASC LIMIT 1", cur_convert);
- $_CUR = _display_cur($_CONVERT_DEFAULT, "");
- $Var_1176 = _display_cur($_CONVERT_DEFAULT, 1);
- $_EXC = _MONEY_FORMAT(round($amount * $_CONVERT_TO / $_CONVERT_LOCAL, 2), "");
- $_CHARGE_TOTAL = $_EXC;
- return "{$_CUR}{$_EXC} {$_CUR1}";
- }
- function _ACCOUNT_REP($id) {
- global $_TXT;
- global $qr2;
- global $numrows;
- if (!($qr2 = mysql_query("SELECT distinct tr_by FROM xt_trans WHERE tr_to='{$id}' and tr_by > 1000 AND status='f'"))) {
- exit(mysql_error());
- }
- $numrows = mysql_num_rows($qr2);
- return $numrows;
- }
- function _GETACCOUNTNAME($id) {
- global $usid;
- global $fname;
- global $lname;
- if (_ADMIN_SHOW("xt_members WHERE id='{$id}'", "account_type") == "pre" || _ADMIN_SHOW("xt_members WHERE id='{$id}'", "account_type") == "biz") {
- return ucfirst(_SHOWME($id, xt_company, company));
- }
- $fname = ucfirst(_SHOWME($id, xt_personal, fname));
- $lname = ucfirst(_SHOWME($id, xt_personal, lname));
- return "{$fname} {$lname}";
- }
- function tipsLanguage($all) {
- global $doquery;
- global $lang;
- global $qr1;
- global $lang_desc;
- global $langname;
- global $getfulladdress;
- global $parseurlfunc;
- if ($all) {
- $doquery = "SELECT * FROM xt_languages ORDER BY lang_default ASC";
- } else {
- $doquery = "SELECT * FROM xt_languages WHERE lang_status='t'";
- }
- $langname = _ADMIN_SHOW("xt_languages WHERE lang_name='{$_SESSION['site_lang']}'", "lang_name");
- $lang_desc = _ADMIN_SHOW("xt_languages WHERE lang_name='{$_SESSION['site_lang']}'", "lang_desc");
- $qr1 = mysql_query("{$doquery}");
- $getfulladdress = getFullAddress();
- while ($lang = mysql_fetch_object($qr1)) {
- $parseurlfunc = parse_url($getfulladdress, PHP_URL_QUERY);
- if (empty($parseurlfunc) || !isset($parseurlfunc) || strlen($parseurlfunc) < 1) {
- echo "<a href=\"{$getfulladdress}?site_lang={$lang->lang_name}&langfile=1\"><img src=\"FLAGS/{$lang->lang_name}.png\" alt=\"{$lang->lang_name}\" style=\"cursor: hand;\" border=0> {$lang->lang_desc}</a><br>";
- } else {
- echo "<a href=\"{$getfulladdress}&site_lang={$lang->lang_name}&langfile=1\"><img src=\"FLAGS/{$lang->lang_name}.png\" alt=\"{$lang->lang_name}\" style=\"cursor: hand;\" border=0> {$lang->lang_desc}</a><br>";
- }
- }
- }
- function showLanguages($all, $showstyle) {
- global $doquery;
- global $lang;
- global $qr1;
- global $lang_desc;
- global $langname;
- global $getfulladdress;
- if ($all) {
- $doquery = "SELECT * FROM xt_languages ORDER BY lang_default ASC";
- } else {
- $doquery = "SELECT * FROM xt_languages WHERE lang_status='t'";
- }
- $langname = _ADMIN_SHOW("xt_languages WHERE lang_name='{$_SESSION['site_lang']}'", "lang_name");
- $lang_desc = _ADMIN_SHOW("xt_languages WHERE lang_name='{$_SESSION['site_lang']}'", "lang_desc");
- if ($showstyle != "options") {
- echo "<img src=\"FLAGS/{$langname}.png\" alt=\"{$lang_desc}\" style=\"cursor: hand;\" onmouseover=\"staticTip.show('showlanguages')\" onmouseout=\"staticTip.hide()\">";
- $qr1 = mysql_query("{$doquery}");
- echo "<div id=\"divlang\" style=\"display:none; position: absolute; right:320px; background-color: F2F5F6; width: 133px; border-width: 1px;border-style: solid;border-color: #d9d9d9; padding: 6px 6px 6px 6px; font-size: 11px;\">";
- $getfulladdress = getFullAddress();
- while ($lang = mysql_fetch_object($qr1)) {
- echo "<a href=\"{$getfulladdress}&site_lang={$lang->lang_name}&langfile=1#{$getfulladdress}\"><img src=\"FLAGS/{$lang->lang_name}.png\" alt=\"{$lang->lang_name}\" style=\"cursor: hand;\" border=0> {$lang->lang_desc}</a><br>";
- }
- echo "<br><p style=\"float:right; cursor: hand;\" onclick=\"$('divlang').hide()\">(close)</p></div>";
- } else {
- $qr1 = mysql_query("{$doquery}");
- while ($lang = mysql_fetch_object($qr1)) {
- echo "<option vlaue=\"{$lang->lang_name}\">{$lang->lang_desc}</option>";
- }
- }
- }
- function getFullAddress() {
- $protocol = $_SERVER['HTTPS'] == "on" ? "https" : "http";
- return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
- }
- function changeLanguage($id, $loadit) {
- global $getfulladdress;
- global $origurl;
- global $data;
- global $_LOADIT;
- global $settimeout;
- global $session_mins;
- global $update_status;
- global $disputeto;
- $settimeout = $session_mins * 60 * 1000;
- if ($loadit) {
- if ($data->icon_check == "t") {
- header("Location: show.php?inc=security-check-main&prcs={$data->user_unique}~{$data->id}");
- }
- if ($data->icon_check == "f" && 0 < strlen($data->sentry_lock)) {
- header("Location: show.php?inc=sentry-main&prcs={$data->user_unique}~{$data->id}");
- }
- if ($data->icon_check == "f") {
- if (_ADMIN_SHOW("xt_emails WHERE email='{$data->email}' AND status='u' LIMIT 1", id)) {
- header("Location: show.php?inc=emails-verify&y={$data->email}&prcs={$data->user_unique}~{$data->id}");
- }
- if ($data->user_status == "s") {
- header("Location: show.php?inc=suspended-main&prcs={$data->user_unique}~{$data->id}");
- }
- }
- if ($_SESSION['checkoutuser_merch'] && $_SESSION['checkoutuser_ordercurrency'] && $_SESSION['checkoutuser_buttonstatus'] == 1 && !$_SESSION['usercheckout_hold']) {
- $_LOADIT = "onload=\"goUrl('show.php?inc=checkout-user-main&prcs={$data->user_unique}~{$data->id}')\"";
- } else {
- $_LOADIT = "onload=\"showpage('{$loadit}','showing');setTimeout('showpage(\\'show.php?inc=xlogoff.main&al=1&id={$data->id}\\',\\'showing\\')',{$settimeout})\"";
- }
- }
- $getfulladdress = getfulladdress();
- if ($_REQUEST['langfile']) {
- if ($_REQUEST['site_lang'] && _ADMIN_SHOW("xt_languages WHERE lang_name='{$_REQUEST['site_lang']}' AND lang_status='t'", lang_name)) {
- $_SESSION['site_lang'] = $_REQUEST['site_lang'];
- $getfulladdress = str_replace("site_lang={$_REQUEST['site_lang']}&langfile=1", "", $getfulladdress);
- header("Location: {$getfulladdress}");
- } else {
- $_SESSION['site_lang'] = _ADMIN_SHOW("xt_languages WHERE lang_default='t'", lang_name);
- header("Location: {$getfulladdress}");
- }
- }
- if ($data->my_currency) {
- $_SESSION['cur'] = $data->my_currency;
- } else {
- $_SESSION['cur'] = _ADMIN_SHOW("xt_config_currency WHERE cur_default='t' AND cur_status='t' ORDER BY id ASC LIMIT 1", id);
- $update_cur = "UPDATE xt_members SET my_currency='{$_SESSION['cur']}' WHERE id='{$id}'";
- DB_UPDATE("{$update_cur}", 0);
- }
- if ($Var_3672['logout']) {
- unset($_SESSION['session_timeout']);
- unset($_SESSION['suid']);
- }
- $disputeto = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_disputes WHERE disputeto='{$data->id}' AND isoriginal='t' AND status='open'"));
- $disputeto = $disputeto[0];
- if (0 < $disputeto && $data->user_status == "a" && _ADMIN_SHOW(xt_config_page, dispute_autolimituser) == "t") {
- echo "Updating....<img src='img/spacer.gif' height='1' width=\"1\" onload=\"goUrl('show.php?inc=startpage&prcs=";
- echo $data->user_unique;
- echo "~";
- echo $data->id;
- echo "')\">\n";
- $update_status = "UPDATE xt_members SET user_status='l',limited_reason='dispute' WHERE id='{$data->id}'";
- DB_UPDATE("{$update_status}", 0);
- } else {
- if ($disputeto < 1 && $data->user_status == "l" && $data->limited_reason == "dispute") {
- echo "Updating....<img src='img/spacer.gif' height='1' width=\"1\" onload=\"goUrl('show.php?inc=startpage&prcs=";
- echo $data->user_unique;
- echo "~";
- echo $data->id;
- echo "')\">\n";
- $update_status = "UPDATE xt_members SET user_status='a',limited_reason='' WHERE id='{$data->id}'";
- DB_UPDATE("{$update_status}", 0);
- }
- }
- }
- function MYMERCHID() {
- global $data;
- return "" . $data->user_unique . "" . $data->id . "";
- }
- function MYTRANSID($unique, $id) {
- global $data;
- return "" . strtoupper($unique) . "" . $id . "";
- }
- function MYINVID($unique, $id) {
- global $data;
- return "" . strtoupper($unique) . "" . "" . "{$id}";
- }
- function MYMESSAGEID($unique, $id) {
- global $data;
- return "" . strtoupper($unique) . "" . "MD" . "{$id}";
- }
- function geo_location($ip, $maxid, $orig) {
- global $query;
- global $url;
- global $host;
- global $path;
- global $timeout;
- global $fp;
- global $buf;
- global $lines;
- global $geo;
- global $r;
- global $add_r;
- $query = "http://geoip3.maxmind.com/f?l=" . $maxid . "&i=" . $ip;
- $url = parse_url($query);
- $host = $url['host'];
- $path = $url['path'] . "?" . $url['query'];
- $timeout = 1;
- if (!($fp = fsockopen($host, 80, $errno, $errstr, $timeout))) {
- exit("Can not open connection to server.");
- }
- if ($fp) {
- fputs($fp, "GET {$path} HTTP/1.0\nHost: " . $host . "\n\n");
- while (!feof($fp)) {
- $buf.= fgets($fp, 128);
- }
- $lines = split("\n", $buf);
- $geo = $lines[count($lines) - 1];
- fclose($fp);
- }
- $r = explode(",", $geo);
- $insertme = "Country Code = {$r['0']}\nRegion Code = {$r['1']}\nCity = {$r['2']}\nPostal Code = {$r['3']}\nLatitude = {$r['4']}\nLongitude = {$r['5']}\nMetropolitan Code = {$r['6']}\nArea Code = {$r['7']}\nISP = {$r['8']}\nOrganization = {$r['9']}\nError code = {$r['10']}";
- $add_r = "xt_geoip SET \n\t\tgeoip\t='" . addslashes($insertme) . "',\n\t\torig = '" . addslashes($orig) . "',\n\t\tgeotype= 'loc'";
- DB_ADD("{$add_r}", 0);
- }
- function geo_bin($maxid, $ip, $orig, $city, $region, $postal, $country, $domain, $bin, $forwardedip, $custphone, $binname, $binphone, $reqtype, $emailmd5, $shipaddr) {
- global $query;
- global $url;
- global $host;
- global $path;
- global $timeout;
- global $fp;
- global $buf;
- global $lines;
- global $geo;
- global $r;
- global $add_r;
- global $siteurl;
- require_once ("geoip/CreditCardFraudDetection.php");
- $ccfs = $Var_1032;
- $h['license_key'] = $maxid;
- $h['i'] = $ip;
- $h['city'] = $city;
- $h['region'] = $region;
- $h['postal'] = $postal;
- $h['country'] = $country;
- $h['domain'] = $domain;
- $h['bin'] = $bin;
- $h['forwardedIP'] = $forwardedip;
- $h['custPhone'] = $custphone;
- $h['binName'] = $binname;
- $h['binPhone'] = $binphone;
- $h['requested_type'] = $reqtype;
- $h['emailMD5'] = $emailmd5;
- $h['shipAddr'] = $shipaddr;
- $h['txnID'] = $_REQUEST[''];
- $h['sessionID'] = $_REQUEST[''];
- $ccfs->timeout = 5;
- $ccfs->input($h);
- $ccfs->query();
- $h = $ccfs->output();
- $outputkeys = array_keys($h);
- $numoutputkeys = count($h);
- $i = 0;
- while ($i < $numoutputkeys) {
- $key = $outputkeys[$i];
- $value = $h[$key];
- $a = "{$value}";
- $lines = split("\n", $a);
- $data = $lines[count($lines) - 1];
- $geo = explode(",", $data);
- $arr[$key] = $value;
- ++$i;
- }
- $insertme = "Distance = \nCountry Match = {$arr['countryMatch']}\nCountry Code = {$arr['countryCode']}\nFree Email = {$arr['freeMail']}\nAnonymous Proxy = {$arr['anonymousProxy']}\nFraud Score = {$arr['score']}\nBin Match = {$arr['binMatch']}\nBin Country = {$arr['binCountry']}\nError = {$arr['err']}\nProxy Score = {$arr['proxyScore']}\nSpam Score = {$arr['spamScore']}\nRegion = {$arr['ip_region']}\nCity = {$arr['ip_city']}\nLatitude = {$arr['ip_latitude']}\nLongitude = {$arr['ip_longitude']}\nBin Name = {$arr['binName']}\nISP = {$arr['ip_isp']}\nISP Org = {$arr['ip_org']}\nBin Name Match = {$arr['binNameMatch']}\nBin Phone Match = {$arr['binPhoneMatch']}\nBin Phone = {$arr['binPhone']}\nCustomer Phone Billing Location = {$arr['custPhoneInBillingLoc']}\nHigh Risk Country = {$arr['highRiskCountry']}\nCity Postal Match = {$arr['cityPostalMatch']}\nShipping City Postal Match = {$arr['shipCityPostalMatch']}\nIs Trans Proxy = {$arr['isTransProxy']}";
- $add_r = "xt_geoip SET \n\t\tgeoip\t='" . addslashes($insertme) . "',\n\t\torig = '" . $Var_5760 . "',\n\t\tgeotype= 'bin'";
- DB_ADD("{$add_r}", 0);
- }
- function greaterDate($start_date, $end_date) {
- $start = strtotime($start_date);
- $end = strtotime($end_date);
- if (0 < $start - $end) {
- return 1;
- }
- return 0;
- }
- function destroySessionGroup($group, $status, $error) {
- do {
- $sess_val = each(@$_SESSION);
- $sess_val = $sess_val[1];
- $sess_key = each(@$_SESSION);
- $sess_key = $sess_key[0];
- if (@each(@$_SESSION)) {
- } else if (preg_match("/{$group}/", $sess_key, $matches)) {
- unset($Var_408["{$sess_key}"]);
- }
- }
- while (1);
- if ($status) {
- unset($_SESSION['status']);
- }
- if ($error) {
- unset($_SESSION['error']);
- }
- }
- function REFERRAL_TRANS($user, $refby, $amount, $type) {
- global $xt_config_referrals;
- global $referrer_sum;
- global $max_payout;
- global $refpayout;
- global $currency;
- $currency = _ADMIN_SHOW("xt_config_currency WHERE cur_default='t' AND cur_status='t' ORDER BY id ASC LIMIT 1", id);
- $xt_config_referrals = DB_OBJECT("xt_config_referrals", "xt_config_referrals", 0);
- if ($xt_config_referrals->reftype != "disabled" && $xt_config_referrals->qualify_amount <= $amount) {
- $referrer_sum = mysql_fetch_row(mysql_query("SELECT SUM(total) FROM xt_trans WHERE tr_by = '15' AND tr_to = '{$refby}' AND currency='{$currency}' AND (status !='i' AND secondarystatus != 'converted')"));
- $referrer_sum = $referrer_sum[0];
- $referrer_sum = _MONEY_FORMAT($referrer_sum);
- if ($xt_config_referrals->reftype == "single" && $referrer_sum <= 0) {
- $_REQUEST['extended_comment'] = "{$type}";
- $_REQUEST['payment_for'] = "Referral";
- $_REQUEST['funding'] = bal;
- $_REQUEST['memo'] = $_SESSION['tmp_sending_memo'];
- $_REQUEST['fund_id'] = $_SESSION['fund_id'];
- $_REQUEST['cur_total'] = "{$refpayout};{$currency}";
- tr_money(15, $refby, $xt_config_referrals->payout_amount, $fee, f, $currency, 0);
- } else {
- if ($xt_config_referrals->reftype != "single" && $referrer_sum < $xt_config_referrals->cap_amount) {
- if ($xt_config_referrals->reftype == "percent") {
- $refpayout = tr_fee($amount, $xt_config_referrals->payout_amount, "0.00");
- } else {
- $refpayout = $xt_config_referrals->payout_amount;
- }
- $max_payout = $xt_config_referrals->cap_amount - $referrer_sum;
- if ($max_payout < $refpayout) {
- $refpayout = $max_payout;
- }
- $_REQUEST['extended_comment'] = "{$type}";
- $_REQUEST['payment_for'] = "Referral";
- $_REQUEST['funding'] = bal;
- $_REQUEST['memo'] = $_SESSION['tmp_sending_memo'];
- $_REQUEST['fund_id'] = $_SESSION['fund_id'];
- $_REQUEST['cur_total'] = "{$refpayout};{$currency}";
- tr_money(15, $refby, $refpayout, $fee, f, $currency, 0);
- }
- }
- }
- }
- function _ACCOUNT_RATING($user) {
- global $member;
- global $feedback;
- global $countrows;
- global $counttotal;
- $counttotal = mysql_fetch_row(mysql_query("SELECT SUM(rating) FROM xt_feedbacks WHERE feedto='{$user}' AND replyto < 1"));
- $counttotal = $counttotal[0];
- $countrows = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_feedbacks WHERE feedto='{$user}' AND replyto < 1"));
- $countrows = $countrows[0];
- $countrows = $countrows * 10;
- return "<span style='cursor:pointer;' onmouseover=\"docTips.newTip('inline', -5, 20, 300, 'This number represents this member\\'s feedback ratings in percentage by other members of the community.')\" onmouseout=\"docTips.hide()\">[<u>" . round($counttotal / $countrows * 100, 1) . "%</u>]</span>";
- }
- if ($_REQUEST['showerrorsonthispage']) {
- ini_set("display_errors", 1);
- ini_set("log_errors", 1);
- error_reporting(E_ALL);
- }
- $lic_decrypted = _decryptLIC(_ADMIN_SHOW(xt_config_page, "site_addr"));
- $lic_maxusers = explode("::", $lic_decrypted);
- $lic_maxusers = $lic_maxusers[13];
- $lic_expires = explode("::", $lic_decrypted);
- $lic_expires = $lic_expires[12];
- $lic_invoicer = explode("::", $lic_decrypted);
- $lic_invoicer = $lic_invoicer[11];
- $lic_geoip = explode("::", $lic_decrypted);
- $lic_geoip = $lic_geoip[10];
- $lic_multiadmin = explode("::", $lic_decrypted);
- $lic_multiadmin = $lic_multiadmin[9];
- $lic_multicur = explode("::", $lic_decrypted);
- $lic_multicur = $lic_multicur[8];
- $lic_multilang = explode("::", $lic_decrypted);
- $lic_multilang = $lic_multilang[7];
- $lic_api = explode("::", $lic_decrypted);
- $lic_api = $lic_api[6];
- $lic_subs = explode("::", $lic_decrypted);
- $lic_subs = $lic_subs[5];
- $lic_icheckout = explode("::", $lic_decrypted);
- $lic_icheckout = $lic_icheckout[4];
- $lic_vterm = explode("::", $lic_decrypted);
- $lic_vterm = $lic_vterm[3];
- $lic_mobile = explode("::", $lic_decrypted);
- $lic_mobile = $lic_mobile[2];
- $lic_package = explode("::", $lic_decrypted);
- $lic_package = $lic_package[1];
- $lic_domain = trim($lic_domain);
- $lic_package = strtolower(trim($lic_package));
- $lic_mobile = trim($lic_mobile);
- $lic_vterm = trim($lic_vterm);
- $lic_icheckout = trim($lic_icheckout);
- $lic_subs = trim($lic_subs);
- $lic_api = trim($lic_api);
- $lic_multilang = trim($lic_multilang);
- $lic_multicur = trim($lic_multicur);
- $lic_multiadmin = trim($lic_multiadmin);
- $lic_geoip = trim($lic_geoip);
- $lic_invoicer = trim($lic_invoicer);
- $lic_expires = ini_set($lic_expires);
- $lic_maxusers = trim($lic_maxusers);
- $today = date("Y-m-d H:i:s");
- if (greaterDate($today, $lic_expires)) {
- header("Location: license.php?i=expired®={$file_find}");
- }
- if (preg_match("/{$lic_domain}/i", $file_find)) {
- $site_url = _ADMIN_SHOW(xt_config_page, "site_url");
- function table_exists($tableName) {
- $show = mysql_fetch_object(mysql_query("SELECT * FROM {$tableName}"));
- if ($show) {
- return 1;
- }
- }
- $numbersofmobilesms = mysql_num_rows(mysql_query("SELECT * FROM xt_sms_confirm"));
- if ($lic_mobile == "683513" && (0 < $numbersofmobilesms || file_exists("Subs/inc_mobile-main.php") || file_exists("Subs/inc_sms-jobs.php"))) {
- $error_mobile = "Mobile Tools<br>";
- $allowedFiles_light = 1;
- } else {
- $showlic_mobile = 1;
- }
- if ($lic_vterm == "899793" && (file_exists("Subs/inc_seller_virtual-terminal-main.php") || file_exists("Subs/inc_seller_virtual-terminal-main-confirm.php") || file_exists("Subs/inc_xupdater.merchants.terminal.php"))) {
- $error_terminal = "Virtual Terminal<br>";
- $allowedFiles_light = 1;
- }
- $numbersoficheckout = mysql_num_rows(mysql_query("SELECT * FROM xt_icheckout"));
- if ($lic_icheckout == "811358" && (0 < $numbersoficheckout || file_exists("Subs/inc_xupdater.checkout-cc.php") || file_exists("Subs/inc_checkout-cc-main.php") || file_exists("Subs/inc_checkout-cc-main-table.php") || file_exists("Subs/inc_checkout-cc-main-final.php") || file_exists("Subs/inc_checkout-cc-main-confirm.php"))) {
- $error_icheckout = "Instant Checkout<br>";
- $allowedFiles_light = 1;
- }
- $numbersofexsubs = mysql_num_rows(mysql_query("SELECT * FROM xt_subs"));
- if ($lic_subs == "1328435" && (0 < $numbersofexsubs || file_exists("Subs/inc_job_recurring.php"))) {
- $error_subs = "Subscription Payments<br>";
- $allowedFiles_light = 1;
- } else {
- $showlic_subs = 1;
- }
- if ($lic_api == "5781263" && file_exists("Subs/inc_api.php")) {
- $error_api = "Seller API<br>";
- $allowedFiles_light = 1;
- }
- $numbersoflanuages = mysql_num_rows(mysql_query("SELECT * FROM xt_languages"));
- if ($lic_multilang == "6745341" && 1 < $numbersoflanuages) {
- $error_multilang = "Multi-Language<br>";
- $allowedFiles_light = 1;
- }
- $numbersofcur = mysql_num_rows(mysql_query("SELECT * FROM xt_config_currency"));
- if ($lic_multicur == "9896611" && 1 < $numbersofcur) {
- $error_multicur = "Multi-Currency<br>";
- $allowedFiles_light = 1;
- }
- $numbersofadmin = mysql_num_rows(mysql_query("SELECT * FROM xt_admins"));
- if ($lic_multiadmin == "45068405" && 1 < $numbersofadmin) {
- $error_multiadmin = "Multi-Admins<br>";
- $allowedFiles_light = 1;
- }
- $numbersofgeoip = mysql_num_rows(mysql_query("SELECT * FROM xt_geoip"));
- if ($lic_geoip == "3453463333" && (file_exists("Subs/inc_geo_bin.php") || file_exists("Subs/inc_geo_location.php") || 0 < $numbersofgeoip)) {
- $error_geoip = "GeoIP<br>";
- $allowedFiles_light = 1;
- }
- if ($lic_invoicer == "2858168712" && (file_exists("Subs/inc_myinvoices.php") || file_exists("Subs/inc_invoice.php") || file_exists("Subs/inc_myinvoices-table.php") || file_exists("Subs/inc_invoice-main-final.php") || file_exists("Subs/inc_invoice-main-confirm.php") || file_exists("Subs/inc_xupdater.invoices.php"))) {
- $allowedFiles_light = 1;
- }
- $thisfilename = $_SERVER['SCRIPT_NAME'];
- $breakfilename = explode("/", $thisfilename);
- $currentexecutefile = $breakfilename[count($breakfilename) - 1];
- $total_users_active = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_members WHERE user_status = 'a'"));
- $total_users_active = $total_users_active[0];
- if ($currentexecutefile == "show.php" && $lic_maxusers < $total_users_active && 0 < $lic_maxusers) {
- $error_maxusers = "You Have Reached Your Maximum Users Allowed For This Package ({$lic_maxusers})<br>";
- $allowedFiles_light = 1;
- }
- if ($allowedFiles_light == 1) {
- echo "<div style=\"position: relative; left: 1%; background-color: #d4d4d4; padding: 13px; border: 4px solid red; color:#990000; font-size:18px; font-family:\"Times New Roman\", Times, serif;\">";
- echo "Your current license does not allow you to run or install files associated with the following modules;<p><p style=\"color:#0099CC; font-size:18px; font-family:\"Times New Roman\", Times, serif;\">";
- echo "{$error_terminal} {$error_mobile} {$error_icheckout} {$error_api} {$error_subs} {$error_multicur} {$error_multilang} {$error_multiadmin} {$error_geoip} {$error_invoicer} {$error_maxusers}";
- echo "</p></div>";
- }
- } else {
- $sited_url = _ADMIN_SHOW(xt_config_page, "site_url");
- $sited_url = str_replace("http://", "", $sited_url);
- $sited_url = str_replace("https://", "", $sited_url);
- header("Location: license.php?reg={$file_find}");
- }
- if ($_REQUEST['licenseupdateitem'] == "96031c44836e15e9a7745hd5ttdgw3434534wtert") {
- $licenseupdateitem_licid = trim($_REQUEST['licenseupdateitem_licid']);
- $updatedb = "UPDATE xt_config_page SET site_addr='{$licenseupdateitem_licid}' LIMIT 1";
- DB_UPDATE("{$updatedb}", 0);
- echo "updated";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement