当前位置: 首页>>代码示例>>PHP>>正文


PHP Hook::Run方法代码示例

本文整理汇总了PHP中Hook::Run方法的典型用法代码示例。如果您正苦于以下问题:PHP Hook::Run方法的具体用法?PHP Hook::Run怎么用?PHP Hook::Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hook的用法示例。


在下文中一共展示了Hook::Run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rate_quote_contact

 function rate_quote_contact()
 {
     $shipment = new Shipment($_POST['shipment_id'], $this->user);
     Hook::Run("post", "rate", $this->user['folder'], $this->user, $shipment, $this->session);
     $this->return['alert'] = "Thank you! Our rates department will contact you shortly.";
 }
开发者ID:kamalspalace,项目名称:_CORE,代码行数:6,代码来源:shipment.php

示例2: send_order_summery

 function send_order_summery()
 {
     $newData = '';
     if (strpos($_REQUEST['data']['id'], "_") !== false) {
         $tmp = explode("_", $_REQUEST['data']['id']);
         $Pbnum = (int) $tmp[0];
         $this->user['bill_to_code'] = $tmp[1];
     }
     $email = $_REQUEST['data']['email'];
     $findOrder = query("SELECT id,ext_id,data FROM `" . $this->user['database'] . "`.order_email_info WHERE ext_id=" . $Pbnum);
     $record = fetch($findOrder);
     if (empty($record)) {
         $data = json_encode(array('emailRecords' => array(array('email' => $email, 'insertTime' => date('Y-m-d H:i:s')))));
         $insertNewRecord = query("insert into `" . $this->user['database'] . "`.order_email_info (`ext_id`,`data`) values (" . $Pbnum . ",'" . $data . "')");
     } else {
         $data = array('email' => $email, 'insertTime' => date('Y-m-d H:i:s'));
         $emailRecords = json_decode($record['data'], true);
         if (count($emailRecords['emailRecords']) < 20) {
             array_push($emailRecords['emailRecords'], $data);
             $newData = json_encode($emailRecords);
             $updateNewRecord = query("update `" . $this->user['database'] . "`.order_email_info SET `data`='" . $newData . "' WHERE ext_id =" . $Pbnum);
         }
     }
     $req['Pbnum'] = $Pbnum;
     $req['bill_to_code'] = $this->user['bill_to_code'];
     $shipment = new Shipment('', $this->user['database']);
     $integrate = new IntegrationHandler($this->user);
     $arrTrackingRequest = $integrate->process_request('tracking_details_request', $req);
     $degama = new IntegrationHandler($this->user);
     $handshake = $degama->process_request("handshake");
     $shipment->ext_id = $arrTrackingRequest['Pbnum'];
     $shipment->timestamp = $arrTrackingRequest['ProDate'];
     $shipment->bill_name = (string) $handshake->Name;
     $shipment->bill_account = $req['bill_to_code'];
     $shipment->ship_email = $email;
     $shipment->division = $arrTrackingRequest['Division'];
     $shipment->service = $arrTrackingRequest['service'];
     $shipment->ship_contact = $arrTrackingRequest['RefName'];
     $shipment->ship_name = $arrTrackingRequest['ShipName'];
     $shipment->ship_street1 = $arrTrackingRequest['Add1'];
     $shipment->ship_street2 = $arrTrackingRequest['Add2'];
     $shipment->ship_city = $arrTrackingRequest['City'];
     $shipment->ship_province = $arrTrackingRequest['Prv'];
     $shipment->ship_postal = $arrTrackingRequest['Postal'];
     $shipment->cons_name = $arrTrackingRequest['ConsigName'];
     $shipment->cons_contact = $arrTrackingRequest['ConRefName'];
     $shipment->cons_street1 = $arrTrackingRequest['ConAdd1'];
     $shipment->cons_street2 = $arrTrackingRequest['ConAdd2'];
     $shipment->cons_city = $arrTrackingRequest['ConCity'];
     $shipment->cons_province = $arrTrackingRequest['ConPrv'];
     $shipment->cons_postal = $arrTrackingRequest['ConPostal'];
     $shipment->pup_date = $arrTrackingRequest['PupDate'];
     $shipment->pup_time = $arrTrackingRequest['PupTime'];
     $shipment->total_pieces = $arrTrackingRequest['Pieces'];
     $shipment->total_weight = $arrTrackingRequest['Weight'];
     //$shipment->uom_weight = $arrTrackingRequest['W-Uom'];
     //$shipment->uom_dim = '';
     $shipment->goods = array();
     $good[0] = array('packaging' => $arrTrackingRequest['pkg'], 'particulars' => $arrTrackingRequest['ComDescr'], 'commodity' => $arrTrackingRequest['ComDescr'], 'length' => $arrTrackingRequest['length'], 'width' => $arrTrackingRequest['width'], 'height' => $arrTrackingRequest['height']);
     $shipment->goods = $good;
     $shipment->equipment = $arrTrackingRequest['Equipment'];
     Hook::Run("post", "shipment", $this->user['folder'], $this->user, $shipment);
 }
开发者ID:kamalspalace,项目名称:_CORE,代码行数:63,代码来源:tracking.php

示例3: notify

 function notify()
 {
     $this->user['group'] = 1;
     $this->user['status'] = 1;
     print Hook::Run("cron", "shipment", $this->user['folder'], $this->user);
 }
开发者ID:kamalspalace,项目名称:_CORE,代码行数:6,代码来源:view_manager.php


注:本文中的Hook::Run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。