本文整理汇总了PHP中EnmasseHelper::displayOrderDisplayId方法的典型用法代码示例。如果您正苦于以下问题:PHP EnmasseHelper::displayOrderDisplayId方法的具体用法?PHP EnmasseHelper::displayOrderDisplayId怎么用?PHP EnmasseHelper::displayOrderDisplayId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EnmasseHelper
的用法示例。
在下文中一共展示了EnmasseHelper::displayOrderDisplayId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
if (JFactory::getUser()->get('guest')) {
$msg = JText::_("ORDER_PLEASE_LOGIN_BEFORE");
$redirectUrl = base64_encode("index.php?option=com_enmasse&view=orderList");
$version = new JVersion();
$joomla = $version->getShortVersion();
if (substr($joomla, 0, 3) >= '1.6') {
$link = JRoute::_("index.php?option=com_users&view=login&return=" . $redirectUrl, false);
} else {
$link = JRoute::_("index.php?option=com_user&view=login&return=" . $redirectUrl, false);
}
JFactory::getApplication()->redirect($link, $msg);
}
$orderList = JModel::getInstance('order', 'enmasseModel')->listForBuyer(JFactory::getUser()->id);
for ($count = 0; $count < count($orderList); $count++) {
$orderItemList = JModel::getInstance('orderItem', 'enmasseModel')->listByOrderId($orderList[$count]->id);
$orderList[$count]->orderItem = $orderItemList[0];
$orderList[$count]->display_id = EnmasseHelper::displayOrderDisplayId($orderList[$count]->id);
}
$this->assignRef('orderList', $orderList);
$this->_setPath('template', JPATH_SITE . DS . "components" . DS . "com_enmasse" . DS . "theme" . DS . EnmasseHelper::getThemeFromSetting() . DS . "tmpl" . DS);
$this->_layout = "order_list";
parent::display($tpl);
}
示例2: createPDF
/**
*
* Create bill with PDF format, return file location.
* @param integer $nOrderId order id that need to print bill.
* @param string $dest whether save to the file or echo direct to web browser (for preview).
* @return string name of created file with absolute path.
*/
public static function createPDF($nOrderId, $dest = 'F')
{
$oOrder = JModel::getInstance('order', 'enmasseModel')->getById($nOrderId);
if (empty($oOrder)) {
return null;
}
$buyer = json_decode($oOrder->buyer_detail);
$arOrderItem = JModel::getInstance('orderItem', 'enmasseModel')->listByOrderId($nOrderId);
$sOderDetail = '<table border="1"><tr valign="middle"><th align="center" style="width:30px;">' . JText::_("BILL_TEMPLATE_ORDER_DETAIL_NO") . '</th><th style="width:60px;">' . JText::_("BILL_TEMPLATE_ORDER_DETAIL_QUANTITY") . '</th><th style="width:50px;">' . JText::_("BILL_TEMPLATE_ORDER_DETAIL_DEAL_ID") . '</th><th align="center" style="width:320px; ">' . JText::_("BILL_TEMPLATE_ORDER_DETAIL_DEAL_DESC") . '</th><th style="width:50px;">' . JText::_("BILL_TEMPLATE_ORDER_DETAIL_UNIT_PRICE") . '</th><th style="width:50px;">' . JText::_("BILL_TEMPLATE_ORDER_DETAIL_TAX") . '</th><th style="width:80px;">' . JText::_("BILL_TEMPLATE_ORDER_DETAIL_TOTAL") . '</th></tr>';
$oPayGty = JModel::getInstance('payGty', 'enmasseModel')->getById($oOrder->pay_gty_id);
if (empty($oPayGty)) {
$oPayGty = new JObject();
$oPayGty->name = "";
}
$count = 1;
foreach ($arOrderItem as $oItem) {
$sOderDetail .= '<tr valign="middle"><td >' . $count++ . '</td><td >' . $oItem->qty . '</td><td >' . $oItem->pdt_id . '</td><td style="width:300px;text-align: left">' . $oItem->description . '</td><td >' . $oItem->unit_price . '</td><td >' . '</td><td >' . $oItem->total_price . '</td></tr>';
}
$sOderDetail .= '<tr><td colspan="7" style="text-align:right" >Total Amount: ' . $oOrder->total_buyer_paid . '</td></tr></table>';
$db = JFactory::getDbo();
$query = "SELECT *\n\t\t\t\t\t\tFROM #__enmasse_bill_template\n\t\t\t\t\t\tWHERE slug_name = " . $db->quote(self::$BUYER_RECEIPT_TMPL_NAME);
$db->setQuery($query);
$oBillTmpl = $db->loadObject();
$sTmpl = $oBillTmpl->content;
$arParam = array();
$arParam['[BUYER_NAME]'] = $buyer->name;
$arParam['[BUYER_EMAIL]'] = $buyer->email;
$arParam['[BILL_NUMBER]'] = EnmasseHelper::displayOrderDisplayId($oOrder->id);
$arParam['[BILL_DATE]'] = DatetimeWrapper::getDatetimeOfNow();
$arParam['[PAYMENT_METHOD]'] = $oPayGty->name;
$arParam['[BILL_DETAIL]'] = $sOderDetail;
$arParam['[BILL_DESCRIPTION]'] = $oOrder->description;
//ADD style for table
$sTmpl = '<style>p{margin: 8px 0px }table {border-collapse:collapse;} td, th{text-align: center} th{height: 40px}</style>' . $sTmpl;
$arSearch = array_keys($arParam);
$sTmpl = str_replace($arSearch, $arParam, $sTmpl);
//-----------------------------
//process for image tag because there have the difference source path between
//html2pdf and richtext editor(using for edit bill template),image tag
//was wrong source path and it cause html2pdf error
$sPattern = '/(<img\\s+src=")(.*)(")/i';
if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") {
$sReplace = '$1' . JPATH_SITE . DS . '\\$2$3';
} else {
$sReplace = '$1' . JPATH_SITE . DS . '$2$3';
}
$sTmpl = preg_replace($sPattern, $sReplace, $sTmpl);
require_once dirname(__FILE__) . '/html2pdf/html2pdf.class.php';
try {
$sOutFileName = "bill_preview.pdf";
if ($dest == 'F') {
$sOutFileName = JPATH_ADMINISTRATOR . DS . "components" . DS . "com_enmasse" . DS . "bills" . DS . EnmasseHelper::displayOrderDisplayId($oOrder->id) . ".pdf";
if (file_exists($sOutFileName)) {
unlink($sOutFileName);
}
}
$html2pdf = new HTML2PDF('P', 'A4', 'en');
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML($sTmpl);
$html2pdf->Output($sOutFileName, $dest);
} catch (HTML2PDF_exception $e) {
return;
}
return $sOutFileName;
}
示例3:
</script>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<div class="width-100 fltrt">
<fieldset class="adminform"><legend><?php
echo JText::_('ORDER_DETAIL');
?>
</legend>
<table class="admintable">
<tr>
<td width="100" align="right" class="key" valign="top"><?php
echo JText::_('ORDER_ID');
?>
</td>
<td><?php
echo EnmasseHelper::displayOrderDisplayId($order_row->id);
?>
</td>
</tr>
<tr>
<td width="100" align="right" class="key" valign="top"><?php
echo JText::_('ORDER_COMMENT');
?>
</td>
<td><textarea name="description" cols=40 rows=3><?php
echo $order_row->description;
?>
</textarea>
</td>
</tr>
<tr>
示例4:
echo JText::_("ORDER_EDITING") . " " . EnmasseHelper::displayOrderDisplayId($this->oOrder->id);
?>
</h4>
</div>
<div class="row row_space">
<div class="delivery_detail_edit">
<form action="index.php" method="post" name="adminForm">
<table>
<tr>
<td valign="top"><?php
echo JText::_('ORDER_ID');
?>
</td>
<td>
<?php
echo EnmasseHelper::displayOrderDisplayId($this->oOrder->id);
?>
<input type="hidden" value="<?php
echo $this->oOrder->id;
?>
" name="id"/>
</td>
</tr>
<tr>
<td valign="top"><?php
echo JText::_('ORDER_DEAL_NAME');
?>
</td>
<td><?php
echo $this->oOrderItemList[0]->description;
?>