Example #1
0
                <td></td>
                <td>This page displays the value that was returned from the UPS Rate Servers.</td>
            </tr>
        </table>
	</head>
    <br><hr><hr><br>
	<body>
        <?php 
function test_input($data)
{
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
}
$objUpsRate = new UpsShippingQuote();
/*   $strDestinationZip = test_input($_POST["varZip"]);
        $strMethodShortName = test_input($_POST["varShipping"]);
        $strPackageLength = test_input($_POST["varLen"]);
        $strPackageWidth = test_input($_POST["varWidth"]);
        $strPackageHeight = test_input($_POST["varHeight"]);
        $strPackageWeight = test_input($_POST["varWeight"]);
        $boolReturnPriceOnly = true;
    	$strUSPSWeight = test_input($_POST["USPSvarWeight"]);
        $strUSPSZip = test_input($_POST["USPSvarZip"]);*/
$strDestinationZip = test_input($_POST["varZip"]);
$strMethodShortName = test_input($_POST["varShipping"]);
$strPackageLength = 12;
$strPackageWidth = 12;
$strPackageHeight = 6;
$strPackageWeight = 5;
Example #2
0
 function calculateShipCost()
 {
     include_once '../classes/Lib/UPS/UPSRate.php';
     $sql = "SELECT * FROM shipments_master_table WHERE shipment_id=2";
     $obj = new Bin_Query();
     $obj->executeQuery($sql);
     $records = $obj->records[0];
     $shipment_accesskey = $records['shipment_accesskey'];
     $shipment_user_id = $records['shipment_user_id'];
     $shipment_password = $records['shipment_password'];
     $ship_duration = $_GET['ship_dur_id'];
     $buyer_zipcode = $_GET['zip'];
     $strServiceShortName = $_GET['ship_dur_id'];
     $product_weight = $_GET['weight'];
     $upsship = new UpsShippingQuote();
     $costupsship['ship_cost'] = $upsship->GetShippingRate($strDestinationZip = $buyer_zipcode, $strServiceShortName = $strServiceShortName, $strPackageLength = '0', $strPackageWidth = '0', $strPackageHeight = '0', $strPackageWeight = $product_weight, $boolReturnPriceOnly = true, $shipment_accesskey, $shipment_user_id, $shipment_password);
     return $costupsship['ship_cost'];
 }