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


PHP EnmasseHelper::generateCouponToken方法代码示例

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


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

示例1: display

 function display($tpl = null)
 {
     $token = JRequest::getVar('token', null);
     $invtyName = JRequest::getVar('invtyName', null);
     $elementList = JModel::getInstance('couponElement', 'enmasseModel')->listAll();
     $bgImageUrl = JModel::getInstance('setting', 'enmasseModel')->getCouponBg();
     if ($invtyName != "") {
         $invty = JModel::getInstance('invty', 'enmasseModel')->getByName($invtyName);
         $orderItem = JModel::getInstance('orderItem', 'enmasseModel')->getById($invty->order_item_id ? $invty->order_item_id : 0);
         $order = JModel::getInstance('order', 'enmasseModel')->getById($orderItem->order_id ? $orderItem->order_id : 0);
         $deal = JModel::getInstance('deal', 'enmasseModel')->getById($invty->pdt_id ? $invty->pdt_id : 0);
         $merchant = JModel::getInstance('merchant', 'enmasseModel')->getById($deal->merchant_id ? $deal->merchant_id : 0);
         $merchant->branches = json_decode($merchant->branches);
         $deliveryDetail = json_decode($order->delivery_detail);
         $varList = array();
         $varList['dealName'] = $deal->name;
         $varList['serial'] = $invty->name;
         /** phuocndt
          * Get status value of Coupon
          */
         $varList['qr_code'] = $invty->name;
         $varList['detail'] = $deal->short_desc;
         $varList['merchantName'] = '';
         if ($merchant != null) {
             if (isset($merchant->branches->branch1)) {
                 $varList['merchantName'] .= $merchant->branches->branch1->name;
                 $varList['merchantName'] .= '<br />' . $merchant->branches->branch1->address;
                 $varList['merchantName'] .= '<br />' . $merchant->branches->branch1->telephone;
             }
         }
         $varList['highlight'] = $deal->highlight;
         $varList['personName'] = $deliveryDetail->name;
         $varList['term'] = $deal->terms;
     } else {
         $varList['serial'] = "";
         $varList['qr_code'] = "";
     }
     /** phuocndt
      * Debug QR code
      */
     //echo '<pre>'; print_r($varList); echo '</pre>'; die;
     if ($token != EnmasseHelper::generateCouponToken($varList['serial'])) {
         $msg = JText::_(INVALID_COUPON_TOKEN);
         $link = JRoute::_("/", false);
         JFactory::getApplication()->redirect($link, $msg);
     } else {
         $this->assignRef('varList', $varList);
         $this->assignRef('elementList', $elementList);
         $this->assignRef('bgImageUrl', $bgImageUrl);
         parent::display($tpl);
         exit(0);
     }
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:53,代码来源:view.html.php

示例2: foreach

		<?php 
$count = 0;
?>
		<h3><?php 
echo JText::_('COUPON_MESSAGE');
?>
 "<?php 
echo $deal->name;
?>
":</h3>
		<table>
		<?php 
foreach ($invtyList as $invty) {
    ?>
			<?php 
    $link = "index.php?option=com_enmasse&controller=coupon&task=generate&invtyName=" . $invty->name . "&token=" . EnmasseHelper::generateCouponToken($invty->name);
    ?>
			<tr>
				<td><?php 
    echo JText::_('COUPON');
    ?>
: <?php 
    echo $invty->name;
    ?>
</td>
				<td>
					<a href="<?php 
    echo JRoute::_($link);
    ?>
" target="_blank"><?php 
    echo JText::_('COUPON_PRINT_LINK');
开发者ID:marsa1985,项目名称:kazabiz,代码行数:31,代码来源:coupon_listing.php

示例3: strtoupper

?>
</th>
			<th width=""><?php 
echo JText::_('ORDER_COUPON_STATUS');
?>
</th>
			<th></th>
		</tr>
	</thead>
	<?php 
$invtyList = $order_row->orderItem->invtyList;
$base_url = 'http://';
$base_url .= $_SERVER["SERVER_NAME"] . $link_server;
for ($i = 0; $i < count($invtyList); $i++) {
    $k = $i % 2;
    $link = $base_url . "/index.php?option=com_enmasse&controller=coupon&task=generate&invtyName=" . $invtyList[$i]->name . "&token=" . EnmasseHelper::generateCouponToken($invtyList[$i]->name);
    ?>
	<tr class="<?php 
    echo "row{$k}";
    ?>
">
		<td align="center"><?php 
    echo $invtyList[$i]->name;
    ?>
</td>
		<td align="center"><?php 
    echo JTEXT::_('COUPON_' . strtoupper($invtyList[$i]->status));
    ?>
</td>
		<td align="center"><a href='<?php 
    echo $link;
开发者ID:marsa1985,项目名称:kazabiz,代码行数:31,代码来源:edit.php

示例4:

echo JText::_('COUPON_IMAGE_LINK');
?>
</a> <i style="float:left; padding-left: 5px"><?php 
echo JText::_('COUPON_REVIEW_MESAGE_2');
?>
</i>                    
		</td>

	</tr>
	<tr class="row1">
	    <td align="center">
            <iframe 
	    		width="100%" 
	    		height="1000px" 
	    		src="<?php 
echo $link . '/index.php?option=com_enmasse&controller=coupon&task=generate&editor=true&token=' . EnmasseHelper::generateCouponToken('');
?>
">
	    	</iframe>	    	
	    </td>
	</tr>
</table>
</fieldset>
<input type='hidden' name='jsondata' id='jsondata' value='' />
<input type="hidden" name="option" value="<?php 
echo $option;
?>
" />
<input type="hidden" name="controller" value="coupon" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
开发者ID:marsa1985,项目名称:kazabiz,代码行数:31,代码来源:edit.php


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