[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/ -> shipping_manifest.php (source)

   1  <?php
   2  
   3    require ('includes/application_top.php');
   4  
   5      if ($HTTP_GET_VARS['pickup_date']) {
   6          $pickup_date = $HTTP_GET_VARS['pickup_date'];
   7          }
   8      else {
   9          $latest_date = tep_db_query("select pickup_date from " . TABLE_SHIPPING_MANIFEST . " order by pickup_date desc limit 1");
  10          $pickup_date = tep_db_fetch_array($latest_date);
  11          $pickup_date = $pickup_date['pickup_date'];
  12          }
  13  
  14      if ($HTTP_GET_VARS['action'] == 'purge') {
  15          $purge_manifest_date = tep_db_query("delete from " . TABLE_SHIPPING_MANIFEST . " where pickup_date = '" . $pickup_date . "'");
  16          if ($purge_manifest_date) {
  17              tep_redirect(FILENAME_SHIPPING_MANIFEST);
  18              }
  19          }
  20      else {
  21      
  22          $display_date = explode('-',$pickup_date);
  23          // format date to look nice
  24          $display_date = $display_date[1] . '/' . $display_date[2] . '/' . $display_date[0];
  25          
  26          // get data about the store
  27          $store_data = array
  28              (
  29                  'STORE_NAME', // 0
  30                  'MODULE_SHIPPING_FEDEX1_ADDRESS_1', // 1
  31                  'MODULE_SHIPPING_FEDEX1_CITY', // 2
  32                  'MODULE_SHIPPING_FEDEX1_STATE', // 3
  33                  'MODULE_SHIPPING_FEDEX1_POSTAL', // 4
  34                  'MODULE_SHIPPING_FEDEX1_ACCOUNT' // 5
  35                  );
  36  
  37          $i = 0;
  38      
  39          foreach ($store_data as $data) {
  40              $store_info_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = '" . $data . "'");
  41              $value = tep_db_fetch_array($store_info_query);
  42              $value = $value['configuration_value'];
  43              // add store variables to store_values
  44              $store_values[] = $value;
  45              $i++;
  46              }
  47      
  48  ?>
  49  
  50  <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  51  <html <?php echo HTML_PARAMS; ?>>
  52  <head>
  53  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  54  <title>FedEx Shipping Manifest</title>
  55  
  56  <style type="text/css">
  57  <!-- 
  58  td {
  59    font-family: Verdana, Arial, sans-serif;
  60    font-size: 8px;
  61      text-align: left;
  62      padding-left: 5px;
  63      }
  64  td.head {
  65      border-left: 1px dashed #000000;
  66      border-bottom: 1px dashed #000000;
  67      border-top: 1px dashed #000000;
  68      padding-top: 3px;
  69      padding-bottom: 5px;
  70      }
  71  td.first-head {
  72      border-bottom: 1px dashed #000000;
  73      border-top: 1px dashed #000000;
  74      padding-top: 3px;
  75      padding-bottom: 5px;
  76      }
  77  td.data {
  78      padding-left: 10px;
  79      }
  80  td.totals {
  81      border-top: 1px dashed #000000;
  82      border-bottom: 1px dashed #000000;
  83      padding-top: 5px;
  84      padding-bottom: 10px;
  85      padding-left: 10px;
  86      }
  87  td.border {
  88      border-right: 1px dashed #000000;
  89      border-bottom: 1px dashed #000000;
  90      padding-top: 10px;
  91      padding-bottom: 10px;
  92      }    
  93  td.border-bottom {
  94      border-bottom: 1px dashed #000000;
  95      }    
  96  li {
  97      padding-top: 5px;
  98      padding-bottom: 5px;
  99      }
 100  table.bordered {
 101      margin-left: 5px;
 102      border-left: 1px dashed #000000;
 103      border-top: 1px dashed #000000;
 104      }
 105      
 106  -->
 107  </style>
 108  
 109  </head>
 110  
 111  <body>
 112  
 113          <table border="0" cellpadding="0" cellspacing="0" width="640" align="left">
 114        <tr>
 115          <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '1', '40'); ?></td>
 116        </tr>
 117              <tr>
 118                  <td>&nbsp;</td>
 119                  <td align="center" class="pageHeading"><?php echo strtoupper('FedEx Ground Pick-up Manifest'); ?></td>
 120                  <td>&nbsp;</td>
 121              </tr>
 122        <tr>
 123          <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '1', '40'); ?></td>
 124        </tr>
 125              <tr>
 126                  <td width="34%" class="main" valign="top"><?php echo strtoupper($store_values[0]); ?>
 127  <br>
 128                      <?php echo strtoupper($store_values[1]); ?><br>
 129                      <?php echo strtoupper($store_values[2]) . ', ' . strtoupper($store_values[3]); ?> <?php echo strtoupper($store_values[4]); ?></td>
 130                  <td width="33%" class="main" valign="top">FedEx Account Number: <?php echo $store_values[5]; ?></td>
 131                  <td width="33%" align="right" class="main" valign="top">Date: <?php echo $display_date; ?></td>
 132              </tr>
 133        <tr>
 134          <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '1', '50'); ?></td>
 135        </tr>
 136              <tr>
 137                  <td colspan="3">
 138                      <table border="0" cellpadding="0" cellspacing="0" width="100%">
 139                          <tr class="head">
 140                              <td class="first-head" valign="top" align="center" width="150">Tracking #</td>
 141                              <td class="head" valign="top" align="center" width="100">COD<br>
 142                                  Amount</td>
 143                              <td class="head" valign="top" align="center" width="100">Decl. Value<br>
 144                                  (if &gt;$100)</td>
 145                              <td class="head" valign="top" align="center" width="100">Oversized 1</td>
 146                              <td class="head" valign="top" align="center" width="100">Oversized 2</td>
 147                              <td class="head" valign="top" align="center" width="100">Oversized 3</td>
 148                              <td class="head" valign="top" align="center" width="100">Residential</td>
 149                          </tr>
 150                          <tr>
 151                              <td colspan="7">&nbsp;</td>
 152                          </tr>
 153  <?php
 154  
 155          $manifest_query = tep_db_query("select tracking_num, cod, package_value, oversized, residential from " . TABLE_SHIPPING_MANIFEST . " where pickup_date = '" . $pickup_date . "'");
 156      
 157          $package_count = 0;
 158          $cod_count = 0;
 159          $package_value_count = 0;
 160          $oversized_1_count = 0;
 161          $oversized_2_count = 0;
 162          $oversized_3_count = 0;
 163          $residential_count = 0;
 164          $international_count = 0;
 165      
 166          while ($manifest_data = tep_db_fetch_array($manifest_query)) {
 167          
 168              // count the number of packages
 169              $package_count++;
 170              echo '<tr>';
 171              echo '<td class="data">' . $manifest_data['tracking_num'] . '</td>';
 172          
 173              // cod - count the number of packages shipped cod
 174              if ($cod) {
 175                  echo '<td class="data">X</td>';
 176                  $cod_count++;
 177                  }
 178              else {
 179                  echo '<td class="data">&nbsp;</td>';
 180                  }            
 181          
 182              // package value - count the number of packages over $100 in value
 183              if ($manifest_data['package_value']>100) {
 184                  echo '<td class="data">' . $manifest_data['package_value'] . '</td>';
 185                  $package_value_count++;
 186                  }
 187              else {
 188                  echo '<td class="data">&nbsp;</td>';
 189                  }
 190              
 191              if ($manifest_data['oversized']) {
 192                  // count the number of each oversized option
 193                  if ($manifest_data['oversized']==1) {
 194                      echo '<td class="data">X</td>';
 195                      echo '<td class="data">&nbsp;</td><td class="data">&nbsp;</td>';
 196                      $oversized_1_count++;
 197                      }
 198                  elseif ($manifest_data['oversized']==2) {
 199                      echo '<td class="data">&nbsp;</td>';
 200                      echo '<td class="data">X</td><td class="data">&nbsp;</td>';
 201                      $oversized_2_count++;
 202                      }
 203                  elseif ($manifest_data['oversized']==3) {
 204                      echo '<td class="data">&nbsp;</td><td class="data">&nbsp;</td>';
 205                      echo '<td class="data">X</td>';
 206                      $oversized_3_count++;
 207                      }
 208                  }
 209              else {
 210                  echo '<td class="data">&nbsp;</td><td class="data">&nbsp;</td><td class="data">&nbsp;</td>';
 211                  }
 212  
 213              if ($manifest_data['residential']=='Y') {
 214                  echo '<td class="data">X</td>';
 215                  $residential_count++;
 216                  }
 217              else {
 218                  echo '<td class="data">&nbsp;</td>';
 219                  }
 220              echo '</tr>';
 221              }
 222  ?>
 223                      <tr>
 224                          <td colspan="7">&nbsp;</td>
 225                      </tr>
 226                      <tr>
 227                          <td class="totals" align="right">Total Packages:</td>
 228                          <td class="totals"><?php echo $cod_count; ?></td>
 229                          <td class="totals"><?php echo $package_value_count; ?></td>
 230                          <td class="totals"><?php echo $oversized_1_count; ?></td>
 231                          <td class="totals"><?php echo $oversized_2_count; ?></td>                        
 232                          <td class="totals"><?php echo $oversized_3_count; ?></td>
 233                          <td class="totals"><?php echo $residential_count; ?></td>                        
 234                      </table>
 235                  </td>
 236              </tr>
 237              <tr>
 238                  <td colspan="3">
 239                      <ol>
 240                          <li>THE LIABILITY OF FEDEX GROUND IS LIMITED TO THE SUM OF $100 PER PACKAGE, UNLESS A HIGHER VALUE IS DECLARED BY A SHIPPER AND AN ADDITIONAL CHARGE IS PAID AT THE RATE SET FORTH IN THE CURRENT FEDEX GROUND RATES SCHEDULE AND TARIFF PER EACH $100.00 OF ADDITIONAL VALUE, OR FRACTION THEREOF. CLAIMS NOT MADE TO FEDEX GROUND WITHIN 9 MONTHS OF THE SCHEDULED DELIVERY DATE ARE WAIVED.</li>
 241                          <li>THE ENTRY OF A C.O.D. AMOUNT IS NOT A DECLARATION OF VALUE.</li>
 242                          <li>IN NO EVENT SHALL FEDEX GROUND BE LIABLE FOR ANY SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING, WITHOUT LIMITATION, LOSS OF PROFITS OR INCOME, WHETHER OR NOT FEDEX GROUND HAD KNOWLEDGE THAT SUCH DAMAGES MIGHT BE INCURRED.</li>
 243                      </ol>
 244                  </td>
 245              </tr>
 246              <tr>
 247                  <td colspan="3">
 248                      <table border="0" cellpadding="0" cellspacing="0" width="100%">
 249                          <tr>
 250                              <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '20'); ?></td>
 251                          </tr>                        
 252                          <tr>
 253                              <td>
 254                                  <table border="0" cellpadding="0" cellspacing="0" width="250" class="bordered">
 255                                      <tr>
 256                                          <td class="border" colspan="2">This section to be completed by Driver</td>
 257                                      <tr>
 258                                          <td class="border">Total Packages:</td>
 259                                          <td class="border">Core Zone:</td>
 260                                      </tr>
 261                                      <tr>
 262                                          <td class="border" colspan="2">Pickup Time:</td>
 263                                      </tr>
 264                                      <tr>
 265                                          <td class="border" colspan="2">Driver Number:</td>                                
 266                                      </tr>
 267                                      <tr>
 268                                          <td class="border" colspan="2">Driver Signature:</td>
 269                                      </tr>
 270                                  </table>
 271                              </td>
 272                              <td>
 273                                  <table border="0" cellpadding="0" cellspacing="0" width="250" class="bordered">
 274                                      <tr>
 275                                          <td class="border">Total Domestic Bar Codes:</td>
 276                                          <td class="border"><?php echo $package_count - $residential_count - $international_count; ?></td>
 277                                      </tr>
 278                                      <tr>
 279                                          <td class="border">Total International Bar Codes:</td>
 280                                          <td class="border"><?php echo $international_count; ?></td>
 281                                      </tr>
 282                                      <tr>
 283                                          <td class="border">Total FedEx Home Delivery Bar Codes:</td>
 284                                          <td class="border"><?php echo $residential_count; ?></td>
 285                                      </tr>
 286                                      <tr>
 287                                          <td class="border">Total Packages:</td>
 288                                          <td class="border"><?php echo $package_count; ?></td>
 289                                      </tr>
 290                                  </table>
 291                              <td>
 292                          </tr>
 293                          <tr>
 294                              <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '20'); ?></td>
 295                          <tr>
 296                              <td>
 297                                  <table border="0" cellpadding="0" cellspacing="0" width="100%" class="bordered">
 298                                      <tr>
 299                                          <td class="border" colspan="2">This section to be completed for spotted trailers</td>
 300                                      </tr>
 301                                      <tr>
 302                                          <td class="border">Shipper Load?</td>
 303                                          <td class="border">Trailer #:</td>
 304                                      </tr>
 305                                  </table>
 306                              </td>
 307                          </tr>
 308                      </table>
 309                  </td>
 310              </tr>
 311              <tr>
 312                  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '20'); ?></td>
 313              <tr>
 314              <tr>
 315                  <td class="border-bottom" colspan="3">&nbsp;</td>
 316              </tr>
 317              <tr>
 318                  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '20'); ?></td>
 319              <tr>
 320              <tr>
 321                  <td><a href="#" onclick="window.print(); return false"><img src=
 322            "includes/languages/english/images/buttons/button_print.gif"  border="0" alt="<?php echo IMAGE_ORDERS_PRINT; ?>" title="<?php echo IMAGE_ORDERS_PRINT; ?>"></a>
 323                  </td>
 324                  <td align="center" valign="top">Available manifests:<br>
 325                      <form name="manifest_dates">
 326                          <select name="manifest_links" onChange="window.location=document.manifest_dates.manifest_links.options[document.manifest_dates.manifest_links.selectedIndex].value">                
 327  
 328  <?php
 329          // menu options for all available dates
 330          $manifest_dates_query = tep_db_query("select distinct pickup_date from " . TABLE_SHIPPING_MANIFEST . "");
 331          while ($date = tep_db_fetch_array($manifest_dates_query)) {
 332              $new_display_date = explode('-',$date['pickup_date']);
 333              $new_display_date = $new_display_date[1] . '/' . $new_display_date[2] . '/' . $new_display_date[0];
 334              if ($new_display_date == $display_date) {
 335                  echo '<option selected value="javascript:void(0)">' . $display_date;
 336                  }
 337              else {    
 338                  echo '<option value="?pickup_date=' . $date['pickup_date'] . '">' . $new_display_date;
 339                  }
 340              $i++;
 341              }
 342  ?>
 343                          </select>
 344                      </form>
 345                  </td>
 346                  <td><a href="?action=purge&pickup_date=<?php echo $pickup_date; ?>" onClick="return(window.confirm('Delete all manifest entries from <?php echo $display_date; ?>?'));"><img src=
 347            "includes/languages/english/images/buttons/button_purge_manifest.gif"  border="0" alt="<?php echo IMAGE_PURGE_MANIFEST; ?>" title="<?php echo IMAGE_PURGE_MANIFEST; ?>"></a>
 348                  </td>
 349              </tr>
 350          </table>
 351      </body>
 352  
 353  </html>
 354  
 355  <?php
 356          }
 357  ?>


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