本文整理汇总了PHP中SC_Utils_Ex::sfTrim方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Utils_Ex::sfTrim方法的具体用法?PHP SC_Utils_Ex::sfTrim怎么用?PHP SC_Utils_Ex::sfTrim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Utils_Ex
的用法示例。
在下文中一共展示了SC_Utils_Ex::sfTrim方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sfSendOrderMail
function sfSendOrderMail($order_id, $template_id, $subject = "", $header = "", $footer = "", $send = true)
{
$arrTplVar = new stdClass();
$arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
$arrTplVar->arrInfo = $arrInfo;
$objQuery = new SC_Query_Ex();
if ($subject == "" && $header == "" && $footer == "") {
// メールテンプレート情報の取得
$where = "template_id = ?";
$arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($template_id));
$arrTplVar->tpl_header = $arrRet[0]['header'];
$arrTplVar->tpl_footer = $arrRet[0]['footer'];
$tmp_subject = $arrRet[0]['subject'];
} else {
$arrTplVar->tpl_header = $header;
$arrTplVar->tpl_footer = $footer;
$tmp_subject = $subject;
}
// 受注情報の取得
$where = "order_id = ?";
$arrRet = $objQuery->select("*", "dtb_order", $where, array($order_id));
$arrOrder = $arrRet[0];
$objQuery->setOrder('order_detail_id');
$arrTplVar->arrOrderDetail = $objQuery->select("*", "dtb_order_detail", $where, array($order_id));
$objProduct = new SC_Product_Ex();
$objQuery->setOrder('shipping_id');
$arrRet = $objQuery->select("*", "dtb_shipping", "order_id = ?", array($order_id));
foreach (array_keys($arrRet) as $key) {
$objQuery->setOrder('shipping_id');
$arrItems = $objQuery->select("*", "dtb_shipment_item", "order_id = ? AND shipping_id = ?", array($order_id, $arrRet[$key]['shipping_id']));
foreach ($arrItems as $itemKey => $arrDetail) {
foreach ($arrDetail as $detailKey => $detailVal) {
$arrRet[$key]['shipment_item'][$arrDetail['product_class_id']][$detailKey] = $detailVal;
}
$arrRet[$key]['shipment_item'][$arrDetail['product_class_id']]['productsClass'] =& $objProduct->getDetailAndProductsClass($arrDetail['product_class_id']);
}
}
$arrTplVar->arrShipping = $arrRet;
$arrTplVar->Message_tmp = $arrOrder['message'];
// 会員情報の取得
$customer_id = $arrOrder['customer_id'];
$objQuery->setOrder('customer_id');
$arrRet = $objQuery->select('point', "dtb_customer", "customer_id = ?", array($customer_id));
$arrCustomer = isset($arrRet[0]) ? $arrRet[0] : "";
$arrTplVar->arrCustomer = $arrCustomer;
$arrTplVar->arrOrder = $arrOrder;
//その他決済情報
if ($arrOrder['memo02'] != "") {
$arrOther = unserialize($arrOrder['memo02']);
foreach ($arrOther as $other_key => $other_val) {
if (SC_Utils_Ex::sfTrim($other_val['value']) == "") {
$arrOther[$other_key]['value'] = "";
}
}
$arrTplVar->arrOther = $arrOther;
}
// 都道府県変換
$arrTplVar->arrPref = $this->arrPref;
$objCustomer = new SC_Customer_Ex();
$arrTplVar->tpl_user_point = $objCustomer->getValue('point');
if (Net_UserAgent_Mobile::isMobile() === true) {
$objMailView = new SC_MobileView_Ex();
} else {
$objMailView = new SC_SiteView_Ex();
}
// メール本文の取得
$objMailView->assignobj($arrTplVar);
$body = $objMailView->fetch($this->arrMAILTPLPATH[$template_id]);
// メール送信処理
$objSendMail = new SC_SendMail_Ex();
$bcc = $arrInfo['email01'];
$from = $arrInfo['email03'];
$error = $arrInfo['email04'];
$tosubject = $this->sfMakeSubject($tmp_subject, $objMailView);
$objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc);
$objSendMail->setTo($arrOrder["order_email"], $arrOrder["order_name01"] . " " . $arrOrder["order_name02"] . " 様");
// 送信フラグ:trueの場合は、送信する。
if ($send) {
if ($objSendMail->sendMail()) {
$this->sfSaveMailHistory($order_id, $template_id, $tosubject, $body);
}
}
return $objSendMail;
}
示例2: is_array
" style="display:<?php
echo is_array($_tmp = $this->_tpl_vars['cat_flg']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
?>
">
<?php
$_from = is_array($_tmp = $this->_tpl_vars['arrProducts'][$this->_sections['cnt']['index']]['categories']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp);
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$this->_foreach['categories'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['categories']['total'] > 0) {
foreach ($_from as $this->_tpl_vars['category_id']) {
$this->_foreach['categories']['iteration']++;
?>
<?php
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['arrCatList'][$this->_tpl_vars['category_id']]) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)) ? $this->_run_mod_handler('sfTrim', true, $_tmp) : SC_Utils_Ex::sfTrim($_tmp);
?>
<?php
if (!(is_array($_tmp = $this->_foreach['categories']['iteration'] == $this->_foreach['categories']['total']) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp))) {
?>
<br /><?php
}
?>
<?php
}
}
unset($_from);
?>
</div>
示例3: sfSendOrderMail
function sfSendOrderMail($order_id, $template_id, $subject = "", $header = "", $footer = "", $send = true)
{
$objPage = new LC_Page();
$objSiteInfo = new SC_SiteInfo();
$arrInfo = $objSiteInfo->data;
$objPage->arrInfo = $arrInfo;
$objQuery = new SC_Query();
if ($subject == "" && $header == "" && $footer == "") {
// メールテンプレート情報の取得
$where = "template_id = ?";
$arrRet = $objQuery->select("subject, header, footer", "dtb_mailtemplate", $where, array($template_id));
$objPage->tpl_header = $arrRet[0]['header'];
$objPage->tpl_footer = $arrRet[0]['footer'];
$tmp_subject = $arrRet[0]['subject'];
} else {
$objPage->tpl_header = $header;
$objPage->tpl_footer = $footer;
$tmp_subject = $subject;
}
// 受注情報の取得
$where = "order_id = ?";
$arrRet = $objQuery->select("*", "dtb_order", $where, array($order_id));
$arrOrder = $arrRet[0];
$arrOrderDetail = $objQuery->select("*", "dtb_order_detail", $where, array($order_id));
$objPage->Message_tmp = $arrOrder['message'];
// 顧客情報の取得
$customer_id = $arrOrder['customer_id'];
$arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id));
$arrCustomer = isset($arrRet[0]) ? $arrRet[0] : "";
$objPage->arrCustomer = $arrCustomer;
$objPage->arrOrder = $arrOrder;
//その他決済情報
if ($arrOrder['memo02'] != "") {
$arrOther = unserialize($arrOrder['memo02']);
foreach ($arrOther as $other_key => $other_val) {
if (SC_Utils_Ex::sfTrim($other_val["value"]) == "") {
$arrOther[$other_key]["value"] = "";
}
}
$objPage->arrOther = $arrOther;
}
// 都道府県変換
$objPage->arrOrder['deliv_pref'] = $this->arrPref[$objPage->arrOrder['deliv_pref']];
$objPage->arrOrderDetail = $arrOrderDetail;
$objCustomer = new SC_Customer();
$objPage->tpl_user_point = $objCustomer->getValue('point');
$objMailView = new SC_SiteView();
// メール本文の取得
$objMailView->assignobj($objPage);
$body = $objMailView->fetch($this->arrMAILTPLPATH[$template_id]);
// メール送信処理
$objSendMail = new SC_SendMail_Ex();
$bcc = $arrInfo['email01'];
$from = $arrInfo['email03'];
$error = $arrInfo['email04'];
$tosubject = $this->sfMakeSubject($objQuery, $objMailView, $objPage, $tmp_subject);
$objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc);
$objSendMail->setTo($arrOrder["order_email"], $arrOrder["order_name01"] . " " . $arrOrder["order_name02"] . " 様");
// 送信フラグ:trueの場合は、送信する。
if ($send) {
if ($objSendMail->sendMail()) {
$this->sfSaveMailHistory($order_id, $template_id, $tosubject, $body);
}
}
return $objSendMail;
}
示例4: sfSendOrderMail
public function sfSendOrderMail($order_id, $template_id, $subject = '', $header = '', $footer = '', $send = true)
{
$arrTplVar = new stdClass();
$arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
$arrTplVar->arrInfo = $arrInfo;
$objQuery =& SC_Query_Ex::getSingletonInstance();
if ($subject == '' && $header == '' && $footer == '') {
// メールテンプレート情報の取得
$objMailtemplate = new SC_Helper_Mailtemplate_Ex();
$mailtemplate = $objMailtemplate->get($template_id);
$arrTplVar->tpl_header = $mailtemplate['header'];
$arrTplVar->tpl_footer = $mailtemplate['footer'];
$tmp_subject = $mailtemplate['subject'];
} else {
$arrTplVar->tpl_header = $header;
$arrTplVar->tpl_footer = $footer;
$tmp_subject = $subject;
}
// 受注情報の取得
$where = 'order_id = ? AND del_flg = 0';
$arrOrder = $objQuery->getRow('*', 'dtb_order', $where, array($order_id));
if (empty($arrOrder)) {
trigger_error("該当する受注が存在しない。(注文番号: {$order_id})", E_USER_ERROR);
}
$where = 'order_id = ?';
$objQuery->setOrder('order_detail_id');
$arrTplVar->arrOrderDetail = $objQuery->select('*', 'dtb_order_detail', $where, array($order_id));
// 配送情報の取得
$arrTplVar->arrShipping = $this->sfGetShippingData($order_id);
$arrTplVar->Message_tmp = $arrOrder['message'];
// 会員情報の取得
$customer_id = $arrOrder['customer_id'];
$objQuery->setOrder('customer_id');
$arrRet = $objQuery->select('point', 'dtb_customer', 'customer_id = ?', array($customer_id));
$arrCustomer = isset($arrRet[0]) ? $arrRet[0] : '';
$arrTplVar->arrCustomer = $arrCustomer;
$arrTplVar->arrOrder = $arrOrder;
//その他決済情報
if ($arrOrder['memo02'] != '') {
$arrOther = unserialize($arrOrder['memo02']);
foreach ($arrOther as $other_key => $other_val) {
if (SC_Utils_Ex::sfTrim($other_val['value']) == '') {
$arrOther[$other_key]['value'] = '';
}
}
$arrTplVar->arrOther = $arrOther;
}
// 都道府県変換
$arrTplVar->arrPref = $this->arrPref;
// 国変換
$arrTplVar->arrCountry = $this->arrCountry;
$objCustomer = new SC_Customer_Ex();
$arrTplVar->tpl_user_point = $objCustomer->getValue('point');
$objMailView = null;
// 注文受付メール(携帯)
if ($template_id == 2) {
$objMailView = new SC_MobileView_Ex();
} else {
$objMailView = new SC_SiteView_Ex();
}
// メール本文の取得
$objMailView->setPage($this->getPage());
$objMailView->assignobj($arrTplVar);
$body = $objMailView->fetch($this->arrMAILTPLPATH[$template_id]);
// メール送信処理
$objSendMail = new SC_SendMail_Ex();
$bcc = $arrInfo['email01'];
$from = $arrInfo['email03'];
$error = $arrInfo['email04'];
$tosubject = $this->sfMakeSubject($tmp_subject, $objMailView);
$objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc);
$objSendMail->setTo($arrOrder['order_email'], $arrOrder['order_name01'] . ' ' . $arrOrder['order_name02'] . ' 様');
// 送信フラグ:trueの場合は、送信する。
if ($send) {
if ($objSendMail->sendMail()) {
$this->sfSaveMailHistory($order_id, $template_id, $tosubject, $body);
}
}
return $objSendMail;
}
示例5: sfSendOrderMail
function sfSendOrderMail($order_id, $template_id, $subject = '', $header = '', $footer = '', $send = true)
{
$arrTplVar = new stdClass();
$arrInfo = SC_Helper_DB_Ex::sfGetBasisData();
$arrTplVar->arrInfo = $arrInfo;
$objQuery =& SC_Query_Ex::getSingletonInstance();
if ($subject == '' && $header == '' && $footer == '') {
// メールテンプレート情報の取得
$where = 'template_id = ?';
$arrRet = $objQuery->select('subject, header, footer', 'dtb_mailtemplate', $where, array($template_id));
$arrTplVar->tpl_header = $arrRet[0]['header'];
$arrTplVar->tpl_footer = $arrRet[0]['footer'];
$tmp_subject = $arrRet[0]['subject'];
} else {
$arrTplVar->tpl_header = $header;
$arrTplVar->tpl_footer = $footer;
$tmp_subject = $subject;
}
// 受注情報の取得
$where = 'order_id = ? AND del_flg = 0';
$arrOrder = $objQuery->getRow('*', 'dtb_order', $where, array($order_id));
if (empty($arrOrder)) {
trigger_error(t('c_No order exists. (Order number: T_ARG1)_01', array('T_ARG1' => $order_id)), E_USER_ERROR);
}
$where = 'order_id = ?';
$objQuery->setOrder('order_detail_id');
$arrTplVar->arrOrderDetail = $objQuery->select('*', 'dtb_order_detail', $where, array($order_id));
$objProduct = new SC_Product_Ex();
$objQuery->setOrder('shipping_id');
$arrRet = $objQuery->select('*', 'dtb_shipping', 'order_id = ?', array($order_id));
foreach ($arrRet as $key => $value) {
$objQuery->setOrder('shipping_id');
$arrItems = $objQuery->select('*', 'dtb_shipment_item', 'order_id = ? AND shipping_id = ?', array($order_id, $arrRet[$key]['shipping_id']));
foreach ($arrItems as $arrDetail) {
foreach ($arrDetail as $detailKey => $detailVal) {
$arrRet[$key]['shipment_item'][$arrDetail['product_class_id']][$detailKey] = $detailVal;
}
$arrRet[$key]['shipment_item'][$arrDetail['product_class_id']]['productsClass'] =& $objProduct->getDetailAndProductsClass($arrDetail['product_class_id']);
}
}
$arrTplVar->arrShipping = $arrRet;
$arrTplVar->Message_tmp = $arrOrder['message'];
// 会員情報の取得
$customer_id = $arrOrder['customer_id'];
$objQuery->setOrder('customer_id');
$arrRet = $objQuery->select('point', 'dtb_customer', 'customer_id = ?', array($customer_id));
$arrCustomer = isset($arrRet[0]) ? $arrRet[0] : '';
$arrTplVar->arrCustomer = $arrCustomer;
$arrTplVar->arrOrder = $arrOrder;
//その他決済情報
if ($arrOrder['memo02'] != '') {
$arrOther = unserialize($arrOrder['memo02']);
foreach ($arrOther as $other_key => $other_val) {
if (SC_Utils_Ex::sfTrim($other_val['value']) == '') {
$arrOther[$other_key]['value'] = '';
}
}
$arrTplVar->arrOther = $arrOther;
}
// 都道府県変換
$arrTplVar->arrPref = $this->arrPref;
$objCustomer = new SC_Customer_Ex();
$arrTplVar->tpl_user_point = $objCustomer->getValue('point');
$objMailView = null;
if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
$objMailView = new SC_MobileView_Ex();
} else {
$objMailView = new SC_SiteView_Ex();
}
// メール本文の取得
$objMailView->setPage($this->getPage());
$objMailView->assignobj($arrTplVar);
$body = $objMailView->fetch($this->arrMAILTPLPATH[$template_id]);
// メール送信処理
$objSendMail = new SC_SendMail_Ex();
$bcc = $arrInfo['email01'];
$from = $arrInfo['email03'];
$error = $arrInfo['email04'];
$tosubject = $this->sfMakeSubject($tmp_subject, $objMailView);
$objSendMail->setItem('', $tosubject, $body, $from, $arrInfo['shop_name'], $from, $error, $error, $bcc);
$objSendMail->setTo($arrOrder['order_email'], t('f_NAME_FULL_SIR_01', array('T_ARG1' => $arrOrder['order_name01'], 'T_ARG2' => $arrOrder['order_name02'])));
// 送信フラグ:trueの場合は、送信する。
if ($send) {
if ($objSendMail->sendMail()) {
$this->sfSaveMailHistory($order_id, $template_id, $tosubject, $body);
}
}
return $objSendMail;
}