<?php

function pad($strValue = "", $lengthOf = 0, $specialChar = "0", $appendMode = "left") {
   if ($lengthOf == 0 || ($appendMode != "left" && $appendMode != "right")) :
      return trim($strValue);
   endif;
   
   $len = strlen($strValue);
   for ($i = $len; $i < $lengthOf; $i++) :
       if ($appendMode == "left") :
          $strValue = $specialChar . $strValue;
       else :
          $strValue = $strValue . $specialChar;
       endif;
   endfor;
   return $strValue;
}

$trackingUserID = "stbx";
$trackingPassword = "cagtmv2924";


$req  = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
$req .= "<AmazonTrackingRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"AmazonTrackingRequest.xsd\">";
$req .= "<Validation><UserID>" . $trackingUserID . "</UserID><Password>" . $trackingPassword . "</Password></Validation><APIVersion>3.1</APIVersion>";
for ($i = 1; $i <= 600; $i++) :
    $testID = "test" . pad($i, 4, "0");
    $req .= "<TrackingNumber>" . $testID . "</TrackingNumber>";
endfor;
$req .= "</AmazonTrackingRequest>";

$req = urlencode($req);
?>


<html>

<head>

</head>

<body>

  <form name="jb_scan" action="../tracking/tracking_amazon.php" method="post">
  
    <input type="hidden" name="trackingReq" value="<?php echo $req ?>">

    <input type="submit" value="Senden">
 
  </form>

</body>

</html>
