<?php 
// Begin Fedex Automated Shipping Label Mod
// link to fedex shipment tracker
if (!function_exists('fedex_track')) {
  function fedex_track($order_id) {
    global $db;
    $fedex_query = "select fedex_tracking from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'";
    $fedexArray = $db->Execute($fedex_query);
    $fedex_tracking = $fedexArray->fields['fedex_tracking'];

    $trackLink = zen_href_link(FILENAME_TRACK_FEDEX);
    if ($fedex_tracking) {
      $trackLink = $trackLink . '?&track=' . $fedex_tracking;
    }
    return $trackLink;
  }
}
// End Fedex Automated Shipping Label Mod
?>