static function listbyaccount($AccountID, $pagenum = 1)
 {
     global $DB, $LANG;
     $result = $DB->make_select('Pool', 'SQL_CALC_FOUND_ROWS *', '`AccountID`=' . $AccountID, 'PoolID', 'DESC');
     $FOUND_ROWS = $DB->row($DB->query_adv('SELECT FOUND_ROWS()'));
     $count = $FOUND_ROWS['FOUND_ROWS()'];
     $show = beginTable($LANG['History'] . ' задач ' . $count . ' записей');
     $show .= makeTH('info', 'status', 'ServerID', 'time');
     while ($data = $DB->row($result)) {
         $show .= makeTD('<a href="?object=pool&amp;action=show&amp;PoolID=' . $data['PoolID'] . '">' . $data['description'] . '</a>', $data['status'], $data['ServerID'], $data['lastrenty']);
     }
     $show .= endTable();
     return $show;
 }
 static function listbyaccount($AccountID, $pagenum = 1)
 {
     global $DB, $LANG;
     $page_posts = 25;
     $spos = ($pagenum - 1) * $page_posts;
     $result = $DB->query_adv("SELECT SQL_CALC_FOUND_ROWS * FROM `History` LEFT JOIN `Users` USING (`UserID`) WHERE `AccountID`={$AccountID} ORDER BY `HistoryID` DESC LIMIT {$spos},{$page_posts}");
     $FOUND_ROWS = $DB->row($DB->query_adv('SELECT FOUND_ROWS()'));
     $count = $FOUND_ROWS['FOUND_ROWS()'];
     $show = beginTable($LANG['History'] . ' ' . $count . ' записей');
     $show .= makeTH($LANG['Actions'], $LANG['Description'], $LANG['User'], 'Время', 'IP');
     while ($row = $DB->row($result)) {
         $show .= makeTD($row['action'], '<pre>' . $row['text'] . '</pre>', empty($row['username']) ? '---' : $row['username'], $row['time'], $row['ip']);
     }
     $show .= '<tr><td colspan="3" class="nob">';
     $show .= makePageNav($pagenum, $page_posts, $count, iSELF . '?object=account&amp;action=history&amp;AccountID=' . $AccountID . '&amp;');
     $show .= '</td></tr>';
     $show .= endTable();
     return $show;
 }
 public function audit()
 {
     global $DB, $error_ar;
     // Проверять сужествование связей обьектов.
     // Массив связей. (проверяемый ключ => таблица которая отвечет за него)
     $LINKS['Orders'] = array('AccountID' => 'Accounts', 'ResellerID' => 'Resellers');
     $LINKS['Accounts'] = array('ResellerID' => 'Resellers', 'PackageID' => 'Packages', 'ServerID' => 'Servers');
     $LINKS['Pool'] = array('AccountID' => 'Accounts');
     $LINKS['History'] = array('AccountID' => 'Accounts');
     //$LINKS['Tarifs'] = array(
     //'ResellerID' => 'Resellers'
     //);
     foreach ($LINKS as $test_table => $links) {
         //$primary_key = substr($test_table,0,-1).'ID';
         $primary_key = '';
         $res = $DB->query_adv("SELECT k.column_name FROM information_schema.key_column_usage k WHERE k.constraint_name = 'PRIMARY' AND k.table_schema = 'billing_db' AND k.table_name = '{$test_table}'");
         while ($data = $DB->row($res)) {
             $primary_key .= "{$data['column_name']}";
         }
         //raw($primary_key);
         echo "Cheking {$test_table} table consistency...";
         foreach ($links as $link_key => $link_table) {
             echo "{$link_key}...";
             $res = $DB->query_adv("SELECT `{$test_table}`.`{$primary_key}` as {$primary_key}, `{$test_table}`.`{$link_key}` as {$link_key} FROM `{$test_table}` LEFT OUTER JOIN `{$link_table}` ON `{$test_table}`.`{$link_key}` = `{$link_table}`.`{$link_key}` WHERE (`{$test_table}`.`{$link_key}`) AND `{$link_table}`.`{$link_key}` IS NULL");
             while ($data = $DB->row($res)) {
                 echo "\n Missing object `{$link_table}`.`{$link_key}`={$data[$link_key]} for lost object `{$test_table}`.`{$primary_key}`={$data[$primary_key]}\n";
             }
         }
         echo "OK\n";
     }
     // Проверка на потеренные тарифы
     /*
     $res = $DB->query_adv('SELECT * FROM `Tarifs` LEFT OUTER JOIN `Resellers` ON `Tarifs`.`ResellerID` = `Resellers`.`ResellerID` WHERE `Resellers`.`ResellerID` IS NULL');
     while($data = $DB->row($res)) {
     	echo "Lost Tarif $data[ResellerID].$data[PackageID]\n";
     }
     */
     /*
     Нормализация сервисов:
     1)проверки на opentime<closetime
     2)проверка на непересекаемость периодов сервисов.
     */
     /*
     $acct_result = $DB->make_select("SELECT * FROM whmaccts a ,whmaccts b WHERE a.Domain=b.Domain AND a.server!=b.server");
     $acct_row = $DB->row($acct_result);
     $acct_count = $DB->count($acct_result);
     echo beginTable("$acct_count Accounts");
     if ($acct_row) {
     	do {
     echo "<tr>
     <td>$acct_row[domain]</td>
     <td>$acct_row[server]</td>
     <td>$acct_row[username]</td>
     <td>$acct_row[email]</td>
     <td>$acct_row[quota]</td>
     <td>$acct_row[package]</td>
     <td>$acct_row[theme]</td>
     <td>$acct_row[ResellerID]</td>
     </tr>\n";
     	} while ($acct_row = $DB->row($acct_result));
     }
     echo endTable();
     echo "Finished Step , found $acct_count doublicated accounts. Time ".intval((microtime(1) - $start_time)*1000)."ms.<br><br>\n\n";
     */
     /*
     $start_time = microtime(1);
     echo "Chech for identical count of acoounts in biling and on servers...<br>\n";
     $acct_result = $DB->make_select("SELECT * FROM (SELECT domain, server, username, ResellerID, 'no in Billing' as System FROM `whmaccts`) UNION  (SELECT domain, ServerID, username, ResellerID, 'no on Server' as System FROM `Accounts`  WHERE Accounts.status!='Deleted') GROUP by domain HAVING COUNT(domain)!=2");
     $acct_row = $DB->row($acct_result);
     $acct_count = $DB->count($acct_result);
     echo beginTable("$acct_count Accounts");
     if ($acct_row) {
     	do {
     echo "<tr>
     <td>$acct_row[domain]</td>
     <td>$acct_row[server]</td>
     <td>$acct_row[username]</td>
     <td>$acct_row[ResellerID]</td>
     <td>$acct_row[System]</td>
     </tr>\n";
     	} while ($acct_row = $DB->row($acct_result));
     }
     
     echo endTable();
     echo "Finished Step, found $acct_count lost accounts. Time ".intval((microtime(1) - $start_time)*1000)."ms.<br><br>\n\n";
     */
     $start_time = microtime(1);
     echo "Chech acoounts info servers on servers...<br>\n";
     echo " !Фукция не рабочая и результаты не следует считать верными ...<br>\n";
     #
     $acct_result = $DB->make_select('whmaccts`, `Accounts', "whmaccts.domain, whmaccts.username, Accounts.username as username2, whmaccts.ResellerID, Accounts.ResellerID as ResellerID2, whmaccts.email, 'email' as email2, whmaccts.package, Accounts.PackageID as package2, whmaccts.theme, Accounts.ServerID", 'whmaccts.domain=Accounts.domain', 'domain');
     $acct_row = $DB->row($acct_result);
     echo beginTable();
     echo '<tr><th>Warning</th><th>wrong value</th><th>true value</th><th>Domain</th><tr>';
     if ($acct_row) {
         do {
             $equal = true;
             if ($acct_row['username'] != $acct_row['username2']) {
                 echo "<tr><td>Incorect Username in Billing</td><td>{$acct_row['username2']}</td><td>{$acct_row['username']}</td><td>{$acct_row['domain']}</td></tr>";
             }
             //if($acct_row['ResellerID']!=$acct_row['ResellerID2']) {echo "ResellerID: Server - $acct_row[ResellerID], Billing - $acct_row[ResellerID2]<br>";$equal=false;
             //echo whmreq("/scripts/dochangeowner?user=$acct_row[Username]&owner=$acct_row[ResellerID2]",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //}
             if ($acct_row['theme'] != 'x3') {
                 echo "<tr><td>Incorect Theme on Server</td><td>{$acct_row['theme']}</td><td>x3</td><td>{$acct_row['domain']}</td></tr>";
             }
             //if(!preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $acct_row['email'])){
             //	echo "<tr><td>Incorrect Email on Server</td><td>$acct_row[email]</td><td>$acct_row[email2]</td><td>$acct_row[domain]</td></tr>";
             //whmreq("/scripts2/dochangeemail?user=$acct_row[Username]&email=$acct_row[Email2]",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //}
             //if($acct_row['package']!=$acct_row['package2']) {
             //echo "<tr><td>Incorrect Tarif on Server</td><td>$acct_row[package2]</td><td>$acct_row[package]</td><td>$acct_row[domain]</td></tr>";
             //$Tarif = $acct_row['package2'];
             //echo whmreq("/scripts2/upacct?user=$acct_row[Username]&pkg=$Tarif",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //echo whmreq("/scripts/saveedituser?BWLIMIT=10485760000&FEATURELIST=default&OWNER=$acct_row[ResellerID2]&user=$acct_row[Username]&DNS=$acct_row[Domain]&PLAN=$Tarif&newuser=$acct_row[Username]&RS=x2&MAXSQL={$TARIF[$Tarif]['SQL']}&MAXADDON={$TARIF[$Tarif]['AddonDomains']}&LANG=russian&seeshell=0&MAXPOP=1000&MAXFTP=1000&MAXLST=1000&MAXSUB=1000&MAXPARK=1000&HASCGI=1&shell=0",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //echo whmreq("/scripts/editquota?user=$acct_row[Username]&quota={$TARIF[$Tarif]['Quota']}",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //whmreq("/scripts2/domanageshells?user=$acct_row[Username]&shell=Disable",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //}
         } while ($acct_row = $DB->row($acct_result));
     }
     echo "</td></tr>";
     echo endTable();
     echo "Finished Step. Time " . intval((microtime(1) - $start_time) * 1000) . "ms.<br><br>\n\n";
 }
    unset($access['Data']['td_tracking_ship_est']);
    unset($access['Data']['td_tracking_info']);
} else {
    $access['Data']['td_tracking_id']['disable'] = false;
    $access['Data']['td_tracking_link']['disable'] = false;
    $access['Data']['td_tracking_order_id']['disable'] = false;
    $access['Data']['td_tracking_company']['disable'] = false;
    $access['Data']['td_tracking_ship_date']['disable'] = false;
    $access['Data']['td_tracking_ship_est']['disable'] = false;
    $access['Data']['td_tracking_info']['disable'] = false;
}
unset($access['Data']['cd_enable_tracking']);
unset($access['Data']['td_enable_tracking']);
$access['Data']['ss_cancel_id']['DisplayName'] = 'Cancelation ID';
if (!$access['Data']['ss_cancel_id']['Value']) {
    unset($access['Data']['ss_cancel_id']);
}
if (!$access['Data']['ss_billing_state']['Value']) {
    unset($access['Data']['ss_billing_state']);
}
if (!$access['Data']['Last_Rebill_Date']['Value']) {
    unset($access['Data']['Last_Rebill_Date']);
}
$access['Columns'] = 1;
$access['Submitable'] = false;
$access['HeaderMessage'] = $msg;
beginTable();
writeAccessForm(&$access);
endTable("Transaction Info", "viewTransaction.php?{$link_info}");
?>
</body></html>
function step_3($en_ID, $skipIfComplete = true)
{
    // Step 3
    $access['SerializedData']['Source'] = 'en_info';
    $access['SerializedData']['Data'] = array('Service_List' => array('Processing_Info', 'Service_List'), 'Anti_Fraud_System' => array('Processing_Info', 'Anti_Fraud_System'), 'CS_Program' => array('Processing_Info', 'CS_Program'), 'Refund_Policy' => array('Processing_Info', 'Refund_Policy'), 'Volume_Last_month' => array('Processing_Info', 'Volume_Last_month'), 'Volume_Prev_30Days' => array('Processing_Info', 'Volume_Prev_30Days'), 'Volume_Prev_60Days' => array('Processing_Info', 'Volume_Prev_60Days'), 'Volume_Forcast_1Month' => array('Processing_Info', 'Volume_Forcast_1Month'), 'Volume_Forcast_2Month' => array('Processing_Info', 'Volume_Forcast_2Month'), 'Volume_Forcast_3Month' => array('Processing_Info', 'Volume_Forcast_3Month'), 'Projected_Monthly_Sales' => array('Processing_Info', 'Projected_Monthly_Sales'), 'Chargeback_%' => array('Processing_Info', 'Chargeback_%'), 'Average_Ticket_Price' => array('Processing_Info', 'Average_Ticket_Price'), 'Previous_Processor_Trans_Fee' => array('Processing_Info', 'Previous_Processor_Trans_Fee'), 'Previous_Processor_Disc_Fee' => array('Processing_Info', 'Previous_Processor_Disc_Fee'), 'Previous_Processing' => array('Processing_Info', 'Previous_Processing'), 'Previous_Processor_Reason' => array('Processing_Info', 'Previous_Processor_Reason'), 'Recur_Billing' => array('Processing_Info', 'Recur_Billing'), 'Currently_Processing' => array('Processing_Info', 'Currently_Processing'));
    $access = getAccessInfo("\r\n\t\r\n\tuserId,\r\n\ten_ID,\r\n\ten_info,\r\n\t\r\n\t'Processing Info' as access_header,\r\n\t'' as Service_List,'' as Anti_Fraud_System,'' as CS_Program,'' as Refund_Policy,\r\n\t'' as Volume_Last_month, '' as Volume_Prev_30Days, '' as Volume_Prev_60Days,\r\n\t'' as Volume_Forcast_1Month, '' as Volume_Forcast_2Month, '' as Volume_Forcast_3Month,  '' as Projected_Monthly_Sales,  '' as Average_Ticket_Price,  '' as 'Chargeback_%',\r\n\t'' as Previous_Processor_Trans_Fee, '' as Previous_Processor_Disc_Fee, '' as Previous_Processing, '' as Previous_Processor_Reason, '' as Recur_Billing, '' as Currently_Processing\r\n\t\r\n\t\r\n\t", "cs_entities left join cs_companydetails on en_type='merchant' and en_type_ID = userId", "en_ID = '{$en_ID}'", array('Size' => 30, 'Rows' => 2, 'HideIfEmpty' => true, 'Valid' => 'req'), $access);
    if ($access == -1) {
        dieLog("Invalid Company", "Invalid Company");
    }
    $access['Data']['userId']['Input'] = "hidden";
    $access['Data']['userId']['disable'] = 1;
    $access['Data']['en_ID']['Input'] = "hidden";
    $access['Data']['en_ID']['disable'] = 1;
    $access['Data']['Service_List']['Input'] = 'textarea';
    $access['Data']['Anti_Fraud_System']['Input'] = 'textarea';
    $access['Data']['CS_Program']['Input'] = 'textarea';
    $access['Data']['Refund_Policy']['Input'] = 'textarea';
    $access['Data']['Previous_Processor_Trans_Fee']['DisplayName'] = 'Previous Processor Transaction Fee';
    $access['Data']['Previous_Processor_Disc_Fee']['DisplayName'] = 'Previous Processor Discount Rate';
    $access['Data']['Volume_Last_month']['Input'] = "selectvolume";
    $access['Data']['Volume_Last_month']['DisplayName'] = "Last Month's Volume";
    $access['Data']['Volume_Prev_30Days']['Input'] = "selectvolume";
    $access['Data']['Volume_Prev_30Days']['DisplayName'] = "Volume 2 Months Ago";
    $access['Data']['Volume_Prev_60Days']['Input'] = "selectvolume";
    $access['Data']['Volume_Prev_60Days']['DisplayName'] = "Volume 3 Months Ago";
    $access['Data']['Volume_Forcast_1Month']['Input'] = "selectvolume";
    $access['Data']['Volume_Forcast_1Month']['DisplayName'] = "Forcast Volume This Month";
    $access['Data']['Volume_Forcast_2Month']['Input'] = "selectvolume";
    $access['Data']['Volume_Forcast_2Month']['DisplayName'] = "Forcast Volume Next Month";
    $access['Data']['Volume_Forcast_3Month']['Input'] = "selectvolume";
    $access['Data']['Volume_Forcast_3Month']['DisplayName'] = "Forcast Volume in two Months";
    $access['Data']['Projected_Monthly_Sales']['Input'] = "selectvolume";
    $access['Data']['Projected_Monthly_Sales']['DisplayName'] = "Projected Monthly Sales Volume";
    $access['Data']['Previous_Processor_Trans_Fee']['DisplayName'] = "Previous Processing";
    $access['Data']['Previous_Processing']['DisplayName'] = "Previous Processor";
    $access['Data']['Previous_Processor_Reason']['DisplayName'] = "Reason for Leaving Previous Processor";
    $access['Data']['Previous_Processor_Reason']['Valid'] = '';
    $access['Data']['Recur_Billing']['DisplayName'] = "Recuring Billing";
    $access['Data']['Currently_Processing']['DisplayName'] = "Currently Processing";
    $access['Data']['Average_Ticket_Price']['DisplayName'] = "Average Ticket Price";
    $access['Data']['Chargeback_%']['DisplayName'] = "Chargeback %";
    $access['Data']['Service_List']['DisplayName'] = "Please List Your Products and Services";
    $access['Data']['Anti_Fraud_System']['DisplayName'] = "Describe your Current Anti Fraud System";
    $access['Data']['CS_Program']['DisplayName'] = "Describe your Customer Service Program";
    $access['Data']['Refund_Policy']['DisplayName'] = "Describe your Refund Policy";
    $access['SubmitValue'] = 'Update Information';
    if ($skipIfComplete) {
        $access['SubmitValue'] = 'Complete Merchant Application';
    }
    $access['SubmitName'] = 'submit_step3';
    // Submit
    $showvalidation = false;
    if ($_POST[$access['SubmitName']]) {
        $result = processAccessForm(&$access);
        $showvalidation = true;
    }
    $access['Columns'] = 1;
    // Validate
    $valid = true;
    foreach ($access['Data'] as $key => $data) {
        if (!$data['Value'] && $data['Valid']) {
            $valid = false;
            if ($showvalidation) {
                $access['Data'][$key]['Highlight'] = true;
            }
        }
    }
    if (!$valid || !$skipIfComplete) {
        draw_step_buttons(3, $skipIfComplete);
        $access['HeaderMessage'] = "Please Complete all required fields to continue.";
        beginTable();
        writeAccessForm(&$access);
        endTable("Step #3 - Processing Information", "");
        include "includes/footer.php";
        die;
    }
}
 public function add()
 {
     global $LANG;
     $show = openForm(iSELF . "?object=letter&amp;action=add2");
     $show .= beginTable("{$LANG['Add']} {$LANG['Letter']}");
     $show .= HiddenField('name', '');
     $show .= HiddenField('ResellerID', '');
     $show .= TextField($LANG['Title'], 'title', '');
     $show .= TextField('From', 'from', '');
     $show .= TextField('Subject', 'subject', '');
     $show .= '<tr><td valign="top"><b>Body:</b></td><td><textarea name="body" cols="120" rows="40" wrap="physical"></textarea></td></tr>';
     $show .= Submitter("add_letter", $LANG['Add']);
     $show .= endTable();
     return $show;
 }
