亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ups.php

?? osCommerce最好的電子商務程序 2.2
?? PHP
字號:
<?php
/*
  $Id: ups.php,v 1.1.1.1 2004/10/09 14:29:26 cvsadmin Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  class ups {
    var $code, $title, $descrption, $icon, $enabled, $types;

// class constructor
    function ups() {
      global $order;

      $this->code = 'ups';
      $this->title = MODULE_SHIPPING_UPS_TEXT_TITLE;
      $this->description = MODULE_SHIPPING_UPS_TEXT_DESCRIPTION;
      $this->sort_order = MODULE_SHIPPING_UPS_SORT_ORDER;
      $this->icon = DIR_WS_ICONS . 'shipping_ups.gif';
      $this->tax_class = MODULE_SHIPPING_UPS_TAX_CLASS;
      $this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);

      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_UPS_ZONE > 0) ) {
        $check_flag = false;
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_UPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
        while ($check = tep_db_fetch_array($check_query)) {
          if ($check['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
        }

        if ($check_flag == false) {
          $this->enabled = false;
        }
      }

      $this->types = array('1DM' => 'Next Day Air Early AM',
                           '1DML' => 'Next Day Air Early AM Letter',
                           '1DA' => 'Next Day Air',
                           '1DAL' => 'Next Day Air Letter',
                           '1DAPI' => 'Next Day Air Intra (Puerto Rico)',
                           '1DP' => 'Next Day Air Saver',
                           '1DPL' => 'Next Day Air Saver Letter',
                           '2DM' => '2nd Day Air AM',
                           '2DML' => '2nd Day Air AM Letter',
                           '2DA' => '2nd Day Air',
                           '2DAL' => '2nd Day Air Letter',
                           '3DS' => '3 Day Select',
                           'GND' => 'Ground',
                           'GNDCOM' => 'Ground Commercial',
                           'GNDRES' => 'Ground Residential',
                           'STD' => 'Canada Standard',
                           'XPR' => 'Worldwide Express',
                           'XPRL' => 'worldwide Express Letter',
                           'XDM' => 'Worldwide Express Plus',
                           'XDML' => 'Worldwide Express Plus Letter',
                           'XPD' => 'Worldwide Expedited');
    }

// class methods
    function quote($method = '') {
      global $HTTP_POST_VARS, $order, $shipping_weight, $shipping_num_boxes;

      if ( (tep_not_null($method)) && (isset($this->types[$method])) ) {
        $prod = $method;
      } else {
        $prod = 'GNDRES';
      }

      if ($method) $this->_upsAction('3'); // return a single quote

      $this->_upsProduct($prod);

      $country_name = tep_get_countries(SHIPPING_ORIGIN_COUNTRY, true);
      $this->_upsOrigin(SHIPPING_ORIGIN_ZIP, $country_name['countries_iso_code_2']);
      $this->_upsDest($order->delivery['postcode'], $order->delivery['country']['iso_code_2']);
      $this->_upsRate(MODULE_SHIPPING_UPS_PICKUP);
      $this->_upsContainer(MODULE_SHIPPING_UPS_PACKAGE);
      $this->_upsWeight($shipping_weight);
      $this->_upsRescom(MODULE_SHIPPING_UPS_RES);
      $upsQuote = $this->_upsGetQuote();

      if ( (is_array($upsQuote)) && (sizeof($upsQuote) > 0) ) {
        $this->quotes = array('id' => $this->code,
                              'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'lbs)');

        $methods = array();
        $qsize = sizeof($upsQuote);
        for ($i=0; $i<$qsize; $i++) {
          list($type, $cost) = each($upsQuote[$i]);
          $methods[] = array('id' => $type,
                             'title' => $this->types[$type],
                             'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
        }

        $this->quotes['methods'] = $methods;

        if ($this->tax_class > 0) {
          $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
        }
      } else {
        $this->quotes = array('module' => $this->title,
                              'error' => 'An error occured with the UPS shipping calculations.<br>' . $upsQuote . '<br>If you prefer to use UPS as your shipping method, please contact the store owner.');
      }

      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

      return $this->quotes;
    }

    function check() {
      if (!isset($this->_check)) {
        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_UPS_STATUS'");
        $this->_check = tep_db_num_rows($check_query);
      }
      return $this->_check;
    }

    function install() {
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable UPS Shipping', 'MODULE_SHIPPING_UPS_STATUS', 'True', 'Do you want to offer UPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Pickup Method', 'MODULE_SHIPPING_UPS_PICKUP', 'CC', 'How do you give packages to UPS? CC - Customer Counter, RDP - Daily Pickup, OTP - One Time Pickup, LC - Letter Center, OCA - On Call Air', '6', '0', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('UPS Packaging?', 'MODULE_SHIPPING_UPS_PACKAGE', 'CP', 'CP - Your Packaging, ULE - UPS Letter, UT - UPS Tube, UBE - UPS Express Box', '6', '0', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Residential Delivery?', 'MODULE_SHIPPING_UPS_RES', 'RES', 'Quote for Residential (RES) or Commercial Delivery (COM)', '6', '0', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_UPS_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_UPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_UPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_UPS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
    }

    function remove() {
      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
      return array('MODULE_SHIPPING_UPS_STATUS', 'MODULE_SHIPPING_UPS_PICKUP', 'MODULE_SHIPPING_UPS_PACKAGE', 'MODULE_SHIPPING_UPS_RES', 'MODULE_SHIPPING_UPS_HANDLING', 'MODULE_SHIPPING_UPS_TAX_CLASS', 'MODULE_SHIPPING_UPS_ZONE', 'MODULE_SHIPPING_UPS_SORT_ORDER');
    }

    function _upsProduct($prod){
      $this->_upsProductCode = $prod;
    }

    function _upsOrigin($postal, $country){
      $this->_upsOriginPostalCode = $postal;
      $this->_upsOriginCountryCode = $country;
    }

    function _upsDest($postal, $country){
      $postal = str_replace(' ', '', $postal);

      if ($country == 'US') {
        $this->_upsDestPostalCode = substr($postal, 0, 5);
      } else {
        $this->_upsDestPostalCode = $postal;
      }

      $this->_upsDestCountryCode = $country;
    }

    function _upsRate($foo) {
      switch ($foo) {
        case 'RDP':
          $this->_upsRateCode = 'Regular+Daily+Pickup';
          break;
        case 'OCA':
          $this->_upsRateCode = 'On+Call+Air';
          break;
        case 'OTP':
          $this->_upsRateCode = 'One+Time+Pickup';
          break;
        case 'LC':
          $this->_upsRateCode = 'Letter+Center';
          break;
        case 'CC':
          $this->_upsRateCode = 'Customer+Counter';
          break;
      }
    }

    function _upsContainer($foo) {
      switch ($foo) {
        case 'CP': // Customer Packaging
          $this->_upsContainerCode = '00';
          break;
        case 'ULE': // UPS Letter Envelope
          $this->_upsContainerCode = '01';
          break;
        case 'UT': // UPS Tube
          $this->_upsContainerCode = '03';
          break;
        case 'UEB': // UPS Express Box
          $this->_upsContainerCode = '21';
          break;
        case 'UW25': // UPS Worldwide 25 kilo
          $this->_upsContainerCode = '24';
          break;
        case 'UW10': // UPS Worldwide 10 kilo
          $this->_upsContainerCode = '25';
          break;
      }
    }

    function _upsWeight($foo) {
      $this->_upsPackageWeight = $foo;
    }

    function _upsRescom($foo) {
      switch ($foo) {
        case 'RES': // Residential Address
          $this->_upsResComCode = '1';
          break;
        case 'COM': // Commercial Address
          $this->_upsResComCode = '2';
          break;
      }
    }

    function _upsAction($action) {
      /* 3 - Single Quote
         4 - All Available Quotes */

      $this->_upsActionCode = $action;
    }

    function _upsGetQuote() {
      if (!isset($this->_upsActionCode)) $this->_upsActionCode = '4';

      $request = join('&', array('accept_UPS_license_agreement=yes',
                                 '10_action=' . $this->_upsActionCode,
                                 '13_product=' . $this->_upsProductCode,
                                 '14_origCountry=' . $this->_upsOriginCountryCode,
                                 '15_origPostal=' . $this->_upsOriginPostalCode,
                                 '19_destPostal=' . $this->_upsDestPostalCode,
                                 '22_destCountry=' . $this->_upsDestCountryCode,
                                 '23_weight=' . $this->_upsPackageWeight,
                                 '47_rate_chart=' . $this->_upsRateCode,
                                 '48_container=' . $this->_upsContainerCode,
                                 '49_residential=' . $this->_upsResComCode));
      $http = new httpClient();
      if ($http->Connect('www.ups.com', 80)) {
        $http->addHeader('Host', 'www.ups.com');
        $http->addHeader('User-Agent', 'osCommerce');
        $http->addHeader('Connection', 'Close');

        if ($http->Get('/using/services/rave/qcostcgi.cgi?' . $request)) $body = $http->getBody();

        $http->Disconnect();
      } else {
        return 'error';
      }

      $body_array = explode("\n", $body);

      $returnval = array();
      $errorret = 'error'; // only return error if NO rates returned

      $n = sizeof($body_array);
      for ($i=0; $i<$n; $i++) {
        $result = explode('%', $body_array[$i]);
        $errcode = substr($result[0], -1);
        switch ($errcode) {
          case 3:
            if (is_array($returnval)) $returnval[] = array($result[1] => $result[8]);
            break;
          case 4:
            if (is_array($returnval)) $returnval[] = array($result[1] => $result[8]);
            break;
          case 5:
            $errorret = $result[1];
            break;
          case 6:
            if (is_array($returnval)) $returnval[] = array($result[3] => $result[10]);
            break;
        }
      }
      if (empty($returnval)) $returnval = $errorret;

      return $returnval;
    }
  }
