/application/views/pages/admin/shipping4.php
PHP | 374 lines | 324 code | 49 blank | 1 comment | 59 complexity | 07b29075fff4f23283611b1d01fe3167 MD5 | raw file
- <?php
- if(@$storesessionvalue=="") $storesessionvalue="virtualstore".time();
- if($_SESSION["loggedon1"] != $storesessionvalue || @$disallowlogin1==TRUE) exit();
- ?>
- <style type="text/css">
- <!--
- tr {
- cursor: hand;
- cursor: pointer;
- background-color: #FFF;
- }
- tr.hilite {
- background-color: #316AC5;
- color: #FFF;
- }
- tr.hover {
- background-color: #EEE;
- }
- -->
- </style>
- <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">
- <!--
- function changeColor(obj,action) {
- if(obj.className!='hilite') {
- if(action=='over') obj.className='hover';
- if(action=='out') obj.className='blank';
- }
- }
- function altColor(obj,order) {
- objInp = document.getElementById('receive' + order);
- if(obj.className=='' || obj.className=='hover') {
- obj.className='hilite';
- objInp.value = 'yes';
- }else{
- obj.className='';
- objInp.value = '';
- }
- }
- function selectAll() {
- for(i=0; i<document.frmReceive.elements.length; i++) {
- if(document.frmReceive.elements[i].name.substr(0,7)=='receive') {
- document.frmReceive.elements[i].value='yes';
- }
- }
- var tableRows = document.getElementById('tblReceive').rows;
- for(i=0; i<tableRows.length; i++) {
- if(tableRows[i].id.substr(0,4)=='data') {
- tableRows[i].className = 'hilite';
- }
- }
- }
- function selectNone() {
- for(i=0; i<document.frmReceive.elements.length; i++) {
- if(document.frmReceive.elements[i].name.substr(0,7)=='receive') {
- document.frmReceive.elements[i].value='';
- }
- }
- var tableRows = document.getElementById('tblReceive').rows;
- for(i=0; i<tableRows.length; i++) {
- if(tableRows[i].id.substr(0,4)=='data') {
- tableRows[i].className = '';
- }
- }
- }
- function compareOrders(element) {
- var scanned=element.value.split("\r\n");
- alert(scanned.length+"\r\n"+element.value);
- }
- function compareOrders2() {
- alert($("receive_barcode").value);
- }
- -->
- </script>
- <h2 style="text-align: center">iFrogz Shipping</h2>
- <h1 style="text-align: center">Viewing <span style="text-decoration: underline"><?=($_GET['status']=='INTL')?'INTL':'USA'?></span> Orders</h1>
- <!--BEGINNING OF LEFT COLUMN-->
- <div style="width: 100%;">
- <div style="width:250px; float: left; text-align:center">
- <form id="frmReceiveScan" name="frmReceiveScan" action="/admin/shippingprocess2.php" method="post">
- <div>
- <p><input type="button" id="rec_ordersScan" name="rec_ordersScan" value="Receive DHL SmartMail Orders" onclick="document.getElementById('recLocationScan').value = 'dhl'; document.frmReceiveScan.submit();"<?=($_GET['status']!='INTL')?'style="visibility: visible"':'style="visibility: hidden"'?> /></p>
- <p><input type="button" id="rec_ordersScan" name="rec_ordersScan" value="Receive FedEx Express Orders" onclick="document.getElementById('recLocationScan').value = 'fedex'; document.frmReceiveScan.submit();"<?=($_GET['status']!='INTL')?'style="visibility: visible"':'style="visibility: hidden"'?> /></p>
- <p><input type="button" id="rec_ordersScan" name="rec_ordersScan" value="Receive INTL Orders" onclick="document.getElementById('recLocationScan').value = 'intl'; document.frmReceiveScan.submit();"<?=($_GET['status']=='INTL')?'style="visibility: visible"':'style="visibility: hidden"'?> /></p>
- <input name="start_barcode" type="button" value="Start Barcode Scan" style="width:200px; height:40px; font-size:16px; " onClick="document.getElementById('receive_barcode').focus();">
- <? if(!empty($error_msg)) echo '<div style="color:#FF0000;">'.$error_msg.'</div>';?>
- <textarea name="receive_barcode" id="receive_barcode" cols="28" rows="30" onFocus="this.style.backgroundColor='#FF6600'" ><?=$error_order?></textarea>
- <input type="hidden" id="recOrdersScan" name="recOrdersScan" value="recOrdersScan" />
- <input type="hidden" id="recLocationScan" name="recLocationScan" value="" />
-
-
- <script language="JavaScript" type="text/javascript">
- new Form.Element.Observer('receive_barcode',1, function compareOrders() {
- element=$("receive_barcode").value;
- var cnt=element.length;
- var lastone=element.substr(cnt-9);
- check=$("check_orders").value;
- //alert(check);
- if(check.indexOf(lastone)==-1) alert('Bad'+' '+check.indexOf(lastone)+"\r\n last one="+lastone);
- else alert('ok'+' '+check.indexOf(lastone));
- });
- document.getElementById('receive_barcode').focus();
- </script>
- </div>
- </form>
- </div>
- <div style="float:left; padding-top: 5px; width:250px; margin:0px 10px 0px 10px;">
- <form id="form1" name="form1" action="/admin/shippingprocess2.php" method="post">
- <td style="background-color: #EEE"><input type="submit" name="viewStatus" id="viewINTL" value="View INTL"<?=($_GET['status']!='INTL')?'style="visibility: visible"':'style="visibility: hidden"'?> /></td>
- <td style="background-color: #EEE"><input type="submit" name="viewStatus" id="viewUSA" value="View USA"<?=($_GET['status']=='INTL')?'style="visibility: visible"':'style="visibility: hidden"'?> /></td>
- </form>
-
-
-
- <!--START OF DHL SMARTMAIL-->
-
-
-
- <?php
- unset($listofiles);
- $qry = "SELECT COUNT(ordID) num FROM orders WHERE ordStatus = '7'";
- $res = mysql_query($qry);
- $row = mysql_fetch_assoc($res);
- $num_of_orders = $row['num'];
- mysql_free_result($res);
- ?>
-
- <h2>DHL SmartMail<br />
- <?=($num_of_orders>0)?$num_of_orders.' Orders':'No Orders'?><br />
- <form id="form3" method="post" action="/admin/shippingprocess2.php">
- <input type="submit" id="create" name="create" value="Create Batch" />
- <input type="hidden" id="status" name="status" value="7" />
- </form>
- <form method="post" action="/admin/batchview.php">
- <input type="submit" id="viewUSA" name="viewUSA" value="View" />
- <input type="hidden" id="status" name="status" value="7" />
- </form>
- </h2>
- <?php
- $dir = "../batches/dhl";
- $dh = opendir($dir);
- $index=0;
- while (false !== ($filename = readdir($dh))) {
- if ($filename != "." && $filename != ".." && $filename != "error_log" && $filename != "tmp") {
- $listofiles[$index++] = $filename;
- }
- }
- if(!empty($listofiles)) {
- ?>
- <table width="90%" border="0" cellspacing="0" cellpadding="3">
- <?
- for($i=0; $i<count($listofiles)&&$i<10; $i++) {
- $thisfile = $listofiles[(count($listofiles)-1-$i)]; // So that it shows most recent to oldest
- echo'<tr><td><a href="/admin/download.php?path='.urlencode('../batches/dhl/').'&file='.urlencode($thisfile).'">'.$thisfile.'</a></td></tr>';
- }
- ?>
- </table>
- <? }else {?>
- <div style="margin: 5px auto">No batches found.</div>
- <? } ?>
- <p> </p>
-
-
-
-
- <!--START OF FEDEX EXPRESS-->
-
-
-
- <?
- unset($listofiles);
- $qry = "SELECT COUNT(ordID) num FROM orders WHERE ordStatus = '8'";
- $res = mysql_query($qry);
- $row = mysql_fetch_assoc($res);
- $num_of_orders = $row['num'];
- mysql_free_result($res);
- ?>
-
- <h2>Fedex Express<br />
- <?=($num_of_orders>0)?$num_of_orders.' Orders':'No Orders'?><br />
- <form id="form3" method="post" action="/admin/shippingprocess2.php">
- <input type="submit" id="create" name="create" value="Create Batch" />
- <input type="hidden" id="status" name="status" value="8" />
- </form>
- <form method="post" action="/admin/batchview.php">
- <input type="submit" id="viewUSA" name="viewUSA" value="View" />
- <input type="hidden" id="status" name="status" value="8" />
- </form>
- </h2>
- <?
- $dir = "../batches/fedex";
- $dh = opendir($dir);
- $index=0;
- while (false !== ($filename = readdir($dh))) {
- if ($filename != "." && $filename != ".." && $filename != "error_log") {
- $listofiles[$index++] = $filename;
- }
- }
- if(!empty($listofiles)) {
- ?>
- <table width="90%" border="0" cellspacing="0" cellpadding="3">
- <?
- for($i=0; $i<count($listofiles)&&$i<10; $i++) {
- $thisfile = $listofiles[(count($listofiles)-1-$i)]; // So that it shows most recent to oldest
- echo'<tr><td><a href="/admin/download.php?path='.urlencode('../batches/fedex/').'&file='.urlencode($thisfile).'">'.$thisfile.'</a></td></tr>';
- }
- ?>
- </table>
- <? }else {?>
- <div style="margin: 5px auto">No batches found.</div>
- <? } ?>
- <p> </p>
-
-
-
-
- <!--START OF INTERNATIONAL BATCH-->
-
-
-
- <?php
- unset($listofiles);
- $qry = "SELECT COUNT(ordID) num FROM orders WHERE ordStatus = '9'";
- $res = mysql_query($qry);
- $row = mysql_fetch_assoc($res);
- $num_of_orders = $row['num'];
- mysql_free_result($res);
- ?>
- <h2>International Batch<br />
- <?=($num_of_orders>0)?$num_of_orders.' Orders':'No Orders'?><br />
- <form id="form3" method="post" action="/admin/shippingprocess2.php">
- <input type="submit" id="create" name="create" value="Create Batch" style="margin: 2px 0" />
- <input type="hidden" id="status" name="status" value="9" />
- </form>
- <form id="form4" method="post" action="/admin/batchview2.php">
- <input type="submit" id="viewINTL" name="viewINTL" value="View" style="margin: 2px 0" />
- <input type="hidden" id="status" name="status" value="9" />
- </form>
- </h2>
- <?php
- $dir = "../batches/intl";
- $dh = opendir($dir);
- $index=0;
- while (false !== ($filename = readdir($dh))) {
- if ($filename != "." && $filename != ".." && $filename != "error_log") {
- $listofiles[$index++] = $filename;
- }
- }
- if(!empty($listofiles)) {
- ?>
- <table width="90%" border="0" cellspacing="0" cellpadding="3">
- <?php
- for($i=0; $i<count($listofiles)&&$i<10; $i++) {
- $thisfile = $listofiles[(count($listofiles)-1-$i)]; // So that it shows most recent to oldest
- echo '<tr><td><a href="/admin/download.php?path='.urlencode('../batches/intl/').'&file='.urlencode($thisfile).'">'.$thisfile.'</a></td></tr>';
- }
- ?>
- </table>
- <? }else {?>
- <div style="margin: 5px auto">No batches found.</div>
- <? } ?>
- <p> </p>
-
-
-
-
-
- </div>
- <div style="width:200px; float: left; text-align:center">
-
- <p>
- <input type="button" id="rec_dhl_orders" name="rec_orders" value="Receive DHL SmartMail Orders" onclick="document.getElementById('recLocation').value = 'dhl'; document.frmReceive.submit();"<?=($_GET['status']!='INTL')?'style="visibility: visible"':'style="visibility: hidden"'?> />
- </p>
- <p>
- <input type="button" id="rec_orders" name="rec_orders" value="Receive FedEx Express Orders" onclick="document.getElementById('recLocation').value = 'fedex'; document.frmReceive.submit();"<?=($_GET['status']!='INTL')?'style="visibility: visible"':'style="visibility: hidden"'?> />
- </p>
- <p>
- <input type="button" id="rec_orders" name="rec_orders" value="Receive INTL Orders" onclick="document.getElementById('recLocation').value = 'intl'; document.frmReceive.submit();"<?=($_GET['status']=='INTL')?'style="visibility: visible"':'style="visibility: hidden"'?> />
- </p>
- <input name="start_normal" type="button" value="Start Manual Receive" style="width:200px; height:40px; font-size:16px; " onClick="document.getElementById('receive_barcode').style.backgroundColor='';document.getElementById('receive_barcode').blur();">
- <table id="tblReceive" width="100%" border="0" cellspacing="0" cellpadding="3" style="border-collapse: collapse; border: 1px solid #777;">
- <tr>
- <th scope="col" style="background-color: #EEE; border-bottom: 1px solid #777; border-top: 1px solid #777">Order #</th>
- <th scope="col" style="background-color: #EEE; border-bottom: 1px solid #777; border-top: 1px solid #777">Status</th>
- </tr>
- <form id="frmReceive" name="frmReceive" action="/admin/shippingprocess2.php" method="post">
- <?
- $qry = "SELECT o.ordID, o.ordStatus
- FROM orders o, orderstatus os
- WHERE o.ordStatus = os.statID
- AND os.statPrivate = 'Packing'
- ORDER BY o.ordID";
- $res = mysql_query($qry) or print(mysql_error());
- $i=0;
- $str_orders='';
- while($row=mysql_fetch_assoc($res)) {
- if(!empty($_GET['status'])) {
- if(getShipStatus($row['ordID'])!=$_GET['status']) {
- continue;
- }
- }else{
- if(getShipStatus($row['ordID'])!='USA') {
- continue;
- }
- }
- ?>
- <tr id="data<?=$i++?>" onMouseOver="changeColor(this,'over');" onMouseOut="changeColor(this,'out');" onClick="altColor(this,'<?=$row['ordID']?>');">
- <td style="text-align: center"><?=$row['ordID']?></td>
- <td style="text-align: center"><?=getShipStatus($row['ordID'])?>
- <input type="hidden" id="receive<?=$row['ordID']?>" name="receive<?=$row['ordID']?>" value="" />
- </td>
- </tr>
- <? $str_orders.=$row['ordID']."\r\n";
- }
-
- if($i<=0) {
- ?>
- <tr>
- <td colspan="2" style="text-align: center">No Orders Found</td>
- </tr>
- <?
- }
- ?> <textarea name="check_orders" id="check_orders" cols="40" rows="50"><?=$str_orders?></textarea>
- <input type="hidden" id="recOrders" name="recOrders" value="recOrders" />
- <input type="hidden" id="recLocation" name="recLocation" value="" />
- </form>
- </table>
- <table width="100%" cellpadding="0" cellspacing="3" style="margin: 5px 10px">
- <tr>
- <td style="text-align: center"><input type="button" value="Select All" onclick="selectAll();" /></td>
- <td style="text-align: center"><input type="button" value="Select None" onclick="selectNone();" /></td>
- </tr>
- </table>
- </div>
- </div>
- <div style="clear: both; height: 10px"></div>
- <?
- function getShipStatus($ordID) {
- $apo = false;
- $qry = "SELECT ordCountry, ordShipCountry, ordPoAPO, ordShipPoApo FROM orders WHERE ordID = $ordID";
- $res = mysql_query($qry) or print(mysql_error());
- $row = mysql_fetch_assoc($res);
-
- if(empty($row['ordShipCountry'])) $country = $row['ordCountry'];
- else $country = $row['ordShipCountry'];
-
- if($row['ordPoAPO']=='yes') {
- $apo = true;
- }
- if($row['ordShipPoApo']=='yes') {
- $apo = true;
- }
-
- if($apo) return 'USA';
- elseif($country=='United States of America') return 'USA';
- elseif($country=='Canada') return 'INTL';
- else return 'INTL';
- }
- ?>