function redirect_onok($location)
{
    $res = beginDocument('Operation COMPLETE');
    $res .= '<script type="text/javascript">
function timeoutgo() {
	document.location.href="' . html_entity_decode($location, ENT_QUOTES, 'UTF-8') . '";
}
window.setTimeout("timeoutgo();", 500);
</script>';
    $res .= '<div align="center">' . beginTable();
    $res .= '<tr><td><b>Operation COMPLETE</b></td></tr>';
    $res .= endTable() . '</div>';
    $res .= endDocument();
    return $res;
}
Exemple #8
0
function showChilds($parnt, $level)
{
    global $debug;
    $parnt = mysql_real_escape_string($parnt);
    $i = 0;
    $result = mysql_query("select * from menu where parent = " . $parnt) or die("Error" . mysql_error());
    $count = mysql_numrows($result);
    // syslog(LOG_DEBUG, "p4: menu width " . $count . " childs of parent " . $parnt . " on level " . $level);
    while ($i < $count) {
        $id = mysql_result($result, $i, "id");
        $child = mysql_result($result, $i, "child");
        $address = mysql_result($result, $i, "address");
        $title = mysql_result($result, $i, "title");
        $type = mysql_result($result, $i, "type");
        $u1 = mysql_result($result, $i, "unknown1");
        $u2 = mysql_result($result, $i, "unknown2");
        $value = "";
        if (rtrim($title) == "" && !$debug) {
            $i++;
            continue;
        }
        if ($type == 0x31) {
            $i++;
            continue;
        }
        if ($type == 0x3 || $type == 0x46) {
            $value = getValue($address);
        }
        if ($value == "") {
            $value = getParameter($id);
        }
        if ($debug) {
            switch ($type) {
                case 0x3:
                case 0x46:
                    $txttp = "Messwert";
                    break;
                case 0x7:
                    $txttp = "Par.";
                    break;
                case 0x8:
                    $txttp = "Par Dig";
                    break;
                case 0x32:
                    $txttp = "Par Set";
                    break;
                case 0x39:
                    $txttp = "Par Set1";
                    break;
                case 0x40:
                    $txttp = "Par Set2";
                    break;
                case 0xa:
                    $txttp = "Par Zeit";
                    break;
                case 0x11:
                    $txttp = "Dig Out";
                    break;
                case 0x12:
                    $txttp = "Anl Out";
                    break;
                case 0x13:
                    $txttp = "Dig In";
                    break;
                case 0x22:
                    $txttp = "Empty?";
                    break;
                case 0x23:
                    $txttp = "Reset";
                    break;
                case 0x26:
                    $txttp = "Zeiten";
                    break;
                case 0x3a:
                    $txttp = "Anzeigen";
                    break;
                case 0x16:
                    $txttp = "Firmware";
                    break;
                default:
                    $txttp = sprintf("0x%02x", $type);
            }
            $txtu1 = sprintf("0x%02x", $u1);
            $txtu2 = sprintf("0x%04x", $u2);
            $txtchild = $child ? sprintf("0x%04x", $child) : "-";
            $txtaddr = $address ? sprintf("0x%04x", $address) : "";
        }
        if (!$level && $child) {
            if ($i > 0) {
                endTable();
            }
            beginTable($title);
        } elseif (!$level && !$child && !$address) {
            $i++;
            continue;
        } else {
            if (!$child) {
                $style = "cellL0";
            } elseif ($level == 1) {
                $style = "cellL1";
            } elseif ($level == 2) {
                $style = "cellL2";
            } elseif ($level == 3) {
                $style = "cellL3";
            } elseif ($level == 4) {
                $style = "cellL4";
            } else {
                syslog(LOG_DEBUG, "p4: unexpected menu level " . $level);
                return;
            }
            echo "          <tr class=\"{$style}\">\n";
            if ($debug) {
                echo "            <td style=\"color:red\">({$id})</td>\n";
                echo "            <td>{$txtaddr}</td>\n";
                echo "            <td style=\"color:blue\">{$level}</td>\n";
                echo "            <td>{$txtchild}</td>\n";
                echo "            <td style=\"color:red\">{$txttp}</td>\n";
                echo "            <td>{$txtu1}</td>\n";
                echo "            <td>{$txtu2}</td>\n";
            }
            if ($child) {
                echo "            <td><center><b>{$title}</b></center></td>\n";
            } elseif ($type == 0x7 || $type == 0x8 || $type == 0x40 || $type == 0x39 || $type == 0x32 || $type == 0xa) {
                echo "            <td><button class=buttont type=submit name=edit value={$id}>{$title}</button></td>\n";
            } else {
                echo "            <td>&nbsp;&nbsp;{$title}</td>\n";
            }
            if ($value != "on (A)") {
                echo "            <td style=\"color:blue\">{$value}</td>\n";
            } else {
                echo "            <td style=\"color:green\">{$value}</td>\n";
            }
            echo "          </tr>\n";
        }
        if ($child) {
            showChilds($child, $level + 1);
        }
        $i++;
    }
    if ($level == 0) {
        endTable();
    }
}
function smart_render_action_results($results, $title)
{
    if ($results['form_complete'] != 0) {
        beginTable();
        echo "<table class='report' width='100%' border='0' cellspacing='0' cellpadding='0'>";
        foreach ($results['results'] as $result) {
            echo "<tr class='row" . gen_row(1) . "'>";
            echo "<td>" . $result['action'] . "</td><td>" . $result['status'] . "</td>";
            echo "</tr>";
        }
        echo "</table>";
        endTable($title);
    }
}
 public function ShowServices()
 {
     global $LANG;
     $services = Service::load_service('*', '`AccountID`=' . $this->id);
     $show = beginTable(count($services) . " {$LANG['Services']}", '100%');
     $show .= makeTH($LANG['Service'], $LANG['Price'], 'Инфо', $LANG['CreateDate'], $LANG['CloseDate'], 'Списано услугой, руб.');
     foreach ($services as $serv) {
         /*
         	if($serv->ServiceID == 'hosting') {
         		foreach($serv->mod as $mod) {
         			$show .= makeTD(
         		"<a href='?object=service&amp;action=show&amp;ServiceID=$serv->id'>$serv->name</a>",
         		round($mod['price'],2),
         		$mod['package']->id,
         		date('d.m.Y H:i',$mod['opentime']),
         		$mod['time'] == 0 ? '---------' : date('d.m.Y H:i',$mod['opentime']+$mod['time']),
         		round($mod['summ'],4)
         		);
         		}
         	}else
         */
         $show .= makeTD("<a href='?object=service&amp;action=show&amp;ServiceID={$serv->id}'>{$serv->name}</a>", round($serv->price, 2), $serv->getInfo(), date('d.m.Y H:i', strtotime($serv->opentime)), $serv->closetime == '0000-00-00 00:00:00' ? '---------' : date('d.m.Y H:i', strtotime($serv->closetime)), round($serv->getSumm(), 4));
     }
     $show .= endTable();
     return $show;
 }
function genResellerViewTable($qrt_select_reseller, $redirectOne, $redirectAll, $mode = 'minimal', $title = 'Select Reseller', $showTable = true)
{
    if (!$redirectOne) {
        $redirectOne = basename($_SERVER['PHP_SELF']);
    }
    if (!$redirectAll) {
        $redirectAll = basename($_SERVER['PHP_SELF']);
    }
    require_once "../includes/function2.php";
    global $bank_sql_limit;
    if (!$qrt_select_reseller) {
        $qrt_select_reseller = " from cs_resellerdetails order by reseller_companyname";
    }
    $qrt_select_reseller = "select reseller_id,reseller_companyname,rd_referenceNumber" . $qrt_select_reseller;
    //$show_reseller_sql =mysql_query($qrt_select_reseller) or dieLog(mysql_errno().": ".mysql_error()."<BR>");
    if ($showTable) {
        beginTable();
    }
    ?>
<script language="JavaScript">
var Reseller = new Array();
var cs_URL = new Array();

function selectReseller(obj)
{
	obj_element = document.getElementById('resellername');
	obj_element.value = obj.value;
}

function DisplayReseller(){
	if(document.getElementById('Resellermode').value=="A") {
		document.getElementById('allC').style.display = "";
		document.getElementById('active').style.display = "none";
		document.getElementById('nonactive').style.display = "none";
	} else if(document.getElementById('Resellermode').value=="AC") {
		document.getElementById('active').style.display = "";
		document.getElementById('allC').style.display = "none";
		document.getElementById('nonactive').style.display = "none";
	} else if(document.getElementById('Resellermode').value=="NC") {
		document.getElementById('nonactive').style.display = "";
		document.getElementById('allC').style.display = "none";
		document.getElementById('active').style.display = "none";
	}
	document.getElementById('resellername').selectedIndex = 0;
	document.getElementById('activename').selectedIndex = 0;
	document.getElementById('nonactivename').selectedIndex = 0;

}
function viewReseller() {
	var liststr = "";
	var curval = 0;
	var curreselId = 0;
	var length = document.getElementById('resellername').length;
	if(document.getElementById('resellername').value=="") {
	 //alert("Please select the Reseller.");
	 return 0;
	}
	if(document.getElementById('resellername').value == 'A')
	{
		curval='A';
	}
	for(i=0;i<length;i++)
	{
		if(document.getElementById('resellername').value == 'AL' || document.getElementById('resellername').options[i].selected) 
		{
			curreselId = document.getElementById('resellername').options[i].value;
			if (curreselId == 'A') {curVal='A'; break;}
			if (!window.redirectTo) 
			{
				if(curreselId!='AL')
				{
					if(!liststr) liststr=curreselId;
					else liststr += '|'+curreselId;
				}
			}
			else reselId[curval] = curreselId;
			curval++;
		}
	}
	if (window.redirectTo) redirectTo(reselId);
	
	if(curval==1) document.getElementById('frmSelComp').action='<?php 
    echo $redirectOne;
    ?>
';
	else document.getElementById('frmSelComp').action='<?php 
    echo $redirectAll;
    ?>
';
	
	document.getElementById('rd_view').value = curval;
	document.getElementById('resellername').value = '';
	resFunc_removeitem();
	document.getElementById('reselIdList').value = liststr;
	
	
	
	document.getElementById('frmSelComp').submit();
}

function DisplayResellertype() {
	document.getElementById('trans_type').value="Submit";
	//document.dates.action = "viewReseller.php";
	//document.dates.submit();
}
function func_fillresellername()
{
	var str_comparison;
	obj_element = document.getElementById('resellername');
	var str_search = document.getElementById('txt_resellername').value.toLowerCase();
	var str_search_refNum = document.getElementById('txt_ResellerrefNum').value.toLowerCase();
	var i_length = str_search.length;
	var i_length_refNum = str_search_refNum.length;
	var i_arraylength = Reseller.length
	var statusSelect = 1;
	resFunc_removeitem();
	
	

	obj_element.options.length=obj_element.options.length+1;
	obj_element.options[obj_element.options.length-1].value="AL";
	obj_element.options[obj_element.options.length-1].text="All Resellers in List";
	obj_element.options[0].selected=true;

	for (i=0;i<i_arraylength;i++)
	{
		str_comparison = Reseller[i]['name'].toLowerCase();
		str_comparison_refNum = Reseller[i]['refNum'].toLowerCase();
		
		comparison = str_comparison.indexOf(str_search) != -1;
		refcomparison = str_search_refNum==str_comparison_refNum;
		if(str_search.length == 0) comparison = true;
		if(str_search_refNum.length == 0) refcomparison = true;


		if(comparison && refcomparison)
		{
			obj_element.options.length=obj_element.options.length+1;
			obj_element.options[obj_element.options.length-1].value=Reseller[i]['id'];
			obj_element.options[obj_element.options.length-1].text=Reseller[i]['name'];
			obj_element.options[obj_element.options.length-1].title=Reseller[i]['request'];
			obj_element.options[obj_element.options.length-1].style.fontWeight=Reseller[i]['style'];
		}
	}
	<?php 
    if ($_REQUEST['resubmit']) {
        ?>
	document.getElementById('resellername').value == 'AL';
	viewReseller();
	<?php 
    }
    ?>
}
function resFunc_removeitem()
{
	obj_element = document.getElementById('resellername');
	obj_element.options.length=0;
}
function loadReseller(cnt,id,name,refNum)
{
	Reseller[cnt] = new Array(); 
	Reseller[cnt]['id'] = id; 
	Reseller[cnt]['name'] = name;
	Reseller[cnt]['refNum'] = refNum; 
}
function resLoadWebsite(cnt,URL,Reseller_id)
{
	cs_URL[cnt] = new Array(); 
	cs_URL[cnt]['URL'] = URL; 
	cs_URL[cnt]['Reseller_id'] = Reseller_id;

}
function resUpdateBatch(obj)
{
	var str = "";
	if(obj.value != 'A')
	{
		for(var i = 0; i<obj.options.length;i++)
		{
			if(obj.options[i].selected) 
			{
				if(str) str+=", ";
				str += obj.options[i].value;
			}
		}
	}
	document.getElementById('resbatchfield').value = str;
}

function resUpdateList(obj)
{
	re = /[^\d]+/;
	var list = obj.value.split(re);
	var total = 0;
	var clist = document.getElementById('resellername');
	
	for(i=0;i<clist.length;i++)
	{
		clist[i].selected = false;
		for(j=0;j<list.length;j++)
		{
			if(clist[i].value==list[j]) 
			{	
				total++;
				clist[i].selected = true;
			}
		}
	}
	if(total>1) alert(total+" Resellers Selected.");
}
</script>

<table border="0" align="center" cellpadding="0" cellspacing="0" width="100%" height="100">
  <tr>
    <td width="50%" valign="top"><table border="0" align="center" cellpadding="0" cellspacing="0" width="100%" height="90">
        <tr>
          <td valign="top" align="right"><font face="verdana" size="1">Reseller Name&nbsp;:</font> </td>
          <td valign="top"><input value="<?php 
    echo $_REQUEST['txt_resellername'];
    ?>
" type="text" name="txt_resellername" id="txt_resellername" size="10" style="font-family:verdana;font-size:10px;WIDTH: 210px" onKeyUp="func_fillresellername();">
          </td>
          <td width="10%" height="30" rowspan="3" align="right"  valign="top"> <font face="verdana" size="1">Select Reseller&nbsp;:&nbsp;</font></td>
          <td rowspan="3"><select name="resellername" size="6" multiple id="resellername" style="font-family:verdana;font-size:10px;WIDTH: 210px" onChange="resUpdateBatch(this)">
              
            </select>
          </td>
        </tr>
        <tr>
          <td align="right" valign="top"><font face="verdana" size="1">Reseller Reference Num&nbsp;:</font> </td>
          <td valign="top"><input value="<?php 
    echo $_REQUEST['txt_ResellerrefNum'];
    ?>
" name="txt_ResellerrefNum" type="text" id="txt_ResellerrefNum" style="font-family:verdana;font-size:10px;WIDTH: 210px" onKeyUp="func_fillresellername();" size="10"></td>
        </tr>
        <tr>
          <td align="right" valign="top"><font face="verdana" size="1">Batch Resellers : </font></td>
          <td valign="top"><textarea name="resbatchfield" rows="1" wrap="VIRTUAL" id="resbatchfield" style="font-family:verdana;font-size:8px;WIDTH: 210px" onMouseOver="this.rows=this.value.length/45+2" onMouseOut="this.rows=1" onChange="resUpdateList(this)"><?php 
    echo quote_smart($_REQUEST['toresbatchfield']);
    ?>
          </textarea></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td align="center" colspan="2">&nbsp;&nbsp;&nbsp;
      <input type="button" id="viewreseller" src="../images/view.jpg" value="View" onClick="viewReseller()">
      <input type="hidden" value="" id="rd_view" name="rd_view">
      <input type="hidden" value="" id="reselIdList" name="reselIdList"> </td>
  </tr>
</table>
<script language="javascript">
<!--
<?php 
    func_multiselect_reseller_jsarray($qrt_select_reseller);
    ?>
func_fillresellername();
<?php 
    if ($_REQUEST['toresbatchfield']) {
        ?>
resUpdateList(document.getElementById('resbatchfield'));<?php 
    }
    ?>

-->
</script>
<?php 
    if ($showTable) {
        endTable($title, '', false, false, false, 'frmSelComp');
    }
}
 public function ShowActions()
 {
     global $LANG;
     $show = beginTable($LANG['Actions']);
     $show .= "<tr><td><a href='?object=payment_print&amp;PaymentID={$this->id}'><img src='images/edit.png' alt='print' />печать акта</a></td></tr>";
     $show .= "<tr><td><a href='?object=payment&amp;action=edit&amp;PaymentID={$this->id}'><img src='images/edit.png' alt='edit' />{$LANG['Edit']} </a></td></tr>";
     $show .= "<tr><td><a href='?object=payment&amp;action=delete&amp;PaymentID={$this->id}'><img src='images/delete.png' alt='delete' />{$LANG['Delete']} </a></td></tr>";
     $show .= endTable();
     return $show;
 }
 static function list_domain($pagenum = 1)
 {
     global $LANG, $DB;
     $page_posts = 20;
     $spos = ($pagenum - 1) * $page_posts;
     $objs = Domain::load_domains('*', '', 'DomainID', 'DESC', $page_posts, $spos);
     $count = $DB->count_objs('Domains');
     $result = beginTable("{$count} {$LANG['Domains']}", '100%');
     $result .= makeTH($LANG['ID'], $LANG['Title']);
     foreach ($objs as $obj) {
         $result .= makeTD("<a href='?object=domain&amp;action=show&amp;DomainID={$obj->id}'>{$obj->id}</a>", $obj->name);
     }
     $result .= '<tr><td colspan="10" class="nob">';
     $result .= makePageNav($pagenum, $page_posts, $count, iSELF . '?object=domain&amp;action=list&amp;');
     $result .= '</td></tr>';
     $result .= endTable();
     return $result;
 }
 function ShowActions()
 {
     global $LANG;
     $show = beginTable($LANG['Actions']);
     $show .= "<tr><td><a href=\"?object=company&amp;action=edit&CompanyID={$this->id}\"><img src=\"images/edit.png\">{$LANG['Edit']}</a></td></tr>";
     $show .= "<tr><td><a href=\"?object=company&amp;action=delete&CompanyID={$this->id}\"><img src=\"images/delete.png\">{$LANG['Delete']}</a></td></tr>";
     $show .= endTable();
     return $show;
 }
