Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- ######################################################
- ###YOU DO NOT NEED TO EDIT ANYTHING BEYON THIS POINT##
- ######################################################
- // lang stuff
- if(!isset($_SESSION['site_lang']) || empty($_SESSION['site_lang'])){
- $_SESSION['site_lang'] = _ADMIN_SHOW("xt_languages WHERE lang_default='t'",lang_name);
- }
- if (!function_exists('SECURE_URL')) {
- function SECURE_URL($omit){
- global $_TXT;
- $_SERVER['THIS_URL'] = 'http';
- if($_SERVER['HTTPS']=='on'){$_SERVER['FULL_URL'] .= 's';}
- $_SERVER['THIS_URL'] .= '://';
- if($_SERVER['SERVER_PORT']!='80') $_SERVER['THIS_URL'] .= $_SERVER['HTTP_HOST'].':'.$_SERVER['SERVER_PORT'].$_SERVER['SCRIPT_NAME'];
- else
- $_SERVER['THIS_URL'] .= $_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
- if($_SERVER['QUERY_STRING']>' '){$_SERVER['THIS_URL'] .= '?'.$_SERVER['QUERY_STRING'];}
- if($omit){
- $_SERVER['THIS_URL'] = str_replace("index.php","",$_SERVER['THIS_URL']);
- }
- return $_SERVER['THIS_URL'];
- }
- }
- if (!function_exists('GetMainBaseFromURL')) {
- function GetMainBaseFromURL($url)
- {
- $chars = preg_split('//', $url, -1, PREG_SPLIT_NO_EMPTY);
- $slash = 3; // 3rd slash
- $i = 0;
- foreach($chars as $key => $char)
- {
- if($char == '/')
- {
- $j = $i++;
- }
- if($i == 3)
- {
- $pos = $key; break;
- }
- }
- $main_base = substr($url, 0, $pos);
- $main_base = str_replace("https://","",$main_base);
- $main_base = str_replace("https://www.","",$main_base);
- $main_base = str_replace("http://","",$main_base);
- $main_base = str_replace("http://www.","",$main_base);
- $main_base = str_replace("www.","",$main_base);
- return $main_base;
- }
- }
- $file_find = GetMainBaseFromURL(SECURE_URL($omit));
- // get security buttons
- function _GETSECURITY_BUTTONS($what){
- global $siteurl,$file,$handle,$x;
- $siteurl = _ADMIN_SHOW(xt_config_page,site_url);
- if( file_exists("../SECURITY_ICONS")){
- $handle=opendir("../SECURITY_ICONS");
- while (false!==($file = readdir($handle))) {
- if ($file != "." && $file != "..") {
- $x = strtolower(substr($file, -4));
- if($x && $x == ".jpg" || $x == ".gif" || $x == ".png"){
- echo "<span><input name=\"security_icons\" type=\"radio\" value=\"$file\" id=\"radio-input\" style=\"position: relative;
- bottom : 35px;\"CHECKED> <img src=\"$siteurl/SECURITY_ICONS/$file\"></span><br>";
- }
- }
- }
- }
- }
- function _GETFLAGS($what){
- global $siteurl,$file,$handle,$x,$functions_full_path;
- $siteurl = _ADMIN_SHOW(xt_config_page,site_url);
- if( file_exists("$functions_full_path/FLAGS/")){
- $handle=opendir("$functions_full_path/FLAGS/");
- while (false!==($file = readdir($handle))) {
- if ($file != "." && $file != "..") {
- $x = strtolower(substr($file, -4));
- if($x && $x == ".jpg" || $x == ".gif" || $x == ".png"){
- echo "<span><input name=\"button\" type=\"radio\" value=\"$file\" id=\"radio-input\" CHECKED> <img src=\"$siteurl/FLAGS/$file\"></span><br>";
- }
- }
- }
- }
- }
- function _GETFLAGS_ADM($what){
- global $siteurl,$file,$handle,$x,$functions_full_path;
- $siteurl = _ADMIN_SHOW(xt_config_page,site_url);
- echo "<div style=\"width:425px;\">";
- if( file_exists("$functions_full_path/FLAGS/")){
- $handle=opendir("$functions_full_path/FLAGS/");
- while (false!==($file = readdir($handle))) {
- if ($file != "." && $file != "..") {
- $x = strtolower(substr($file, -4));
- if($x && $x == ".jpg" || $x == ".gif" || $x == ".png"){
- echo "<span style=\"margin-bottom:3px; padding: 3px; border: thin solid gray;\"><input name=\"button\" type=\"radio\" value=\"$file\" id=\"radio-input\"><img src=\"$siteurl/FLAGS/$file\" height=\"14\" width=\"20\" alt=\"".strtoupper($file)."\" title=\"".strtoupper($file)."\"></span>";
- }
- }
- }
- }
- echo "</div>";
- }
- // get merchant buttons
- function _GETBUTTONS($what){
- global $siteurl,$file,$handle,$x,$functions_full_path;
- $siteurl = _ADMIN_SHOW(xt_config_page,site_url);
- if( file_exists("$functions_full_path/CHECKOUT_BUTTONS/$what")){
- $handle=opendir("$functions_full_path/CHECKOUT_BUTTONS/$what");
- while (false!==($file = readdir($handle))) {
- if ($file != "." && $file != "..") {
- $x = strtolower(substr($file, -4));
- if($x && $x == ".jpg" || $x == ".gif" || $x == ".png"){
- echo "<span><input name=\"button\" type=\"radio\" value=\"$file\" id=\"radio-input\" CHECKED> <img src=\"$siteurl/CHECKOUT_BUTTONS/$what/$file\"></span><br>";
- }
- }
- }
- }
- }
- // show table data \\
- //\\ _SHOWME($data->id,"xt_company","company")
- // count it
- function _COUNTIT($table,$what){
- global $show;
- list($show) = mysql_fetch_row(mysql_query("SELECT COUNT($what) FROM $table"));
- return $show;
- }
- // query user status \\
- function _USERTATS($id){
- global $home,$cc,$bank,$_TXT,$count;
- ## query user status by checking verified items ##
- if(!_getEmail($id)){
- return "ur";
- }else{
- // bank
- list($bank) = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_banks WHERE user='$id' AND status='v'"));
- // card
- list($cc) = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_cc WHERE user='$id' AND status='v'"));
- $count = $bank+$cc;
- if($count > 0){
- return "v";
- }else{
- return "u";
- }
- }
- } // end
- function _ADMIN_SHOW($table,$what){
- $show = mysql_fetch_object(mysql_query(
- "SELECT * FROM $table"));
- return $show->$what;
- # mysql_close ($show);
- }
- function DB_OBJECT($dbname,$table,$what){
- $dbname = mysql_fetch_object(mysql_query(
- "SELECT * FROM $table"));
- //print_r($dbname);
- return $dbname;
- # mysql_close ($show);
- }
- // show addy summary
- function _addyShow($user,$life,$input,$what){
- global $_TXT,$addy0,$addy1,$addy2,$addy3,$addy4, $status,$and2,$addy,$shipto,$data;
- if($life == 'count'){
- $addy1 = mysql_num_rows(mysql_query("SELECT * FROM xt_address WHERE user='$user' AND status='v'"));
- $addy2 = mysql_num_rows(mysql_query("SELECT * FROM xt_address WHERE user='$user' AND status='u'"));
- $addy3 = mysql_num_rows(mysql_query("SELECT * FROM xt_address WHERE user='$user' AND status='d'"));
- $addy4 = mysql_num_rows(mysql_query("SELECT * FROM xt_address WHERE user='$user' AND life='p'"));
- if($what == '0'){
- $addy0 = $addy1+$addy2+$addy3;
- return $addy0;
- }
- if($what == '1'){
- return $addy1;
- }
- if($what == '2'){
- return $addy2;
- }
- if($what == '3'){
- return $addy3;
- }
- if($what == '4'){
- return $addy4;
- }
- }
- if($life == 'list'){
- if(!$what){
- $and2 = "";
- }else{
- $and2 = "AND status='v'";
- }
- if($input == 'dropbox'){
- echo "<select id='select-input' name='addy'>";
- # $and2 = " AND (status='v' OR status='u')";
- }
- $addy1 = mysql_query("SELECT * FROM xt_address WHERE user='$user'$and2 ORDER BY status,life ASC");
- while ($addy = mysql_fetch_object($addy1)){
- $shipto = "$addy->address1 $addy->address2, $addy->city $addy->state $addy->zip $addy->country";
- $shipto = ucfirst(strtolower($shipto));
- if($input == 'radio'){
- if($addy->status == 'v' && $addy->life == 'p'){
- $status = "<P><input type='radio' name='addy' value='$addy->id' id='addy' CHECKED> $shipto</p></TD><TD><P>{$_TXT['global_verified']} / {$_TXT['global_primary']}</p>";
- }elseif($addy->status == 'v'){
- $status = "<P><input type='radio' name='addy' value='$addy->id' id='addy' CHECKED> $shipto</p></TD><TD><P>{$_TXT['global_verified']}</p>";
- }elseif($addy->status == 'u'){
- $status = "<P><input type='radio' name='addy' value='$addy->id' id='addy' CHECKED> $shipto</p></TD><TD><P>{$_TXT['global_unverified']}</p>";
- }elseif($addy->status == 'd'){
- $status = "<P><input type='radio' name='addy' value='$addy->id' id='addy' CHECKED> $shipto</p></TD><TD><P>{$_TXT['global_disabled']}</p>";
- }
- echo "<TR><TD>$status</TD></TR><br>";
- }
- if($input == 'table'){
- if($addy->status == 'v' && $addy->life == 'p'){
- $status = "{$_TXT['global_verified']} / {$_TXT['global_primary']}";
- }elseif($addy->status == 'v'){
- $status = $_TXT['global_verified'];
- }elseif($addy->status == 'u'){
- $status = $_TXT['global_unverified'];
- }elseif($addy->status == 'd'){
- $status = $_TXT['global_disabled'];
- }
- if($num%2==0)
- {
- $color = "#FCFCFC";
- }else{
- $color = "#ffffff";
- }
- ?>
- <TR>
- <TD WIDTH="50%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P>
- <?=$shipto?></TD>
- <TD WIDTH="23%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P>
- <?=$status?></TD>
- <TD WIDTH="27%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P ALIGN=RIGHT>
- <?=$doit?> <?=$disable?></TD>
- </TR>
- <?
- }
- if($input == 'dropbox'){
- if(strlen($shipto) > 35){
- $shipto = substr($shipto, 0, 35)."...";
- }
- if($addy->status == 'v' && $addy->life == 'p'){
- $status = "<option value='$addy->id' SELECTED>$shipto ({$_TXT['global_verified']} / {$_TXT['global_primary']})</option>";
- }elseif($addy->status == 'v'){
- $status = "<option value='$addy->id'>$shipto ({$_TXT['global_verified']}) </option>";
- }elseif($addy->status == 'u'){
- $status = "<option value='$addy->id'>$shipto ({$_TXT['global_unverified']}) </option>";
- }
- echo $status;
- }
- $num = $num+1;
- }
- if($input == 'dropbox'){
- echo "</select>";
- }
- }
- }
- // show cc summary
- function _ccShow($user,$life,$input,$what){
- global $_TXT,$cc,$cc0,$cc1,$cc2,$cc3,$cc4,$cards,$status,$cards1,$and,$ccString,$data;
- if($life == 'count'){
- $cc0 = mysql_num_rows(mysql_query("SELECT * FROM xt_cc WHERE user='$user' AND life='p'"));
- $cc1 = mysql_num_rows(mysql_query("SELECT * FROM xt_cc WHERE user='$user' AND status='v'"));
- $cc2 = mysql_num_rows(mysql_query("SELECT * FROM xt_cc WHERE user='$user' AND status='u'"));
- $cc3 = mysql_num_rows(mysql_query("SELECT * FROM xt_cc WHERE user='$user' AND (status='d' OR status='x')"));
- if($what == '0'){
- $cc = $cc1+$cc2+$cc3;
- return $cc;
- }
- if($what == '1'){
- return $cc1;
- }
- if($what == '2'){
- return $cc2;
- }
- if($what == '3'){
- return $cc3;
- }
- if($what == '4'){
- return $cc0;
- }
- }
- if(!$what){
- $and = "";
- }else{
- $and = "AND status='v'";
- }
- if($life == 'list'){
- if($input == 'dropbox'){
- echo "<select id='select-input' name='cc2'>";
- }
- $cards1 = mysql_query("SELECT * FROM xt_cc WHERE user='$user'$and ORDER BY status,life ASC");
- while ($cards = mysql_fetch_object($cards1)){
- $ccString = trim(_ccDecrypt($cards->ccNum));
- $ccString = substr($ccString, 0, 1).XXXX.substr($ccString, -2, 2);
- if($input == 'radio'){
- if($cards->status == 'v' && $cards->life == 'p'){
- $status = "<P><input type='radio' name='cc' value='$cards->id' id='cc' CHECKED> $cards->ccType $ccString</p></TD><TD><P>{$_TXT['global_verified']} / {$_TXT['global_primary']}</p>";
- }elseif($cards->status == 'v'){
- $status = "<P><input type='radio' name='cc' value='$cards->id' id='cc' CHECKED> $cards->ccType $ccString</p></TD><TD><P>{$_TXT['global_verified']}</p>";
- }elseif($cards->status == 'u'){
- $status = "<P><input type='radio' name='cc' value='$cards->id' id='cc' CHECKED> $cards->ccType $ccString</p></TD><TD><P>{$_TXT['global_unverified']}</p>";
- }elseif($cards->status == 'd'){
- $status = "<P><input type='radio' name='cc' value='$cards->id' id='cc' CHECKED> $cards->ccType $ccString</p></TD><TD><P>{$_TXT['global_disabled']}</p>";
- }elseif($cards->status == 'x'){
- $status = "<P><input type='radio' name='cc' value='$cards->id' id='cc' CHECKED> $cards->ccType $ccString</p></TD><TD><P>{$_TXT['global_expired']}</p>";
- }
- echo "<TR><TD>$status</TD> </TR><br>";
- }
- if($input == 'table'){
- if($cards->status == 'v' && $cards->life == 'p'){
- $status = "{$_TXT['global_verified']} / {$_TXT['global_primary']}";
- }elseif($cards->status == 'v'){
- $status = "{$_TXT['global_verified']}";
- }elseif($cards->status == 'u'){
- $status = "{$_TXT['global_unverified']}";
- }elseif($cards->status == 'd'){
- $status = "{$_TXT['global_disabled']}";
- }elseif($cards->status == 'x'){
- $status = "{$_TXT['global_expired']}";
- }
- if($cards->status == 'u'){
- $doit = "<a href=\"show.php?inc=creditcards-verify-main&prcs=$data->user_unique~$data->id&y=$cards->id\">{$_TXT['xcardsmain_ver']}</a> |";
- }else{
- $doit = "";
- }
- if($cards->status == 'v' && $cards->life != 'p'){
- $makeprime = "<a href=\"show.php?inc=creditcards-primary-main&prcs=$data->user_unique~$data->id&y=$cards->id\">{$_TXT['xcardsmain_pri']}</a> |";
- }else{
- $makeprime = "";
- }
- if($cards->cards != 'd' || $banks->status != 'x'){
- $disable = "<a href=\"show.php?inc=creditcards-ed-main&prcs=$data->user_unique~$data->id&y=$cards->id\">{$_TXT['xcardsmain_ed']}</a>";
- }else{
- $disable = "";
- }
- if($cards->cards == 'd' || $banks->status == 'x'){
- $enable = "<a href=\"show.php?inc=creditcards-ed-main&prcs=$data->user_unique~$data->id&y=$cards->id\">{$_TXT['global_enable']}</a>";
- }else{
- $enable = "";
- }
- if($num%2==0)
- {
- $color = "#FCFCFC";
- }else{
- $color = "#ffffff";
- }
- ?>
- <TR>
- <TD WIDTH="50%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P>
- <img src="img/<?=$cards->ccType?>.gif"> <?=$cards->ccType?> <?=$ccString?></TD>
- <TD WIDTH="23%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P>
- <?=$status?></TD>
- <TD WIDTH="27%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P ALIGN=RIGHT>
- <a href="show.php?inc=creditcards-update-main&prcs=<?=$data->user_unique?>~<?=$data->id?>&y=<?=$cards->id?>"><?=$_TXT['xcardsmain_ud']?></a> | <? echo "$doit $makeprime $disable"; ?></TD>
- </TR>
- <?
- }
- if($input == 'dropbox'){
- if($cards->status == 'v' && $cards->life == 'p'){
- $status = "<option value='$cards->id' SELECTED>$cards->ccType $ccString ({$_TXT['global_verified']} / {$_TXT['global_primary']})</option>";
- }elseif($cards->status == 'v'){
- $status = "<option value='$cards->id'>$cards->ccType $ccString ({$_TXT['global_verified']}) </option>";
- }elseif($cards->status == 'u'){
- $status = "<option value='$cards->id'>$cards->ccType $ccString ({$_TXT['global_unverified']}) </option>";
- }elseif($cards->status == 'd'){
- $status = "<option value='$cards->id'>$cards->ccType $ccString ({$_TXT['global_disabled']}) </option>";
- }elseif($cards->status == 'x'){
- $status = "<option value='$cards->id'>$cards->ccType $ccString ({$_TXT['global_expired']}) </option>";
- }
- echo $status;
- }
- $num = $num+1;
- }
- if($input == 'dropbox'){
- echo "</select>";
- }
- }
- }
- // show bank summary
- function _bankShow($user,$life,$input,$what){
- global $_TXT,$ba,$ba0,$ba1,$ba2,$ba3,$banks,$status,$banks1,$and,$bankString,$doit,$makeprime,$disable;
- if($life == 'count'){
- $ba0 = mysql_num_rows(mysql_query("SELECT * FROM xt_banks WHERE user='$user' AND life='p'"));
- $ba1 = mysql_num_rows(mysql_query("SELECT * FROM xt_banks WHERE user='$user' AND status='v'"));
- $ba2 = mysql_num_rows(mysql_query("SELECT * FROM xt_banks WHERE user='$user' AND status='u'"));
- $ba3 = mysql_num_rows(mysql_query("SELECT * FROM xt_banks WHERE user='$user' AND (status='d' OR status='x')"));
- if($what == '0'){
- $ba = $ba1+$ba2+$ba3;
- return $ba;
- }
- if($what == '1'){
- return $ba1;
- }
- if($what == '2'){
- return $ba2;
- }
- if($what == '3'){
- return $ba3;
- }
- if($what == '4'){
- return $ba0;
- }
- }
- if(!$what){
- $and = "";
- }else{
- $and = "AND status='v'";
- }
- if($life == 'list'){
- if($input == 'dropbox'){
- echo "<select id='select-input' name='bank2'>";
- }
- $banks1 = mysql_query("SELECT * FROM xt_banks WHERE user='$user'$and ORDER BY status,life ASC");
- while ($banks = mysql_fetch_object($banks1)){
- $bankString = trim(_bankDecrypt($banks->acct));
- $bankString = substr($bankString, 0, 1).XX.substr($bankString, -2, 2);
- if($input == 'radio'){
- if($banks->bankType == 's'){
- $banks->bankType = "Savings";
- }elseif($banks->bankType == 'c'){
- $banks->bankType = "Checking";
- }
- if($banks->status == 'v' && $banks->life == 'p'){
- $status = "<P><input type='radio' name='bank' value='$banks->id' id='bank' CHECKED> $banks->bank_name ($banks->bankType) $bankString</p></TD><TD><P>{$_TXT['global_verified']} / {$_TXT['global_primary']}</p>";
- }elseif($banks->status == 'v'){
- $status = "<P><input type='radio' name='bank' value='$banks->id' id='bank'> $banks->bank_name ($banks->bankType) $bankString</p></TD><TD><P>{$_TXT['global_verified']}</p>";
- }elseif($banks->status == 'u'){
- $status = "<P><input type='radio' name='bank' value='$banks->id' id='bank'> $banks->bank_name ($banks->bankType) $bankString</p></TD><TD><P>{$_TXT['global_unverified'] }</p>";
- }elseif($banks->status == 'd'){
- $status = "<P><input type='radio' name='bank' value='$banks->id' id='bank'> $banks->bank_name ($banks->bankType) $bankString</p></TD><TD><P>{$_TXT['global_disabled']}</p>";
- }elseif($banks->status == 'x'){
- $status = "<P><input type='radio' name='bank' value='$banks->id' id='bank'> $banks->bank_name ($banks->bankType) $bankString</p></TD><TD><P>{$_TXT['global_expired']}</p>";
- }
- echo "<TR><TD>$status</TD> </TR><br>";
- }
- if($input == 'table'){
- $banks->bank_name = strtoupper($banks->bank_name);
- if($banks->bankType == 's'){
- $banks->bankType = $_TXT['xbankadd_savings'];
- }elseif($banks->bankType == 'c'){
- $banks->bankType = $_TXT['xbankadd_checking'];
- }
- if($banks->status == 'v' && $banks->life == 'p'){
- $status = "{$_TXT['global_verified']} / {$_TXT['global_primary']}";
- }elseif($banks->status == 'v'){
- $status = $_TXT['global_verified'];
- }elseif($banks->status == 'u'){
- $status = $_TXT['global_unverified'];
- }elseif($banks->status == 'd'){
- $status = $_TXT['global_disabled'];
- }elseif($banks->status == 'x'){
- $status = $_TXT['global_expired'];
- }
- if($banks->status == 'u'){
- $doit = "<a href=\"show.php?inc=banksacc-verify-main&prcs=$data->user_unique~$data->id&y=$banks->id\">{$_TXT['xbankman_verify']}</a> |";
- }else{
- $doit = "";
- }
- if($banks->status == 'v' && $banks->life != 'p'){
- $makeprime = "<a href=\"show.php?inc=banksacc-primary-main&prcs=$data->user_unique~$data->id&y=$banks->id\">{$_TXT['xbankman_prime']}</a> |";
- }else{
- $makeprime = "";
- }
- if($banks->status != 'd' || $banks->status != 'x'){
- $disable = "<a href=\"show.php?inc=banksacc-ed-main&prcs=$data->user_unique~$data->id&y=$banks->id\">{$_TXT['xbankman_dsenable']}</a>";
- }else{
- $disable = "";
- }
- if($num%2==0)
- {
- $color = "#FCFCFC";
- }else{
- $color = "#ffffff";
- }
- ?>
- <TR>
- <TD WIDTH="50%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P>
- <?=$banks->bank_name?> (<?=$banks->bankType?>) <?=$bankString?></TD>
- <TD WIDTH="23%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P>
- <?=$status?></TD>
- <TD WIDTH="27%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P ALIGN=RIGHT>
- <? echo "$doit $makeprime $disable"; ?></TD>
- </TR>
- <?
- }
- if($input == 'dropbox'){
- if($banks->bankType == 's'){
- $banks->bankType = $_TXT['xbankadd_savings'];
- }elseif($banks->bankType == 'c'){
- $banks->bankType = $_TXT['xbankadd_checking'];
- }
- if($banks->status == 'v' && $banks->life == 'p'){
- $status = "<option value='$banks->id' SELECTED>$banks->bank_name ($banks->bankType) $bankString ({$_TXT['global_verified']} / {$_TXT['global_primary']})</option>";
- }elseif($banks->status == 'v'){
- $status = "<option value='$banks->id'>$banks->bank_name ($banks->bankType) $bankString ({$_TXT['global_verified']}) </option>";
- }elseif($banks->status == 'u'){
- $status = "<option value='$banks->id'>$banks->bank_name ($banks->bankType) $bankString ({$_TXT['global_unverified']}) </option>";
- }elseif($banks->status == 'd'){
- $status = "<option value='$banks->id'>$banks->bank_name ($banks->bankType) $bankString ({$_TXT['global_disable']}) </option>";
- }elseif($banks->status == 'x'){
- $status = "<option value='$banks->id'>$banks->bank_name ($banks->bankType) $bankString ({$_TXT['global_expired']}) </option>";
- }
- echo $status;
- }
- $num = $num+1;
- }
- if($input == 'dropbox'){
- echo "</select>";
- }
- }
- }
- // show phone summary
- function _phoneShow($user,$life,$input,$what){
- global $_TXT,$ph,$ph0,$ph1,$ph2,$ph3,$status,$and,$phString,$data,$verifyit;
- if($life == 'count'){
- $ph0 = mysql_num_rows(mysql_query("SELECT * FROM xt_phones WHERE user='$user' AND life='p'"));
- $ph1 = mysql_num_rows(mysql_query("SELECT * FROM xt_phones WHERE user='$user' AND status='v'"));
- $ph2 = mysql_num_rows(mysql_query("SELECT * FROM xt_phones WHERE user='$user' AND status='u'"));
- $ph3 = mysql_num_rows(mysql_query("SELECT * FROM xt_phones WHERE user='$user' AND (status='d' OR status='x')"));
- if($what == '0'){
- $ph = $ph1+$ph2+$ph3;
- return $ph;
- }
- if($what == '1'){
- return $ph1;
- }
- if($what == '2'){
- return $ph2;
- }
- if($what == '3'){
- return $ph3;
- }
- if($what == '4'){
- return $ph0;
- }
- }
- if(!$what){
- $and = "";
- }else{
- $and = "AND status='v'";
- }
- if($life == 'list'){
- if($input == 'dropbox'){
- echo "<select id='select-input' name='phone'>";
- }
- $ph1 = mysql_query("SELECT * FROM xt_phones WHERE user='$user'$and ORDER BY status ASC");
- while ($ph = mysql_fetch_object($ph1)){
- // find type
- if($ph->ptype == 'm'){
- $ph->ptype = $_TXT['global_phone_mobile'];
- }elseif($ph->ptype == 'h'){
- $ph->ptype = $_TXT['global_phone_home'];
- }elseif($ph->ptype == 'f'){
- $ph->ptype = $_TXT['global_phone_fax'];
- }elseif($ph->ptype == 'b'){
- $ph->ptype = $_TXT['global_phone_business'];
- }
- if($input == 'table'){
- if($ph->status == 'v' && $ph->life == 'p'){
- $status = "{$_TXT['global_verified']} / {$_TXT['global_primary']}";
- }elseif($ph->status == 'v'){
- $status = $_TXT['global_verified'];
- }elseif($ph->status == 'u'){
- $status = $_TXT['global_unverified'];
- $verifyit = "<a href=\"show.php?inc=phones-verify-main&prcs=$data->user_unique~$data->id&y=$ph->pnumber\">{$_TXT['global_verify']}</a>";
- }elseif($ph->status == 'd'){
- $status = $_TXT['global_disabled'];
- }elseif($ph->status == 'x'){
- $status = $_TXT['global_expired'];
- }
- //$ph->pnumber = substr($ph->pnumber, 0, 5).substr($ph->pnumber, 5);
- //$ph->pnumber = str_replace($ph->ccode, "", $ph->pnumber);
- $ph->pnumber = substr($ph->pnumber, strlen($ph->ccode));
- if($num%2==0)
- {
- $color = "#FCFCFC";
- }else{
- $color = "#ffffff";
- }
- ?>
- <TR>
- <TD WIDTH="50%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P>
- <? echo "+$ph->ccode $ph->pnumber"; ?></TD>
- <TD WIDTH="23%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P>
- <?=$status?></TD>
- <TD WIDTH="27%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P ALIGN=RIGHT>
- <? echo "$verifyit"; ?></TD>
- </TR>
- <?
- }
- if($input == 'radio'){
- if($ph->status == 'v' && $ph->life == 'p'){
- $status = "<P><input type='radio' name='phone' value='$ph->id' id='phone' CHECKED> +($ph->ccode) $ph->pnumber ($ph->ptype)</p></TD><TD><P>{$_TXT['global_verified']} / {$_TXT['global_primary']}</p>";
- }elseif($ph->status == 'v'){
- $status = "<P><input type='radio' name='phone' value='$ph->id' id='phone' CHECKED> +($ph->ccode) $ph->pnumber ($ph->ptype)</p></TD><TD><P>{$_TXT['global_verified'] }</p>";
- }elseif($ph->status == 'u'){
- $status = "<P><input type='radio' name='phone' value='$ph->id' id='phone' CHECKED> +($ph->ccode) $ph->pnumber ($ph->ptype)</p></TD><TD><P>{$_TXT['global_unverified']}</p>";
- }elseif($ph->status == 'd'){
- $status = "<P><input type='radio' name='phone' value='$ph->id' id='phone' CHECKED> +($ph->ccode) $ph->pnumber ($ph->ptype)</p></TD><TD><P>{$_TXT['global_disabled']}</p>";
- }elseif($ph->status == 'x'){
- $status = "<P><input type='radio' name='phone' value='$ph->id' id='phone' CHECKED> +($ph->ccode) $ph->pnumber ($ph->ptype)</p></TD><TD><P>{$_TXT['global_expired']}</p>";
- }
- echo "<TR><TD>$status</TD> </TR><br>";
- }
- if($input == 'dropbox'){
- if($ph->status == 'v' && $ph->life == 'p'){
- $status = "<option value='$ph->id' SELECTED>+($ph->ccode) $ph->pnumber ($ph->ptype) ({$_TXT['global_verified']} / {$_TXT['global_primary']})</option>";
- }elseif($ph->status == 'v'){
- $status = "<option value='$ph->id' SELECTED>+($ph->ccode) $ph->pnumber ($ph->ptype) ({$_TXT['global_verified']}) </option>";
- }elseif($ph->status == 'u'){
- $status = "<option value='$ph->id' SELECTED>+($ph->ccode) $ph->pnumber ($ph->ptype) ({$_TXT['global_unverified']}) </option>";
- }elseif($ph->status == 'd'){
- $status = "<option value='$ph->id' SELECTED>+($ph->ccode) $ph->pnumber ($ph->ptype) ({$_TXT['global_disabled']}) </option>";
- }elseif($ph->status == 'x'){
- $status = "<option value='$ph->id' SELECTED>+($ph->ccode) $ph->pnumber ($ph->ptype) ({$_TXT['global_expired']}) </option>";
- }
- echo $status;
- }
- $num = $num+1;
- }
- if($input == 'dropbox'){
- echo "</select>";
- }
- }
- }
- // what is user email
- function _getEmail($id,$link){
- global $_TXT;
- $user = mysql_fetch_object(mysql_query("SELECT * FROM xt_members WHERE id='$id'"));
- // show link to profile page \\
- if($link){
- $user->email = "<a href=\"?cmd=xpr&i=$id\">$user->email</a>";
- }else{
- $user->email = $user->email;
- }
- return $user->email;
- }
- // find out user's preferred language
- function _getUserLang($id){
- global $_TXT;
- $user = mysql_fetch_object(mysql_query("SELECT * FROM xt_members WHERE id='$id'"));
- return $user->my_language;
- }
- // create error messages
- function _ERROR($msg,$type){
- global $_epost,$_TXT,$_errorcode;
- if(!$type){
- return die("<div id='failed' class='failed' onclick=\"$('update_results').hide()\">
- <img src='img/spacer.gif' onload=\"$('update_results').show()\"> $msg
- </div>");
- $_failed = 1;
- }elseif($type == '3'){
- echo "<div id='failed' class='failed' onclick=\"$('update_results').hide()\">
- <img src='img/spacer.gif' onload=\"$('update_results').show()\">
- » $msg
- </div>";
- $_epost = 1;
- }elseif($type == '1'){
- echo "<div class='failed'>
- $msg
- </div>";
- $_epost = 1;
- }elseif($type == '2'){
- echo "$msg";
- }elseif($type == '4'){
- return die("status=0&error={$_REQUEST['errorcode']}&reason=$msg");
- }
- }
- // create success messages
- function _SUCCESS($msg){
- global $_TXT;
- return die("<div class='success' onclick=\"$('update_results').hide()\">
- <img src='img/spacer.gif' onload=\"$('update_results').show()\">
- $msg
- </div>");
- }
- // check transaction hold
- function _CHECKPHONES($p,$debug){
- global $data,$_TXT,$tr_status,$qr1,$qr2,$pending,$holds,$update,$delete,$debug,$reqs,
- $fee,$tr_flat,$tr_percent,$_SESSION,$_REQUEST,$cur,$matches;
- $qr1 = mysql_query(
- "SELECT * FROM xt_phones");
- //echo $qr1;
- while ($phones = mysql_fetch_object($qr1)){
- //echo $phones->pnumber;
- preg_match('/129759865874159/i', $phones->pnumber, $matches, PREG_OFFSET_CAPTURE);
- print_r($matches);
- }
- } // end
- // IPN
- function run_ipn($url,$transid,$user,$status){
- $qarray = array();
- array_push($qarray, "transid=" . urlencode($transid));
- array_push($qarray, "uid=" . urlencode($user));
- array_push($qarray, "status=" . urlencode($status));
- $query = implode('&', $qarray);
- $ch = curl_init("$url");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
- curl_setopt($ch, CURLOPT_TIMEOUT, 4);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $result = curl_exec($ch);
- curl_close($ch);
- }
- // END IPN
- // check transaction hold
- function _CHECKHOLDS($email,$debug){
- global $data,$_TXT,$tr_status,$qr1,$qr2,$pending,$holds,$update,$delete,$debug,$reqs,
- $fee,$tr_flat,$tr_percent,$_SESSION,$_REQUEST,$cur,$updateme,$accfee;
- //$cur = $_SESSION['cur'];
- $qr1 = mysql_query(
- "SELECT * FROM xt_hold WHERE email='$email'");
- while ($holds = mysql_fetch_object($qr1)){
- // open up a connection
- $xt_trans = DB_OBJECT("xt_trans","xt_trans WHERE id='$holds->trans_id'",0);
- $cur = $xt_trans->currency;
- // GET FEE
- $accfee = DB_OBJECT("acc","xt_config_accounts_fees WHERE currency='$cur' AND account_id='$data->account_type'",0);
- $tr_flat = $accfee->receive_flat;
- $tr_percent = $accfee->receive_percent;
- // END FEE
- $fee = TR_FEE(_ADMIN_SHOW("xt_trans WHERE id='$holds->trans_id'",total),$tr_percent,$tr_flat);
- // if used bank account
- if($holds->ftype == 'bank'){
- $tr_status = 'i';
- }else{
- $tr_status = 'f';
- }
- // do the query thing
- $update = "UPDATE xt_trans SET status='$tr_status',tr_to='$data->id',fees='$fee' WHERE id='$holds->trans_id'";
- $delete = "DELETE FROM xt_hold WHERE id='$holds->id'";
- // send it, no debug
- DB_UPDATE("$update",$debug);
- DB_UPDATE("$delete",$debug);
- // if referredby auto create is on
- if(_ADMIN_SHOW("xt_config_referrals",refer_sendrequest) == 't' && ($data->referredby <= 0 || is_null($data->referredby) )){
- $updateme = "UPDATE xt_members SET
- referredby='$xt_trans->tr_by' WHERE id='$data->id'";
- // send it, no debug
- DB_UPDATE("$updateme",0);
- }
- }
- $qr2 = mysql_query(
- "SELECT * FROM xt_trans WHERE status='p' AND extended_comment='$email'");
- while ($pending = mysql_fetch_object($qr2)){
- // do the query thing
- $update = "UPDATE xt_trans SET status='f' WHERE tr_to='$data->id'";
- // send it, no debug
- DB_UPDATE("$update",$debug);
- }
- // mysql_close ($show);
- }
- // check transaction hold when adding email
- function _CHECKHOLDS_EMAILADD($email,$debug){
- global $data,$_TXT,$tr_status,$qr1,$qr2,$pending,$holds,$update,$delete,$debug,$reqs,
- $fee,$tr_flat,$tr_percent,$xt_trans,$cur;
- $qr1 = mysql_query(
- "SELECT * FROM xt_hold WHERE email='$email'");
- while ($holds = mysql_fetch_object($qr1)){
- $xt_trans = DB_OBJECT("xt_trans","xt_trans WHERE id='$holds->trans_id'",0);
- $cur = $xt_trans->currency;
- // GET FEE
- $accfee = DB_OBJECT("acc","xt_config_accounts_fees WHERE currency='$cur' AND account_id='$data->account_type'",0);
- $tr_flat = $accfee->receive_flat;
- $tr_percent = $accfee->receive_percent;
- // END FEE
- $fee = TR_FEE(_ADMIN_SHOW("xt_trans WHERE id='$holds->trans_id'",total),$tr_percent,$tr_flat);
- $tr_status = 'h';
- // do the query thing
- $update = "UPDATE xt_trans SET status='$tr_status',tr_to='$data->id',fees='$fee' WHERE id='$holds->trans_id'";
- // send it, no debug
- DB_UPDATE("$update",$debug);
- }
- // mysql_close ($show);
- }
- // check request money hold
- function _CHECKREQS($email,$debug){
- global $data,$_TXT,$tr_status,$qr1,$qr2,$pending,$holds,$update,$delete,$debug,$reqs,
- $fee,$tr_flat,$tr_percent,$xt_moneyreqs;
- $qr1 = mysql_query(
- "SELECT * FROM xt_moneyreqs WHERE email='$email'");
- while ($reqs = mysql_fetch_object($qr1)){
- $xt_moneyreqs = DB_OBJECT("xt_moneyreqs","xt_moneyreqs WHERE id='$reqs->trans_id'",0);
- $cur = $xt_moneyreqs->currency;
- // GET FEE
- $accfee = DB_OBJECT("acc","xt_config_accounts_fees WHERE currency='$cur' AND account_id='$data->account_type'",0);
- $tr_flat = $accfee->receive_flat;
- $tr_percent = $accfee->receive_percent;
- // END FEE
- $fee = TR_FEE(_ADMIN_SHOW("xt_trans WHERE id='$holds->trans_id'",total),$tr_percent,$tr_flat);
- // do the query thing
- $update = "UPDATE xt_trans SET tr_by='$data->id', fees='$fee' WHERE id='$reqs->trans_id'";
- $delete = "DELETE FROM xt_moneyreqs WHERE id='$reqs->id'";
- // send it, no debug
- DB_UPDATE("$update",$debug);
- DB_UPDATE("$delete",$debug);
- }
- // mysql_close ($show);
- }
- // Balance notify output \\
- function MyBalNotify(){
- global $_TXT,$data,$balance_notify,$bnt,$currency;
- list($balance_notify, $bnt) = split(':', $data->balance_notify);
- if($bnt == 'u' || empty($bnt)){
- $balance_notify = "<a href='#' onclick=\"showpage('launch.php?fuse=xbalance.notify&id=$data->id','showing')\">Create</a>";
- }else{
- if($bnt == '1'){
- $bnt = "Over";
- }elseif($bnt == '2'){
- $bnt = "Under";
- }
- $balance_notify = "<a href='#' onclick=\"showpage('launch.php?fuse=xbalance.notify&id=$data->id','showing')\">$bnt $currency$balance_notify</b>";
- }
- return $balance_notify;
- }
- //geoip location
- function geo_location($ip,$maxid,$orig){
- global $query,$url,$host,$path,$timeout,$fp,$buf,$lines,$geo,$r,$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;
- $fp = fsockopen ($host, 80, $errno, $errstr, $timeout)
- or die('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);
- } else {
- # enter error handing code here
- }
- //echo "$geo<p>";
- $r = explode(',', $geo);
- $insertme = "Country Code = $r[0]
- Region Code = $r[1]
- City = $r[2]
- Postal Code = $r[3]
- Latitude = $r[4]
- Longitude = $r[5]
- Metropolitan Code = $r[6]
- Area Code = $r[7]
- ISP = $r[8]
- Organization = $r[9]
- Error code = $r[10]";
- // add recovery
- $add_r = "xt_geoip SET
- geoip ='".addslashes($insertme)."',
- orig = '".addslashes($orig)."',
- geotype= 'loc'";
- //echo $add_r;
- DB_ADD("$add_r",0);
- }
- //geoip bin
- function geo_bin($maxid,$ip,$orig,$city,$region,$postal,$country,$domain,$bin,$forwardedip,$custphone,$binname,$binphone,$reqtype,$emailmd5,$shipaddr){
- global $query,$url,$host,$path,$timeout,$fp,$buf,$lines,$geo,$r,$add_r,$siteurl;
- require_once("geoip/CreditCardFraudDetection.php");
- //first we create a new CreditCardFraudDetection object
- $ccfs = new CreditCardFraudDetection;
- // Set inputs and store them in a hash
- // See http://www.maxmind.com/app/ccv for more details on the input fields
- // Enter your license key here (non registered users limited to 20 lookups per day)
- $h["license_key"] = $maxid;
- // Required fields
- $h["i"] = $ip; // set the client ip address
- $h["city"] = $city; // set the billing city
- $h["region"] = $region; // set the billing state
- $h["postal"] = $postal; // set the billing zip code
- $h["country"] = $country; // set the billing country
- // Recommended fields
- $h["domain"] = $domain; // Email domain
- $h["bin"] = $bin; // bank identification number
- $h["forwardedIP"] = $forwardedip; // X-Forwarded-For or Client-IP HTTP Header
- $h["custPhone"] = $custphone; // Area-code and local prefix of customer phone number
- // Optional fields
- $h["binName"] = $binname; // bank name
- $h["binPhone"] = $binphone; // bank customer service phone number on back of credit card
- $h["requested_type"] = $reqtype; // Which level (free, city, premium) of CCFD to use
- $h["emailMD5"] = $emailmd5; // CreditCardFraudDetection.php will take
- // MD5 hash of e-mail address passed to emailMD5 if it detects '@' in the string
- $h["shipAddr"] = $shipaddr; // Shipping Address
- $h["txnID"] = $_REQUEST['']; // Transaction ID
- $h["sessionID"] = $_REQUEST['']; // Session ID
- // If you want to disable Secure HTTPS or don't have Curl and OpenSSL installed
- // uncomment the next line
- // $ccfs->isSecure = 0;
- //set the time out to be five seconds
- $ccfs->timeout = 5;
- //uncomment to turn on debugging
- // $ccfs->debug = 1;
- //next we pass the input hash to the server
- $ccfs->input($h);
- //then we query the server
- $ccfs->query();
- //then we get the result from the server
- $h = $ccfs->output();
- //echo "<!--start-->";
- //then finally we print out the result
- $outputkeys = array_keys($h);
- $numoutputkeys = count($h);
- for ($i = 0; $i < $numoutputkeys; $i++) {
- $key = $outputkeys[$i];
- $value = $h[$key];
- $a = "$value";
- $lines = split("\n", $a);
- $data = $lines[count($lines)-1];
- $geo = explode(",",$data);
- //echo $key . " = " . $value . "<br>";
- $arr[$key] = $value;
- }
- $insertme = "Distance = $arr[distance]
- Country Match = $arr[countryMatch]
- Country Code = $arr[countryCode]
- Free Email = $arr[freeMail]
- Anonymous Proxy = $arr[anonymousProxy]
- Fraud Score = $arr[score]
- Bin Match = $arr[binMatch]
- Bin Country = $arr[binCountry]
- Error = $arr[err]
- Proxy Score = $arr[proxyScore]
- Spam Score = $arr[spamScore]
- Region = $arr[ip_region]
- City = $arr[ip_city]
- Latitude = $arr[ip_latitude]
- Longitude = $arr[ip_longitude]
- Bin Name = $arr[binName]
- ISP = $arr[ip_isp]
- ISP Org = $arr[ip_org]
- Bin Name Match = $arr[binNameMatch]
- Bin Phone Match = $arr[binPhoneMatch]
- Bin Phone = $arr[binPhone]
- Customer Phone Billing Location = $arr[custPhoneInBillingLoc]
- High Risk Country = $arr[highRiskCountry]
- City Postal Match = $arr[cityPostalMatch]
- Shipping City Postal Match = $arr[shipCityPostalMatch]
- Is Trans Proxy = $arr[isTransProxy]";
- // add recovery
- $add_r = "xt_geoip SET
- geoip ='".addslashes($insertme)."',
- orig = '".addslashes($orig)."',
- geotype= 'bin'";
- //echo $add_r;
- DB_ADD("$add_r",0);
- }
- function _RELEASEPENDING($id,$debug){
- $qr1 = mysql_query(
- "SELECT * FROM xt_trans WHERE id='$id'");
- while ($holds = mysql_fetch_object($qr1)){
- // do the query thing
- $update = "UPDATE xt_trans SET status='f' WHERE id='$id' LIMIT 1";
- // send it, no debug
- DB_UPDATE("$update",$debug);
- }
- }// end _RELEASEPENDING
- // do manage email address \\
- function _manageEmails($user,$type){
- global $emails1,$emails,$data,$_TXT;
- $emails1 = mysql_query("SELECT * FROM xt_emails WHERE user='$user' ORDER BY status,life ASC");
- while ($emails = mysql_fetch_object($emails1)){
- if($type == 'radio'){
- if($emails->status == 'v' && $emails->life == 'p'){
- $emails->status = "<P><input type='radio' name='emails' value='$emails->email' id='email' CHECKED> $emails->email</p></TD><TD><P>{$_TXT['global_verified']} / {$_TXT['global_primary']}</p>";
- }elseif($emails->status == 'v'){
- $emails->status = "<P><input type='radio' name='emails' value='$emails->email' id='email' CHECKED> $emails->email</p></TD><TD><P>{$_TXT['global_verified']}</p>";
- }else{
- $emails->status = "<P><input type='radio' name='emails' value='$emails->email' id='email' CHECKED> $emails->email</p></TD><TD><P>{$_TXT['global_unverified']}</p>";
- }
- echo "<TR><TD>$emails->status</TD> </TR><br>";
- }
- if($type == 'table'){
- if($emails->status == 'v' && $emails->life == 'p'){
- $status = "{$_TXT['global_verified']} / {$_TXT['global_primary']}";
- }elseif($emails->status == 'v'){
- $status = $_TXT['global_verified'];
- }else{
- $status = $_TXT['global_unverified'];
- }
- if($emails->status == 'u'){
- $doit = "<a href=\"show.php?inc=emails-verify&y=$emails->email\">{$_TXT['global_verify']}</a> |";
- }else{
- $doit = "";
- }
- if($emails->status != 'p'){
- $disable = "<a href=\"show.php?inc=emails-delete&y=$emails->email\">{$_TXT['global_delete']}</a>";
- }else{
- $disable = "";
- }
- if($num%2==0)
- {
- $color = "#FCFCFC";
- }else{
- $color = "#ffffff";
- }
- ?>
- <TR>
- <TD WIDTH="50%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P>
- <?=$emails->email?></TD>
- <TD WIDTH="23%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P>
- <?=$status?></TD>
- <TD WIDTH="27%" VALIGN=TOP BGCOLOR="<?=$color?>">
- <P ALIGN=RIGHT>
- <?=$doit?> <?=$disable?></TD>
- </TR>
- <?
- }
- $num = $num+1;
- }
- } // end
- // show account type \\
- function _ACCOUNT_TYPE(){
- global $_TXT,$data,$type;
- $type = DB_OBJECT("acc","xt_config_accounts WHERE id='$data->account_type'",0);
- return ucwords($type->account_name);
- }
- // check if valid email address
- function validate_email($email) {
- global $_TXT;
- if (eregi("^.+@.+\\..+$", $email, $check)) {
- if (checkdnsrr(substr(strstr($check[0], '@'), 1), "ANY")) {
- return 1;
- }
- }
- return 0;
- }
- // check transaction validity & status
- function _isValidTrans($id,$what){
- global $_TXT,$data;
- $show = mysql_fetch_object(mysql_query(
- "SELECT * FROM xt_trans WHERE id='$id' AND (tr_to='$data->id' OR tr_by='$data->id')"));
- return $show->$what;
- // mysql_close ($show);
- }
- // get status output
- function _GETSTATUS($id,$what){
- global $_TXT,$data,$trans,$ret,$bankname,$bankprint;
- $trans = mysql_fetch_object(mysql_query(
- "SELECT * FROM xt_trans WHERE id='$id' AND (tr_to='$data->id' OR tr_by='$data->id')"));
- if($what == 'status'){
- if($trans->status == 'h' && $trans->tr_to == $user){
- $ret = $_TXT['global_st_p'];
- }
- elseif($trans->status == 'p' && strlen($trans->extended_comment) > 1 && $trans->tr_to == $user){
- $ret = $_TXT['global_st_p'];
- }
- elseif(($trans->status == 'f') && ($trans->id == _ADMIN_SHOW("xt_hold WHERE trans_id='$trans->id'",trans_id))){
- $ret = $_TXT['global_st_h1'];
- }
- elseif($trans->status == 'rf') {
- $ret = $_TXT['global_st_rf'];
- }
- elseif($trans->status == 'esc') {
- $ret = $_TXT['global_st_esc'];
- }
- elseif($trans->status == 'prf') {
- $ret = $_TXT['global_st_prf'];
- }
- elseif($trans->status == 'c') {
- $ret = $_TXT['global_st_c'];
- }
- elseif(($trans->status == 'p' && $trans->tr_by == $user) || ($trans->status == 'h' && $trans->tr_by == $user)) {
- $ret = $_TXT['global_st_p'];
- }
- elseif($trans->status == 'rv') {
- $ret = $_TXT['global_st_rv'];
- }
- elseif($trans->status == 'i' && $trans->secondarystatus == 'reversed'){
- $ret = $_TXT['global_st_f'];
- }
- elseif($trans->status == 'i'){
- $ret = $_TXT['global_st_i'];
- }
- elseif($trans->status == 'f' && $trans->secondarystatus == 'refunded'){
- $ret = $_TXT['global_st_rf'];
- }
- elseif($trans->status == 'f' && $trans->secondarystatus == 'pending_refunded'){
- $ret = $_TXT['global_st_prf'];
- }
- elseif($trans->status == 'f'){
- $ret = $_TXT['global_st_f'];
- }
- elseif($trans->status == 'mreq'){
- $ret = $_TXT['global_st_p'];
- }
- }
- // tr to
- if($what == 'tr_to'){
- if($trans->tr_to == '1'){
- $ret = $trans->extended_comment;
- }elseif($trans->tr_to == '2'){
- $ret = $_TXT['global_2'];
- }elseif($trans->tr_to == '3'){
- $ret = $_TXT['global_3'];
- }elseif($trans->tr_to == '4'){
- $ret = $_TXT['global_4'];
- }elseif($trans->tr_to == '5'){
- $ret = $_TXT['global_5'];
- }elseif($trans->tr_to == '6'){
- $ret = $_TXT['global_6'];
- }elseif($trans->tr_to == '13'){
- $ret = $_TXT['global_13'];
- }elseif($trans->tr_to == '16'){
- $ret = $_TXT['global_16'];
- }else{
- $ret = _GETIDNAME($trans->tr_to,1,1);;
- }
- }
- // tr by
- if($what == 'tr_by'){
- if($trans->tr_by == '1'){
- $ret = $trans->extended_comment;
- }elseif($trans->tr_by == '2'){
- $ret = $_TXT['global_2'];
- }elseif($trans->tr_by == '3'){
- $ret = $_TXT['global_3'];
- }elseif($trans->tr_by == '4'){
- $ret = $_TXT['global_4'];
- }elseif($trans->tr_by == '5'){
- $ret = $_TXT['global_5'];
- }elseif($trans->tr_by == '6'){
- $ret = $_TXT['global_6'];
- }elseif($trans->tr_by == '13'){
- $ret = $_TXT['global_13'];
- }elseif($trans->tr_by == '15'){
- $ret = $_TXT['global_15'];
- }else{
- $ret = _GETIDNAME($trans->tr_by,1,1);
- }
- }
- // funding
- if($what == 'transfer_type'){
- if($trans->transfer_type == 'bal'){
- $ret = $_TXT['global_accountbalance'];
- }elseif($trans->transfer_type == 'card'){
- $bankname = _SHOWME($data->id,"xt_cc","ccType","AND id='$trans->trtype_id'");
- $bankprint = trim(_ccDecrypt(_SHOWME($data->id,"xt_cc","ccNum","AND id='$trans->trtype_id'")));
- $bankprint = substr($bankprint, 0, 1).XXXX.substr($bankprint, -2, 2);
- $ret = "{$_TXT['global_creditcard']} $bankname $bankprint";
- }elseif($trans->transfer_type == 'bank'){
- $bankname = _SHOWME($data->id,"xt_banks","bank_name","AND id='$trans->trtype_id'");
- $bankprint = trim(_bankDecrypt(_SHOWME($data->id,"xt_banks","acct","AND id='$trans->trtype_id'")));
- $bankprint = substr($bankprint, 0, 1).XX.substr($bankprint, -2, 2);
- $ret = "{$_TXT['global_bankaccount']} $bankname $bankprint";
- }elseif($trans->transfer_type == 'mail'){
- $ret = $_TXT['global_mail'];
- }elseif($trans->tr_by == '5'){
- $ret = $_TXT['global_5'];
- }elseif($trans->tr_by == '6'){
- $ret = $_TXT['global_6'];
- }elseif($trans->tr_by == '15'){
- $ret = $_TXT['global_15'];
- }
- }
- return ucwords($ret);
- // mysql_close ($show);
- }
- // check reserves being held
- function _CHECKRESERVES($email,$debug){
- global $data,$_TXT,$tr_status,$qr1,$qr2,$pending,$holds,$update,$delete,$debug,$reqs,
- $fee,$tr_flat,$tr_percent;
- $qr1 = mysql_query(
- "SELECT * FROM xt_reserves WHERE email='$email'");
- while ($res = mysql_fetch_object($qr1)){
- // do the query thing
- $update = "UPDATE xt_reserves SET user='$data->id' WHERE email='$email'";
- // send it, no debug
- DB_UPDATE("$update",$debug);
- }
- // mysql_close ($show);
- }
- // create randon generated numbers \\
- //\\ GENERATE_ID("1234567890",10)
- function GENERATE_ID($chars,$len){
- global $_TXT;
- $salt = $chars;
- srand((double)microtime()*1200500);
- $i = 1;
- while ($i <= $len) { // this is the number of digits
- $length = strlen($salt);
- $num = rand(0, $length - 1);
- $tmp = substr($salt, $num, 1);
- $pass = $pass . $tmp;
- $i++;
- }
- return $pass;
- }
- // MYSQL ONLY \\
- // mysql update \\
- function DB_UPDATE($inserts,$debug){
- global $_TXT;
- $doit = $inserts;
- //\\ show mysql input
- if($debug){
- echo "<p>$doit <p>";
- }
- mysql_query($doit) or die( mysql_error() );
- // mysql_close ($doit);
- }
- // mysql add query \\
- function DB_DELETE($inserts,$debug){
- global $_TXT;
- $doit = "DELETE FROM $inserts";
- //\\ show mysql input
- if($debug){
- echo "<p>$doit <p>";
- }
- mysql_query($doit) or die( mysql_error() );
- // mysql_close ($doit);
- }
- // mysql add query \\
- function DB_ADD($inserts,$debug){
- global $_TXT;
- $doit = "INSERT INTO $inserts";
- //\\ show mysql input
- if($debug){
- echo "<p>$doit <p>";
- }
- mysql_query($doit) or die( mysql_error() );
- // mysql_close ($doit);
- }
- function isValidURL($url)
- {
- return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
- }
- // show table data \\
- //\\ _SHOWME($data->id,"xt_company","company")
- function _SHOWME($user,$table,$what,$optional){
- global $_TXT;
- $show = mysql_fetch_object(mysql_query(
- "SELECT * FROM $table WHERE user='$user' $optional"));
- return $show->$what;
- // mysql_close ($show);
- }
- function _CHECKIT($table,$what,$optional,$s){
- global $_TXT;
- if($s == 'email'){
- $show = mysql_fetch_object(mysql_query(
- "SELECT * FROM $table WHERE $optional"));
- return $show->$what;
- }
- if($s == 'seller'){
- $show = mysql_fetch_object(mysql_query(
- "SELECT * FROM $table WHERE $optional"));
- return $show->$what;
- }
- if($s == 'phone'){
- $show = mysql_fetch_object(mysql_query(
- "SELECT * FROM $table WHERE $optional"));
- return $show->$what;
- }
- }
- function SENDTO_ADMIN($subject,$body,$lang){
- global $xt_config_page,$sendto;
- $xt_config_page = DB_OBJECT("xt_config_page","xt_config_page",0);
- SEND_MAIL($xt_config_page->main_email,"$subject","$body",$lang);
- }
- function MYCONVERSATIONS(){
- global $data, $origmess, $unread,$arc;
- $origmess = DB_OBJECT("xt_pm","xt_pm WHERE (sent_by='$data->id' OR sent_to='$data->id') AND original='t'",0);
- if($origmess->sent_by == $data->id){
- $arc = "del_by != $data->id";
- }elseif($origmess->sent_to == $data->id){
- $arc = "del_to != $data->id";
- }
- list($unread) = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_pm WHERE sent_to='$data->id' AND status='unread' AND $arc"));
- return $unread;
- }
- if(!function_exists('checkdnsrr'))
- {
- function checkdnsrr($hostName, $recType = '')
- {
- return true;
- }
- }
- $requirelogin = array(
- 'login_checker',
- 'redirecting',
- 'startpage',
- 'sub-nav',
- 'summary-overview',
- 'summary-history',
- 'summary-currency',
- 'todo-main',
- 'emails-main',
- 'emails-main-table',
- 'emails-add',
- 'emails-add-table',
- 'emails-verify',
- 'emails-verify-table',
- 'emails-verify-final',
- 'emails-delete',
- 'emails-delete-table',
- 'emails-delete-final',
- 'emails-add-final',
- 'my-referrals-main',
- 'my-referrals-main-table',
- 'sendmoney-main',
- 'sendmoney-main-table',
- 'sendmoney-main-confirm',
- 'sendmoney-main-working',
- 'sendmoney-main-final',
- 'depositmoney-main',
- 'depositmoney-main-table',
- 'depositmoney-main-cc',
- 'depositmoney-main-cc-table',
- 'depositmoney-main-bank',
- 'depositmoney-main-bank-table',
- 'depositmoney-main-mail',
- 'depositmoney-main-mail-table',
- 'depositmoney-main-confirm',
- 'depositmoney-main-final',
- 'geoip',
- 'geoip-table',
- 'geoip-final',
- 'withdrawmoney-main',
- 'withdrawmoney-main-table',
- 'withdrawmoney-main-bank',
- 'withdrawmoney-main-bank-table',
- 'withdrawmoney-main-mail',
- 'withdrawmoney-main-mail-table',
- 'withdrawmoney-main-confirm',
- 'withdrawmoney-main-final',
- 'history-main',
- 'history-main-table',
- 'mobilepay-main',
- 'mobilepay-main-table',
- 'mobilepay-api',
- 'bulkpay-main',
- 'bulkpay-main-table',
- 'balance-notify-main',
- 'balance-notify-main-table',
- 'sendescrow-main',
- 'sendescrow-main-table',
- 'sendescrow-main-confirm',
- 'sendescrow-main-final',
- 'requestmoney-main',
- 'requestmoney-main-table',
- 'requestmoney-main-confirm',
- 'requestmoney-main-final',
- 'sellertools-main',
- 'sellertools-main-table',
- 'seller_singles-main',
- 'seller_singles-main-table',
- 'seller_singles-main-final',
- 'seller_subscriptions-main',
- 'seller_subscriptions-main-table',
- 'seller_subscriptions-main-final',
- 'seller_donations-main',
- 'seller_donations-main-table',
- 'seller_donations-main-final',
- 'seller_secured-view-main',
- 'seller_secured-view-main-table',
- 'seller_secured-edit-main',
- 'seller_secured-edit-main-table',
- 'seller_ipn-main',
- 'seller_ipn-main-table',
- 'seller_secured-delete-main',
- 'seller_secured-delete-main-table',
- 'seller_secured-create-main',
- 'seller_secured-create-main-table',
- 'seller_secured-create-main-final',
- 'seller_virtual-terminal-main',
- 'seller_virtual-terminal-main-table',
- 'seller_virtual-terminal-main-confirm',
- 'seller_virtual-terminal-main-final',
- 'seller_shopcart-main',
- 'seller_shopcart-main-table',
- 'seller_shopcart-main-final',
- 'seller_instantcheckout-main',
- 'seller_instantcheckout-main-table',
- 'seller_instantcheckout-main-final',
- 'seller-api-main',
- 'seller-api-main-table',
- 'seller-api-main-confirm',
- 'seller-api-main-final',
- 'my-invoices-main',
- 'my-invoices-main-table',
- 'xupdater.invoices',
- 'profile-main',
- 'profile-main-table',
- 'profile-contact-main',
- 'profile-contact-main-table',
- 'profile-logo-main',
- 'profile-logo-main-table',
- 'profile-company-main',
- 'profile-company-main-table',
- 'address-main',
- 'address-main-table',
- 'account-limits-main',
- 'account-limits-main-table',
- 'address-add-main',
- 'address-add-main-table-1',
- 'address-add-main-table-2',
- 'address-add-main-confirm',
- 'address-add-main-final',
- 'creditcards-main',
- 'creditcards-main-table',
- 'creditcards-add-main',
- 'creditcards-add-main-table',
- 'creditcards-add-main-confirm',
- 'creditcards-add-main-final',
- 'reserves-show-main-table',
- 'reserves-show-main',
- 'creditcards-update-main',
- 'creditcards-update-main-table',
- 'creditcards-verify-main',
- 'creditcards-verify-main-table',
- 'creditcards-verify-main-final',
- 'creditcards-ed-main',
- 'creditcards-ed-main-table',
- 'creditcards-ed-main-final',
- 'creditcards-primary-main',
- 'creditcards-primary-main-table',
- 'creditcards-primary-main-final',
- 'banksacc-main',
- 'banksacc-main-table',
- 'banksacc-add-main',
- 'banksacc-add-main-table',
- 'banksacc-add-main-final',
- 'banksacc-verify-main',
- 'banksacc-verify-main-table',
- 'banksacc-verify-main-final',
- 'banksacc-ed-main',
- 'banksacc-ed-main-table',
- 'banksacc-ed-main-final',
- 'banksacc-primary-main',
- 'banksacc-primary-main-table',
- 'banksacc-primary-main-final',
- 'phones-main',
- 'phones-main-table',
- 'phones-verify-main',
- 'phones-verify-main-table',
- 'phones-add-country-main',
- 'phones-add-main',
- 'phones-add-main-table',
- 'phones-add-main-final',
- 'profile-cpw-main',
- 'profile-cpw-main-table',
- 'profile-closeacc-main',
- 'profile-closeacc-main-table',
- 'profile-mydocs-main',
- 'profile-mydocs-main-table',
- 'profile-secprefs-main',
- 'profile-secprefs-main-table',
- 'profile-mycust-main',
- 'profile-mycust-main-start',
- 'profile-mycust-main-table',
- 'profile-mycust-main-final',
- 'profile-managecust-main',
- 'profile-managecust-main-table',
- 'checkout-singles-main',
- 'checkout-singles-main-table',
- 'checkout-singles-main-confirm',
- 'checkout-singles-main-final',
- 'checkout-user-main',
- 'checkout-user-main-table',
- 'checkout-user-main-confirm',
- 'checkout-user-main-final',
- 'xupdater.checkout-user',
- 'checkout-donations-main',
- 'checkout-donations-main-table',
- 'checkout-donations-main-confirm',
- 'checkout-donations-main-final',
- 'checkout-recurring-main',
- 'checkout-recurring-main-table',
- 'checkout-recurring-main-confirm',
- 'checkout-recurring-main-final',
- 'recurring-show-main',
- 'recurring-show-main-table',
- 'recurring-main',
- 'recurring-main-table',
- 'transaction-details-main',
- 'transaction-details-main-table',
- 'transaction-refund-main',
- 'transaction-refund-main-table',
- 'xupdater.refunds',
- 'transaction-cancel-main',
- 'transaction-cancel-main-table',
- 'show-ads-main',
- 'show-ads-main-table',
- 'mobile-main',
- 'mobile-main-table',
- 'security-check-main',
- 'security-check-main-table',
- 'sentry-main',
- 'sentry-main-table',
- 'mycurrencies-main',
- 'mycurrencies-main-table',
- 'mycurrencies-main-final',
- 'convert-mycurrencies-main',
- 'convert-mycurrencies-main-table',
- 'convert-mycurrencies-main-final',
- 'convert-mycurrencies-main-confirm',
- 'generate-buttons-main',
- 'generate-buttons-main-process',
- 'generate-buttons-single',
- 'generate-buttons-subs',
- 'generate-buttons-donation',
- 'generate-buttons-invoice',
- 'generate-buttons-invoice-confirm',
- 'generate-buttons-invoice-final',
- 'generate-buttons-final',
- 'xupdater.generate-buttons',
- 'my-buttons-main',
- 'my-buttons-main-table',
- 'my-buttons-main-code',
- 'my-buttons-main-edit',
- 'suspended-main',
- 'suspended-main-table',
- 'limited-main',
- 'limited-main-table',
- 'my-messages',
- 'my-messages-table',
- 'my-messages-send',
- 'my-messages-deleted',
- 'profile-preferences-main',
- 'profile-preferences-main-table',
- 'resolution-center',
- 'resolution-center-main',
- 'resolution-center-create',
- 'resolution-center-view',
- 'resolution-center-confirm',
- 'resolution-center-final',
- 'xlogoff.main',
- 'trans-api-main',
- 'trans-api-table',
- 'howto',
- 'list',
- 'list-country',
- 'list-card-types',
- 'list-currency',
- 'list-main-table',
- 'feedback',
- 'feedback-table',
- 'feedback-rate',
- 'feedback-final',
- 'profile-upgrade-main',
- 'profile-upgrade-table',
- 'profile-upgrade-confirm',
- 'profile-upgrade-final',
- 'xupdater.mymessages',
- 'xupdater.send',
- 'xupdater.banks',
- 'xupdater.cards',
- 'xupdater.address',
- 'xupdater.password',
- 'xupdater.phones',
- 'xupdater.show.ads',
- 'xupdater.deposit',
- 'xupdater.withdraw',
- 'xupdater.xtrans.history',
- 'xupdater.merchants.terminal',
- 'xupdater.balance.notify',
- 'xupdater.personal',
- 'xupdater.company',
- 'xupdater.emails',
- 'xupdater.escrow',
- 'xupdater.request',
- 'xupdater.resolution-center',
- 'xupdater');
- $stdactions = array(
- 'xchecker', 'loading', 'similar', 'xsms.api','icheckout','checkout','checkout-instant-main','invoice',
- 'invoice-main-table','invoice-main-final','invoice-main-confirm','register-main','register-main-table','register-pre-table','register-main-accounts','register-main-confirm','register-general-main','register-security-main','register-main-final',
- 'pfs-main','pfs-main-table','pfs-main-confirm','pfs-main-final',
- 'main-final','sms-jobs','job_recurring','checkout-cc-main','checkout-cc-main-table','checkout-cc-main-confirm','checkout-cc-main-final','xupdater.checkout-cc','xupdater.open','reset-pwd-main','reset-pwd-main-email','reset-pwd-main-cc','reset-pwd-main-bank','reset-pwd-main-table','reset-pwd-confirm','reset-pwd-changepwd','reset-pwd-final','geoip-bin',
- 'job_balance_notify','api','geo_location','geo_bin','api_trans','member','member-table',
- 'xupdater.register', 'xupdater.pfs'
- );
- $atype = '';
- ?>
Add Comment
Please, Sign In to add comment