當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Quote::read_by_params方法代碼示例

本文整理匯總了PHP中Quote::read_by_params方法的典型用法代碼示例。如果您正苦於以下問題:PHP Quote::read_by_params方法的具體用法?PHP Quote::read_by_params怎麽用?PHP Quote::read_by_params使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Quote的用法示例。


在下文中一共展示了Quote::read_by_params方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: order_request

 public function order_request($params = [])
 {
     $quote = Quote::read_by_params($params);
     if (!isset($quote['id'])) {
         Render::error_404();
     }
     $order = $params;
     $order += $quote;
     $order['country'] = Util::get_countries()[$order['country']];
     $order['payment'] = Util::get_payments()[$order['payment']];
     if (!isset($order['po'])) {
         $order['po'] = '';
     }
     $body = Template::render_doc_by_name('order-email', $order);
     // send order request to "WinWrap Web Primary/web.primary@winwrap.com"
     $linkc = 'https://www.winwrap.com/web/basic/support/admin/new_company.asp' . '?license=16' . '&company=' . urlencode($order['company']) . '&country=' . urlencode($order['country']) . '&billingaddress=' . urlencode(str_replace("\r\n", '|', $order['address'])) . '&billingname=' . urlencode($order['billing_name']) . '&billingaddr=' . urlencode($order['billing_email']) . '&billingphone=' . urlencode($order['billing_phone']) . '&name=' . urlencode($order['technical_name']) . '&addr=' . urlencode($order['technical_email']);
     $link = 'https://www.winwrap.com/web/basic/support/admin/new_fees.asp' . '?licenseid=' . '&company=' . urlencode($order['company']) . '&feecount=0' . '&payment=' . urlencode($order['payment']) . '&po=' . urlencode($order['po']);
     if (!is_null($quote['discount'])) {
         $link .= '&WWXX00=' . urlencode($quote['discount']) . '&WWXX00_DESC=' . urlencode($quote['discount_desc']);
     }
     $problem = false;
     $parts = [];
     foreach ($quote['items'] as $item) {
         $link .= '&' . $item['part'] . '=' . $item['quantity'];
         $part = substr($item['part'], 0, 6);
         if (array_search($part, $parts)) {
             $problem = true;
         } else {
             $parts[] = $part;
         }
         if (isset($item['override'])) {
             $link .= '&' . $part . '-override=' . $item['override'];
         }
     }
     $bodyc = '1) Click on this link to create the new company:' . "\r\n" . $linkc . "\r\n\r\n";
     if ($problem) {
         $bodyc .= '*** the following link will not create the correct fees ***' . "\r\n";
     }
     $bodyc .= '2) Click on this link to create the fees and invoice:' . "\r\n" . $link . "\r\n\r\n" . $body;
     $args = ['IP: ' . $_SERVER['REMOTE_ADDR'] . "\r\n\r\n" . 'toname' => 'WinWrap Web Primary', 'toemail' => 'web.primary@winwrap.com', 'fromname' => 'WinWrap Web Primary', 'fromemail' => 'web.primary@winwrap.com', 'subject' => 'WinWrap Basic Order Request', 'body' => $bodyc];
     if (GoogleMail::send($args) !== true) {
         header('Status: 500');
         return;
     }
     $status = '1/2: send to ' . $args['toemail'] . "\r\n";
     //echo '<pre>' . $body . '</pre>'; exit;
     // send order request to puchaser
     $args = ['toname' => $order['billing_name'], 'toemail' => $order['billing_email'], 'fromname' => 'WinWrap Support', 'fromemail' => 'support@mail.winwrap.com', 'subject' => 'WinWrap Basic Order Request', 'body' => $body];
     if (GoogleMail::send($args) !== true) {
         header('Status: 500');
         return;
     }
     $status .= '2/2: send to ' . $args['toemail'];
     Render::text($status);
 }
開發者ID:wileybenet,項目名稱:mobile-docs,代碼行數:55,代碼來源:product_ctrl.php


注:本文中的Quote::read_by_params方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。