[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/ -> fedex_popup.php (source)

   1  <?php
   2  
   3    require ('includes/application_top.php');
   4      
   5      $oID = $HTTP_GET_VARS['oID'];
   6      $active = $HTTP_GET_VARS['active'];
   7      
   8      // check to see if there are multiple packages in this shipment
   9      $packages_query = tep_db_query("select multiple from " . TABLE_SHIPPING_MANIFEST . " where orders_id = " . $oID . " order by multiple asc");
  10      
  11      // if there's no other indication, first label should be active label
  12      if (!$active) {
  13          $active = 1;
  14          }
  15      
  16      $multiple = array();
  17      
  18      while ($packages = tep_db_fetch_array($packages_query)) {
  19          // if 'multiple' is populated, get all values into an array
  20  /*        
  21          echo '<pre>';
  22          echo 'packages is <br>';
  23          print_r($packages);
  24          echo '</pre>';
  25  */        
  26          if ($packages['multiple']) {
  27              $multiple[] = $packages['multiple'];
  28              }
  29          }
  30      
  31      // get the highest value from $multiple, it's the last label
  32      if ($multiple) {
  33          $last = max($multiple);
  34          }
  35      
  36      // now get the tracking number for the selected (active) label
  37      if ($multiple) {
  38          $tracking_num = tep_manifest_data($oID,$active);
  39          }
  40      elseif (!$multiple) {
  41          $tracking_num = $HTTP_GET_VARS['num'];
  42          }
  43  
  44  ?>
  45      
  46  <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  47  <html>
  48    <head>
  49  
  50      <style type="text/css">
  51      <!-- 
  52          table { 
  53              width: 675; 
  54              border-top: 1px dotted black; 
  55              }
  56          td {
  57              font-family: Verdana, Arial, sans-serif; 
  58              font-size: 12px; 
  59              }
  60          -->
  61      </style>
  62      <script language="JavaScript1.1" type="text/javascript">
  63      var NS4 = (document.layers) ? true : false ;var resolution = 96;if (NS4 && navigator.javaEnabled()){var toolkit = java.awt.Toolkit.getDefaultToolkit();resolution = toolkit.getScreenResolution();}
  64      </script>
  65      <script language="JavaScript" type="text/javascript">
  66      document.write('<img WIDTH=' + (675 * resolution )/100 + '<img HEIGHT=' + (467 * resolution )/100 + ' alt="ASTRA Barcode" src="images/fedex/<?php echo $tracking_num; ?>.png">');
  67      </script>
  68      <title></title>
  69    </head>
  70    <body>
  71      <table border="0" width="100%">
  72        <tr>
  73          <td colspan="3">
  74            <img src="images/pixel_trans.gif" border="0" alt=""
  75            width="1" height="100">
  76          </td>
  77        </tr>
  78        <tr>
  79          <td align="center">
  80            <a href="#" onclick=
  81            "window.print(); return false"><img src=
  82            "includes/languages/english/images/buttons/button_print.gif"
  83                 border="0" alt="IMAGE_ORDERS_PRINT" title=
  84                 " IMAGE_ORDERS_PRINT "></a>
  85          </td>
  86                  <td align="center">
  87  <?php
  88  
  89  // links for multiple packages
  90  
  91      if ($multiple) {
  92          if ($active != 1) {
  93              echo '<a href="?oID=' . $oID . '&active=' . ($active-1) . '">&lt;-- previous</a> &nbsp; ';
  94              }
  95          else {
  96              echo '&lt;-- previous';
  97              }
  98          foreach ($multiple as $package_num) {
  99              if ($active != $package_num) {
 100                  echo ' &nbsp; <a href="?oID=' . $oID . '&active=' . $package_num . '">' . $package_num . '</a> &nbsp; ';
 101                  }
 102              else {
 103                  echo ' <b>' . $package_num . '</b> ';
 104                  }
 105              }
 106          if ($active != $last) {
 107              echo ' &nbsp; <a href="?oID=' . $oID . '&active=' . ($active+1) . '">next --&gt;</a>';
 108              }
 109          else {
 110              echo ' &nbsp; next --&gt;';
 111              }
 112          }        
 113  ?>
 114          </td>
 115                  <td align="center">
 116            <a href="orders.php?oID=<?php echo $oID; ?>"><img src=
 117            "includes/languages/english/images/buttons/button_back.gif"
 118                 border="0" alt="IMAGE_ORDERS_BACK" title=
 119                 " IMAGE_ORDERS_BACK "></a>
 120          </td>
 121        </tr>
 122      </table>
 123    </body>
 124  </html>
 125  
 126  <?php
 127  
 128  function tep_manifest_data($oID, $active) {
 129      if (!$active) {
 130          $packages_query = tep_db_query("select tracking_num from " . TABLE_SHIPPING_MANIFEST . " where orders_id = " . $oID . "");
 131          }
 132      else {    
 133          $packages_query = tep_db_query("select tracking_num from " . TABLE_SHIPPING_MANIFEST . " where orders_id = " . $oID . " and multiple = '" . $active . "'");
 134          }
 135      while ($val = tep_db_fetch_array($packages_query)) {
 136          $tracking_num = $val['tracking_num'];
 137          }
 138      return $tracking_num;
 139      }
 140  ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7