Advertisement
johnburn

general_funcs.php

May 1st, 2011
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 57.38 KB | None | 0 0
  1. <?php
  2. function _GETSECURITY_BUTTONS($what) {
  3.     global $siteurl;
  4.     global $file;
  5.     global $handle;
  6.     global $x;
  7.     $siteurl = _ADMIN_SHOW(xt_config_page, site_url);
  8.     if (file_exists("../SECURITY_ICONS")) {
  9.         $handle = opendir("../SECURITY_ICONS");
  10.         do {
  11.             if (false !== ($file = readdir($handle))) {
  12.             } else if ($file != "." && $file != "..") {
  13.                 $x = strtolower(substr($file, 0 - 4));
  14.                 if ($x && $x == ".jpg" || $x == ".gif" || $x == ".png") {
  15.                     echo "<span><input name=\"security_icons\" type=\"radio\" value=\"{$file}\" id=\"radio-input\" style=\"position: relative;\nbottom\t: 35px;\"CHECKED>\t<img src=\"{$siteurl}/SECURITY_ICONS/{$file}\"></span><br>";
  16.                 }
  17.             }
  18.         }
  19.         while (1);
  20.     }
  21. }
  22. function _GETFLAGS($what) {
  23.     global $siteurl;
  24.     global $file;
  25.     global $handle;
  26.     global $x;
  27.     $siteurl = _ADMIN_SHOW(xt_config_page, site_url);
  28.     if (file_exists("../../FLAGS/")) {
  29.         $handle = opendir("../../FLAGS/");
  30.         do {
  31.             if (false !== ($file = readdir($handle))) {
  32.             } else if ($file != "." && $file != "..") {
  33.                 $x = strtolower(substr($file, 0 - 4));
  34.                 if ($x && $x == ".jpg" || $x == ".gif" || $x == ".png") {
  35.                     echo "<span><input name=\"button\" type=\"radio\" value=\"{$file}\" id=\"radio-input\" CHECKED>\t<img src=\"{$siteurl}/FLAGS/{$file}\"></span><br>";
  36.                 }
  37.             }
  38.         }
  39.         while (1);
  40.     }
  41. }
  42. function _GETBUTTONS($what) {
  43.     global $siteurl;
  44.     global $file;
  45.     global $handle;
  46.     global $x;
  47.     $siteurl = _ADMIN_SHOW(xt_config_page, site_url);
  48.     if (file_exists("../CHECKOUT_BUTTONS/{$what}")) {
  49.         $handle = opendir("../CHECKOUT_BUTTONS/{$what}");
  50.         do {
  51.             if (false !== ($file = readdir($handle))) {
  52.             } else if ($file != "." && $file != "..") {
  53.                 $x = strtolower(substr($file, 0 - 4));
  54.                 if ($x && $x == ".jpg" || $x == ".gif" || $x == ".png") {
  55.                     echo "<span><input name=\"button\" type=\"radio\" value=\"{$file}\" id=\"radio-input\" CHECKED>\t<img src=\"{$siteurl}/CHECKOUT_BUTTONS/{$what}/{$file}\"></span><br>";
  56.                 }
  57.             }
  58.         }
  59.         while (1);
  60.     }
  61. }
  62. function _ADMIN_SHOW($table, $what) {
  63.     $show = mysql_fetch_object(mysql_query("SELECT * FROM {$table}"));
  64.     return $show->$what;
  65. }
  66. function DB_OBJECT($dbname, $table, $what) {
  67.     $dbname = mysql_fetch_object(mysql_query("SELECT * FROM {$table}"));
  68.     return $dbname;
  69. }
  70. function _COUNTIT($table, $what) {
  71.     global $show;
  72.     $show = mysql_fetch_row(mysql_query("SELECT COUNT({$what}) FROM {$table}"));
  73.     $show = $show[0];
  74.     return $show;
  75. }
  76. function _MONEY_FORMAT($Var_0, $color) {
  77.     global $_TXT;
  78.     global $currency;
  79.     global $user;
  80.     global $summ;
  81.     if ($color) {
  82.         if ($number <= 0) {
  83.             $money = number_format($number, 2, ".", ",");
  84.             $money = "<span class=money_negative>{$money}</span>";
  85.         } else if (0 < $number) {
  86.             $money = number_format($number, 2, ".", ",");
  87.             $money = "<span class=money_positive>+{$money}</span>";
  88.         }
  89.     }
  90.     if (!$color) {
  91.         $money = number_format($number, 2, ".", ",");
  92.     }
  93.     $money = str_replace(",", "", $money);
  94.     return $money;
  95. }
  96. function _USERTATS($id) {
  97.     global $home;
  98.     global $cc;
  99.     global $bank;
  100.     global $_TXT;
  101.     global $count;
  102.     if (!_getEmail($id)) {
  103.         return "ur";
  104.     }
  105.     $bank = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_banks WHERE user='{$id}' AND status='v'"));
  106.     $bank = $bank[0];
  107.     $cc = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_cc WHERE user='{$id}' AND status='v'"));
  108.     $cc = $cc[0];
  109.     $count = $bank + $cc;
  110.     if (0 < $count) {
  111.         return "v";
  112.     }
  113.     return "u";
  114. }
  115. function _addyShow($user, $life, $input, $what) {
  116.     global $_TXT;
  117.     global $addy0;
  118.     global $addy1;
  119.     global $addy2;
  120.     global $addy3;
  121.     global $addy4;
  122.     global $status;
  123.     global $and2;
  124.     global $shipto;
  125.     global $data;
  126.     if ($life == "count") {
  127.         $addy1 = mysql_num_rows(mysql_query("SELECT * FROM xt_address WHERE user='{$user}' AND status='v'"));
  128.         $addy2 = mysql_num_rows(mysql_query("SELECT * FROM xt_address WHERE user='{$user}' AND status='u'"));
  129.         $addy3 = mysql_num_rows(mysql_query("SELECT * FROM xt_address WHERE user='{$user}' AND status='d'"));
  130.         $addy4 = mysql_num_rows(mysql_query("SELECT * FROM xt_address WHERE user='{$user}' AND life='p'"));
  131.         if ($what == "0") {
  132.             $addy0 = $addy1 + $addy2 + $addy3;
  133.             return $addy0;
  134.         }
  135.         if ($what == "1") {
  136.             return $addy1;
  137.         }
  138.         if ($what == "2") {
  139.             return $addy2;
  140.         }
  141.         if ($what == "3") {
  142.             return $addy3;
  143.         }
  144.         if ($what == "4") {
  145.             return $addy4;
  146.         }
  147.     }
  148.     if ($life == "list") {
  149.         if (!$what) {
  150.             $and2 = "";
  151.         } else {
  152.             $and2 = "AND status='v'";
  153.         }
  154.         if ($input == "dropbox") {
  155.             echo "<select id='select-input' name='addy'>";
  156.         }
  157.         $addy1 = mysql_query("SELECT * FROM xt_address WHERE user='{$user}'{$and2} ORDER BY status,life ASC");
  158.         while ($addy = mysql_fetch_object($addy1)) {
  159.             $shipto = "{$addy->address1} {$addy->address2}, {$addy->city} {$addy->state} {$addy->zip} {$addy->country}";
  160.             $shipto = ucfirst(strtolower($shipto));
  161.             if ($input == "radio") {
  162.                 if ($addy->status == "v" && $addy->life == "p") {
  163.                     $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>";
  164.                 } else if ($addy->status == "v") {
  165.                     $status = "<P><input type='radio' name='addy' value='{$addy->id}' id='addy' CHECKED> {$shipto}</p></TD><TD><P>{$_TXT['global_verified']}</p>";
  166.                 } else if ($addy->status == "u") {
  167.                     $status = "<P><input type='radio' name='addy' value='{$addy->id}' id='addy' CHECKED> {$shipto}</p></TD><TD><P>{$_TXT['global_unverified']}</p>";
  168.                 } else if ($addy->status == "d") {
  169.                     $status = "<P><input type='radio' name='addy' value='{$addy->id}' id='addy' CHECKED> {$shipto}</p></TD><TD><P>{$_TXT['global_disabled']}</p>";
  170.                 }
  171.                 echo "<TR><TD>{$status}</TD></TR><br>";
  172.             }
  173.             if ($input == "table") {
  174.                 if ($addy->status == "v" && $addy->life == "p") {
  175.                     $status = "{$_TXT['global_verified']} / {$_TXT['global_primary']}";
  176.                 } else if ($addy->status == "v") {
  177.                 } else if ($addy->status == "u") {
  178.                     $status = $_TXT['global_unverified'];
  179.                 } else if ($addy->status == "d") {
  180.                     $status = $_TXT['global_disabled'];
  181.                 }
  182.                 if ($num % 2 == 0) {
  183.                     $color = "#FCFCFC";
  184.                 } else {
  185.                     $color = "#ffffff";
  186.                 }
  187.                 echo "    <TR>\n     <TD WIDTH=\"50%\" VALIGN=TOP BGCOLOR=\"";
  188.                 echo $color;
  189.                 echo "\">\n      <P>\n       ";
  190.                 echo $shipto;
  191.                 echo "</TD>\n     <TD WIDTH=\"23%\" VALIGN=TOP BGCOLOR=\"";
  192.                 echo $color;
  193.                 echo "\">\n      <P>\n       ";
  194.                 echo $status;
  195.                 echo "</TD>\n     <TD WIDTH=\"27%\" VALIGN=TOP BGCOLOR=\"";
  196.                 echo $color;
  197.                 echo "\">\n      <P ALIGN=RIGHT>\n        ";
  198.                 echo $doit;
  199.                 echo " ";
  200.                 echo $disable;
  201.                 echo "</TD>\n\t</TR>\n";
  202.             }
  203.             if ($input == "dropbox") {
  204.                 if (35 < strlen($shipto)) {
  205.                     $shipto = substr($shipto, 0, 35) . "...";
  206.                 }
  207.                 if ($addy->status == "v" && $addy->life == "p") {
  208.                     $status = "<option value='{$addy->id}' SELECTED>{$shipto} ({$_TXT['global_verified']} / {$_TXT['global_primary']})</option>";
  209.                 } else if ($addy->status == "v") {
  210.                     $status = "<option value='{$addy->id}'>{$shipto} ({$_TXT['global_verified']}) </option>";
  211.                 } else if ($addy->status == "u") {
  212.                     $status = "<option value='{$addy->id}'>{$shipto} ({$_TXT['global_unverified']}) </option>";
  213.                 }
  214.                 echo $status;
  215.             }
  216.             $num = $num + 1;
  217.         }
  218.         if ($input == "dropbox") {
  219.             echo "</select>";
  220.         }
  221.     }
  222. }
  223. function _ccShow($user, $life, $input, $what) {
  224.     global $_TXT;
  225.     global $cc;
  226.     global $cc0;
  227.     global $cc1;
  228.     global $cc2;
  229.     global $cc3;
  230.     global $cc4;
  231.     global $cards;
  232.     global $status;
  233.     global $cards1;
  234.     global $and;
  235.     global $ccString;
  236.     global $data;
  237.     if ($life == "count") {
  238.         $cc0 = mysql_num_rows(mysql_query("SELECT * FROM xt_cc WHERE user='{$user}' AND life='p'"));
  239.         $cc1 = mysql_num_rows(mysql_query("SELECT * FROM xt_cc WHERE user='{$user}' AND status='v'"));
  240.         $cc2 = mysql_num_rows(mysql_query("SELECT * FROM xt_cc WHERE user='{$user}' AND status='u'"));
  241.         $cc3 = mysql_num_rows(mysql_query("SELECT * FROM xt_cc WHERE user='{$user}' AND (status='d' OR status='x')"));
  242.         if ($what == "0") {
  243.             $cc = $cc1 + $cc2 + $cc3;
  244.             return $cc;
  245.         }
  246.         if ($what == "1") {
  247.             return $cc1;
  248.         }
  249.         if ($what == "2") {
  250.             return $cc2;
  251.         }
  252.         if ($what == "3") {
  253.             return $cc3;
  254.         }
  255.         if ($what == "4") {
  256.             return $cc0;
  257.         }
  258.     }
  259.     if (!$what) {
  260.         $and = "";
  261.     } else {
  262.         $and = "AND status='v'";
  263.     }
  264.     if ($life == "list") {
  265.         if ($input == "dropbox") {
  266.             echo "<select id='select-input' name='cc2'>";
  267.         }
  268.         $cards1 = mysql_query("SELECT * FROM xt_cc WHERE user='{$user}'{$and} ORDER BY status,life ASC");
  269.         while ($cards = mysql_fetch_object($cards1)) {
  270.             $ccString = trim(_ccDecrypt($cards->ccNum));
  271.             $Var_2496 = substr($ccString, 0, 1) . XXXX . substr($ccString, 0 - 2, 2);
  272.             if ($input == "radio") {
  273.                 if ($cards->status == "v" && $cards->life == "p") {
  274.                     $status = "<P><input type='radio' name='cc' value='{$cards->id}' id='cc' CHECKED> {$cards->ccType} {$ccString}</p></TD><TD><P>Verified / Primary</p>";
  275.                 } else if ($cards->status == "v") {
  276.                     $status = "<P><input type='radio' name='cc' value='{$cards->id}' id='cc' CHECKED> {$cards->ccType} {$ccString}</p></TD><TD><P>Verified</p>";
  277.                 } else if ($cards->status == "u") {
  278.                     $status = "<P><input type='radio' name='cc' value='{$cards->id}' id='cc' CHECKED> {$cards->ccType} {$ccString}</p></TD><TD><P>Unverified</p>";
  279.                 } else if ($cards->status == "d") {
  280.                     $status = "<P><input type='radio' name='cc' value='{$cards->id}' id='cc' CHECKED> {$cards->ccType} {$ccString}</p></TD><TD><P>Disabled</p>";
  281.                 } else if ($cards->status == "x") {
  282.                     $status = "<P><input type='radio' name='cc' value='{$cards->id}' id='cc' CHECKED> {$cards->ccType} {$ccString}</p></TD><TD><P>Expired</p>";
  283.                 }
  284.                 echo "<TR><TD>{$status}</TD> </TR><br>";
  285.             }
  286.             if ($input == "table") {
  287.                 if ($cards->status == "v" && $cards->life == "p") {
  288.                     $status = "Verified / Primary";
  289.                 } else if ($cards->status == "v") {
  290.                     $status = "Verified";
  291.                 } else if ($cards->status == "u") {
  292.                     $status = "Unverified";
  293.                 } else if ($cards->status == "d") {
  294.                     $status = "Disabled";
  295.                 } else if ($cards->status == "x") {
  296.                     $status = "Expired";
  297.                 }
  298.                 if ($cards->status == "u") {
  299.                     $doit = "<a href=\"show.php?inc=creditcards-verify-main&prcs={$data->user_unique}~{$data->id}&y={$cards->id}\">{$_TXT['xcardsmain_ver']}</a> |";
  300.                 } else {
  301.                     $doit = "";
  302.                 }
  303.                 if ($cards->status == "v" && $cards->life != "p") {
  304.                     $makeprime = "<a href=\"show.php?inc=creditcards-primary-main&prcs={$data->user_unique}~{$data->id}&y={$cards->id}\">{$_TXT['xcardsmain_pri']}</a> |";
  305.                 } else {
  306.                     $makeprime = "";
  307.                 }
  308.                 if ($cards->cards != "d" || $banks->status != "x") {
  309.                     $disable = "<a href=\"show.php?inc=creditcards-ed-main&prcs={$data->user_unique}~{$data->id}&y={$cards->id}\">{$_TXT['xcardsmain_ed']}</a>";
  310.                 } else {
  311.                     $disable = "";
  312.                 }
  313.                 if ($cards->cards == "d" || $banks->status == "x") {
  314.                     $enable = "<a href=\"show.php?inc=creditcards-ed-main&prcs={$data->user_unique}~{$data->id}&y={$cards->id}\">Enable</a>";
  315.                 } else {
  316.                     $enable = "";
  317.                 }
  318.                 if ($num % 2 == 0) {
  319.                     $color = "#FCFCFC";
  320.                 } else {
  321.                     $color = "#ffffff";
  322.                 }
  323.                 echo "\n   <TR>\n     <TD WIDTH=\"50%\" VALIGN=TOP BGCOLOR=\"";
  324.                 echo $color;
  325.                 echo "\">\n      <P>\n       <img src=\"img/";
  326.                 echo $cards->ccType;
  327.                 echo ".gif\"> ";
  328.                 echo $cards->ccType;
  329.                 echo " ";
  330.                 echo $ccString;
  331.                 echo "</TD>\n     <TD WIDTH=\"23%\" VALIGN=TOP BGCOLOR=\"";
  332.                 echo $color;
  333.                 echo "\">\n      <P>\n       ";
  334.                 echo $status;
  335.                 echo "</TD>\n     <TD WIDTH=\"27%\" VALIGN=TOP BGCOLOR=\"";
  336.                 echo $color;
  337.                 echo "\">\n      <P ALIGN=RIGHT>\n       <a href=\"show.php?inc=creditcards-update-main&prcs=";
  338.                 echo $data->user_unique;
  339.                 echo "~";
  340.                 echo $data->id;
  341.                 echo "&y=";
  342.                 echo $cards->id;
  343.                 echo "\">";
  344.                 echo $_TXT['xcardsmain_ud'];
  345.                 echo "</a> | ";
  346.                 echo "{$doit} {$makeprime} {$disable}";
  347.                 echo "</TD>\n\t</TR>\n\n";
  348.             }
  349.             if ($input == "dropbox") {
  350.                 if ($cards->status == "v" && $cards->life == "p") {
  351.                     $status = "<option value='{$cards->id}' SELECTED>{$cards->ccType} {$ccString} (Verified / Primary)</option>";
  352.                 } else if ($cards->status == "v") {
  353.                     $status = "<option value='{$cards->id}'>{$cards->ccType} {$ccString} (Verified) </option>";
  354.                 } else if ($cards->status == "u") {
  355.                     $status = "<option value='{$cards->id}'>{$cards->ccType} {$ccString} (Unverified) </option>";
  356.                 } else if ($cards->status == "d") {
  357.                     $status = "<option value='{$cards->id}'>{$cards->ccType} {$ccString} (Disabled) </option>";
  358.                 } else if ($cards->status == "x") {
  359.                     $status = "<option value='{$cards->id}'>{$cards->ccType} {$ccString} (Expired) </option>";
  360.                 }
  361.                 echo $status;
  362.             }
  363.             $num = $num + 1;
  364.         }
  365.         if ($input == "dropbox") {
  366.         }
  367.     }
  368. }
  369. function _bankShow($user, $life, $input, $what) {
  370.     global $_TXT;
  371.     global $cc;
  372.     global $cc0;
  373.     global $cc1;
  374.     global $cc2;
  375.     global $cc3;
  376.     global $banks;
  377.     global $status;
  378.     global $banks1;
  379.     global $and;
  380.     global $bankString;
  381.     global $doit;
  382.     global $makeprime;
  383.     global $disable;
  384.     if ($life == "count") {
  385.         $cc0 = mysql_num_rows(mysql_query($Tmp_35 . "SELECT * FROM xt_banks WHERE user='{$user}' AND life='p'"));
  386.         $cc1 = mysql_num_rows(mysql_query("SELECT * FROM xt_banks WHERE user='{$user}' AND status='v'"));
  387.         $cc2 = mysql_num_rows(mysql_query("SELECT * FROM xt_banks WHERE user='{$user}' AND status='u'"));
  388.         $cc3 = mysql_num_rows(mysql_query("SELECT * FROM xt_banks WHERE user='{$user}' AND (status='d' OR status='x')"));
  389.         if ($what == "0") {
  390.             $cc = $cc1 + $cc2 + $cc3;
  391.             return $cc;
  392.         }
  393.         if ($what == "1") {
  394.             return $cc1;
  395.         }
  396.         return $cc2;
  397.     }
  398.     if ($what == "3") {
  399.         return $cc3;
  400.     }
  401.     if ($what == "4") {
  402.         return $cc0;
  403.     }
  404. }
  405. if (!$what) {
  406.     $and = "";
  407. } else {
  408.     $and = "AND status='v'";
  409. }
  410. if ($life == "list") {
  411.     if ($input == "dropbox") {
  412.         echo "<select id='select-input' name='bank2'>";
  413.     }
  414.     $banks1 = mysql_query("SELECT * FROM xt_banks WHERE user='{$user}' ORDER BY status,life ASC");
  415.     while ($banks = mysql_fetch_object($banks1)) {
  416.         $bankString = trim(_bankDecrypt($banks->acct));
  417.         $bankString = substr($bankString, 0, 1) . XX . substr($bankString, 0 - 2, 2);
  418.         if ($input == "radio") {
  419.             if ($banks->bankType == "s") {
  420.                 $banks->bankType = "Savings";
  421.             } else if ($banks->bankType == "c") {
  422.                 $banks->bankType = "Checking";
  423.             }
  424.             if ($banks->status == "v" && $banks->life == "p") {
  425.             } else if ($banks->status == "v") {
  426.                 $status = "<P><input type='radio' name='bank' value='{$banks->id}' id='bank'> {$banks->bank_name} ({$banks->bankType}) {$bankString}</p></TD><TD><P>Verified</p>";
  427.             } else if ($banks->status == "u") {
  428.                 $status = "<P><input type='radio' name='bank' value='{$banks->id}' id='bank'> {$banks->bank_name} ({$banks->bankType}) {$bankString}</p></TD><TD><P>Unverified</p>";
  429.             } else if ($banks->status == "d") {
  430.                 $status = "<P><input type='radio' name='bank' value='{$banks->id}' id='bank'> {$banks->bank_name} ({$banks->bankType}) {$bankString}</p></TD><TD><P>Disabled</p>";
  431.             } else if ($banks->status == "x") {
  432.                 $status = "<P><input type='radio' name='bank' value='{$banks->id}' id='bank'> {$banks->bank_name} ({$banks->bankType}) {$bankString}</p></TD><TD><P>Expired</p>";
  433.             }
  434.             echo "<TR><TD>{$status}</TD> </TR><br>";
  435.         }
  436.         if ($input == "table") {
  437.             $banks->bank_name = strtoupper($banks->bank_name);
  438.             if ($banks->bankType == "s") {
  439.                 $banks->bankType = "Savings";
  440.             } else if ($banks->bankType == "c") {
  441.                 $banks->bankType = "Checking";
  442.             }
  443.             if ($banks->status == "v" && $banks->life == "p") {
  444.                 $status = "Verified / Primary";
  445.             } else if ($banks->status == "v") {
  446.                 $status = "Verified";
  447.             } else if ($banks->status == "u") {
  448.                 $status = "Unverified";
  449.             } else if ($banks->status == "d") {
  450.                 $status = "Disabled";
  451.             } else {
  452.                 $status = "Expired";
  453.             }
  454.             if ($banks->status == "u") {
  455.                 $doit = "<a href=\"show.php?inc=banksacc-verify-main&prcs={$data->user_unique}~{$data->id}&y={$banks->id}\">{$_TXT['xbankman_verify']}</a> |";
  456.             } else {
  457.                 $doit = "";
  458.             }
  459.             if ($banks->status == "v" && $banks->life != "p") {
  460.                 $makeprime = "<a href=\"show.php?inc=banksacc-primary-main&prcs={$data->user_unique}~{$data->id}&y={$banks->id}\">{$_TXT['xbankman_prime']}</a> |";
  461.             } else {
  462.                 $makeprime = "";
  463.             }
  464.             if ($banks->status != "d" || $banks->status != "x") {
  465.                 $disable = "<a href=\"show.php?inc=banksacc-ed-main&prcs={$data->user_unique}~{$data->id}&y={$banks->id}\">{$_TXT['xbankman_dsenable']}</a>";
  466.             } else {
  467.                 $disable = "";
  468.             }
  469.             if ($num % 2 == 0) {
  470.                 $color = "#FCFCFC";
  471.             } else {
  472.                 $color = "#ffffff";
  473.             }
  474.             echo "\n   <TR>\n     <TD WIDTH=\"50%\" VALIGN=TOP BGCOLOR=\"";
  475.             echo $color;
  476.             echo "\">\n      <P>\n       ";
  477.             echo $banks->bank_name;
  478.             echo " (";
  479.             echo $banks->bankType;
  480.             echo ") ";
  481.             echo $bankString;
  482.             echo "</TD>\n     <TD WIDTH=\"23%\" VALIGN=TOP BGCOLOR=\"";
  483.             echo $color;
  484.             echo "\">\n      <P>\n       ";
  485.             echo $status;
  486.             echo "</TD>\n     <TD WIDTH=\"27%\" VALIGN=TOP BGCOLOR=\"";
  487.             echo $color;
  488.             echo "\">\n      <P ALIGN=RIGHT>\n       ";
  489.             echo "{$doit} {$makeprime} {$disable}";
  490.             echo "</TD>\n\t</TR>\n\n";
  491.         }
  492.         if ($input == "dropbox") {
  493.             if ($banks->bankType == "s") {
  494.                 $banks->bankType = "Savings";
  495.             } else if ($banks->bankType == "c") {
  496.                 $banks->bankType = "Checking";
  497.             }
  498.             if ($banks->status == "v" && $banks->life == "p") {
  499.                 $status = "<option value='{$banks->id}' SELECTED>{$banks->bank_name} ({$banks->bankType}) {$bankString} (Verified / Primary)</option>";
  500.             } else if ($banks->status == "v") {
  501.                 $status = "<option value='{$banks->id}'>{$banks->bank_name} ({$banks->bankType}) {$bankString} (Verified) </option>";
  502.             } else if ($banks->status == "u") {
  503.                 $status = "<option value='{$banks->id}'>{$banks->bank_name} ({$banks->bankType}) {$bankString} (Unverified) </option>";
  504.             } else if ($banks->status == "d") {
  505.                 $status = "<option value='{$banks->id}'>{$banks->bank_name} ({$banks->bankType}) {$bankString} (Disabled) </option>";
  506.             } else if ($banks->status == "x") {
  507.                 $status = "<option value=''>{$banks->bank_name} ({$banks->bankType}) {$bankString} (Expired) </option>";
  508.             }
  509.             echo $status;
  510.         }
  511.         $num = $num + 1;
  512.     }
  513.     if ($input == "dropbox") {
  514.         echo "</select>";
  515.     }
  516. }
  517. function _phoneShow($user, $life, $input, $what) {
  518.     global $_TXT;
  519.     global $cc;
  520.     global $cc0;
  521.     global $cc1;
  522.     global $cc2;
  523.     global $cc3;
  524.     global $cards;
  525.     global $status;
  526.     global $cards1;
  527.     global $and;
  528.     global $ccString;
  529.     global $data;
  530.     global $verifyit;
  531.     if ($life == "count") {
  532.         $cc0 = mysql_num_rows(mysql_query("SELECT * FROM xt_phones WHERE user='{$user}' AND life='p'"));
  533.         $cc1 = mysql_num_rows(mysql_query("SELECT * FROM xt_phones WHERE user='{$user}' AND status='v'"));
  534.         $cc2 = mysql_num_rows(mysql_query("SELECT * FROM xt_phones WHERE user='{$user}' AND status='u'"));
  535.         $cc3 = mysql_num_rows(mysql_query("SELECT * FROM xt_phones WHERE user='{$user}' AND (status='d' OR status='x')"));
  536.         if ($what == "0") {
  537.             $cc = $cc1 + $cc2 + $cc3;
  538.             return $cc;
  539.         }
  540.         if ($what == "1") {
  541.             return $cc1;
  542.         }
  543.         if ($what == "2") {
  544.             return $cc2;
  545.         }
  546.         if ($what == "3") {
  547.             return $cc3;
  548.         }
  549.         if ($what == "4") {
  550.             return $cc0;
  551.         }
  552.     }
  553.     if (!$what) {
  554.         $and = "";
  555.     } else {
  556.         $and = "AND status='v'";
  557.     }
  558.     if ($life == "list") {
  559.         if ($input == "dropbox") {
  560.             echo "<select id='select-input' name='phone'>";
  561.         }
  562.         $cards1 = mysql_query("SELECT * FROM xt_phones WHERE user='{$user}'{$and} ORDER BY status ASC");
  563.         while ($cards = mysql_fetch_object($cards1)) {
  564.             if ($cards->ptype == "m") {
  565.                 $cards->ptype = "Mobile";
  566.             } else if ($cards->ptype == "h") {
  567.                 $cards->ptype = "Home";
  568.             } else if ($cards->ptype == "f") {
  569.                 $cards->ptype = "Fax";
  570.             } else if ($cards->ptype == "b") {
  571.                 $cards->ptype = "Business";
  572.             }
  573.             if ($input == "table") {
  574.                 if ($cards->status == "v" && $cards->life == "p") {
  575.                     $status = "Verified / Primary";
  576.                 } else if ($cards->status == "v") {
  577.                     $status = "Verified";
  578.                 } else if ($cards->status == "u") {
  579.                     $status = "Unverified";
  580.                     $verifyit = "<a href=\"show.php?inc=phones-verify-main&prcs={$data->user_unique}~{$data->id}&y={$cards->pnumber}\">Verify</a>";
  581.                 } else if ($cards->status == "d") {
  582.                     $status = "Disabled";
  583.                 } else if ($cards->status == "x") {
  584.                     $status = "Expired";
  585.                 }
  586.                 $cards->pnumber = substr($cards->pnumber, strlen($cards->ccode));
  587.                 if ($num % 2 == 0) {
  588.                     $color = "#FCFCFC";
  589.                 } else {
  590.                     $color = "#ffffff";
  591.                 }
  592.                 echo "\n   <TR>\n     <TD WIDTH=\"50%\" VALIGN=TOP BGCOLOR=\"";
  593.                 echo $color;
  594.                 echo "\">\n      <P>\n       ";
  595.                 echo "+{$cards->ccode} {$cards->pnumber}";
  596.                 echo "</TD>\n     <TD WIDTH=\"23%\" VALIGN=TOP BGCOLOR=\"";
  597.                 echo $color;
  598.                 echo "\">\n      <P>\n       ";
  599.                 echo $status;
  600.                 echo "</TD>\n     <TD WIDTH=\"27%\" VALIGN=TOP BGCOLOR=\"";
  601.                 echo $color;
  602.                 echo "\">\n      <P ALIGN=RIGHT>\n       ";
  603.                 echo "{$verifyit}";
  604.                 echo "</TD>\n\t</TR>\n\n";
  605.             }
  606.             if ($input == "radio") {
  607.                 if ($cards->status == "v" && $cards->life == "p") {
  608.                     $status = "<P><input type='radio' name='phone' value='{$cards->id}' id='phone' CHECKED> +({$cards->ccode}) {$cards->pnumber} ({$cards->ptype})</p></TD><TD><P>Verified / Primary</p>";
  609.                 } else if ($cards->status == "v") {
  610.                     $status = "<P><input type='radio' name='phone' value='{$cards->id}' id='phone' CHECKED> +({$cards->ccode}) {$cards->pnumber} ({$cards->ptype})</p></TD><TD><P>Verified</p>";
  611.                 } else if ($cards->status == "u") {
  612.                     $status = "<P><input type='radio' name='phone' value='{$cards->id}' id='phone' CHECKED> +({$cards->ccode}) {$cards->pnumber} ({$cards->ptype})</p></TD><TD><P>Unverified</p>";
  613.                 } else if ($cards->status == "d") {
  614.                     $status = "<P><input type='radio' name='phone' value='{$cards->id}' id='phone' CHECKED> +({$cards->ccode}) {$cards->pnumber} ({$cards->ptype})</p></TD><TD><P>Disabled</p>";
  615.                 } else if ($cards->status == "x") {
  616.                     $status = "<P><input type='radio' name='phone' value='{$cards->id}' id='phone' CHECKED> +({$cards->ccode}) {$cards->pnumber} ({$cards->ptype})</p></TD><TD><P>Expired</p>";
  617.                 }
  618.                 echo "<TR><TD>{$status}</TD> </TR><br>";
  619.             }
  620.             if ($input == "dropbox") {
  621.                 if ($cards->status == "v" && $cards->life == "p") {
  622.                     $status = "<option value='{$cards->id}' SELECTED>+({$cards->ccode}) {$cards->pnumber} ({$cards->ptype}) (Verified / Primary)</option>";
  623.                 } else if ($cards->status == "v") {
  624.                     $status = "<option value='{$cards->id}' SELECTED>+({$cards->ccode}) {$cards->pnumber} () (Verified) </option>";
  625.                 } else if ($cards->status == "u") {
  626.                     $status = "<option value='{$cards->id}' SELECTED>+({$cards->ccode}) {$cards->pnumber} ({$cards->ptype}) (Unverified) </option>";
  627.                 } else if ($cards->status == "d") {
  628.                     $status = "<option value='{$cards->id}' SELECTED>+({$cards->ccode}) {$cards->pnumber} ({$cards->ptype}) (Disabled) </option>";
  629.                 } else if ($cards->status == "x") {
  630.                     $status = "<option value='{$cards->id}' SELECTED>+({$cards->ccode}) {$cards->pnumber} ({$cards->ptype}) (Expired) </option>";
  631.                 }
  632.                 echo $status;
  633.             }
  634.             $num = $num + 1;
  635.         }
  636.         if ($input == "dropbox") {
  637.             echo "</select>";
  638.         }
  639.     }
  640. }
  641. function _getEmail($id, $link) {
  642.     global $_TXT;
  643.     $user = mysql_fetch_object(mysql_query("SELECT * FROM xt_members WHERE id='{$id}'"));
  644.     if ($link) {
  645.         $user->email = "<a href=\"?cmd=xpr&i={$id}\">{$user->email}</a>";
  646.     } else {
  647.         $user->email = $user->email;
  648.     }
  649.     return $user->email;
  650. }
  651. function _ERROR($msg, $type) {
  652.     global $_epost;
  653.     global $_TXT;
  654.     global $_errorcode;
  655.     if (!$type) {
  656.         exit("<div id='failed' class='failed' onclick=\"$('update_results').hide()\">\n\t<img src='img/spacer.gif' onload=\"$('update_results').show()\">\t{$msg} \n\t\t</div>");
  657.         return TRUE;
  658.     }
  659.     if ($type == "3") {
  660.         echo "<div id='failed' class='failed' onclick=\"$('update_results').hide()\">\n\t<img src='img/spacer.gif' onload=\"$('update_results').show()\">\n\t&raquo;\t{$msg}\n\t\t</div>";
  661.         $_epost = 1;
  662.     } else if ($type == "1") {
  663.         echo "<div class='failed'>\n\t\t{$msg} \n\t\t</div>";
  664.         $_epost = 1;
  665.     } else if ($type == "2") {
  666.         echo "{$msg}";
  667.     } else if ($type == "4") {
  668.         exit("status=0&error={$_REQUEST['errorcode']}&reason={$msg}");
  669.         return TRUE;
  670.     } else {
  671.     }
  672. }
  673. function _SUCCESS($msg) {
  674.     global $_TXT;
  675.     exit("<div class='success' onclick=\"$('update_results').hide()\">\n\t<img src='img/spacer.gif' onload=\"$('update_results').show()\">\n\t\t{$msg}\n\t\t</div>");
  676.     return TRUE;
  677. }
  678. function _CHECKPHONES($p, $debug) {
  679.     global $data;
  680.     global $_TXT;
  681.     global $tr_status;
  682.     global $qr1;
  683.     global $qr2;
  684.     global $pending;
  685.     global $holds;
  686.     global $update;
  687.     global $delete;
  688.     global $debug;
  689.     global $reqs;
  690.     global $fee;
  691.     global $tr_flat;
  692.     global $tr_percent;
  693.     global $_SESSION;
  694.     global $_REQUEST;
  695.     global $cur;
  696.     global $matches;
  697.     $qr1 = mysql_query("SELECT * FROM xt_phones");
  698.     while ($phones = mysql_fetch_object($qr1)) {
  699.         preg_match("/129759865874159/i", $phones->pnumber, $matches, PREG_OFFSET_CAPTURE);
  700.         print_r($matches);
  701.     }
  702. }
  703. function _CHECKHOLDS($email, $debug) {
  704.     global $data;
  705.     global $_TXT;
  706.     global $tr_status;
  707.     global $qr1;
  708.     global $qr2;
  709.     global $pending;
  710.     global $holds;
  711.     global $update;
  712.     global $delete;
  713.     global $debug;
  714.     global $reqs;
  715.     global $fee;
  716.     global $tr_flat;
  717.     global $tr_percent;
  718.     global $_SESSION;
  719.     global $_REQUEST;
  720.     global $cur;
  721.     global $updateme;
  722.     $qr1 = mysql_query("SELECT * FROM xt_hold WHERE email='{$email}'");
  723.     while ($holds = mysql_fetch_object($qr1)) {
  724.         $xt_trans = db_object("xt_trans", "xt_trans WHERE id='{$holds->trans_id}'", 0);
  725.         $cur = $xt_trans->currency;
  726.         if ($data->account_type == "per") {
  727.             $tr_flat = _admin_show("xt_config_currency WHERE id='{$cur}'", per_flat);
  728.             $tr_percent = _admin_show("xt_config_currency WHERE id='{$cur}'", "per_percent");
  729.         } else if ($data->account_type == "biz") {
  730.             $tr_flat = _admin_show("xt_config_currency WHERE id='{$cur}'", bus_flat);
  731.             $tr_percent = _admin_show("xt_config_currency WHERE id='{$cur}'", "bus_percent");
  732.         } else if ($data->account_type == "pre") {
  733.             $tr_flat = _admin_show("xt_config_currency WHERE id='{$cur}'", "pre_flat");
  734.             $tr_percent = _admin_show("xt_config_currency WHERE id='{$cur}'", "pre_percent");
  735.         }
  736.         $fee = TR_FEE(_admin_show("xt_trans WHERE id='{$holds->trans_id}'", total), $tr_percent, $tr_flat);
  737.         if ($holds->ftype == "bank") {
  738.             $tr_status = "i";
  739.         } else {
  740.             $tr_status = "f";
  741.         }
  742.         $update = "UPDATE xt_trans SET status='{$tr_status}',tr_to='{$data->id}',fees='{$fee}' WHERE id='{$holds->trans_id}'";
  743.         $delete = "DELETE FROM xt_hold WHERE id='{$holds->id}'";
  744.         DB_UPDATE("{$update}", $debug);
  745.         DB_UPDATE("{$delete}", $debug);
  746.         if (_admin_show("xt_config_referrals", refer_sendrequest) == "t" && ($data->referredby <= 0 || is_null($data->referredby))) {
  747.             $updateme = "UPDATE xt_members SET \nreferredby='{$xt_trans->tr_by}' WHERE id='{$Var_3624}'";
  748.             DB_UPDATE("{$updateme}", 0);
  749.         }
  750.     }
  751.     $qr2 = mysql_query("SELECT * FROM xt_trans WHERE status='p' AND extended_comment='{$email}'");
  752.     while ($pending = mysql_fetch_object($qr2)) {
  753.         $update = "UPDATE xt_trans SET status='f' WHERE tr_to='{$data->id}'";
  754.         DB_UPDATE("{$update}", $debug);
  755.     }
  756. }
  757. function _CHECKHOLDS_EMAILADD($email, $debug) {
  758.     global $data;
  759.     global $_TXT;
  760.     global $tr_status;
  761.     global $qr1;
  762.     global $qr2;
  763.     global $pending;
  764.     global $holds;
  765.     global $update;
  766.     global $delete;
  767.     global $debug;
  768.     global $reqs;
  769.     global $fee;
  770.     global $tr_flat;
  771.     global $tr_percent;
  772.     global $xt_trans;
  773.     global $cur;
  774.     $qr1 = mysql_query("SELECT * FROM xt_hold WHERE email='{$email}'");
  775.     while ($holds = mysql_fetch_object($qr1)) {
  776.         $xt_trans = db_object("xt_trans", "xt_trans WHERE id='{$holds->trans_id}'", 0);
  777.         $cur = $xt_trans->currency;
  778.         if ($data->account_type == "per") {
  779.             $tr_flat = _admin_show("xt_config_currency WHERE id='{$cur}'", "per_flat");
  780.             $tr_percent = _admin_show("xt_config_currency WHERE id='{$cur}'", "per_percent");
  781.         } else if ($data->account_type == "biz") {
  782.             $tr_flat = _admin_show("xt_config_currency WHERE id='{$cur}'", "bus_flat");
  783.             $tr_percent = _admin_show("xt_config_currency WHERE id='{$cur}'", "bus_percent");
  784.         } else if ($data->account_type == "pre") {
  785.             $tr_flat = _admin_show("xt_config_currency WHERE id='{$cur}'", pre_flat);
  786.             $tr_percent = _admin_show("xt_config_currency WHERE id='{$cur}'", pre_percent);
  787.         }
  788.         $fee = TR_FEE(_admin_show("xt_trans WHERE id='{$holds->trans_id}'", total), $tr_percent, $tr_flat);
  789.         $tr_status = "h";
  790.         $update = "UPDATE xt_trans SET status='{$tr_status}',tr_to='{$data->id}',fees='{$fee}' WHERE id='{$holds->trans_id}'";
  791.         DB_UPDATE("{$update}", $debug);
  792.     }
  793. }
  794. function _CHECKREQS($email, $debug) {
  795.     global $data;
  796.     global $_TXT;
  797.     global $tr_status;
  798.     global $qr1;
  799.     global $qr2;
  800.     global $pending;
  801.     global $holds;
  802.     global $update;
  803.     global $delete;
  804.     global $debug;
  805.     global $reqs;
  806.     global $fee;
  807.     global $tr_flat;
  808.     global $tr_percent;
  809.     global $xt_moneyreqs;
  810.     $qr1 = mysql_query("SELECT * FROM xt_moneyreqs WHERE email='{$email}'");
  811.     while ($reqs = mysql_fetch_object($qr1)) {
  812.         $xt_moneyreqs = db_object("xt_moneyreqs", "xt_moneyreqs WHERE id='{$reqs->trans_id}'", 0);
  813.         $cur = $xt_moneyreqs->currency;
  814.         if ($data->account_type == "per") {
  815.             $tr_flat = _admin_show("xt_config_currency WHERE id='{$cur}'", per_flat);
  816.             $tr_percent = _admin_show("xt_config_currency WHERE id='{$cur}'", per_percent);
  817.         } else if ($data->account_type == "biz") {
  818.             $tr_flat = _admin_show("xt_config_currency WHERE id='{$cur}'", bus_flat);
  819.             $tr_percent = _admin_show("xt_config_currency WHERE id='{$cur}'", bus_percent);
  820.         } else if ($data->account_type == "pre") {
  821.             $tr_flat = _admin_show("xt_config_currency WHERE id=''", pre_flat);
  822.             $tr_percent = _admin_show("xt_config_currency WHERE id='{$cur}'", pre_percent);
  823.         }
  824.         $fee = TR_FEE(_admin_show("xt_trans WHERE id='{$holds->trans_id}'", total), $tr_percent, $tr_flat);
  825.         $update = "UPDATE xt_trans SET tr_by='{$data->id}', fees='{$fee}' WHERE id='{$reqs->trans_id}'";
  826.         $delete = "DELETE FROM xt_moneyreqs WHERE id='{$reqs->id}'";
  827.         DB_UPDATE("{$update}", $debug);
  828.         DB_UPDATE("{$delete}", $debug);
  829.     }
  830. }
  831. function MyBalNotify() {
  832.     global $_TXT;
  833.     global $data;
  834.     global $balance_notify;
  835.     global $bnt;
  836.     global $currency;
  837.     $bnt = split(":", $data->balance_notify);
  838.     $bnt = $bnt[1];
  839.     $balance_notify = split(":", $data->balance_notify);
  840.     $balance_notify = $balance_notify[0];
  841.     if ($bnt == "u" || empty($bnt)) {
  842.         $balance_notify = "<a href='#' onclick=\"showpage('launch.php?fuse=xbalance.notify&id={$data->id}','showing')\">Create</a>";
  843.     } else {
  844.         if ($bnt == "1") {
  845.             $bnt = "Over";
  846.         } else if ($bnt == "2") {
  847.             $bnt = "Under";
  848.         }
  849.         $balance_notify = "<a href='#' onclick=\"showpage('launch.php?fuse=xbalance.notify&id={$data->id}','showing')\">{$bnt} {$currency}{$balance_notify}</b>";
  850.     }
  851.     return $balance_notify;
  852. }
  853. function _manageEmails($user, $type) {
  854.     global $emails1;
  855.     global $emails;
  856.     global $data;
  857.     global $_TXT;
  858.     $emails1 = mysql_query("SELECT * FROM xt_emails WHERE user='{$user}' ORDER BY status,life ASC");
  859.     while ($emails = mysql_fetch_object($emails1)) {
  860.         if ($type == "radio") {
  861.             if ($emails->status == "v" && $emails->life == "p") {
  862.                 $emails->status = "<P><input type='radio' name='emails' value='{$emails->email}' id='email' CHECKED> {$emails->email}</p></TD><TD><P>Verified / Primary</p>";
  863.             } else if ($emails->status == "v") {
  864.                 $emails->status = "<P><input type='radio' name='emails' value='{$emails->email}' id='email' CHECKED> {$emails->email}</p></TD><TD><P>Verified</p>";
  865.             } else {
  866.                 $emails->status = "<P><input type='radio' name='emails' value='{$emails->email}' id='email' CHECKED> {$emails->email}</p></TD><TD><P>Unverified</p>";
  867.             }
  868.             echo "<TR><TD>{$emails->status}</TD> </TR><br>";
  869.         }
  870.         if ($type == "table") {
  871.             if ($emails->status == "v" && $emails->life == "p") {
  872.                 $status = "Verified / Primary";
  873.             } else if ($emails->status == "v") {
  874.                 $status = "Verified";
  875.             } else {
  876.                 $status = "Unverified";
  877.             }
  878.             if ($emails->status == "u") {
  879.                 $doit = "<a href=\"show.php?inc=emails-verify&y={$emails->email}\">Verify</a> |";
  880.             } else {
  881.                 $doit = "";
  882.             }
  883.             if ($emails->status != "p") {
  884.                 $disable = "<a href=\"show.php?inc=emails-delete&y={$emails->email}\">Delete</a>";
  885.             } else {
  886.                 $disable = "";
  887.             }
  888.             if ($num % 2 == 0) {
  889.                 $color = "#FCFCFC";
  890.             } else {
  891.                 $color = "#ffffff";
  892.             }
  893.             echo "\n\n    <TR>\n     <TD WIDTH=\"50%\" VALIGN=TOP BGCOLOR=\"";
  894.             echo $color;
  895.             echo "\">\n      <P>\n       ";
  896.             echo $emails->email;
  897.             echo "</TD>\n     <TD WIDTH=\"23%\" VALIGN=TOP BGCOLOR=\"";
  898.             echo $color;
  899.             echo "\">\n      <P>\n       ";
  900.             echo $status;
  901.             echo "</TD>\n     <TD WIDTH=\"27%\" VALIGN=TOP BGCOLOR=\"";
  902.             echo $color;
  903.             echo "\">\n      <P ALIGN=RIGHT>\n        ";
  904.             echo $doit;
  905.             echo " ";
  906.             echo $disable;
  907.             echo "</TD>\n\t</TR>\n\n\n";
  908.         }
  909.         $num = $num + 1;
  910.     }
  911. }
  912. function _ACCOUNT_TYPE() {
  913.     global $_TXT;
  914.     global $data;
  915.     global $type;
  916.     if ($data->account_type == "biz") {
  917.         $type = Business;
  918.     } else if ($data->account_type == "pre") {
  919.         $type = Premier;
  920.     } else if ($data->account_type == "per") {
  921.         $type = Personal;
  922.     }
  923.     return $type;
  924. }
  925. function validate_email($email) {
  926.     global $_TXT;
  927.     if (eregi("^.+@.+\\..+\$", $email, $check) && checkdnsrr(substr(strstr($check[0], "@"), 1), "ANY")) {
  928.         return 1;
  929.     }
  930.     return 0;
  931. }
  932. function _isValidTrans($id, $what) {
  933.     global $_TXT;
  934.     global $data;
  935.     $show = mysql_fetch_object(mysql_query("SELECT * FROM xt_trans WHERE id='{$id}' AND (tr_to='{$data->id}' OR tr_by='{$data->id}')"));
  936.     return $show->$what;
  937. }
  938. function _GETSTATUS($id, $what) {
  939.     global $_TXT;
  940.     global $data;
  941.     global $trans;
  942.     global $ret;
  943.     global $bankname;
  944.     global $bankprint;
  945.     $trans = mysql_fetch_object(mysql_query("SELECT * FROM xt_trans WHERE id='{$id}' AND (tr_to='{$data->id}' OR tr_by='{$data->id}')"));
  946.     if ($what == "status") {
  947.         if ($trans->status == "h" && $trans->tr_to == $user) {
  948.             $ret = "Pending";
  949.         } else if ($trans->status == "p" && 1 < strlen($trans->extended_comment) && $trans->tr_to == $user) {
  950.             $ret = "Pending";
  951.         } else if ($trans->status == "f" && $trans->id == _admin_show("xt_hold WHERE trans_id='{$trans->id}'", trans_id)) {
  952.             $ret = "Pending Pickup";
  953.         } else if ($trans->status == "rf") {
  954.             $ret = "Refunded";
  955.         } else if ($trans->status == "esc") {
  956.             $ret = "In Escrow";
  957.         } else if ($trans->status == "prf") {
  958.             $ret = "Pending Refund";
  959.         } else if ($trans->status == "c") {
  960.             $ret = "Cancelled";
  961.         } else if ($trans->status == "p" && $trans->tr_by == $user || $trans->status == "h" && $trans->tr_by == $user) {
  962.             $ret = "Pending";
  963.         } else if ($trans->status == "rv") {
  964.             $ret = "Reversed";
  965.         } else if ($trans->status == "i" && $trans->secondarystatus == "reversed") {
  966.             $ret = "Completed";
  967.         } else if ($trans->status == "i") {
  968.             $ret = "Pending Release";
  969.         } else if ($trans->status == "f" && $trans->secondarystatus == "refunded") {
  970.             $ret = "Refunded";
  971.         } else if ($trans->status == "f" && $trans->secondarystatus == "pending_refunded") {
  972.             $ret = "Pending Refund";
  973.         } else if ($trans->status == "f") {
  974.             $ret = "Completed";
  975.         } else if ($trans->status == "mreq") {
  976.             $ret = "Pending";
  977.         }
  978.     }
  979.     if ($what == "tr_to") {
  980.         if ($trans->tr_to == "1") {
  981.             $ret = $trans->extended_comment;
  982.         } else if ($trans->tr_to == "2") {
  983.             $ret = "Deposit";
  984.         } else if ($trans->tr_to == "3") {
  985.             $ret = "Withdrawal";
  986.         } else if ($trans->tr_to == "4") {
  987.             $ret = "Bonus";
  988.         } else if ($trans->tr_to == "5") {
  989.             $ret = "Virtual Terminal";
  990.         } else if ($trans->tr_to == "6") {
  991.             $ret = "InstantCheckout";
  992.         } else if ($trans->tr_to == "13") {
  993.             $ret = "Currency Conversion";
  994.         } else {
  995.             $ret = _GETIDNAME($trans->tr_to, 1, 1);
  996.         }
  997.     }
  998.     if ($what == "tr_by") {
  999.         if ($trans->tr_by == "1") {
  1000.             $ret = $trans->extended_comment;
  1001.         } else if ($trans->tr_by == "2") {
  1002.             $ret = "Deposit";
  1003.         } else if ($trans->tr_by == "3") {
  1004.             $ret = "Withdrawal";
  1005.         } else if ($trans->tr_by == "4") {
  1006.             $ret = "Bonus";
  1007.         } else if ($trans->tr_by == "5") {
  1008.             $ret = "Virtual Terminal";
  1009.         } else if ($trans->tr_by == "6") {
  1010.             $ret = "InstantCheckout";
  1011.         } else if ($trans->tr_by == "13") {
  1012.             $ret = "Currency Conversion";
  1013.         } else if ($trans->tr_by == "15") {
  1014.             $Var_5448 = "Referral Payout";
  1015.         } else {
  1016.             $ret = _GETIDNAME($trans->tr_by, 1, 1);
  1017.         }
  1018.     }
  1019.     if ($what == "transfer_type") {
  1020.         if ($trans->transfer_type == "bal") {
  1021.             $ret = "Balance";
  1022.         } else if ($trans->transfer_type == "card") {
  1023.             $bankname = _SHOWME($data->id, "xt_cc", "ccType", "AND id='{$trans->trtype_id}'");
  1024.             $bankprint = substr($bankprint, 0, 1) . XXXX . substr($bankprint, 0 - 2, 2);
  1025.             $ret = "Credit/Debit Card {$bankname} {$bankprint}";
  1026.         } else if ($trans->transfer_type == "bank") {
  1027.             $bankname = _SHOWME($data->id, "xt_banks", "bank_name", "AND id='{$trans->trtype_id}'");
  1028.             $bankprint = trim(_bankDecrypt(_SHOWME($data->id, "xt_banks", "acct", "AND id='{$trans->trtype_id}'")));
  1029.             $bankprint = substr($bankprint, 0, 1) . XX . substr($bankprint, 0 - 2, 2);
  1030.             $ret = "Bank Account {$Var_7440} {$bankprint}";
  1031.         } else if ($trans->transfer_type == "mail") {
  1032.             $ret = "Regular Mail";
  1033.         } else if ($trans->tr_by == "5") {
  1034.             $ret = "Virtual Terminal";
  1035.         } else if ($trans->tr_by == "6") {
  1036.             $ret = "InstantCheckout";
  1037.         } else if ($trans->tr_by == "15") {
  1038.             $ret = "Referral Payout";
  1039.         }
  1040.     }
  1041.     return ucwords($ret);
  1042. }
  1043. function _CHECKRESERVES($email, $debug) {
  1044.     global $data;
  1045.     global $_TXT;
  1046.     global $tr_status;
  1047.     global $qr1;
  1048.     global $qr2;
  1049.     global $pending;
  1050.     global $holds;
  1051.     global $update;
  1052.     global $delete;
  1053.     global $debug;
  1054.     global $reqs;
  1055.     global $fee;
  1056.     global $tr_flat;
  1057.     global $tr_percent;
  1058.     $qr1 = mysql_query("SELECT * FROM xt_reserves WHERE email='{$email}'");
  1059.     while ($res = mysql_fetch_object($qr1)) {
  1060.         $update = "UPDATE xt_reserves SET user='{$data->id}' WHERE email='{$email}'";
  1061.         DB_UPDATE("{$update}", $debug);
  1062.     }
  1063. }
  1064. function GENERATE_ID($chars, $len) {
  1065.     global $_TXT;
  1066.     $salt = $chars;
  1067.     srand(( double )microtime() * 1200500);
  1068.     $i = 1;
  1069.     while ($i <= $len) {
  1070.         $length = strlen($salt);
  1071.         $num = rand(0, $length - 1);
  1072.         $tmp = substr($salt, $num, 1);
  1073.         ++$i;
  1074.     }
  1075.     return $pass;
  1076. }
  1077. function DB_UPDATE($inserts, $debug) {
  1078.     global $_TXT;
  1079.     $doit = $inserts;
  1080.     if ($debug) {
  1081.         echo "<p>{$doit} <p>";
  1082.     }
  1083.     if (!mysql_query($doit)) {
  1084.         exit(mysql_error());
  1085.     }
  1086. }
  1087. function DB_DELETE($inserts, $debug) {
  1088.     global $_TXT;
  1089.     $doit = "DELETE FROM {$inserts}";
  1090.     if ($debug) {
  1091.         echo "<p>{$doit} <p>";
  1092.     }
  1093.     if (!mysql_query($doit)) {
  1094.         exit(mysql_error());
  1095.     }
  1096. }
  1097. function DB_ADD($inserts, $debug) {
  1098.     global $_TXT;
  1099.     $doit = "INSERT INTO {$inserts}";
  1100.     if ($debug) {
  1101.         echo "<p>{$doit} <p>";
  1102.     }
  1103.     if (!mysql_query($doit)) {
  1104.         exit(mysql_error());
  1105.     }
  1106. }
  1107. function isValidURL($url) {
  1108.     return preg_match("|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i", $url);
  1109. }
  1110. function _SHOWME($user, $table, $what, $optional) {
  1111.     global $_TXT;
  1112.     $show = mysql_fetch_object(mysql_query("SELECT * FROM {$table} WHERE user='{$user}' {$optional}"));
  1113.     return $show->$what;
  1114. }
  1115. function _CHECKIT($table, $what, $optional, $s) {
  1116.     global $_TXT;
  1117.     if ($s == "email") {
  1118.         $show = mysql_fetch_object(mysql_query("SELECT * FROM {$table} WHERE {$optional}"));
  1119.         return $show->$what;
  1120.     }
  1121.     if ($s == "seller") {
  1122.         $show = mysql_fetch_object(mysql_query("SELECT * FROM {$table} WHERE {$optional}"));
  1123.         return $show->$what;
  1124.     }
  1125.     if ($s == "phone") {
  1126.         $show = mysql_fetch_object(mysql_query("SELECT * FROM {$table} WHERE {$optional}"));
  1127.         return $show->$what;
  1128.     }
  1129. }
  1130. function SENDTO_ADMIN($subject, $body, $lang) {
  1131.     global $xt_config_page;
  1132.     global $sendto;
  1133.     $xt_config_page = db_object("xt_config_page", "xt_config_page", 0);
  1134.     SEND_MAIL($xt_config_page->main_email, "{$subject}", "{$body}", $lang);
  1135. }
  1136. function MYCONVERSATIONS() {
  1137.     global $data;
  1138.     global $origmess;
  1139.     global $unread;
  1140.     global $arc;
  1141.     $origmess = db_object("xt_pm", "xt_pm WHERE (sent_by='{$data->id}' OR sent_to='{$data->id}') AND original='t'", 0);
  1142.     if ($origmess->sent_by == $data->id) {
  1143.     } else if ($origmess->sent_to == $data->id) {
  1144.         $arc = "del_to != {$data->id}";
  1145.     }
  1146.     $unread = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM xt_pm WHERE sent_to='{$data->id}' AND status='unread' AND {$arc}"));
  1147.     $unread = $unread[0];
  1148.     return $unread;
  1149. }
  1150. if (!isset($_SESSION['site_lang']) || empty($_SESSION['site_lang'])) {
  1151.     $_SESSION['site_lang'] = _ADMIN_SHOW("xt_languages WHERE lang_default='t'", lang_name);
  1152. }
  1153. if (!function_exists("SECURE_URL")) {
  1154.     function SECURE_URL($omit) {
  1155.         global $_TXT;
  1156.         $_SERVER['THIS_URL'] = "http";
  1157.         if ($_SERVER['HTTPS'] == "on") {
  1158.             $_SERVER.= "FULL_URL";
  1159.         }
  1160.         $_SERVER.= "THIS_URL";
  1161.         if ($_SERVER['SERVER_PORT'] != "80") {
  1162.         } else {
  1163.             $_SERVER.= "THIS_URL";
  1164.         }
  1165.         if (" " < $_SERVER['QUERY_STRING']) {
  1166.             $_SERVER.= "THIS_URL";
  1167.         }
  1168.         if ($omit) {
  1169.             $_SERVER['THIS_URL'] = str_replace("index.php", "", $_SERVER['THIS_URL']);
  1170.         }
  1171.         return $_SERVER['THIS_URL'];
  1172.     }
  1173. }
  1174. if (!function_exists("GetMainBaseFromURL")) {
  1175.     function GetMainBaseFromURL($url) {
  1176.         $chars = preg_split("//", $url, 0 - 1, PREG_SPLIT_NO_EMPTY);
  1177.         $slash = 3;
  1178.         $i = 0;
  1179.         foreach($chars as $key => $char) {
  1180.             if ($char == "/") {
  1181.                 $j = $i++;
  1182.             }
  1183.             if ($i == 3) {
  1184.                 $pos = $key;
  1185.                 break;
  1186.                 break;
  1187.             }
  1188.         }
  1189.         $main_base = substr($url, 0, $pos);
  1190.         $main_base = str_replace("https://", "", $main_base);
  1191.         $main_base = str_replace("https://www.", "", $main_base);
  1192.         $main_base = str_replace("http://", "", $main_base);
  1193.         $main_base = str_replace("http://www.", "", $main_base);
  1194.         $main_base = str_replace("www.", "", $main_base);
  1195.         return $main_base;
  1196.     }
  1197. }
  1198. $file_find = GetMainBaseFromURL(SECURE_URL($omit));
  1199. if (!function_exists("checkdnsrr")) {
  1200.     function checkdnsrr($hostName, $recType = "") {
  1201.         return true;
  1202.     }
  1203. }
  1204. $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-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");
  1205. $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-confirm", "register-general-main", "register-security-main", "register-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");
  1206. $atype = "";
  1207. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement