/application/views/pages/admin/hksearch.php
PHP | 2017 lines | 1777 code | 43 blank | 197 comment | 271 complexity | fad700ead043ed0546b9fdc9e42bec87 MD5 | raw file
- <?php
- //This code is copyright (c) Internet Business Solutions SL, all rights reserved.
- //The contents of this file are protect under law as the intellectual property of Internet
- //Business Solutions SL. Any use, reproduction, disclosure or copying of any kind
- //without the express and written permission of Internet Business Solutions SL is forbidden.
- //Author: Vince Reid, vince@virtualred.net
- include('init.php');
- include(APPPATH.'views/pages/admin/cartmisc.php');
- include_once(IFZROOT.'kohana.php');
- session_register('order_id_commas');
- $lisuccess=0;
- if(@$dateadjust=="") $dateadjust=0;
- if(@$dateformatstr == "") $dateformatstr = "m/d/Y";
- $admindatestr="Y-m-d";
- if(@$admindateformat=="") $admindateformat=0;
- if($admindateformat==1)
- $admindatestr="m/d/Y";
- elseif($admindateformat==2)
- $admindatestr="d/m/Y";
- if(@$storesessionvalue=="") $storesessionvalue="virtualstore".time();
- $doedit=FALSE;
- function editfunc($data,$col,$size){
- global $doedit;
- if($doedit) return('<input type="text" id="' . $col . '" name="' . $col . '" value="' . str_replace('"','"',$data) . '" size="' . $size . '">'); else return($data);
- }
- function editnumeric($data,$col,$size){
- global $doedit;
- if($doedit) return('<input type="text" id="' . $col . '" name="' . $col . '" value="' . number_format($data,2,'.','') . '" size="' . $size . '">'); else return(FormatEuroCurrency($data));
- }
- if(@$_SESSION["loggedon"] != $storesessionvalue && trim(@$_COOKIE["WRITECKL"])!=""){
- $config = RBI_Kohana::config('database.default_ifrogz');
- $config = $config['connection'];
- $db=mysql_connect($config['hostname'], $config['username'], $config['password']);
- mysql_select_db($config['database']) or die ('RBI connection failed.</td></tr></table></body></html>');
- $rbiSQL = 'SELECT *
- FROM employee
- WHERE username="'.mysql_real_escape_string(unstripslashes(trim(@$_COOKIE["WRITECKL"]))).'" and password="'.mysql_real_escape_string(unstripslashes(trim(@$_COOKIE["WRITECKP"]))).'"';
- $rs_rbi = mysql_query($rbiSQL);
- if(mysql_num_rows($rs_rbi) > 0) {
- @$_SESSION["loggedon"] = $storesessionvalue;
- }else{
- $lisuccess=2;
- }
- mysql_free_result($rs_rbi);
- include(APPPATH.'views/partials/admin/dbconnection.php');
- }
- if(($_SESSION["loggedon"] != $storesessionvalue && $lisuccess!=2) || @$disallowlogin==TRUE) exit();
- if($lisuccess==2){
- ?>
- <table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="" align="center">
- <tr>
- <td width="100%">
- <table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="">
- <tr>
- <td width="100%" colspan="4" align="center"><p> </p><p> </p>
- <p><strong><?php print $yyOpFai?></strong></p><p> </p>
- <p><?php print $yyCorCoo?> <?php print $yyCorLI?> <a href="/admin/login.php"><?php print $yyClkHer?></a>.</p>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <?php
- }else{
- $success=true;
- $alreadygotadmin = getadminsettings();
- if(@$_GET["id"] != ""){
- $sSQL = "SELECT cartProdId,cartProdName,cartProdPrice,cartQuantity,cartID FROM cart WHERE cartOrderID=" . $_GET["id"];
- $allorders = mysql_query($sSQL) or print(mysql_error());
- }
- $numstatus=0;
- $sSQL = "SELECT statID,statPrivate FROM orderstatus WHERE statPrivate<>'' ORDER BY statID";
- $result = mysql_query($sSQL) or print(mysql_error());
- while($rs = mysql_fetch_assoc($result)){
- $allstatus[$numstatus++]=$rs;
- }
- mysql_free_result($result);
- if(@$_GET["id"] != ""){
- $statetaxrate=0;
- $countrytaxrate=0;
- $hsttaxrate=0;
- $countryorder=0;
- $sSQL = "SELECT ordID,ordName,ordAddress,ordAddress2,ordCity,ordState,ordZip,ordCountry,ordEmail,ordPhone,ordShipName,ordShipAddress,ordShipAddress2,ordShipCity,ordShipState,ordShipZip,ordShipCountry,ordPayProvider,ordAuthNumber,ordTransID,ordTotal,ordDate,ordStateTax,ordCountryTax,ordHSTTax,ordShipping,ordShipType,ordIP,ordAffiliate,ordDiscount,ordHandling,ordDiscountText,ordComLoc,ordExtra1,ordExtra2,ordAddInfo,ordCNum,ordStatusInfo,ordSupportInfo,order_changed,ordStatus,ord_cert_amt,ord_cert_id,ordPoApo,ordShipPoApo,ordEID FROM orders LEFT JOIN payprovider ON payprovider.payProvID=orders.ordPayProvider WHERE ordID='" . $_GET["id"] . "'
- AND ordEID!=34";
- $result = mysql_query($sSQL) or print(mysql_error());
- $alldata = mysql_fetch_array($result);
- $alldata["ordDate"] = strtotime($alldata["ordDate"]);
- mysql_free_result($result);
- if($doedit){
- print '<form method="post" name="editform" action="/admin/orders.php" onsubmit="return confirmedit()"><input type="hidden" name="orderid" value="' . $_GET["id"] . '" /><input type="hidden" name="doedit" value="true" />';
- $overridecurrency=TRUE;
- $orcsymbol="";
- $orcdecplaces=2;
- $orcpreamount=TRUE;
- $orcdecimals=".";
- $orcthousands="";
- }
- ?>
- <script language="JavaScript" type="text/javascript" src="http://assets.ifrogz.com/lib/packages/scriptaculous-js/1.5.1/prototype.js"></script>
- <script language="JavaScript" type="text/javascript" src="http://assets.ifrogz.com/lib/packages/scriptaculous-js/1.5.1/scriptaculous.js"></script>
- <script language="JavaScript" type="text/javascript">
- <!--
- var newwin="";
- var plinecnt=0;
- function openemailpopup(id) {
- popupWin = window.open('/admin/popupemail.php?'+id,'emailpopup','menubar=no, scrollbars=no, width=300, height=250, directories=no,location=no,resizable=yes,status=no,toolbar=no')
- }
- function updateoptions(id){
- prodid = document.getElementById('prodid'+id).value;
- if(prodid != ''){
- newwin = window.open('/admin/popupemail.php?prod='+prodid+'&index='+id,'updateopts','menubar=no, scrollbars=no, width=50, height=40, directories=no,location=no,resizable=yes,status=no,toolbar=no');
- }
- return(false);
- }
- function extraproduct(plusminus){
- var productspan=document.getElementById('productspan');
- if(plusminus=='+'){
- productspan.innerHTML=productspan.innerHTML.replace(/<!--NEXTPRODUCTCOMMENT-->/,'<!--PLINE'+plinecnt+'--><tr><td valign="top"><input type="button" value="..." onclick="updateoptions('+(plinecnt+1000)+')"> <input name="prodid'+(plinecnt+1000)+'" size="18" id="prodid'+(plinecnt+1000)+'"></td><td valign="top"><input type="text" id="prodname'+(plinecnt+1000)+'" name="prodname'+(plinecnt+1000)+'" size="24"></td><td><span id="optionsspan'+(plinecnt+1000)+'">-</span></td><td valign="top"><input type="text" id="quant'+(plinecnt+1000)+'" name="quant'+(plinecnt+1000)+'" size="5" value="1"></td><td valign="top"><input type="text" id="price'+(plinecnt+1000)+'" name="price'+(plinecnt+1000)+'" value="0" size="7"><br /><input type="hidden" id="optdiffspan'+(plinecnt+1000)+'" value="0"></td><td> </td></tr><!--PLINEEND'+plinecnt+'--><!--NEXTPRODUCTCOMMENT-->');
- plinecnt++;
- }else{
- if(plinecnt>0){
- plinecnt--;
- var restr = '<!--PLINE'+plinecnt+'-->(.|\\n)+<!--PLINEEND'+plinecnt+'-->';
- //alert(restr);
- var re = new RegExp(restr);
- productspan.innerHTML=productspan.innerHTML.replace(re,'');
- }
- }
- }
- function confirmedit(){
- if(updateClicked) {
- if(confirm('<?php print str_replace("'","\'",$yyChkRec)?>'))
- return(true);
- return(false);
- }
- if(cloneClicked) {
- if(confirm('Are you sure you want to clone this order?'))
- return(true);
- return(false);
- }
- }
- function checkAIM(frm) {
- if(frm.aim_type.selectedIndex==0) {
- alert("Please choose a transaction type.");
- frm.aim_type.focus();
- return false;
- }else if(frm.aim_txn=='') {
- alert("A transaction number is required.");
- frm.aim_txn.focus();
- return false;
- }else if(frm.aim_amt=='') {
- alert("Please enter an amount.");
- frm.aim_amt.focus();
- return false;
- }
-
- return true;
- }
- function toggleTXN() {
- if($('div_trans').style.display=='' || $('div_trans').style.display==undefined) {
- //$('div_trans').style.display = 'none';
- Effect.BlindUp('div_trans');
- $('btn_add_txn').value = 'Credit or Void';
- }else if($('div_trans').style.display=='none') {
- //$('div_trans').style.display = '';
- Effect.BlindDown('div_trans');
- $('btn_add_txn').value = 'Hide Credit or Void';
- }
- }
- function toggleCharge() {
- if($('div_charge').style.display=='' || $('div_charge').style.display==undefined) {
- //$('div_charge').style.display = 'none';
- Effect.BlindUp('div_charge');
- $('btn_charge').value = 'Charge CC';
- }else if($('div_charge').style.display=='none') {
- //$('div_charge').style.display = '';
- Effect.BlindDown('div_charge');
- $('btn_charge').value = 'Hide Charge CC';
- }
- }
- function togglePrcAdd() {
- if($('div_prc_add').style.display=='' || $('div_prc_add').style.display==undefined) {
- //$('div_charge').style.display = 'none';
- Effect.BlindUp('div_prc_add');
- $('btn_prc_add').value = 'Add Price Adjustment';
- }else if($('div_prc_add').style.display=='none') {
- //$('div_charge').style.display = '';
- Effect.BlindDown('div_prc_add');
- $('btn_prc_add').value = 'Hide Price Adjustment';
- }
- }
- //-->
- </script>
- <style type="text/css">
- a img{
- border: 0;
- }
- </style>
- <span id="productspan">
- <table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="">
- <?php if($isprinter && @$invoiceheader != ""){ ?>
- <tr>
- <td colspan="6"><?php print $invoiceheader?></td>
- </tr>
- <?php } ?>
- <tr <? if(!empty($alldata["ordEID"])) echo 'bgcolor="#FA6561"'?>>
- <td colspan="6" align="center"><strong><?php print $xxOrdNum . " " . $alldata["ordID"] . "<br /><br />" . date($dateformatstr, $alldata["ordDate"]) . " " . date("H:i", $alldata["ordDate"])?></strong></td>
- </tr>
- <?php if($isprinter && @$invoiceaddress != ""){ ?>
- <tr>
- <td colspan="6"><?php print $invoiceaddress?></td>
- </tr>
- <?php } ?>
- <?php if(trim(@$extraorderfield1)!=""){ ?>
- <tr>
- <td width="23%" align="right"><strong><?php print $extraorderfield1 ?>:</strong></td>
- <td align="left" colspan="5"><?php print editfunc($alldata["ordExtra1"],"ordextra1",25)?></td>
- </tr>
- <?php } ?>
- <tr>
- <td width="23%" align="right"><strong><?php print $xxName?>:</strong></td>
- <td colspan="3" align="left"><?php print editfunc($alldata["ordName"],"name",25)?></td>
- <td width="25%" align="right">
- <strong><?php print $xxEmail?>:</strong></td>
- <td width="24%" align="left"><?php
- if($isprinter || $doedit) print editfunc($alldata["ordEmail"],"email",25); else print '<a href="mailto:' . $alldata["ordEmail"] . '">' . $alldata["ordEmail"] . '</a>';?></td>
- </tr>
- <tr>
- <td align="right"><strong><?php print $xxAddress?>:</strong></td>
- <td colspan="3" align="left"<?php if(@$useaddressline2==TRUE) print ' colspan="3"'?>><?php print editfunc($alldata["ordAddress"],"address",25)?></td>
- <?php if(@$useaddressline2==TRUE){ ?>
- </tr>
- <tr>
- <td align="right"><strong><?php print $xxAddress2?>:</strong></td>
- <td colspan="3" align="left"><?php print editfunc($alldata["ordAddress2"],"address2",25)?></td>
- <?php } ?>
- <td align="right"><strong><?php print $xxCity?>:</strong></td>
- <td align="left"><?php print editfunc($alldata["ordCity"],"city",25)?></td>
- </tr>
- <tr>
- <td align="right"><strong><?php print $xxAllSta?>:</strong></td>
- <td align="left"><?php print editfunc($alldata["ordState"],"state",25)?></td>
- <td align="right"><strong>APO/PO:</strong></td>
- <td align="left"><input <?php if (!(strcmp($alldata["ordPoApo"],1))) {echo "checked=\"checked\"";} ?> <? if($doedit) echo ''; else echo 'disabled="disabled"'; ?> name="APO" type="checkbox" value="1" /></td>
- <td align="right"><strong><?php print $xxCountry?>:</strong></td>
- <td align="left"><?php
- if($doedit){
- $foundmatch=FALSE;
- print '<select name="country" size="1">';
- $sSQL = "SELECT countryName,countryTax,countryOrder FROM countries ORDER BY countryOrder DESC, countryName";
- $result = mysql_query($sSQL) or print(mysql_error());
- while($rs2 = mysql_fetch_array($result)){
- print '<option value="' . str_replace('"','"',$rs2["countryName"]) . '"';
- if($alldata["ordCountry"]==$rs2["countryName"]){
- print ' selected';
- $foundmatch=TRUE;
- $countrytaxrate=$rs2["countryTax"];
- $countryorder=$rs2["countryOrder"];
- }
- print '>' . $rs2["countryName"] . "</option>\r\n"; }
- mysql_free_result($result);
- if(! $foundmatch) print '<option value="' . str_replace('"','"',$alldata["ordCountry"]) . '" selected>' . $alldata["ordCountry"] . "</option>\r\n";
- print '</select>';
- if($countryorder==2){
- $sSQL = "SELECT stateTax FROM states WHERE stateAbbrev='" . mysql_real_escape_string($alldata["ordState"]) . "'";
- $result = mysql_query($sSQL) or print(mysql_error());
- if($rs2 = mysql_fetch_array($result))
- $statetaxrate = $rs2["stateTax"];
- }
- if($alldata["ordStateTax"]==0)$statetaxrate=0;
- }else
- print $alldata["ordCountry"];?></td>
- </tr>
- <tr>
- <td align="right"><strong><?php print $xxZip?>:</strong></td>
- <td colspan="3" align="left"><?php print editfunc($alldata["ordZip"],"zip",15)?></td>
- <td align="right"><strong><?php print $xxPhone?>:</strong></td>
- <td align="left"><?php print editfunc($alldata["ordPhone"],"phone",25)?></td>
- </tr>
- <?php if(trim(@$extraorderfield2)!=""){ ?>
- <tr>
- <td align="right"><strong><?php print @$extraorderfield2 ?>:</strong></td>
- <td align="left" colspan="5"><?php print editfunc($alldata["ordExtra2"],"ordextra2",25)?></td>
- </tr>
- <?php } ?>
- <?php if(! $isprinter){ ?>
- <tr>
- <td align="right"><strong>IP Address:</strong></td>
- <td colspan="3" align="left"><?php print editfunc($alldata["ordIP"],"ipaddress",15)?></td>
- <td align="right"><strong><?php print $yyAffili?>:</strong></td>
- <td align="left"><?php print editfunc($alldata["ordAffiliate"],"PARTNER",15)?></td>
- </tr>
- <?php }
- if(trim($alldata["ordDiscountText"])!=""){ ?>
- <tr>
- <td align="right" valign="top"><strong><?php print $xxAppDs?>:</strong></td>
- <td align="left" colspan="5"><?php print editfunc($alldata["ordDiscountText"],"discounttext",25)?></td>
- </tr>
- <?php }
- if(trim($alldata["ordShipName"]) != "" || trim($alldata["ordShipAddress"]) != "" || trim($alldata["ordShipCity"]) != "" || $doedit){ ?>
- <tr>
- <td align="center" colspan="6"><strong><?php print $xxShpDet?>.</strong></td>
- </tr>
- <tr>
- <td align="right"><strong><?php print $xxName?>:</strong></td>
- <td align="left" colspan="5"><?php print editfunc($alldata["ordShipName"],"sname",25)?></td>
- </tr>
- <tr>
- <td align="right"><strong><?php print $xxAddress?>:</strong></td>
- <td colspan="3" align="left"<?php if(@$useaddressline2==TRUE) print ' colspan="3"'?>><?php print editfunc($alldata["ordShipAddress"],"saddress",25)?></td>
- <?php if(@$useaddressline2==TRUE){ ?>
- </tr>
- <tr>
- <td align="right"><strong><?php print $xxAddress2?>:</strong></td>
- <td colspan="3" align="left"><?php print editfunc($alldata["ordShipAddress2"],"saddress2",25)?></td>
- <?php } ?>
- <td align="right"><strong><?php print $xxCity?>:</strong></td>
- <td align="left"><?php print editfunc($alldata["ordShipCity"],"scity",25)?></td>
- </tr>
- <tr>
- <td align="right"><strong><?php print $xxAllSta?>:</strong></td>
- <td align="left"><?php print editfunc($alldata["ordShipState"],"sstate",25)?></td>
- <td align="right"><strong>APO/PO:</strong></td>
- <td align="left"><input name="ShipAPO" type="checkbox" id="ShipAPO" value="1" <?php if (!(strcmp($alldata["ordShipPoApo"],1))) {echo "checked=\"checked\"";} ?> <? if($doedit) echo ''; else echo 'disabled="disabled"'; ?>></td>
- <td align="right"><strong><?php print $xxCountry?>:</strong></td>
- <td align="left"><?php
- if($doedit){
- if(trim($alldata["ordShipName"]) != "" || trim($alldata["ordShipAddress"]) != "") $usingshipcountry=TRUE; else $usingshipcountry=FALSE;
- $foundmatch=FALSE;
- print '<select name="scountry" size="1">';
- $sSQL = "SELECT countryName,countryTax,countryOrder FROM countries ORDER BY countryOrder DESC, countryName";
- $result = mysql_query($sSQL) or print(mysql_error());
- while($rs2 = mysql_fetch_array($result)){
- print '<option value="' . str_replace('"','"',$rs2["countryName"]) . '"';
- if($alldata["ordShipCountry"]==$rs2["countryName"]){
- print ' selected';
- $foundmatch=TRUE;
- if($usingshipcountry) $countrytaxrate=$rs2["countryTax"];
- $countryorder=$rs2["countryOrder"];
- }
- print '>' . $rs2["countryName"] . "</option>\r\n"; }
- mysql_free_result($result);
- if(! $foundmatch) print '<option value="' . str_replace('"','"',$alldata["ordShipCountry"]) . '" selected>' . $alldata["ordShipCountry"] . "</option>\r\n";
- print '</select>';
- if($countryorder==2 && $usingshipcountry){
- $sSQL = "SELECT stateTax FROM states WHERE stateName='" . mysql_real_escape_string($alldata["ordShipState"]) . "'";
- $result = mysql_query($sSQL) or print(mysql_error());
- if($rs2 = mysql_fetch_array($result))
- $statetaxrate = $rs2["stateTax"];
- }
- }else
- print $alldata["ordShipCountry"]?></td>
- </tr>
- <tr>
- <td align="right"><strong><?php print $xxZip?>:</strong></td>
- <td align="left" colspan="5"><?php print editfunc($alldata["ordShipZip"],"szip",15)?></td>
- </tr>
- <?php }
- if($alldata["ordShipType"] != "" || $alldata["ordComLoc"]>0 || $doedit){ ?>
- <tr>
- <td align="right"><strong><?php print $xxShpMet?>:</strong></td>
- <td colspan="3" align="left"><?php
- if($doedit && $alldata["ordStatus"]<=3){
- print editfunc($alldata["ordShipType"],"shipmethod",25);?>
- <a href="javascript:void(0);" onclick="$('shipmethod').value='Standard';">Standard</a> <a href="javascript:void(0);" onclick="$('shipmethod').value='FedEx Express';">FedEx</a> <a href="javascript:void(0);" onclick="$('shipmethod').value='International';">Int</a>
- <? }else{
- echo $alldata["ordShipType"].'<input type="hidden" name="shipmethod" value="'.$alldata["ordShipType"].'" />';
- }
- if(! $doedit && ($alldata["ordComLoc"]&2)==2) print $xxWtIns?>
- </td>
- <td align="right"><strong><?php print $xxCLoc?>:</strong></td>
- <td align="left"><?php if($doedit){
- print '<select name="commercialloc" size="1">';
- print '<option value="N">' . $yyNo . '</option>';
- print '<option value="Y"' . (($alldata["ordComLoc"]&1)==1 ? ' selected' : '') . '>' . $yyYes . '</option>';
- print '</select>';
- }else{
- if(($alldata["ordComLoc"]&1)==1) print $yyYes; else print $yyNo;
- }?></td>
- </tr>
- <?php if($doedit){ ?>
- <tr>
- <td align="right"><strong><?php print $xxShpIns?>:</strong></td>
- <td align="left" colspan="5"><?php
- print '<select name="wantinsurance" size="1">';
- print '<option value="N">' . $yyNo . '</option>';
- print '<option value="Y"' . (($alldata["ordComLoc"]&2)==2 ? ' selected' : '') . '>' . $yyYes . '</option>';
- print '</select>';
- ?></td>
- </tr>
- <?php }
- }
- $ordAuthNumber = trim($alldata["ordAuthNumber"]);
- $ordTransID = trim($alldata["ordTransID"]);
- if(! $isprinter && ($ordAuthNumber != "" || $ordTransID != "" || $doedit)){ ?>
- <tr>
- <td align="right"><strong><?php print $yyAutCod?>:</strong></td>
- <td colspan="3" align="left"><?php print editfunc($ordAuthNumber,"ordAuthNumber",15) ?></td>
- <td align="right"><strong><?php print $yyTranID?>:</strong></td>
- <td align="left"><?php print editfunc($ordTransID,"ordTransID",15) ?></td>
- </tr>
- <?php }
- // BOL#s ADDED BY CHAD JUL 27,06
- $sql_bol = "SELECT * FROM bol WHERE ordID = " . $alldata["ordID"];
- $res_bol = mysql_query($sql_bol) or print(mysql_error());
- if(mysql_num_rows($res_bol) > 0) {
- $row_bol = mysql_fetch_assoc($res_bol);
- ?>
- <tr>
- <td align="right"><strong>Express BOL#:</strong></td>
- <td colspan="3"><?=$row_bol['exBOL']?></td>
- <?php
- if(!empty($row_bol['smBOL'])) {
- ?>
- <td align="right"><strong>Smart Mail BOL#:</strong></td>
- <td><?=$row_bol['smBOL']?></td>
- <?php
- }
- if(!empty($row_bol['gmBOL'])) {
- ?>
- <td align="right"><strong>Global Mail BOL#:</strong></td>
- <td><?=$row_bol['gmBOL']?></td>
- <?php
- }
- ?>
- </tr>
- <?php
- }
- // ADD ENDED
- $ordAddInfo = Trim($alldata["ordAddInfo"]);
- if($ordAddInfo != "" || $doedit){ ?>
- <tr>
- <td align="right" valign="top"><strong><?php print $xxAddInf?>:</strong></td>
- <td align="left" colspan="5"><?php
- if($doedit)
- print '<textarea name="ordAddInfo" cols="50" rows="4" wrap=virtual>' . $ordAddInfo . '</textarea>';
- else
- print str_replace(array("\r\n","\n"),array("<br />","<br />"),$ordAddInfo); ?></td>
- </tr>
- <?php }
- if(! $isprinter){
- if(! $doedit) print '<form method="post" action="/admin/orders.php"><input type="hidden" name="updatestatus" value="1" /><input type="hidden" name="orderid" value="' . @$_GET["id"] . '" />';
- ?>
- <tr>
- <td align="right" valign="top"><strong><?php print $yyStaInf?>:</strong></td>
- <td align="left" colspan="5"><textarea name="ordStatusInfo" cols="50" rows="4" wrap="virtual"><?php print $alldata["ordStatusInfo"]?></textarea>
- <?php if(! $doedit) print '<input type="submit" value="' . $yyUpdate . '" />'?></td>
- </tr>
- <? if($doedit) { ?>
- <tr>
- <td align="right" valign="top"><strong><?php print $yySupInf?>:</strong></td>
- <td align="left" colspan="5"><textarea name="ordSupportInfo" cols="50" rows="4" wrap="virtual"><?php print $alldata["ordSupportInfo"]?></textarea>
- <?php if(! $doedit) print '<input type="submit" value="' . $yyUpdate . '" />'?></td>
- </tr>
- <? } ?>
- <?php if(($alldata["ordPayProvider"]==3 || $alldata["ordPayProvider"]==13) && $alldata["ordAuthNumber"] != ""){ ?>
- <!--<tr>
- <td align="center" colspan="6">
- <input type="button" value="Capture Funds" onclick="javascript:openemailpopup('oid=<?php print $alldata["ordID"]?>')" /> </td>
- </tr>-->
- <?php }
- if(! $doedit) print '</form>';
- if((int)$alldata["ordPayProvider"]==10){ ?>
- <tr>
- <td align="center" colspan="6"><hr width="50%" />
- </td>
- </tr>
- <?php if(@$_SERVER["HTTPS"] != "on" && (@$_SERVER["SERVER_PORT"] != "443") && @$nochecksslserver != TRUE){ ?>
- <tr>
- <td align="center" colspan="6"><strong><font color="#FF0000">You do not appear to be viewing this page on a secure (https) connection. Credit card information cannot be shown.</font></strong></td>
- </tr>
- <?php }else{
- $ordCNum = $alldata["ordCNum"];
- if($ordCNum != ""){
- $cnumarr = "";
- $encryptmethod = strtolower(@$encryptmethod);
- if($encryptmethod=="none"){
- $cnumarr = explode("&",$ordCNum);
- }elseif($encryptmethod=="mcrypt"){
- if(@$mcryptalg == "") $mcryptalg = MCRYPT_BLOWFISH;
- $td = mcrypt_module_open($mcryptalg, '', 'cbc', '');
- $thekey = @$ccencryptkey;
- $thekey = substr($thekey, 0, mcrypt_enc_get_key_size($td));
- $cnumarr = explode(" ", $ordCNum);
- $iv = @$cnumarr[0];
- $iv = @pack("H" . strlen($iv), $iv);
- $ordCNum = @pack("H" . strlen(@$cnumarr[1]), @$cnumarr[1]);
- mcrypt_generic_init($td, $thekey, $iv);
- $cnumarr = explode("&", mdecrypt_generic($td, $ordCNum));
- mcrypt_generic_deinit($td);
- mcrypt_module_close($td);
- }else{
- print '<tr><td colspan="4">WARNING: $encryptmethod is not set. Please see http://www.ecommercetemplates.com/phphelp/ecommplus/parameters.asp#encryption</td></tr>';
- }
- } ?>
- <tr>
- <td align="right" colspan="4"><strong><?php print $xxCCName?>:</strong></td>
- <td align="left" colspan="2"><?php
- if(@$encryptmethod!=""){
- if(is_array(@$cnumarr)) print URLDecode(@$cnumarr[4]);
- } ?></td>
- </tr>
- <tr>
- <td align="right" colspan="4"><strong><?php print $yyCarNum?>:</strong></td>
- <td align="left" colspan="2"><?php
- if($ordCNum != ""){
- if(is_array($cnumarr)) print $cnumarr[0];
- }else{
- print "(no data)";
- } ?></td>
- </tr>
- <tr>
- <td align="right" colspan="4"><strong><?php print $yyExpDat?>:</strong></td>
- <td align="left" colspan="2"><?php
- if(@$encryptmethod!=""){
- if(is_array(@$cnumarr)) print @$cnumarr[1];
- } ?></td>
- </tr>
- <tr>
- <td align="right" colspan="4"><strong>CVV Code:</strong></td>
- <td align="left" colspan="2"><?php
- if(@$encryptmethod!=""){
- if(is_array(@$cnumarr)) print @$cnumarr[2];
- } ?></td>
- </tr>
- <tr>
- <td align="right" colspan="4"><strong>Issue Number:</strong></td>
- <td align="left" colspan="2"><?php
- if(@$encryptmethod!=""){
- if(is_array(@$cnumarr)) print @$cnumarr[3];
- } ?></td>
- </tr>
- <?php if($ordCNum != "" && !$doedit){ ?>
- <form method="post" action="/admin/orders.php?id=<?php print $_GET["id"]?>">
- <input type="hidden" name="delccdets" value="<?php print $_GET["id"]?>" />
- <tr>
- <td align="center" colspan="6"><input name="submit" type="submit" value="<?php print $yyDelCC?>" /></td>
- </tr>
- </form>
- <?php }
- }
- }
- } // isprinter ?>
- <tr>
- <td align="center" colspan="6"> <br /></td>
- </tr>
- </table>
- <tr>
- <table width="100%" border="1" cellspacing="0" cellpadding="4" bordercolor="#999999" style="border-collapse: collapse">
- <tr>
- <td><strong><?php print $xxPrId?></strong></td>
- <td><strong><?php print $xxPrNm?></strong></td>
- <td><strong><?php print $xxPrOpts?></strong></td>
- <td><strong><?php print $xxQuant?></strong></td>
- <td><strong> </strong></td>
- <?php if($doedit) print '<td align="center"><strong>DEL</strong></td>' ?>
- </tr>
- <?php
- $totoptpricediff = 0;
- if(mysql_num_rows($allorders)>0){
- $totoptpricediff = 0;
- $rowcounter=0;
- while($rsOrders = mysql_fetch_assoc($allorders)){
- $optpricediff = 0;
- ?>
- <tr>
- <td valign="top" nowrap><?php if($doedit) print '<input type="button" value="..." onclick="updateoptions(' . $rowcounter . ')"> <input type="hidden" name="cartid' . $rowcounter . '" value="' . str_replace('"','"',$rsOrders["cartID"]) . '" />'?><strong><?php print editfunc($rsOrders["cartProdId"],'prodid' . $rowcounter,18)?></strong></td>
- <td valign="top">
- <?php print editfunc($rsOrders["cartProdName"],'prodname' . $rowcounter,24)?><br />
- <?
- $sql_cert="SELECT cert_id,cert_code FROM certificates WHERE cert_order_id=".$_GET["id"]." AND cert_prod_id='".$rsOrders["cartProdId"]."'";
- //echo $sql_cert;
- $result_cert=mysql_query($sql_cert);
- if(mysql_num_rows($result_cert)>0) {
- while($row_cert=mysql_fetch_assoc($result_cert)){?>
- <stong>(<?=$row_cert['cert_code']?>)</strong> <a href="/admin/certs.php?mode=1&sbcode=<?=$row_cert['cert_id']?>">view</a> | <a href="/admin/certs.php?mode=2&sbcode=<?=$row_cert['cert_id']?>">history</a><br />
- <? }
- }?>
- <?
- $sql_down="SELECT * FROM digitaldownloads WHERE orderID=".$_GET["id"]." AND type='".$rsOrders["cartProdId"]."'";
- //echo $sql_cert;
- $result_down=mysql_query($sql_down);
- if(mysql_num_rows($result_down)>0) {?>
- <ol style="margin:2px;">
- <? while($row_down=mysql_fetch_assoc($result_down)){?>
-
- <li style="margin:1px; font-weight:bold;">License ID: <?=$row_down['licenseID']?><br />
- Password: <?=$row_down['password']?></li>
- <? } ?>
- </ol>
- <? }?> </td>
- <td valign="top"><?php
- if($doedit) print '<span id="optionsspan' . $rowcounter . '">';
- $sSQL = "SELECT coOptGroup,coCartOption,coPriceDiff,coOptID,optGroup,optStyleID,coExtendShipping,ui.display_image,ui.org_img_name FROM cartoptions LEFT JOIN options ON cartoptions.coOptID=options.optID LEFT JOIN uploaded_images ui ON cartoptions.coCartOption=ui.id WHERE coCartID=" . $rsOrders["cartID"] . " ORDER BY coID";
- $result = mysql_query($sSQL) or print(mysql_error());
- if(mysql_num_rows($result) > 0){
- if($doedit) print '<table border="0" cellspacing="0" cellpadding="1" width="100%">';
- while($rs2 = mysql_fetch_array($result)){
- $imgsrc='';
- $imgname='';
- if(!empty($rs2["display_image"])) {
- $imgsrc='<br /><img src="/imguploads/img_screen/'.$rs2["display_image"].'.gif" align="top"><div style="font-size:9px;">(If the image does not appear there is a problem with the custom screen upload)</div>';
- $imgname='<br /> -Image Name: '.$rs2["org_img_name"];
- }
- if($doedit){
- print '<tr><td align="right"><strong>' . $rs2["coOptGroup"] . ':</strong></td><td>';
- if(is_null($rs2["optGroup"])){
- print 'xxxxxx';
- }else{
- $sSQL="SELECT optID," . getlangid("optName",32) . ",optPriceDiff,optType,optFlags,optStock,optPriceDiff AS optDims FROM options INNER JOIN optiongroup ON options.optGroup=optiongroup.optGrpID WHERE optGroup=" . $rs2["optGroup"] . ' ORDER BY optID';
- $result2 = mysql_query($sSQL) or print(mysql_error());
- if($rsl = mysql_fetch_assoc($result2)){
- if(abs($rsl["optType"])==2){
- print '<select onchange="dorecalc(true)" name="optn' . $rowcounter . '_' . $rs2["coOptID"] . '" id="optn' . $rowcounter . '_' . $rs2["coOptID"] . '" size="1">';
- do {
- print '<option value="' . $rsl["optID"] . "|" . (($rsl["optFlags"] & 1) == 1 ? ($rsOrders["cartProdPrice"]*$rsl["optPriceDiff"])/100.0 : $rsl["optPriceDiff"]) . '"';
- if($rsl["optID"]==$rs2["coOptID"]) print ' selected';
- print '>' . $rsl[getlangid("optName",32)];
- if((double)$rsl["optPriceDiff"] != 0){
- print ' ';
- if((double)$rsl["optPriceDiff"] > 0) print '+';
- if(($rsl["optFlags"] & 1) == 1)
- print number_format(($rsOrders["cartProdPrice"]*$rsl["optPriceDiff"])/100.0,2,'.','');
- else
- print number_format($rsl["optPriceDiff"],2,'.','');
- }
- print '</option>';
- } while($rsl = mysql_fetch_array($result2));
- print '</select>';
- }else{
- print "<input type='hidden' name='optn" . $rowcounter . '_' . $rs2["coOptID"] . "' value='" . $rsl["optID"] . "' /><textarea wrap='virtual' name='voptn" . $rowcounter . '_' . $rs2["coOptID"] . "' id='voptn". $rowcounter. '_' . $rs2["coOptID"] . "' cols='30' rows='3'>";
- print $rs2["coCartOption"] . '</textarea>';
- }
- }
- }
- print "</td></tr>";
- }else{
- $extend_shipping='';
- if(!empty($rs2["coExtendShipping"])) $extend_shipping=' <span style="color:#FF0000;font-weight:bold;">(This option increases shipping time by '.$rs2["coExtendShipping"]. ' days)</span>';
- print '<strong>' . $rs2["coOptGroup"] . ':</strong> ' . str_replace(array("\r\n","\n"),array("<br />","<br />"),$rs2["coCartOption"]).' ' .$imgname.' '.$imgsrc.$cert_code. $extend_shipping . '<br />';
- }
- if($doedit)
- $optpricediff += $rs2["coPriceDiff"];
- else
- $rsOrders["cartProdPrice"] += $rs2["coPriceDiff"];
- }
- if($doedit) print '</table>';
- }else{
- print '-';
- }
- mysql_free_result($result);
- if($doedit) print '</span>' ?></td>
- <td valign="top"><?php print editfunc($rsOrders["cartQuantity"],'quant' . $rowcounter . '" onchange="dorecalc(true)',5)?></td>
- <td valign="top"><?php /*?><?php if($doedit) print editnumeric($rsOrders["cartProdPrice"],'price' . $rowcounter . '" onchange="dorecalc(true)',7); else print FormatEuroCurrency($rsOrders["cartProdPrice"]*$rsOrders["cartQuantity"])?>
- <?php if($doedit){
- print '<input type="hidden" id="optdiffspan' . $rowcounter . '" value="' . $optpricediff . '">';
- $totoptpricediff += ($optpricediff*$rsOrders["cartQuantity"]);
- }
- ?><?php */?></td>
- <?php if($doedit) print '<td align="center"><input type="checkbox" name="del_' . $rowcounter . '" id="del_' . $rowcounter . '" value="yes" /></td>' ?>
- </tr>
- <?php $rowcounter++;
- }
- }
- ?>
- <!--NEXTPRODUCTCOMMENT-->
- <?php /*?><?php if($doedit){ ?>
- <tr>
- <td align="right" colspan="4">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td align="center"><?php if($doedit) print '<input style="width:30px;" type="button" value="-" onclick="extraproduct(\'-\')"> ' . $yyMoProd . ' <input style="width:30px;" type="button" value="+" onclick="extraproduct(\'+\')"> <input type="button" value="' . $yyRecal . '" onclick="dorecalc(false)">'?></td>
- <td align="right"><strong>Options Total:</strong></td>
- </tr>
- </table></td>
- <td align="left" colspan="2"><span id="optdiffspan"><?php print number_format($totoptpricediff, 2, '.', '')?></span></td>
- </tr>
- <?php } ?>
- <tr>
- <td align="right" colspan="4"><strong><?php print $xxOrdTot?>:</strong></td>
- <td align="left"><div id="ordTot"><?php echo sprintf("%.2f",$alldata["ordTotal"]); ?></div><input name="ordtotal" id="ordtotal" type="hidden" value="<?php echo $alldata["ordTotal"] ?>" /></td>
- <?php if($doedit) print '<td align="center"> </td>' ?>
- </tr>
- <?php
- $runTot = $alldata["ordTotal"];
- $sql = "SELECT * FROM price_adj WHERE ordID = " . $_GET['id'] . " ORDER BY ordering";
- $res = mysql_query($sql) or print(mysql_error());
- if(mysql_num_rows($res) > 0) {
- $k=1;
- $prcTot = 0;
- ?>
- <tr>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- <?php
- while($row=mysql_fetch_assoc($res)) {
- $price = 0;
- $disp_price = 0;
- $amount = '';
-
- if($row['type'] == 'credit') {
- if($row['amt_type'] == 'percentage') {
- $price = $runTot * ($row['amt'] * .01);
- $runTot -= $price;
- $prcTot -= $price;
- $disp_price = '-'.(int)$row['amt'].'%';
- $amount = '-'.money_format("%!.2n",$price);
- }else{
- $price = '$-'.money_format("%!.2n",$row['amt']);
- $runTot -= $row['amt'];
- $prcTot -= $row['amt'];
- $disp_price = $price;
- $amount = '-'.money_format("%!.2n",$row['amt']);
- }
- }else{
- if($row['amt_type'] == 'percentage') {
- $price = $runTot * ($row['amt'] * .01);
- $runTot += $price;
- $prcTot += $price;
- $disp_price = (int)$row['amt'].'%';
- $amount = money_format("%.2n",$price);
- }else{
- $price = money_format("%.2n",$row['amt']);
- $runTot += $row['amt'];
- $prcTot += $row['amt'];
- $disp_price = $price;
- $amount = money_format("%.2n",$row['amt']);
- }
- }
- ?>
- <tr>
- <td colspan="3" style="font-weight: bold; text-align: right">Price Adjustment <?=$k?>:</td>
- <td align="left"<?=(strstr($disp_price,"-"))?' style="color: red"':''?>><?=$disp_price?></td>
- <td align="left"<?=(strstr($disp_price,"-"))?' style="color: red"':''?>><?=$amount?></td>
- </tr>
- <?php
- $k++;
- }
- ?>
- <tr>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- <?php
- }
- ?>
- <?php if((double)$alldata["ordShipping"]!=0.0 || $doedit){ ?>
- <tr>
- <td align="right" colspan="4"><strong><?php print $xxShippg?>:</strong></td>
- <td align="left"><?php print editnumeric($alldata["ordShipping"],"ordShipping",7)?></td>
- <?php if($doedit) print '<td align="center"> </td>' ?>
- </tr>
- <?php }
- if((double)$alldata["ordHandling"]!=0.0 || $doedit){ ?>
- <tr>
- <td align="right" colspan="4"><strong><?php print $xxHndlg?>:</strong></td>
- <td align="left"><?php print editnumeric($alldata["ordHandling"],"ordHandling",7)?></td>
- <?php if($doedit) print '<td align="center"> </td>' ?>
- </tr>
- <?php }
- if((double)$alldata["ordDiscount"]!=0.0 || $doedit){ ?>
- <tr>
- <td align="right" colspan="4"><strong><?php print $xxDscnts?>:</strong></td>
- <td align="left"><font color="#FF0000"><?php print editnumeric($alldata["ordDiscount"],"ordDiscount",7)?></font></td>
- <?php if($doedit) print '<td align="center"> </td>' ?>
- </tr>
- <?php }
- if((double)$alldata["ord_cert_amt"]!=0.0 || $doedit){
- $sqlcert="SELECT cert_code FROM certificates WHERE cert_id=".$alldata["ord_cert_id"];
- $resultcert=mysql_query($sqlcert);
- $rowcert=mysql_fetch_assoc($resultcert);
- ?>
- <tr>
- <td align="right" colspan="4"><strong><?='('.$rowcert["cert_code"].')'?> <?php print $xxGCerts?>:</strong></td>
- <td align="left"><font color="#FF0000"><?php print editnumeric($alldata["ord_cert_amt"],"ord_cert_amt",7)?></font></td>
- <?php if($doedit) print '<td align="center"> </td>' ?>
- </tr>
- <?php }
- if((double)$alldata["ordStateTax"]!=0.0 || $doedit){ ?>
- <tr>
- <td align="right" colspan="4"><strong><?php print $xxStaTax?>:</strong></td>
- <td align="left"><?php print editnumeric($alldata["ordStateTax"],"ordStateTax",7)//$alldata["ordStateTax"]?></td>
- <?php if($doedit) print '<td align="center" nowrap><input type="text" name="staterate" id="staterate" size="1" value="' . $statetaxrate . '">%</td>' ?>
- </tr>
- <?php }
- if((double)$alldata["ordCountryTax"]!=0.0 || $doedit){ ?>
- <tr>
- <td align="right" colspan="4"><strong><?php print $xxCntTax?>:</strong></td>
- <td align="left"><?php print editnumeric($alldata["ordCountryTax"],"ordCountryTax",7)?></td>
- <?php if($doedit) print '<td align="center" nowrap><input type="text" name="countryrate" id="countryrate" size="1" value="' . $countrytaxrate . '">%</td>' ?>
- </tr>
- <?php }
- if((double)$alldata["ordHSTTax"]!=0.0 || ($doedit && @$canadataxsystem)){ ?>
- <tr>
- <td align="right" colspan="4"><strong><?php print $xxHST?>:</strong></td>
- <td align="left"><?php print editnumeric($alldata["ordHSTTax"],"ordHSTTax",7)?></td>
- <?php if($doedit) print '<td align="center" nowrap><input type="text" name="hstrate" id="hstrate" size="1" value="' . $hsttaxrate . '">%</td>' ?>
- </tr>
- <?php } ?>
- <tr>
- <td align="right" colspan="4"><strong><?php print $xxGndTot?>:</strong></td>
- <td align="left"><span id="grandtotalspan"><?php print FormatEuroCurrency(($alldata["ordTotal"]+$alldata["ordStateTax"]+$alldata["ordCountryTax"]+$alldata["ordHSTTax"]+$alldata["ordShipping"]+$alldata["ordHandling"]+$prcTot)-$alldata["ordDiscount"]-$alldata["ord_cert_amt"])?></span></td>
- <?php if($doedit) print '<td align="center"> </td>' ?>
- </tr>
- </table>
- </span>
- </td>
- </tr>
- <?php if($isprinter && @$invoicefooter != ""){ ?>
- <tr>
- <td width="100%"><?php print $invoicefooter?></td>
- </tr>
- <?php }elseif($doedit){ ?>
- <tr>
- <td align="center" width="100%"> <br /><input type="submit" value="<?php print $yyUpdate?>" onclick="updateClicked=true; cloneClicked=false;" /> <input type="submit" name="clone" value="Clone Order" onclick="updateClicked=false; cloneClicked=true;" /><br /> </td>
- </tr>
- <?php } ?><?php */?>
- </table>
- <?php
- if($doedit) print '</form>';
- if($doedit){
- // ADDED by Chad Jun-06-06
- // PRICE ADJUSTMENTS
- ?>
-
- <h2><a name="prc_adj"></a>Price Adjustments</h2>
- <?php
- if(!empty($_GET['adj_err'])) {
- ?>
- <div style="margin: 5px auto; color: #FF0000; font-weight: bold; text-align: center"><?=$_GET['adj_err']?>
- </div>
- <?php
- }elseif(!empty($_GET['adj_msg'])) {
- ?>
- <div style="margin: 5px auto; color: #009900; font-weight: bold; text-align: center"><?=$_GET['adj_msg']?>
- </div>
- <?php
- }
- ?>
- <table width="95%" cellpadding="3" cellspacing="0" border="1" style="margin: 0 auto 5px auto; border: 1px solid #BFC9E0; border-collapse: collapse">
- <tr style="background-color: #BFC9E0; color: #194C7F">
- <th width="60" style="text-align: center">Type</th>
- <th width="80" style="text-align: center">Amount Type</th>
- <th width="80" style="text-align: center">Amount</th>
- <th width="150" style="text-align: center">Date</th>
- <th>Note</th>
- <?php
- if(strstr($_SESSION['employee']['permissions'],"all") || $_SESSION['employee']['id']==19 || $_SESSION['employee']['id']==12 || $_SESSION['employee']['id']==2) {
- ?>
- <th width="28">Edit</th>
- <th width="28">Delete</th>
- <th width="28">Move Up</th>
- <th width="28">Move Down</th>
- <?php
- }
- ?>
- </tr>
- <?php
- $sql = "SELECT * FROM price_adj WHERE ordID = " . $_GET["id"] . " ORDER BY ordering";
- $res = mysql_query($sql) or print(mysql_error());
-
- $num_rows = mysql_num_rows($res);
- if($num_rows > 0) {
- $j=0;
- while($row=mysql_fetch_assoc($res)) {
- ?>
- <tr<?=($j%0==0?'':' style="background-color: #E6E9F5"')?>>
- <td style="text-align: center"><?=$row['type']?></td>
- <td style="text-align: center"><?=$row['amt_type']?></td>
- <td style="text-align: right"><?=$row['amt']?></td>
- <td style="text-align: left"><?=date("n/j/Y g:i a",strtotime($row['date']))?></td>
- <td style="text-align: left"><?=$row['note']?></td>
- <?php
- if(strstr($_SESSION['employee']['permissions'],"all") || $_SESSION['employee']['id']==19 || $_SESSION['employee']['id']==12 || $_SESSION['employee']['id']==2) {
- ?>
- <td style="text-align: center"><a href="/admin/editprcadj.php?pa_id=<?=$row['id']?>&action=edit" onclick="window.open(this.href,'edit_txn','left=700,top=100,width=550,height=150,toolbar=0'); return false;"><img src="/lib/images/misc/edit.gif" height="24" width="24" /></a></td>
- <td style="text-align: center"><a href="/admin/editprcadj.php?pa_id=<?=$row['id']?>&action=delete" onclick="window.open(this.href,'edit_txn','left=700,top=100,width=550,height=150,toolbar=0'); return false;"><img src="/lib/images/misc/delete.gif" width="24" height="24" /></a></td>
- <td style="text-align: center"><? if($row['ordering']!=1){?><a href="/admin/mvprcadj.php?pa_id=<?=$row['id']?>&pa_ordID=<?=$row['ordID']?>&position=<?=$row['ordering']?>&action=moveup" onclick=""><img src="/lib/images/misc/arrow_up.png" width="24" height="24" /></a><? } ?></td>
- <td style="text-align: center"><? if($row['ordering']!=$num_rows){?><a href="/admin/mvprcadj.php?pa_id=<?=$row['id']?>&pa_ordID=<?=$row['ordID']?>&position=<?=$row['ordering']?>&action=movedown" onclick=""><img src="/lib/images/misc/arrow_down.png" width="24" height="24" /></a><? } ?></td>
- <?php
- }
- ?>
- </tr>
- <?php
- $j++;
- }
- }else{
- ?>
- <tr>
- <td colspan="9" style="text-align: center; font-weight: bold">No Price Adjustments Found</td>
- </tr>
- <?php
- }
- ?>
- </table>
- <?php
- if(strstr($_SESSION['employee']['permissions'],"all") || $_SESSION['employee']['id']==19 || $_SESSION['employee']['id']==12 || $_SESSION['employee']['id']==2) {
- ?>
-
- <input type="button" id="btn_prc_add" value="Add Price Adjustment" onclick="togglePrcAdd();" />
-
- <div id="div_prc_add" style="display: none">
- <form id="adj_frm" name="adj_frm" method="post" action="/admin/ordersprocess.php">
- <table cellpadding="3" cellspacing="0" border="1" style="margin: 0 auto 5px auto; border: 1px solid #BFC9E0; border-collapse: collapse">
- <tr style="background-color: #BFC9E0; color: #194C7F">
- <td colspan="2" style="text-align: center; font-weight: bold; font-size: 14px">Add Price Adjustment</td>
- </tr>
- <tr>
- <td style="font-weight: bold">Type:</td>
- <td>
- <select id="adj_type" name="adj_type">
- <option value="" selected="selected">Choose...</option>
- <option value="credit">Credit</option>
- <option value="debit">Debit</option>
- </select> </td>
- </tr>
- <tr>
- <td style="font-weight: bold">Amt Type:</td>
- <td>
- <select id="adj_amt_type" name="adj_amt_type">
- <option value="" selected="selected">Choose...</option>
- <option value="fixed">Fixed</option>
- <option value="percentage">Percentage</option>
- </select> </td>
- </tr>
- <tr>
- <td style="font-weight: bold">Amount:</td>
- <td><input id="adj_amt" name="adj_amt" type="text" value="" /></td>
- </tr>
- <tr>
- <td style="font-weight: bold">Note:</td>
- <td><textarea id="adj_note" name="adj_note"></textarea></td>
- </tr>
- <tr>
- <td colspan="2" style="text-align: center"><input type="submit" id="adj_submit" name="adj_submit" value="Add" /></td>
- </tr>
- </table>
- <input type="hidden" id="adj_ordID" name="adj_ordID" value="<?=$_GET["id"]?>" />
- <input type="hidden" id="adj_doedit" name="adj_doedit" value="<?=$_GET["doedit"]?>" />
- </form>
- </div>
- <?php
- }
- // ADD ENDED
- // ADDED by Chad Jun-05-06
- // TRANSACTIONS
- $sql = "SELECT * FROM transactions WHERE ordID = " . $_GET["id"];
- $res = mysql_query($sql) or print(mysql_error());
- ?>
- <h2><a name="aim"></a>Transactions</h2>
- <?php
- if(!empty($_GET['aim_err'])) {
- ?>
- <div style="margin: 5px auto; color: #FF0000; font-weight: bold; text-align: center"><?=$_GET['aim_err']?>
- </div>
- <?php
- }elseif(!empty($_GET['aim_msg'])) {
- ?>
- <div style="margin: 5px auto; color: #009900; font-weight: bold; text-align: center"><?=$_GET['aim_msg']?>
- </div>
- <?php
- }
- ?>
- <table width="95%" cellpadding="3" cellspacing="0" border="1" style="margin: 0 auto 5px auto; border: 1px solid #BFC9E0; border-collapse: collapse">
- <tr style="background-color: #BFC9E0; color: #194C7F">
- <th width="85" style="text-align: center">Type</th>
- <th width="60" style="text-align: right">Amount</th>
- <th width="80" style="text-align: center">TXN</th>
- <th width="120" style="text-align: left">Date</th>
- <th>Note</th>
- </tr>
- <?php
- while($row=mysql_fetch_assoc($res)) {
- ?>
- <tr>
- <td style="text-align: center"><?=$row['type']?></td>
- <td style="text-align: center"><?=money_format("%.2n",$row['amt'])?></td>
- <td style="text-align: center"><?=$row['txn']?></td>
- <td style="text-align: center"><?=date("n/j/Y g:i a",strtotime($row['date_received']))?></td>
- <td><?=$row['note']?></td>
- </tr>
- <?php
- }
- ?>
- </table>
- <?php
- if(strstr($_SESSION['employee']['permissions'],"all") || $_SESSION['employee']['id']==9 || $_SESSION['employee']['id']==12 || $_SESSION['employee']['id']==2) {
- ?>
- <input type="button" id="btn_add_txn" value="Credit or Void" onclick="toggleTXN();" />
-
- <div id="div_trans" style="display: none">
- <form id="aim_frm" name="aim_frm" method="post" action="/admin/ordersprocess.php" onsubmit="return checkAIM(this);">
- <table cellpadding="3" cellspacing="0" border="1" style="margin: 5px auto 5px auto; border: 1px solid #BFC9E0; border-collapse: collapse">
- <tr style="background-color: #BFC9E0; color: #194C7F">
- <td colspan="4" style="text-align: center; font-weight: bold; font-size: 14px">Credit or Void a Transaction</td>
- </tr>
- <tr>
- <th style="text-align: center">Type</th>
- <th style="text-align: center">TXN</th>
- <th style="text-align: center">Amount</th>
- <th>Note</th>
- </tr>
- <tr>
- <td valign="top">
- <select name="aim_type" id="aim_type">
- <option value="" selected="selected">Choose...</option>
- <option value="CREDIT">Credit</option>
- <option value="VOID">Void</option>
- </select> </td>
- <td valign="top"><input type="text" id="aim_txn" name="aim_txn" value="" autocomplete="off" /></td>
- <td valign="top"><input type="text" id="aim_amt" name="aim_amt" value="" autocomplete="off" /></td>
- <td valign="top"><textarea id="aim_note" name="aim_note"></textarea></td>
- </tr>
- <tr>
- <td colspan="4" style="text-align: right"><input type="submit" id="aim_submit" name="aim_submit" value="Submit" /></td>
- </tr>
- </table>
- <input type="hidden" id="aim_inv" name="aim_inv" value="<?=$_GET["id"]?>" />
- <?php
- $tmp = explode(" ",$alldata["ordName"]);
- ?>
- <input type="hidden" id="aim_fname" name="aim_fname" value="<?=$tmp[0]?>" />
- <input type="hidden" id="aim_lname" name="aim_lname" value="<?=(!empty($tmp[1]))?$tmp[1]:''?>" />
- <input type="hidden" id="aim_doedit" name="aim_doedit" value="<?=$_GET['doedit']?>" />
- </form>
- </div>
- <input type="button" id="btn_charge" value="Charge CC" onclick="toggleCharge();" style="display: block; margin: 5px 5px 5px 0" />
-
- <div id="div_charge" style="display: none">
- <?
- if(!empty($alldata["ordEID"])){
- $sql_eid="SELECT * FROM customers WHERE custID=".$alldata["ordEID"];
- $result_eid=mysql_query($sql_eid);
- if(mysql_num_rows($result_eid)>0){
- $row_eid=mysql_fetch_assoc($result_eid);
- }
- }
- ?>
- <form id="frmCharge" name="frmCharge" method="post" action="/admin/ordersprocess.php">
- <table cellpadding="3" cellspacing="0" border="1" style="margin: 5px auto 5px auto; border: 1px solid #BFC9E0; border-collapse: collapse">
- <tr style="background-color: #BFC9E0; color: #194C7F">
- <td colspan="2" style="font-size: 14px; font-weight: bold; text-align: center">Authorize & Capture</td>
- </tr>
- <tr>
- <td>First Name:</td>
- <td><input type="text" id="am_fname" name="am_fname" value="<?=$row_eid['Name']?>" /></td>
- </tr>
- <tr>
- <td>Last Name:</td>
- <td><input type="text" id="am_lname" name="am_lname" value="" /></td>
- </tr>
- <tr>
- <td>Address:</td>
- <td><input type="text" id="am_address" name="am_address" value="<?=$row_eid['Address']?>" /></td>
- </tr>
- <tr>
- <td>Address 2:</td>
- <td><input type="text" id="am_address2" name="am_address2" value="<?=$row_eid['Address2']?>" /></td>
- </tr>
- <tr>
- <td>City:</td>
- <td><input type="text" id="am_city" name="am_city" value="<?=$row_eid['City']?>" /></td>
- </tr>
- <tr>
- <td>State:</td>
- <td><input type="text" id="am_state" name="am_state" value="<? if(!empty($row_eid['State2'])) echo $row_eid['State2']; else echo $row_eid['State']; ?>" /></td>
- </tr>
- <tr>
- <td>Zip:</td>
- <td><input type="text" id="am_zip" name="am_zip" value="<?=$row_eid['Zip']?>" /></td>
- </tr>
- <tr>
- <td>Amount:</td>
- <td><input type="text" id="am_amt" name="am_amt" value="" autocomplete="off" /></td>
- </tr>
- <tr>
- <td>CC#:</td>
- <td><input type="text" id="am_cc_num" name="am_cc_num" value="<?=Decrypt($row_eid['ccNum'], $cart_misc)?>" autocomplete="off" /></td>
- </tr>
- <tr>
- <td>Exp. Date:</td>
- <td>
- <select id="am_exp_mon" name="am_exp_mon">
- <?
- $ccexp=explode('/',$row_eid['ccExp']);
- for($i=1; $i<=12; $i++)
- {
- if($i<10)
- $i = '0'.$i;
- if($i == $ccexp[0])
- echo '<option value="'.$i.'" selected="selected">'.$i.'</option>';
- else if(date('n') == $i )
- echo '<option value="'.$i.'" selected="selected">'.$i.'</option>';
- else
- echo '<option value="'.$i.'">'.$i.'</option>';
- }
- ?>
- </select> /
- <select id="am_exp_year" name="am_exp_year">
- <?
- $cur_year = date('Y');
- for($i=($cur_year); $i<=$cur_year+10; $i++)
- {
- if($i == $ccexp[1])
- echo '<option value="'.$i.'" selected="selected">'.$i.'</option>';
- elseif(date('Y') == $i || $i==$ccexp[1])
- echo '<option value="'.$i.'" selected="selected">'.$i.'</option>';
- else
- echo '<option value="'.$i.'">'.$i.'</option>';
- }
- ?>
- </select> </td>
- </tr>
- <tr>
- <td>CCV:</td>
- <td><input type="text" id="am_ccv" name="am_ccv" value="<?=$row_eid['ccCCV']?>" autocomplete="off" /></td>
- </tr>
- <tr>
- <td colspan="2" style="text-align: center"><input type="submit" id="am_submit" name="am_submit" value="Submit" /></td>
- </tr>
- </table>
- <input type="hidden" id="am_inv" name="am_inv" value="<?=$_GET["id"]?>" />
- <input type="hidden" id="am_type" name="am_type" value="AUTH_CAPTURE" />
- <input type="hidden" id="am_doedit" name="am_doedit" value="<?=$_GET['doedit']?>" />
- </form>
- </div>
- <?php
- }
- } // End of User permission check
- // ADDED by Chad Apr-04-06
- // LOCATION HISTORY
- $qry = "SELECT * FROM location WHERE ordID = '".$_GET["id"]."'";
- $res = mysql_query($qry) or print(mysql_error());
- ?>
- <table width="300" cellpadding="3" cellspacing="0" style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; border: 1px solid #4B1610; border-collapse: collapse">
- <tr style="border-bottom: 1px solid #4B1610">
- <td colspan="2" style="text-align: center; background-color: #4B1610; color: #FFFFFF; font-weight: bold">Location History</td>
- </tr>
- <?php
- $i=0;
- if(mysql_num_rows($res) > 0 ) {
- while($row = mysql_fetch_assoc($res)) {
- ?>
- <tr style="background-color: #<?=($i%2==0)?'903E36':'903E36'?>; border-bottom: 1px solid #4B1610">
- <td width="50%" style="color: #FFFFFF"><?=$row['location']?></td>
- <td style="color: #FFFFFF"><?=$row['stamp']?></td>
- </tr>
- <?php
- $i++;
- }
- }else{
- ?>
- <tr>
- <td colspan="2" style="text-align: center">No location found</td>
- </tr>
- <?php
- }
- ?>
- </table>
- <?php
- // ADD ENDED
-
- // ADDED by Chad Apr-04-06
- // FEDEX TRACKING
- $qry = "SELECT * FROM fedex WHERE ordID = '".$_GET["id"]."'";
- $res = mysql_query($qry);
- if(mysql_num_rows($res) > 0) {
- $row = mysql_fetch_assoc($res);
- $trackNum = $row['trackNum'];
- if(!empty($trackNum)) {
- include(DOCROOT.'includes/fedex/fedexdc.php');
- $fed = new FedExDC();
- $track_Ret = $fed->track(
- array(
- '1537' => $trackNum, //Tracking Number
- '1534' =>'Y' // detail_scan_indicator (Show me all the tracking data)
- )
- );
-
- $ctr = 0;
- $hasChanged = false;
- $isDelivered = false;
- for($i=1; $i<=$track_Ret[1584]; $i++) {
- // See Customer Service Page for displaying results
- ?>
- <div style="margin: 10px auto; border: 2px solid #2C578A; width: 550px">
- <table align="center" width="550" border="0" cellpadding="3" cellspacing="0" style="font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif">
- <tr>
- <th colspan="2" style="font-size: 18px; background-color: #2C578A; color: #FFF; font-weight: bold; text-align: left">Fed<span style="margin-left: -3px; color: #FF6600">Ex</span></th>
- <th colspan="3" style="font-size: 14px; text-align: right; background-color: #2C578A; color: #FFF; font-weight: bold">Tracking# <?=$trackNum?></th>
- </tr>
- <?php
- if(!empty($track_Ret['1339-'.$i]))
- {
- $tmp_date = $track_Ret['1339-'.$i];
- $est_del = substr($tmp_date,0,4).'-'.substr($tmp_date,4,2).'-'.substr($tmp_date,6,2);
- ?>
- <tr>
- <td colspan="5" style="background-color: #2C578A; height: 15px"> </td>
- </tr>
- <tr>
- <td colspan="5" style="background-color: #DFE7FF"><strong>Estimated Delivery Date:</strong> <?=date('M j, Y',strtotime($est_del))?></td>
- </tr>
- <?php
- }
- ?>
- <tr>
- <th align="left" width="150" colspan="2" style="background-color: #2C578A; color: #FFF; font-weight: bold">Date/Time</th>
- <th align="left" style="background-color: #2C578A; color: #FFF; font-weight: bold">Activity</th>
- <th align="left" style="background-color: #2C578A; color: #FFF; font-weight: bold">Location</th>
- <th align="left" style="background-color: #2C578A; color: #FFF; font-weight: bold">Details</th>
- </tr>
- <?php
- for($j=1; $j<=$track_Ret['1715-'.$i]; $j++)
- {
- $date = $track_Ret['1162-'.$i.'-'.$j];
- $year = substr($date,0,4);
- $mon = substr($date,4,2);
- $day = substr($date,6,2);
- $hrs = substr($track_Ret['1163-'.$i.'-'.$j],0,2);
- $min = substr($track_Ret['1163-'.$i.'-'.$j],2,2);
- $sec = substr($track_Ret['1163-'.$i.'-'.$j],4,2);
-
- $date = $year.'-'.$mon.'-'.$day.' '.$hrs.':'.$min.':'.$sec;
- $unixDate = strtotime($date);
-
- if(empty($track_Ret['1161-'.$i.'-'.$j]))
- {
- $state = $track_Ret['1164-'.$i.'-'.$j];
- }
- else
- {
- $state = $track_Ret['1161-'.$i.'-'.$j];
- }
-
- if(date('Ymd',$unixDate) != date('Ymd',$last_date))
- {
- $ctr++;
- $hasChanged = true;
- }
-
- if($track_Ret['1159-'.$i.'-'.$j] == 'Delivered' && empty($track_Ret['1711-'.$i.'-'.$j]))
- {
- $isDelivered = true;
- }
- ?>
- <tr style="background-color: #<?=($ctr%2==0)?'FFF':'DFE7FF'?>">
- <?php
- if($hasChanged)
- {
- ?>
- <td style="text-align: left" valign="top">
- <span style="font-weight: bold"><?=date('M j, Y',$unixDate)?></span> </td>
- <td valign="top" style="text-align: right; border-right: 1px solid #<?=($ctr%2!=0)?'FFF':'DFE7FF'?>"><?=date('g:i A',$unixDate)?></td>
- <?php
- $hasChanged = false;
- }
- else
- {
- ?>
- <td valign="top" colspan="2" style="text-align: right; border-right: 1px solid #<?=($ctr%2!=0)?'FFF':'DFE7FF'?>"><?=date('g:i A',$unixDate)?></td>
- <?php
- }
- ?>
- </td>
- <td valign="top" style="border-right: 1px solid #<?=($ctr%2!=0)?'FFF':'DFE7FF'?>"><?=($isDelivered)?'<strong>':''?><?=$track_Ret['1159-'.$i.'-'.$j]?><?=($isDelivered)?'</strong>':''?></td>
- <td valign="top" style="border-right: 1px solid #<?=($ctr%2!=0)?'FFF':'DFE7FF'?>"><?=$track_Ret['1160-'.$i.'-'.$j]?>, <?=$state?></td>
- <td valign="top"><?=$track_Ret['1711-'.$i.'-'.$j]?></td>
- </tr>
- <?php
- if($isDelivered)
- {
- $isDelivered = false;
- }
-
- $last_date = $unixDate;
- }
- }
- ?>
- </table>
- </div>
- <?php
- }
- }
- // ADD ENDED
-
- // ADDED by Chad Apr-03-06
- // DHL AND USPS TRACKING
- $qry = "SELECT * FROM dhl WHERE custPackID = '".$_GET["id"]."'";
- $res = mysql_query($qry) or print(mysql_error());
- if(mysql_num_rows($res) > 0) {
- $row = mysql_fetch_assoc($res);
- $trackNum = $row['DHLGMTrackNum'];
- if(!empty($trackNum)) {
- $ch = curl_init();
- curl_setopt($ch,CURLOPT_URL,"http://api.smartmail.com/tnt2.cfm?number=$trackNum&criteria=3&type=wddx&custid=rband&passwd=sm36732");
- //curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch,CURLOPT_HEADER,0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- //curl_setopt($ch, CURLOPT_POSTFIELDS, "number=$trackNum&criteria=3&type=wddx&custid=rband&passwd=sm36732");
- $res = curl_exec($ch);
- curl_close($ch);
- $info = wddx_deserialize($res);
- if(empty($info['Detail'][0])) { //If no errors
- ?>
- <div style="height: 20px"></div>
- <table align="center" width="500" cellpadding="3" cellspacing="0" style="border: 1px solid #FFFFFF">
- <tr>
- <td colspan="2" style="color: #FFFFFF; background-color: #CC0000; text-align: center; font-weight: bold; font-size: 18px">DHL Tracking</td>
- </tr>
- <?php
- if(!empty($info['TRACK_PKUP_DATE'][0])) {
- ?>
- <tr>
- <td style="background-color: #FFCC00; text-align: left; font-weight: bold"><?=$info['TRACK_PKUP_DATE'][0]?></td>
- <td bordercolor="#FFFFFF" style="background-color: #FFCC00">Picked Up by SmartMail</td>
- </tr>
- <?php
- }
- if(!empty($info['TRACK_RECV_DATE'][0])) {
- ?>
- <tr>
- <td style="background-color: #FFCC00; text-align: left; font-weight: bold"><?=$info['TRACK_RECV_DATE'][0]?></td>
- <td bordercolor="#FFFFFF" style="background-color: #FFCC00">Arrived at Smart Center</td>
- </tr>
- <?php
- }
- if(!empty($info['TRACK_ENCD_DATE'][0])) {
- ?>
- <tr>
- <td style="background-color: #FFCC00; text-align: left; font-weight: bold"><?=$info['TRACK_ENCD_DATE'][0]?></td>
- <td bordercolor="#FFFFFF" style="background-color: #FFCC00">Processed and Verified</td>
- </tr>
- <?php
- }
- if(!empty($info['TRACK_DNSD_DATE'][0])) {
- ?>
- <tr>
- <td style="background-color: #FFCC00; text-align: left; font-weight: bold"><?=$info['TRACK_DNSD_DATE'][0]?></td>
- <td bordercolor="#FFFFFF" style="background-color: #FFCC00">Sent via <?=(!empty($info['TRACK_DNDC'][0]))?$info['TRACK_DNDC'][0]:"SmartMail"?></td>
- </tr>
- <?php
- }
- if(!empty($info['TRACK_DNRC_DATE'][0])) {
- ?>
- <tr>
- <td style="background-color: #FFCC00; text-align: left; font-weight: bold"><?=$info['TRACK_DNRC_DATE'][0]?></td>
- <td bordercolor="#FFFFFF" style="background-color: #FFCC00">Received</td>
- </tr>
- <?php
- }
- if(!empty($info['TRACK_MFST_DATE'][0])) {
- ?>
- <tr>
- <td style="background-color: #FFCC00; text-align: left; font-weight: bold"><?=$info['TRACK_MFST_DATE'][0]?></td>
- <td bordercolor="#FFFFFF" style="background-color: #FFCC00">Mail Delivered to Post Office</td>
- </tr>
- <?php
- }
- ?>
- </table>
- <?php
- // CHECK USPS TRACKING INFO
- if(!empty($info['TRACK_DELV_CONF'][0])) {
- $ch = curl_init();
- curl_setopt($ch,CURLOPT_URL,"http://Production.ShippingAPIs.com/ShippingAPI.dll");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch,CURLOPT_HEADER,0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, 'API=TrackV2&XML=<TrackFieldRequest USERID="268REMIN3619"><TrackID ID="'.$info['TRACK_DELV_CONF'][0].'"></TrackID></TrackFieldRequest>');
- $res = curl_exec($ch);
- curl_close($ch);
-
- include(APPPATH.'views/pages/admin/xml2array.php');
-
- $xmlData = new xml2array();
- $uspsData = $xmlData -> parseXMLintoarray($res);
- ?>
- <div style="margin: 5px auto; width: 500px">
-
- <div style="margin: 0; height: 5px; background-color: #CC0000"></div>
- <div style="margin: 0; padding: 2px; background-color: #0066CB; color: #FFFFFF; font-weight: bold; font-size: 18px; text-align: center">USPS Tracking<br /><span style="font-size: 11px">Tracking # <?=$info['TRACK_DELV_CONF'][0]?></span></div>
- <div style="margin: 0; height: 7px; background-color: #98CCFF"></div>
- <div style="margin: 2px 0 0 0; background-color: #E3F1FC; border: 1px solid #89B9E7">
- <?php
- if(is_array($uspsData['TrackResponse']['TrackInfo']['Error'])) {
- echo '<div style="margin: 0; text-align: center; font-weight: bold">Error Getting USPS Tracking Information</div>';
- }else{
- if(is_array($uspsData['TrackResponse']['TrackInfo']['TrackSummary'])) {
- $eventTime = $uspsData['TrackResponse']['TrackInfo']['TrackSummary']['EventDate'].' '.$uspsData['TrackResponse']['TrackInfo']['TrackSummary']['EventTime'];
- ?>
- <div style="margin: 0; padding: 3px; background-color: #89B9E7; color: #FFFFFF; font-weight: bold">Event Summary</div>
- <div style="margin: 0">
- <table width="500" border="0" cellpadding="3" cellspacing="0" style="margin: 2px;">
- <tr>
- <td valign="top" style="font-weight: bold"><?=$eventTime?></td>
- <td valign="top"><?=$uspsData['TrackResponse']['TrackInfo']['TrackSummary']['EventCity']?>, <?=$uspsData['TrackResponse']['TrackInfo']['TrackSummary']['EventState']?></td>
- <td valign="top"><?=$uspsData['TrackResponse']['TrackInfo']['TrackSummary']['Event']?></td>
- </tr>
- </table>
- </div>
- <?php
- }
- if(is_array($uspsData['TrackResponse']['TrackInfo']['TrackDetail'])) {
- ?>
- <div style="margin: 0; padding: 3px; background-color: #89B9E7; color: #FFFFFF; font-weight: bold">Tracking Details</div>
- <table width="500" border="0" align="center" cellpadding="3" cellspacing="0" style="margin: 2px;">
- <?php
- if(is_array($uspsData['TrackResponse']['TrackInfo']['TrackDetail'][0])){
- for($i=0; $i<count($uspsData['TrackResponse']['TrackInfo']['TrackDetail']); $i++) {
- $eventTime = $uspsData['TrackResponse']['TrackInfo']['TrackDetail'][$i]['EventDate'].' '.$uspsData['TrackResponse']['TrackInfo']['TrackDetail'][$i]['EventTime'];
- ?>
- <tr>
- <td valign="top" style="font-weight: bold"><?=$eventTime?></td>
- <td valign="top"><?=$uspsData['TrackResponse']['TrackInfo']['TrackDetail'][$i]['EventCity']?>, <?=$uspsData['TrackResponse']['TrackInfo']['TrackDetail'][$i]['EventState']?></td>
- <td valign="top"><?=$uspsData['TrackResponse']['TrackInfo']['TrackDetail'][$i]['Event']?></td>
- </tr>
- <?php
- } // End of TrackDetail Loop
- }else{
- $eventTime = $uspsData['TrackResponse']['TrackInfo']['TrackDetail']['EventDate'].' '.$uspsData['TrackResponse']['TrackInfo']['TrackDetail']['EventTime'];
- ?>
- <tr>
- <td valign="top" style="font-weight: bold"><?=$eventTime?></td>
- <td valign="top"><?=$uspsData['TrackResponse']['TrackInfo']['TrackDetail']['EventCity']?>, <?=$uspsData['TrackResponse']['TrackInfo']['TrackDetail']['EventState']?></td>
- <td valign="top"><?=$uspsData['TrackResponse']['TrackInfo']['TrackDetail']['Event']?></td>
- </tr>
- <?php
- }
- ?>
- </table>
- <?php
- } // End of displaying all Tracking Details
- } // End of displaying all USPS tracking information
- ?>
- </div>
- </div>
- <?php
- }
- }
- }
- }
-
- // ADD ENDED
-
- }elseif(!empty($_REQUEST['ship_to_logan'])) {
- ?>
- <h2 style="margin-left: 20px">Provide Reason for Change of Status to Shipping from Logan</h2>
- <form id="mainform" action="<?=$_SERVER['PHP_SELF']?>" method="post">
- <table align="center" width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="" style="margin-top: 20px;">
- <tr>
- <td colspan="6"> </td>
- <td align="center"><strong>Master Reason for Change</strong><br /><textarea name="master_reason" id="master_reason" rows="2" cols="17"></textarea></td>
- </tr>
- <tr bgcolor="#030133">
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyOrdId?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyName?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyShipMe?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF">Status</font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyBatDate?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyOrdDate?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF">Reason for Change</font></strong></td>
- </tr>
- <?php
- foreach($_REQUEST['orders'] as $order) {
- $sql = "SELECT * FROM orders WHERE ordID = " . $order;
- $res = mysql_query($sql) or print(mysql_error());
- $row = mysql_fetch_assoc($res);
-
- $sql_st = "SELECT os.statPrivate FROM orderstatus os, orders o
- WHERE o.ordStatus = os.statID
- AND o.ordID = " . $order;
- $res_st = mysql_query($sql_st) or print(mysql_error());
- $row_st = mysql_fetch_assoc($res_st);
-
- $sql_b = "select * from location l where ordID = ". $order ." and l.location = 'Packing'";
- $result_b = mysql_query($sql_b);
- $row_b = mysql_fetch_assoc($result_b);
-
- if(@$bgcolor=="#E7EAEF") $bgcolor="#EAECEB"; else $bgcolor="#E7EAEF";
- ?>
- <tr bgcolor="<?=$bgcolor?>">
- <td align="center"><?=$row['ordID']?></td>
- <td align="center"><?=$row['ordName']?></td>
- <td align="center"><?=$row['ordShipType']?></td>
- <td align="center"><?=$row_st['statPrivate']?><input name="oldstatus_<?=$order?>" type="text" value="<?=$row['ordStatus']?>" /></td>
- <td align="center"><?=$row_b['stamp']?></td>
- <td align="center"><?=$row['ordDate']?></td>
- <td align="center"><textarea name="reason<?=$order?>" rows="2" cols="17"></textarea></td>
- </tr>
- <?php
- }
- ?>
- <tr>
- <td colspan="7" align="center"><input type="submit" id="ship_to_logan_final" name="ship_to_logan_final" value="Update Statuses" /></td>
- </tr>
- </table>
- </form>
- <p> </p>
- <?php
- }elseif(!empty($_REQUEST['ship_to_logan_final'])) {
- $aReasons = array();
- $i=0;
- foreach($_REQUEST as $key => $request) {
- if(eregi("^reason",$key)) {
- $aReasons[$i]['order'] = substr($key,6);
- $aReasons[$i]['oldstatus'] = $_REQUEST['oldstatus_'.substr($key,6)];
- if(!empty($_REQUEST['master_reason'])) {
- $aReasons[$i]['reason'] = $_REQUEST['master_reason'];
- }else{
- $aReasons[$i]['reason'] = $request;
- }
- $i++;
- }
- }
- //showarray($aReasons); exit();
- for($i=0; $i<count($aReasons); $i++) {
- $sql = "UPDATE orders
- SET ordStatus = 10, ordStatusDate = '".date("Y-m-d H:i:s")."'
- WHERE ordID = " . $aReasons[$i]['order'];
- $res = mysql_query($sql) or print(mysql_error());
-
- setNewLocation(10,$aReasons[$i]['order'],'Manual',$aReasons[$i]['reason']);
- //release stock if old status !=10 and >=3
- if($aReasons[$i]['oldstatus']!=10 && $aReasons[$i]['oldstatus']!=17 && $aReasons[$i]['oldstatus']>=3) release_stock($smOrdId);
- }
- ?>
- <script language="JavaScript" type="text/javascript">
- <!--
- setTimeout("window.location = '/admin/hksearch.php'",4000);
- // -->
- </script>
- <table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="" align="center">
- <tr>
- <td width="100%">
- <table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="">
- <tr>
- <td width="100%" colspan="4" align="center"><br /><strong><?php print $yyUpdSuc?></strong><br /><br />You will now be forwarded to the HK Search Page<br /><br />
- <?php print $yyNoAuto?> <a href="javascript:window.location='/admin/hksearch.php'"><strong><?php print $yyClkHer?></strong></a>.<br /><br />
- <img src="/lib/images/misc/clearpixel.gif" width="300" height="3" alt="" /></td>
- </tr>
- </table> </td>
- </tr>
- </table>
- <?php
- }elseif(!empty($_REQUEST['send_packing'])) {
- ?>
- <h2 style="margin-left: 20px">Provide Reason for Change of Status to Packing</h2>
- <form id="mainform" action="<?=$_SERVER['PHP_SELF']?>" method="post">
- <table align="center" width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="" style="margin-top: 20px;">
- <tr>
- <td colspan="6"> </td>
- <td align="center"><strong>Master Reason for Change</strong><br /><textarea name="master_reason" id="master_reason" rows="2" cols="17"></textarea></td>
- </tr>
- <tr bgcolor="#030133">
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyOrdId?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyName?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyShipMe?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF">Status</font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyBatDate?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyOrdDate?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF">Reason for Change</font></strong></td>
- </tr>
- <?php
- foreach($_REQUEST['orders'] as $order) {
- $sql = "SELECT * FROM orders WHERE ordID = " . $order;
- $res = mysql_query($sql) or print(mysql_error());
- $row = mysql_fetch_assoc($res);
-
- $sql_st = "SELECT os.statPrivate FROM orderstatus os, orders o
- WHERE o.ordStatus = os.statID
- AND o.ordID = " . $order;
- $res_st = mysql_query($sql_st) or print(mysql_error());
- $row_st = mysql_fetch_assoc($res_st);
-
- // Get Batch Date
- $sql_b = "select * from location l where ordID = ". $order ." and l.location = 'Packing'";
- $result_b = mysql_query($sql_b);
- $row_b = mysql_fetch_assoc($result_b);
-
- if(@$bgcolor=="#E7EAEF") $bgcolor="#EAECEB"; else $bgcolor="#E7EAEF";
- ?>
- <tr bgcolor="<?=$bgcolor?>">
- <td align="center"><?=$row['ordID']?></td>
- <td align="center"><?=$row['ordName']?></td>
- <td align="center"><?=$row['ordShipType']?></td>
- <td align="center"><?=$row_st['statPrivate']?></td>
- <td align="center"><?=$row_b['stamp']?></td>
- <td align="center"><?=$row['ordDate']?></td>
- <td align="center"><textarea name="reason<?=$order?>" rows="2" cols="17"></textarea></td>
- </tr>
- <?php
- }
- ?>
- <tr>
- <td colspan="7" align="center"><input type="submit" id="send_packing_final" name="send_packing_final" value="Update Statuses" /></td>
- </tr>
- </table>
- </form>
- <p> </p>
- <?php
- }elseif(!empty($_REQUEST['send_packing_final'])) {
- $aReasons = array();
- $i=0;
- foreach($_REQUEST as $key => $request) {
- if(eregi("^reason",$key)) {
- $aReasons[$i]['order'] = substr($key,6);
- if(!empty($_REQUEST['master_reason'])) {
- $aReasons[$i]['reason'] = $_REQUEST['master_reason'];
- }else{
- $aReasons[$i]['reason'] = $request;
- }
- $i++;
- }
- }
- //showarray($aReasons); exit();
- for($i=0; $i<count($aReasons); $i++) {
- $sql = "UPDATE orders
- SET ordStatus = 6, ordStatusDate = '".date("Y-m-d H:i:s")."'
- WHERE ordID = " . $aReasons[$i]['order'];
- $res = mysql_query($sql) or print(mysql_error());
-
- setNewLocation(6,$aReasons[$i]['order'],'Manual',$aReasons[$i]['reason']);
- }
- ?>
- <script language="JavaScript" type="text/javascript">
- <!--
- setTimeout("window.location = '/admin/hksearch.php'",4000);
- // -->
- </script>
- <table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="" align="center">
- <tr>
- <td width="100%">
- <table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="">
- <tr>
- <td width="100%" colspan="4" align="center"><br /><strong><?php print $yyUpdSuc?></strong><br /><br />You will now be forwarded to the HK Search Page<br /><br />
- <?php print $yyNoAuto?> <a href="javascript:window.location='/admin/hksearch.php'"><strong><?php print $yyClkHer?></strong></a>.<br /><br />
- <img src="/lib/images/misc/clearpixel.gif" width="300" height="3" alt="" /></td>
- </tr>
- </table> </td>
- </tr>
- </table>
- <?php
- }else{
- if(@$_POST["sd"] != "")
- $sd = @$_POST["sd"];
- elseif(@$_GET["sd"] != "")
- $sd = @$_GET["sd"];
- else
- $sd = date($admindatestr, time() + ($dateadjust*60*60));
- if(@$_POST["ed"] != "")
- $ed = @$_POST["ed"];
- elseif(@$_GET["ed"] != "")
- $ed = @$_GET["ed"];
- else
- $ed = date($admindatestr, time() + ($dateadjust*60*60));
- $sd = parsedate($sd);
- $ed = parsedate($ed);
- if($sd > $ed) $ed = $sd;
- $fromdate = trim(@$_POST["fromdate"]);
- $todate = trim(@$_POST["todate"]);
- $ordid = trim(str_replace('"',"",str_replace("'","",@$_POST["ordid"])));
- $origsearchtext = trim(unstripslashes(@$_POST["searchtext"]));
- $searchtext = trim(mysql_real_escape_string(unstripslashes(@$_POST["searchtext"])));
- $ordstatus = "";
- if(@$_POST["powersearch"]=="1" && !empty($_POST['searchby'])){
- $sSQL = "SELECT o.ordID,ordName,ordDate, ordAuthNumber, ordShipType,l.stamp,ordStatus,ordTotal-ordDiscount AS ordTot,ordTransID,ordEID FROM orders o INNER JOIN location l ON l.ordID=o.ordID WHERE ordStatus>=0 ";
- $addcomma = "";
- if(is_array(@$_POST["ordstatus"])){
- foreach($_POST["ordstatus"] as $objValue){
- if(is_array($objValue))$objValue=$objValue[0];
- $ordstatus .= $addcomma . $objValue;
- $addcomma = ",";
- }
- }else
- $ordstatus = trim((string)@$_POST["ordstatus"]);
- //discounts
-
- if($_POST['searchby'] == "invoice" && $_POST['invoice_number'] != ""){
- $sSQL .= ' AND o.ordID="'.$_POST['invoice_number'].'" group by o.ordID';
- }
- elseif($_POST['searchby'] == "status" && $_POST['ordstatus'] != ""){
- if($ordstatus == 9999) {
- $ordstatus = '3,4,6';
- }
- $sSQL .= " AND ordStatus IN (".$ordstatus.") group by o.ordID";
- }
- elseif($_POST['searchby'] == "name" && $_POST['order_name'] != ""){
- $sSQL .= " AND (ordName like '%" . $_POST['order_name'] . "%' or ordShipName like '%" . $_POST['order_name'] . "%') group by o.ordID";
- }
- elseif($_POST['searchby'] == "batches" && $_POST['batch_to'] != "" && $_POST['batch_from'] != ""){
- $sSQL .= ' AND l.statNum=6 AND l.stamp BETWEEN "' . $_POST['batch_from'] . ' 00:00:00" AND "' . $_POST['batch_to'] . ' 23:59:59"';
- }
- $sSQL .= " ORDER BY ordID DESC".(($_POST['batches_to'] != "" && $_POST['batches_from'] != "")?',l.stamp DESC':'');
- }else{
- $sSQL = "SELECT * FROM orders WHERE ordStatus = 6"; // Purposely querying 0 results for default view
- }
- $alldata = mysql_query($sSQL) or print(mysql_error());
- $num_of_listed = mysql_num_rows($alldata);
- //echo $sSQL;
- //showarray($_POST);
- ?>
- <script language="JavaScript" type="text/javascript" src="/lib/js/util/popcalendar.js"></script>
- <script language="JavaScript" type="text/javascript" src="http://assets.ifrogz.com/lib/packages/scriptaculous-js/1.5.1/prototype.js"></script>
- <script language="JavaScript" type="text/javascript" src="http://assets.ifrogz.com/lib/packages/scriptaculous-js/1.5.1/scriptaculous.js"></script>
- <script language="JavaScript" type="text/javascript">
- <!--
- function showCell() {
- var val = $('searchby').value;
-
- if(val == 'invoice') {
- resetCells();
- $('invoice').style.display = 'block';
- }else if(val == 'batches') {
- resetCells();
- $('batches').style.display = 'block';
- }else if(val == 'name') {
- resetCells();
- $('name').style.display = 'block';
- }else if(val == 'status') {
- resetCells();
- $('status').style.display = 'block';
- }
- }
- function resetCells() {
- $('invoice').style.display = 'none';
- $('batches').style.display = 'none';
- $('name').style.display = 'none';
- $('status').style.display = 'none';
- }
- function delrec(id) {
- cmsg = "<?php print $yyConDel?>\n"
- if (confirm(cmsg)) {
- document.mainform.id.value = id;
- document.mainform.act.value = "delete";
- document.mainform.sd.value="<?php print date($admindatestr, $sd)?>";
- document.mainform.ed.value="<?php print date($admindatestr, $ed)?>";
- document.mainform.submit();
- }
- }
- function authrec(id) {
- var aucode;
- cmsg = "<?php print $yyEntAuth?>"
- if ((aucode=prompt(cmsg,'<?php print $yyManAut?>')) != null) {
- document.mainform.id.value = id;
- document.mainform.act.value = "authorize";
- document.mainform.authcode.value = aucode;
- document.mainform.sd.value="<?php print date($admindatestr, $sd)?>";
- document.mainform.ed.value="<?php print date($admindatestr, $ed)?>";
- document.mainform.submit();
- }
- }
- function checkcontrol(tt,evt){
- <?php if(strstr(@$HTTP_SERVER_VARS["HTTP_USER_AGENT"], "Gecko")){ ?>
- theevnt = evt;
- return;
- <?php }else{ ?>
- theevnt=window.event;
- <?php } ?>
- if(theevnt.ctrlKey){
- maxitems=document.mainform.maxitems.value;
- for(index=0;index<maxitems;index++){
- if(eval('document.mainform.ordstatus'+index+'.length') > tt.selectedIndex){
- eval('document.mainform.ordstatus'+index+'.selectedIndex='+tt.selectedIndex);
- eval('document.mainform.ordstatus'+index+'.options['+tt.selectedIndex+'].selected=true');
- }
- }
- }
- }
- function displaysearch(){
- thestyle = document.getElementById('searchspan').style;
- if(thestyle.display=='none')
- thestyle.display = 'block';
- else
- thestyle.display = 'none';
- }
- function checkprinter(tt,evt){
- <?php if(strstr(@$HTTP_SERVER_VARS["HTTP_USER_AGENT"], "Gecko")){ ?>
- if(evt.ctrlKey || evt.altKey || document.mainform.ctrlmod[document.mainform.ctrlmod.selectedIndex].value=="1"){
- tt.href += "&printer=true";
- window.location.href = tt.href;
- }
- if(document.mainform.ctrlmod[document.mainform.ctrlmod.selectedIndex].value=="2"){
- tt.href += "&doedit=true";
- window.location.href = tt.href;
- }
- <?php }else{ ?>
- theevnt=window.event;
- if(theevnt.ctrlKey || document.mainform.ctrlmod[document.mainform.ctrlmod.selectedIndex].value=="1")tt.href += "&printer=true";
- if(document.mainform.ctrlmod[document.mainform.ctrlmod.selectedIndex].value=="2")tt.href += "&doedit=true";
- <?php } ?>
- return(true);
- }
- // -->
- </script>
-
- <table border="0" cellspacing="0" cellpadding="0" width="100%" bgcolor="">
- <tr>
- <td width="100%" align="center">
- <?php $themask = 'yyyy-mm-dd';
- if($admindateformat==1)
- $themask='mm/dd/yyyy';
- elseif($admindateformat==2)
- $themask='dd/mm/yyyy';
- if(! $success) print "<p><font color='#FF0000'>" . $errmsg . "</font></p>"; ?>
- <span name="searchspan" id="searchspan" >
- <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="">
- <form method="post" action="/admin/hksearch.php" name="psearchform">
- <input type="hidden" name="powersearch" value="1" />
- <tr bgcolor="#030133"><td colspan="7"><strong><font color="#E7EAEF"> <?php print $yyPowSea?></font></strong></td></tr>
- <tr bgcolor="#E7EAEF">
- <td align="right" width="15%"><strong>Search By:</strong></td>
- <td align="left" width="15%">
- <select id="searchby" name="searchby" onchange="showCell();">
- <option value="status"<?=($_POST['searchby']=='status')?' selected="selected"':''?>>Status</option>
- <option value="invoice"<?=($_POST['searchby']=='invoice')?' selected="selected"':''?>>Invoice #</option>
- <option value="batches"<?=($_POST['searchby']=='batches')?' selected="selected"':''?>>Batches</option>
- <option value="name"<?=($_POST['searchby']=='name')?' selected="selected"':''?>>Name</option>
- </select> </td>
- <td id="invoice" align="left" style="display:none">
- <strong>Invoice #:</strong> <input name="invoice_number" type="text" id="invoice_number" value="<?=$_POST['invoice_number']?>" /> </td>
- <td id="batches" align="left" style="display:none">
- <strong>Batches:</strong> between <input type="text" id="batch_from" name="batch_from" value="<?php print $_POST['batch_from']?>" /> <input type="button" onclick="popUpCalendar(this, document.forms.psearchform.batch_from, '<?php print $themask?>', -205)" value='DP' />
- and <input type="text" id="batch_to" name="batch_to" value="<?php print $_POST['batch_to']?>" /> <input type="button" onclick="popUpCalendar(this, document.forms.psearchform.batch_to, '<?php print $themask?>', -205)" value='DP' /> </td>
- <td id="name" align="left" style="display:none">
- Name: <input type="text" size="24" name="order_name" value="<?php print $_POST['order_name']?>" /> </td>
- <td id="status" align="left" valign="middle" style="display:none">
-
- <strong><?php print $yyOrdSta?>:</strong>
- <select name="ordstatus[]" size="5" multiple><option value="9999" <?php if(strpos($ordstatus,"9999") !== FALSE) print "selected"?>><?php print $yyAllSta?></option><?php
- $ordstatus="";
- $addcomma = "";
- if(empty($_POST["ordstatus"])) $_POST["ordstatus"]=6;
- if(is_array(@$_POST["ordstatus"])){
- foreach($_POST["ordstatus"] as $objValue){
- if(is_array($objValue))$objValue=$objValue[0];
- $ordstatus .= $addcomma . $objValue;
- $addcomma = ",";
- }
- }else
- $ordstatus = trim(@$_POST["ordstatus"]);
- $ordstatusarr = explode(",", $ordstatus);
- for($index=0; $index < $numstatus; $index++){
- if(in_array($allstatus[$index]["statID"],array(3,4,6,10))) {
- print '<option value="' . $allstatus[$index]["statID"] . '"';
- if(is_array($ordstatusarr)){
- foreach($ordstatusarr as $objValue)
- if($objValue==$allstatus[$index]["statID"]) print " selected";
- }
- print ">" . $allstatus[$index]["statPrivate"] . "</option>";
- }
- } ?></select> </td>
- </tr>
- <script type="text/javascript">
- <!--
- resetCells();
- showCell();
-
- function shipLogan(){
- var resp = confirm("Are you sure you want to update all CHECKED orders to Shipping Logan?");
-
- return resp;
- }
-
- function sendPacking(){
- var resp = confirm("Are you sure you want to update all CHECKED orders to Packing?");
-
- return resp;
- }
- -->
- </script>
- </table><input type="submit" value="<?php print $yySearch?>" />
- </span>
- <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="" style="margin-top: 20px">
- <tr>
- <td colspan="7">
- <?
- $sql_status = "SELECT count( * ) as statcount , os.statPrivate , os.statID
- FROM orders o, orderstatus os
- WHERE o.ordStatus = os.statID
- AND o.ordStatus
- BETWEEN 3
- AND 10
- GROUP BY os.statID,os.statPrivate";
- $result_status=mysql_query($sql_status);
- while($row_status=mysql_fetch_assoc($result_status)){?>
- <div style="color:#000066; font-weight:bold; border:#030133 solid 1px; margin:2px; float:left; width:146px;padding:2px; text-align:center; background-color:#E7EAEF;"><?=$row_status['statID'].'-'.$row_status['statPrivate'].': '.$row_status['statcount'] ?></div>
- <? } ?> </td>
- </tr>
- <tr>
- <td colspan="3"><input type="submit" id="ship_to_logan" name="ship_to_logan" value="Ship From Logan" onclick="return shipLogan();" /> <!--<input type="submit" id="send_packing" name="send_packing" value="Send to Packing" onclick="return sendPacking();" />--></td>
- <td colspan="4" align="right">* Order has Custom Screenz | <span style="background-color:#FA6561; padding:2px;">etailer</span></td>
- </tr>
- <tr bgcolor="#030133">
- <td align="center"> </td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyOrdId?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyName?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyShipMe?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF">Status</font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyBatDate?></font></strong></td>
- <td align="center"><strong><font color="#E7EAEF"><?php print $yyOrdDate?></font></strong></td>
- </tr>
- <?php
- if(mysql_num_rows($alldata) > 0){
- $rowcounter=0;
- $ordTot=0;
- $i=0;
- $num_rows_order=mysql_num_rows($alldata);
- while($rs = mysql_fetch_assoc($alldata)){
- $order_id_array[$i]=$rs["ordID"];
- $i++;
- if($rs["ordStatus"]>=3) $ordTot += $rs["ordTot"];
- if($rs["ordStatus"]>=3) $num_auth_order += 1;
- if($rs["ordAuthNumber"]=="" || is_null($rs["ordAuthNumber"])){
- $startfont="<font color='#FF0000'>";
- $endfont="</font>";
- } else{
- $startfont="";
- $endfont="";
- }
- if($rs["order_changed"]=='yes'){
- $startfont="<font color='#00CC00'>";
- $endfont="</font>";
- }
- //check for custom screenz
- $hascustomscreen='';
- $sql_check="SELECT * FROM cart WHERE cartOrderID=".$rs["ordID"]." AND cartProdID LIKE '%-Custom'";
- $result_check=mysql_query($sql_check);
- if(mysql_num_rows($result_check)>0) $hascustomscreen='*';
- // Get Current Status Name
- $sql_st = "SELECT os.statPrivate FROM orderstatus os, orders o
- WHERE o.ordStatus = os.statID
- AND o.ordID = " . $rs["ordID"];
- $res_st = mysql_query($sql_st) or print(mysql_error());
- $row_st = mysql_fetch_assoc($res_st);
-
- if(@$bgcolor=="#E7EAEF") $bgcolor="#EAECEB"; else $bgcolor="#E7EAEF";
- if(!empty($rs["ordEID"])) $bgcolor="#FA6561";
- ?>
- <tr bgcolor="<?php print $bgcolor?>">
- <td><input type="checkbox" id="orders<?=$i?>" name="orders[]" value="<?=$rs["ordID"]?>" /></td>
- <td align="center"><a onclick="return(checkprinter(this,event));" href="/admin/hksearch.php?id=<?php print $rs["ordID"]?>"><?php print "<strong>" . $hascustomscreen.$startfont . $rs["ordID"] . $endfont . "</strong>"?></a></td>
- <td align="center"><a onclick="return(checkprinter(this,event));" href="/admin/hksearch.php?id=<?php print $rs["ordID"]?>"><?php print $startfont . $rs["ordName"] . $endfont?></a></td>
- <td align="center"><a onclick="return(checkprinter(this,event));" href="/admin/hksearch.php?id=<?php print $rs["ordID"]?>"><?php print $startfont . $rs["ordShipType"] . $endfont?></a></td>
- <td align="center"><a onclick="return(checkprinter(this,event));" href="/admin/hksearch.php?id=<?php print $rs["ordID"]?>"><?php print $startfont . $row_st["statPrivate"] . $endfont?></a></td>
- <td align="center">
- <?php
- $sql="select * from location l where ordID = ". $rs["ordID"] ." and l.location = 'Packing'";
- $result= mysql_query($sql);
- $row= mysql_fetch_assoc($result);
- echo $row["stamp"];
- ?></td>
-
- <td align="center"><font size="1"><?php print $startfont . date($admindatestr . "\<\\b\\r\>H:i:s", strtotime($rs["ordDate"])) . $endfont?></font></td>
- </tr>
- <?php $rowcounter++;
- if($rowcounter>=1000){
- print "<tr><td colspan='6' align='center'><strong>Limit of " . $rowcounter . " orders reached. Please refine your search.</strong></td></tr>";
- break;
- }
- }
- ?>
- <tr>
- <td colspan="6" align="left"><?=$num_rows_order?> Orders</td>
- </tr>
- <?php
- }else{
- ?>
- <tr>
- <td colspan="9" align="center">
- <p><?php
- if(@$_POST["powersearch"]=="1")
- print $yyNoMat1;
- elseif($num_of_listed==0)
- print "There were no orders found";
- ?></p> </td>
- </tr>
- <?php if($hasdeleted){ ?>
- <tr>
- <td colspan="9"><input type="submit" value="<?php print $yyPurDel?>" onclick="document.mainform.act.value='purge';" /></td>
- </tr>
- <?php } ?>
- <!--</form>-->
- <?php
- } ?>
- </table> </td>
- </tr>
- </table>
- <?php
- }
- }
- ?>