You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
450 B
PHTML
18 lines
450 B
PHTML
3 years ago
|
<?php
|
||
|
|
||
|
$trackinginfo;
|
||
|
|
||
|
try {
|
||
|
if (!empty($VARS["carrier"])) {
|
||
|
$trackinginfo = Tracking::track($VARS["code"], $VARS["carrier"]);
|
||
|
} else {
|
||
|
$trackinginfo = Tracking::track($VARS["code"]);
|
||
|
}
|
||
|
} catch (TrackingException $ex) {
|
||
|
sendJsonResp($ex->getMessage(), "ERROR");
|
||
|
}
|
||
|
|
||
|
if (is_null($trackinginfo)) {
|
||
|
sendJsonResp("Could not find any results for that tracking code.", "ERROR");
|
||
|
}
|
||
|
exitWithJson($trackinginfo->toObject());
|