This topic is locked
[SOLVED]

 Route Tracking Numbers to FEDEX / UPS

5/4/2012 9:51:13 PM
PHPRunner General questions
M
malnak author

Another just trying to contribute effort- I have a table with tracking numbers. I have another table ,shippingmethods, with shipping methods and shipping companies FEDEX and UPS. I wanted to hyperlink the tracking number to go to the correct company based on the shipping company listed in the shipping table. I formatted the field with a view as custom and applied this code. Kudos to Jane and Sergey for their assistance.

if ($data["TrackingNumber"] && $data["ShippingCode"]) { $rstmp = CustomQuery("select ShippingMethod,ShippingCompany from shippingmethods where ShippingMethodID=".$data["ShippingCode"]);

$datatmp = db_fetch_array($rstmp);

$coname = $datatmp["ShippingCompany"];

//$MyLink = new ShipTrack();

//$MyLink->PrintLink($coname,$data["ShippingCode"],"1","","_blank");
if ($coname=="FedEx")

$value = "<a href=\"http://www.fedex.com/Tracking/Detail?trackNum=".$data["TrackingNumber"]."\">".$data["TrackingNumber"]."</a>";;

if ($coname=="UPS")

$value = "<a href=\"http://wwwapps.ups.com/etracking/tracking.cgi?tracknums_displayed=1&TypeOfInquiryNumber=T&HTMLVersion=4.0&InquiryNumber1=".$data["TrackingNumber"]."\">".$data["TrackingNumber"]."</a>";;

}