[insert_php]

function cmp($obja, $objb)
{
$a = $obja->dataid;
$b = $objb->dataid;
if ($a == $b) {
return 0;
}
return ($a > $b) ? -1 : 1;
}

$url = ‘http://www.greensoftsolutions.co.in/WS2LS_WEBTRACK.asmx/webtrack’;

$fields = array(‘prmgrno’=>$_GET[“field-location”]
);

foreach($fields as $key=>$value) { $fields_string .= $key.’=’.$value.’&’; }

rtrim($fields_string,’&’);

// Posting with CURL

$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,$url);

curl_setopt($ch,CURLOPT_POST,count($fields));

curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$result = curl_exec($ch);

curl_close($ch);

$xml = new DOMDocument(‘1.0’, ‘utf-8’);
$xml->formatOutput = true;
$xml->preserveWhiteSpace = false;
$xml->loadXML($result);
$json=$xml->getElementsByTagName(‘string’)->item(0)->textContent;

$arrTopTable=json_decode($json)->Table;
$arrTable=json_decode($json)->Table1;
usort($arrTable,”cmp”);

//print_r( $arrTable);

[/insert_php]

[insert_php]
for($i=0;$i“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
}
[/insert_php]

Consignment Tracking
Consignment Ref # Pickup Date Destination Status View Details
“.$arrTopTable[$i]->grnotext.” “.$arrTopTable[$i]->awbdt.” “.$arrTopTable[$i]->destination.” “.$arrTopTable[$i]->currentstatus.” View
* Please click on view details to get more information about your consignment.