本文整理汇总了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);
}