示例#1
0
文件: test.php 项目: mws2j/Textile
        $strServiceCode = "Standard";
        break;
    case 'XPR':
        $strServiceCode = "Worldwide Express";
        break;
    case 'XDM':
        $strServiceCode = "Worldwide Express Plus";
        break;
    case 'XPD':
        $strServiceCode = "Worldwide Expedited";
        break;
    default:
        $strServiceCode = "Ground";
        break;
}
$result = $objUpsRate->GetShippingRate($strDestinationZip, $strMethodShortName, $strPackageLength, $strPackageWidth, $strPackageHeight, $strPackageWeight, $boolReturnPriceOnly);
?>
        <form action= "" method = "post">
            <table id = "InputTable">
                <tr>
                    <th colspan="2">UPS Shipping Calculator</th>	
                </tr><tr>
                    <td colspan="2" style="font-size: 1.5em">Package Details</td>
                    <td colspan="2"><hr></td>
                </tr><tr>
                    <td> </td>
                    <td> </td>
                </tr><tr>
                    <td>Shipping Option:</td>
                    <td><?php 
echo $strServiceCode;
示例#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'];
 }