0byt3m1n1-V2
Path:
/
home
/
a
/
c
/
a
/
academiac
/
www
/
[
Home
]
File: coupon.tar
view.html.php 0000666 00000006376 15137453523 0007222 0 ustar 00 <?php /** * * Coupon View * * @package VirtueMart * @subpackage Coupon * @author RickG * @author Valerie Isaksen * @link http://www.virtuemart.net * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * @version $Id: view.html.php 5601 2012-03-04 18:22:24Z Milbo $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); // Load the view framework if(!class_exists('VmView'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmview.php'); /** * HTML View class for maintaining the list of Coupons * * @package VirtueMart * @subpackage Coupon * @author RickG * @author Valerie Isaksen */ class VirtuemartViewCoupon extends VmView { function display($tpl = null) { // Load the helper(s) if (!class_exists('VmHTML')) require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php'); $model = VmModel::getModel(); $coupon = $model->getCoupon(); $this->SetViewTitle('', $coupon->coupon_code); $layoutName = JRequest::getWord('layout', 'default'); // if(Vmconfig::get('multix','none')!=='none'){ // $vendorList= ShopFunctions::renderVendorList($coupon->virtuemart_vendor_id); // $this->assignRef('vendorList', $vendorList); // } $vendorModel = VmModel::getModel('Vendor'); $vendorModel->setId(1); $vendor = $vendorModel->getVendor(); $currencyModel = VmModel::getModel('Currency'); $currencyModel = $currencyModel->getCurrency($vendor->vendor_currency); $this->assignRef('vendor_currency', $currencyModel->currency_symbol); if ($layoutName == 'edit') { if ($coupon->virtuemart_coupon_id < 1) { // Set a default expiration date $_expTime = explode(',', VmConfig::get('coupons_default_expire','14,D')); if (!empty( $_expTime[1]) && $_expTime[1] == 'W') { $_expTime[0] = $_expTime[0] * 7; $_expTime[1] = 'D'; } if (version_compare(PHP_VERSION, '5.3.0', '<')) { $_dtArray = getdate(time()); if ($_expTime[1] == 'D') { $_dtArray['mday'] += $_expTime[0]; } elseif ($_expTime[1] == 'M') { $_dtArray['mon'] += $_expTime[0]; } elseif ($_expTime[1] == 'Y') { $_dtArray['year'] += $_expTime[0]; } $coupon->coupon_expiry_date = mktime($_dtArray['hours'], $_dtArray['minutes'], $_dtArray['seconds'] , $_dtArray['mon'], $_dtArray['mday'], $_dtArray['year']); } else { $_expDate = new DateTime(); $_expDate->add(new DateInterval('P'.$_expTime[0].$_expTime[1])); $coupon->coupon_expiry_date = $_expDate->format("U"); } } $this->assignRef('coupon', $coupon); $this->addStandardEditViewCommands(); } else { $this->addStandardDefaultViewCommands(); $this->addStandardDefaultViewLists($model); $coupons = $model->getCoupons(); $this->assignRef('coupons', $coupons); $pagination = $model->getPagination(); $this->assignRef('pagination', $pagination); } parent::display($tpl); } } // pure php no closing tag index.html 0000666 00000000000 15137453523 0006543 0 ustar 00 tmpl/default.php 0000666 00000007075 15137453523 0007702 0 ustar 00 <?php /** * * Description * * @package VirtueMart * @subpackage Coupon * @author RickG * @link http://www.virtuemart.net * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * VirtueMart is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * @version $Id: default.php 5628 2012-03-08 09:00:21Z alatak $ */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); AdminUIHelper::startAdminArea($this); ?> <form action="index.php" method="post" name="adminForm" id="adminForm"> <div id="editcell"> <table class="adminlist" cellspacing="0" cellpadding="0"> <thead> <tr> <th width="10"> <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->coupons); ?>);" /> </th> <th> <?php echo JText::_('COM_VIRTUEMART_COUPON_CODE'); ?> </th> <th> <?php echo JText::_('COM_VIRTUEMART_COUPON_PERCENT_TOTAL'); ?> </th> <th> <?php echo JText::_('COM_VIRTUEMART_COUPON_TYPE'); ?> </th> <th> <?php echo JText::_('COM_VIRTUEMART_VALUE'); ?> </th> <th> <?php echo JText::_('COM_VIRTUEMART_COUPON_VALUE_VALID_AT'); ?> </th> <th> <?php echo JText::_('COM_VIRTUEMART_COUPON_USED'); ?> </th> <th><?php echo $this->sort('virtuemart_coupon_id', 'COM_VIRTUEMART_ID') ?></th> </tr> </thead> <?php $k = 0; for ($i=0, $n=count($this->coupons); $i < $n; $i++) { $row = $this->coupons[$i]; $checked = JHTML::_('grid.id', $i, $row->virtuemart_coupon_id); $editlink = JROUTE::_('index.php?option=com_virtuemart&view=coupon&task=edit&cid[]=' . $row->virtuemart_coupon_id); ?> <tr class="row<?php echo $k; ?>"> <td width="10"> <?php echo $checked; ?> </td> <td align="left"> <a href="<?php echo $editlink; ?>"><?php echo $row->coupon_code; ?></a> </td> <td> <?php echo JText::_($row->percent_or_total); ?> </td> <td align="left"> <?php echo JText::_($row->coupon_type); ?> </td> <td> <?php echo JText::_($row->coupon_value); ?> <?php if ( $row->percent_or_total=='percent') echo '%' ; else echo $this->vendor_currency; ?> </td> <td align="left"> <?php echo JText::_($row->coupon_value_valid); ?> <?php echo $this->vendor_currency; ?> </td> <td align="center"> <?php if( $row->coupon_type=='gift'){ if ($row->coupon_used ) { echo JText::_('COM_VIRTUEMART_YES'); } else { echo JText::_('COM_VIRTUEMART_NO'); } } ?> </td> <td align="left"> <?php echo JText::_($row->virtuemart_coupon_id); ?> </td> </tr> <?php $k = 1 - $k; } ?> <tfoot> <tr> <td colspan="10"> <?php echo $this->pagination->getListFooter(); ?> </td> </tr> </tfoot> </table> </div> <input type="hidden" name="option" value="com_virtuemart" /> <input type="hidden" name="controller" value="coupon" /> <input type="hidden" name="view" value="coupon" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <?php echo JHTML::_( 'form.token' ); ?> </form> <?php AdminUIHelper::endAdminArea(); ?>