function step_2($en_ID, $skipIfComplete = true)
{
    global $companyInfo, $etel_routing_types;
    // Step 2
    $access = array();
    $access['SerializedData']['Source'] = 'en_info';
    $access['SerializedData']['Data'] = array('Method' => array('Payment_Data', 'Method'), 'ACH_Bank_Name' => array('Payment_Data', 'ACH', 'Bank_Name'), 'ACH_Bank_Address' => array('Payment_Data', 'ACH', 'Bank_Address'), 'ACH_Bank_ZipCode' => array('Payment_Data', 'ACH', 'Bank_ZipCode'), 'ACH_Bank_City' => array('Payment_Data', 'ACH', 'Bank_City'), 'ACH_Bank_State' => array('Payment_Data', 'ACH', 'Bank_State'), 'ACH_Bank_Country' => array('Payment_Data', 'ACH', 'Bank_Country'), 'ACH_Bank_Phone' => array('Payment_Data', 'ACH', 'Bank_Phone'), 'ACH_Bank_Beneficiary_Name' => array('Payment_Data', 'ACH', 'Bank_Beneficiary_Name'), 'ACH_Bank_Account_Name' => array('Payment_Data', 'ACH', 'Bank_Account_Name'), 'ACH_Bank_Account_Number' => array('Payment_Data', 'ACH', 'Bank_Account_Number'), 'ACH_Bank_Routing_Number' => array('Payment_Data', 'ACH', 'Bank_Routing_Number'), 'ACH_Bank_Additional_Notes' => array('Payment_Data', 'ACH', 'Bank_Additional_Notes'), 'Wire_Bank_Name' => array('Payment_Data', 'Wire', 'Bank_Name'), 'Wire_Bank_Address' => array('Payment_Data', 'Wire', 'Bank_Address'), 'Wire_Bank_ZipCode' => array('Payment_Data', 'Wire', 'Bank_ZipCode'), 'Wire_Bank_City' => array('Payment_Data', 'Wire', 'Bank_City'), 'Wire_Bank_State' => array('Payment_Data', 'Wire', 'Bank_State'), 'Wire_Bank_Country' => array('Payment_Data', 'Wire', 'Bank_Country'), 'Wire_Bank_Phone' => array('Payment_Data', 'Wire', 'Bank_Phone'), 'Wire_Bank_Beneficiary_Name' => array('Payment_Data', 'Wire', 'Bank_Beneficiary_Name'), 'Wire_Bank_Account_Name' => array('Payment_Data', 'Wire', 'Bank_Account_Name'), 'Wire_Bank_Account_Number' => array('Payment_Data', 'Wire', 'Bank_Account_Number'), 'Wire_Bank_Routing_Number' => array('Payment_Data', 'Wire', 'Bank_Routing_Number'), 'Wire_Bank_Routing_Type' => array('Payment_Data', 'Wire', 'Bank_Routing_Type'), 'Wire_Bank_Sort_Code' => array('Payment_Data', 'Wire', 'Bank_Sort_Code'), 'Wire_Bank_VAT_Number' => array('Payment_Data', 'Wire', 'Bank_VAT_Number'), 'Wire_Bank_Registration_Number' => array('Payment_Data', 'Wire', 'Bank_Registration_Number'), 'Wire_Bank_Additional_Notes' => array('Payment_Data', 'Wire', 'Bank_Additional_Notes'), 'Wire_Intermediary_Bank_Routing_Type' => array('Payment_Data', 'Wire', 'Intermediary_Bank_Routing_Type'), 'Wire_Intermediary_Bank_Routing_Number' => array('Payment_Data', 'Wire', 'Intermediary_Bank_Routing_Number'), 'Wire_Intermediary_Bank_Name' => array('Payment_Data', 'Wire', 'Intermediary_Bank_Name'), 'Wire_Intermediary_Bank_City' => array('Payment_Data', 'Wire', 'Intermediary_Bank_City'), 'Wire_Intermediary_Bank_State' => array('Payment_Data', 'Wire', 'Intermediary_Bank_State'));
    //if($companyInfo['cd_bank_routingcode']) $payment['Payment_Data']['Wire']['Bank_Routing_Type'] = $routingTypes[$companyInfo['cd_bank_routingcode']];
    //if($companyInfo['bank_IBRoutingCodeType']) $payment['Payment_Data']['Wire']['Intermediary_Bank_Routing_Type'] = $routingTypes[$companyInfo['bank_IBRoutingCodeType']];
    $access = getAccessInfo("\n\t\n\ten_ID,\n\ten_info,\n\t\n\t'Payment Method' as access_header,\n\t1 as 'Method',\n\t\n\t'ACH Banking Info' as access_header,\n  \t\t1 as 'ACH_Bank_Name', 1 as 'ACH_Bank_Address', 1 as 'ACH_Bank_ZipCode', 1 as 'ACH_Bank_City', 1 as 'ACH_Bank_State', \n  \t\t1 as 'ACH_Bank_Country', 1 as 'ACH_Bank_Phone', 1 as 'ACH_Bank_Beneficiary_Name', 1 as 'ACH_Bank_Account_Name', 1 as 'ACH_Bank_Account_Number', \n  \t\t1 as 'ACH_Bank_Routing_Number', 1 as 'ACH_Bank_Additional_Notes',\n\t\t\n\t'Wire Banking Info' as access_header,\n  \t\t1 as 'Wire_Bank_Name', 1 as 'Wire_Bank_Address', 1 as 'Wire_Bank_ZipCode', 1 as 'Wire_Bank_City', 1 as 'Wire_Bank_State', \n  \t\t1 as 'Wire_Bank_Country', 1 as 'Wire_Bank_Phone', 1 as 'Wire_Bank_Beneficiary_Name', 1 as 'Wire_Bank_Account_Name', 1 as 'Wire_Bank_Account_Number', \n  \t\t1 as 'Wire_Bank_Routing_Number', 1 as 'Wire_Bank_Routing_Type', 1 as 'Wire_Intermediary_Bank_Routing_Number',\n\t\t1 as 'Wire_Intermediary_Bank_Routing_Type',\t1 as 'Wire_Intermediary_Bank_Name', 1 as 'Wire_Intermediary_Bank_City', 1 as 'Wire_Intermediary_Bank_State', \n\t\t1 as 'Wire_Bank_Sort_Code', 1 as 'Wire_Bank_VAT_Number', 1 as 'Wire_Bank_Registration_Number', 1 as 'Wire_Bank_Additional_Notes'\n\t", "cs_entities", "en_ID = '{$en_ID}'", array('Size' => 30, 'Rows' => 2, 'HideIfEmpty' => true, 'Length' => 32, 'Valid' => 'req'), $access);
    if ($access == -1) {
        dieLog("Invalid Company", "Invalid Company");
    }
    $access['Data']['en_ID']['Input'] = "hidden";
    $access['Data']['en_ID']['disable'] = 1;
    $access['Data']['Method']['Input'] = "selectcustomarray";
    $access['Data']['Method']['Input_Custom'] = array('' => 'Please Select a Method', 'Wire' => 'Wire (International)', 'ACH' => 'ACH (US Only)');
    $access['Data']['Method']['InputAdditional'] = 'onchange="this.form.submit()"';
    $access['Data']['ACH_Bank_Additional_Notes']['Valid'] = '';
    $access['Data']['Wire_Bank_Additional_Notes']['Input'] = 'textarea';
    $access['Data']['Wire_Bank_Additional_Notes']['Size'] = '50';
    $access['Data']['Wire_Bank_Additional_Notes']['Rows'] = '6';
    $access['Data']['ACH_Bank_Additional_Notes']['Input'] = 'textarea';
    $access['Data']['ACH_Bank_Additional_Notes']['Size'] = '50';
    $access['Data']['ACH_Bank_Additional_Notes']['Rows'] = '6';
    $access['Data']['Wire_Bank_Sort_Code']['Valid'] = '';
    $access['Data']['Wire_Bank_VAT_Number']['Valid'] = '';
    $access['Data']['Wire_Bank_Registration_Number']['Valid'] = '';
    $access['Data']['Wire_Bank_Additional_Notes']['Valid'] = '';
    $access['Data']['Wire_Bank_Additional_Notes']['RowDisplay'] = 'Wide';
    $access['Data']['ACH_Bank_Additional_Notes']['Valid'] = '';
    $access['Data']['ACH_Bank_Additional_Notes']['RowDisplay'] = 'Wide';
    $access['Data']['Wire_Bank_Country']['Style'] = 'width:205px;';
    $access['Data']['Wire_Bank_Country']['Input'] = 'selectcustom';
    $access['Data']['Wire_Bank_Country']['Input_Custom'] = "Select co_ISO,co_full From cs_country";
    $access['Data']['Wire_Bank_Country']['InputAdditional'] = "onchange='" . "\$(\"Wire_Intermediary_Bank_Routing_Number\").setAttribute(\"valid\",(this.value!=\"US\"?\"req\":\"\"));" . "\$(\"Wire_Intermediary_Bank_Routing_Type\").setAttribute(\"valid\",(this.value!=\"US\"?\"req\":\"\"));" . "\$(\"Wire_Intermediary_Bank_Name\").setAttribute(\"valid\",(this.value!=\"US\"?\"req\":\"\"));" . "\$(\"Wire_Intermediary_Bank_City\").setAttribute(\"valid\",(this.value!=\"US\"?\"req\":\"\"));" . "\$(\"Wire_Intermediary_Bank_State\").setAttribute(\"valid\",(this.value!=\"US\"?\"req\":\"\"));" . "';" . ($access['Data']['Wire_Bank_State']['Input'] = 'selectcustom');
    $access['Data']['Wire_Bank_State']['Style'] = 'width:205px;';
    $access['Data']['Wire_Bank_State']['Input_Custom'] = "Select st_abbrev,st_full From cs_states";
    $access['Data']['ACH_Bank_Country']['Style'] = 'width:205px;';
    $access['Data']['ACH_Bank_Country']['Input'] = 'selectcustom';
    $access['Data']['ACH_Bank_Country']['Input_Custom'] = "Select co_ISO,co_full From cs_country";
    $access['Data']['ACH_Bank_State']['Input'] = 'selectcustom';
    $access['Data']['ACH_Bank_State']['Style'] = 'width:205px;';
    $access['Data']['ACH_Bank_State']['Input_Custom'] = "Select st_abbrev,st_full From cs_states";
    $access['Data']['Wire_Intermediary_Bank_Routing_Type']['Input'] = "selectcustomarray";
    $access['Data']['Wire_Intermediary_Bank_Routing_Type']['Input_Custom'] = $etel_routing_types;
    $access['Data']['Wire_Bank_Routing_Type']['Input'] = "selectcustomarray";
    $access['Data']['Wire_Bank_Routing_Type']['Input_Custom'] = $etel_routing_types;
    $access['SubmitValue'] = 'Update Information';
    if ($skipIfComplete) {
        $access['SubmitValue'] = 'Continue to Step 3';
    }
    $access['SubmitName'] = 'submit_step2';
    // Submit
    $showvalidation = false;
    if ($_POST[$access['SubmitName']] || $_POST['Method']) {
        $result = processAccessForm(&$access);
        $showvalidation = true;
    }
    $access['Columns'] = 1;
    // Display Parsing
    foreach ($access['Data'] as $key => $data) {
        $access['Data'][$key]['DisplayName'] = preg_replace('/Wire |ACH /', '', $access['Data'][$key]['DisplayName']);
        if ($access['Data']['Method']['Value'] != 'Wire') {
            if (strpos($key, 'Wire_') !== false) {
                unset($access['Data'][$key]);
            }
            if ($access['Data'][$key]['Name'] == 'access_header' && $access['Data'][$key]['Value'] == 'Wire Banking Info') {
                unset($access['Data'][$key]);
            }
        }
        if ($access['Data']['Method']['Value'] != 'ACH') {
            if (strpos($key, 'ACH_') !== false) {
                unset($access['Data'][$key]);
            }
            if ($access['Data'][$key]['Name'] == 'access_header' && $access['Data'][$key]['Value'] == 'ACH Banking Info') {
                unset($access['Data'][$key]);
            }
        }
    }
    if ($access['Data']['Wire_Bank_Country']['Value'] == 'US') {
        $access['Data']['Wire_Intermediary_Bank_Routing_Type']['Valid'] = '';
        $access['Data']['Wire_Intermediary_Bank_Routing_Number']['Valid'] = '';
        $access['Data']['Wire_Intermediary_Bank_Name']['Valid'] = '';
        $access['Data']['Wire_Intermediary_Bank_City']['Valid'] = '';
        $access['Data']['Wire_Intermediary_Bank_State']['Valid'] = '';
    }
    // Validate
    $valid = true;
    foreach ($access['Data'] as $key => $data) {
        if (!$data['Value'] && $data['Valid']) {
            $valid = false;
            if ($showvalidation) {
                $access['Data'][$key]['Highlight'] = true;
            }
        }
    }
    if (!$valid || !$skipIfComplete) {
        draw_step_buttons(2, $skipIfComplete);
        $access['HeaderMessage'] = "Please Complete all required fields to continue.";
        beginTable();
        writeAccessForm(&$access);
        endTable("Step #2 - Company Information", "");
        include "includes/footer.php";
        die;
    }
}