?>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩亚洲欧美综合| 色婷婷av一区二区三区软件 | 欧美在线你懂的| 香蕉乱码成人久久天堂爱免费| 欧美理论片在线| 国产一区二区91| 一区二区三区不卡视频在线观看| 69精品人人人人| 久久99久久精品| 亚洲女同女同女同女同女同69| 欧美日本一道本在线视频| 国产麻豆日韩欧美久久| 亚洲一区免费在线观看| 精品国产区一区| 色综合久久久久综合体桃花网| 蜜臀精品一区二区三区在线观看 | 欧美一区二区人人喊爽| 懂色av一区二区夜夜嗨| 亚洲成国产人片在线观看| 欧美成人r级一区二区三区| 91亚洲精品久久久蜜桃| 美女视频黄频大全不卡视频在线播放| 亚洲国产精品二十页| 欧美精品久久99久久在免费线| 日本一不卡视频| 久久久久9999亚洲精品| 在线观看日韩精品| 激情欧美一区二区| 亚洲午夜日本在线观看| 国产精品色呦呦| 日韩你懂的在线播放| 成人午夜视频网站| 九一久久久久久| 日韩精品乱码免费| 国产精品日产欧美久久久久| 欧美xxxxxxxxx| 欧美日韩国产综合视频在线观看| 波多野结衣亚洲| 国产高清精品久久久久| 日韩激情在线观看| 亚洲中国最大av网站| 国产精品视频一二三区| 欧美疯狂做受xxxx富婆| 色天天综合久久久久综合片| 国产精品99久久久久久久女警| 日日夜夜精品视频免费| 亚洲精品日韩一| 国产精品白丝在线| 国产网红主播福利一区二区| 精品久久久网站| 欧美一级一区二区| 欧美日本国产一区| 欧美日韩综合在线| 欧美亚洲日本国产| 色狠狠一区二区| 色婷婷综合中文久久一本| av电影在线观看一区| 国产成人精品亚洲777人妖| 国产精品综合在线视频| 日韩av不卡在线观看| 日韩精品三区四区| 日韩电影在线免费观看| 奇米色一区二区三区四区| 日韩精品久久理论片| 麻豆国产欧美日韩综合精品二区| 日日摸夜夜添夜夜添亚洲女人| 午夜精品久久久久久久久| 亚洲一区二区欧美日韩| 亚洲国产你懂的| 五月综合激情网| 午夜电影久久久| 一区二区三区加勒比av| 亚洲一区免费视频| 亚洲国产精品精华液网站| 亚洲妇女屁股眼交7| 亚洲成精国产精品女| 日本免费新一区视频| 激情欧美一区二区三区在线观看| 韩国一区二区三区| 国产精品综合二区| 狠狠色综合播放一区二区| 国产老肥熟一区二区三区| 成人黄色在线看| 色综合天天在线| 欧美日本韩国一区二区三区视频 | 亚洲在线视频免费观看| 视频一区二区三区中文字幕| 蓝色福利精品导航| 成人精品视频一区| 在线观看免费亚洲| 欧美一级理论片| 日韩欧美国产综合| 国产精品福利在线播放| 亚洲日本青草视频在线怡红院| 亚洲成在人线免费| 国产在线精品一区二区不卡了| 成人aaaa免费全部观看| 欧美视频第二页| 精品国产91乱码一区二区三区| 国产精品乱码久久久久久| 一区二区高清免费观看影视大全| 日韩精品一卡二卡三卡四卡无卡| 国产一区二区在线电影| 色综合亚洲欧洲| 久久中文字幕电影| 亚洲免费观看高清完整版在线观看熊 | 欧美精品久久久久久久久老牛影院| 9191精品国产综合久久久久久| 欧美成人三级在线| 久久久午夜精品| 国产精品国产自产拍高清av | 国产精品欧美一区喷水| 亚洲3atv精品一区二区三区| 久久av资源站| 在线观看三级视频欧美| 国产嫩草影院久久久久| 婷婷丁香久久五月婷婷| 99视频在线观看一区三区| 欧美一区二区日韩| 一区二区三区在线观看动漫| 国产一区二区在线观看视频| 欧美性色综合网| 国产欧美一区二区三区网站| 日本亚洲视频在线| 欧美综合久久久| 国产精品素人一区二区| 精品亚洲国产成人av制服丝袜| 日本韩国欧美一区二区三区| 日韩一区二区精品葵司在线| 亚洲精品成人天堂一二三| 国产自产v一区二区三区c| 在线播放国产精品二区一二区四区| 中文字幕成人在线观看| 免费美女久久99| 一本色道久久综合亚洲aⅴ蜜桃| 久久久久久一级片| 日本成人超碰在线观看| 欧美性淫爽ww久久久久无| 18欧美亚洲精品| 国产91在线|亚洲| 精品女同一区二区| 日韩高清不卡在线| 5858s免费视频成人| 亚洲国产日产av| 在线精品视频免费观看| 亚洲特级片在线| 成人午夜精品一区二区三区| 精品国产网站在线观看| 久久av中文字幕片| 久久伊人蜜桃av一区二区| 精品一区二区三区免费观看| 欧美电视剧免费观看| 日本va欧美va精品发布| 制服.丝袜.亚洲.另类.中文 | 精品一区二区国语对白| 日韩欧美在线一区二区三区| 日本午夜精品一区二区三区电影| 欧美高清hd18日本| 日本欧美韩国一区三区| 欧美一三区三区四区免费在线看 | 97久久久精品综合88久久| 国产欧美一区二区三区鸳鸯浴 | 日本伊人精品一区二区三区观看方式| 欧美日韩你懂的| 日日噜噜夜夜狠狠视频欧美人| 91福利小视频| 亚洲国产欧美另类丝袜| 欧美精品高清视频| 五月综合激情日本mⅴ| 欧美一区二区三区免费视频| 六月婷婷色综合| 久久综合成人精品亚洲另类欧美| 国产高清成人在线| 亚洲人成网站色在线观看| 在线观看日产精品| 日韩成人一区二区三区在线观看| 日韩精品中文字幕一区 | 91麻豆国产自产在线观看| 久久久久久久久久美女| 国产综合色精品一区二区三区| 91精品一区二区三区久久久久久 | 国产成人aaaa| 综合精品久久久| 在线成人免费观看| 国产精品一区在线观看你懂的| 中文字幕av免费专区久久| 欧美区视频在线观看| 国产成人亚洲精品青草天美| 亚洲成人午夜影院| 国产欧美日韩亚州综合| 欧美高清视频www夜色资源网| 成人黄色在线看| 九色综合国产一区二区三区| 亚洲美女一区二区三区| 久久精品视频在线免费观看| 欧美伦理视频网站| 色综合天天综合网天天狠天天| 国产一区二区三区在线观看免费视频 | 爽好多水快深点欧美视频| 国产色一区二区|