[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
1 <?php 2 /** 3 * Override Template for common/tpl_main_page.php 4 * 5 * @package templateSystem 6 * @copyright Copyright 2003-2005 Zen Cart Development Team 7 * @copyright Portions Copyright 2003 osCommerce 8 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 9 * @version $Id: tpl_main_page.php 4591 2006-09-23 04:25:15Z ajeh $ 10 */ 11 ?> 12 <body id="popupCouponHelp" onload="resize();"> 13 14 <?php 15 $coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_id = '" . $_GET['cID'] . "'"); 16 $coupon_desc = $db->Execute("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $_GET['cID'] . "' and language_id = '" . $_SESSION['languages_id'] . "'"); 17 $text_coupon_help = TEXT_COUPON_HELP_HEADER; 18 $text_coupon_help .= sprintf(TEXT_COUPON_HELP_NAME, $coupon_desc->fields['coupon_name']); 19 if (zen_not_null($coupon_desc->fields['coupon_description'])) $text_coupon_help .= sprintf(TEXT_COUPON_HELP_DESC, $coupon_desc->fields['coupon_description']); 20 $coupon_amount = $coupon->fields['coupon_amount']; 21 switch ($coupon->fields['coupon_type']) { 22 case 'F': 23 $text_coupon_help .= sprintf(TEXT_COUPON_HELP_FIXED, $currencies->format($coupon->fields['coupon_amount'])); 24 break; 25 case 'P': 26 $text_coupon_help .= sprintf(TEXT_COUPON_HELP_FIXED, number_format($coupon->fields['coupon_amount'],2). '%'); 27 break; 28 case 'S': 29 $text_coupon_help .= TEXT_COUPON_HELP_FREESHIP; 30 break; 31 default: 32 } 33 if ($coupon->fields['coupon_minimum_order'] > 0 ) $text_coupon_help .= sprintf(TEXT_COUPON_HELP_MINORDER, $currencies->format($coupon->fields['coupon_minimum_order'])); 34 $text_coupon_help .= sprintf(TEXT_COUPON_HELP_DATE, zen_date_short($coupon->fields['coupon_start_date']),zen_date_short($coupon->fields['coupon_expire_date'])); 35 $text_coupon_help .= '<strong>' . TEXT_COUPON_HELP_RESTRICT . '</strong>'; 36 37 if ($coupon->fields['coupon_zone_restriction'] > 0) { 38 $text_coupon_help .= '<br /><br />' . TEXT_COUPON_GV_RESTRICTION_ZONES; 39 } 40 41 $text_coupon_help .= '<br /><br />' . TEXT_COUPON_HELP_CATEGORIES; 42 $get_result=$db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id='".$_GET['cID']."' and category_id !='0'"); 43 $cats = ''; 44 while (!$get_result->EOF) { 45 if ($get_result->fields['coupon_restrict'] == 'N') { 46 $restrict = TEXT_ALLOWED; 47 } else { 48 $restrict = TEXT_DENIED; 49 } 50 $result = $db->Execute("SELECT * FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id and cd.language_id = '" . $_SESSION['languages_id'] . "' and c.categories_id='" . $get_result->fields['category_id'] . "'"); 51 $cats .= '<br />' . $result->fields["categories_name"] . $restrict; 52 $get_result->MoveNext(); 53 } 54 if ($cats=='') $cats = '<br />NONE'; 55 $text_coupon_help .= $cats; 56 $text_coupon_help .= '<br /><br />' . TEXT_COUPON_HELP_PRODUCTS; 57 $get_result=$db->Execute("select * from " . TABLE_COUPON_RESTRICT . " where coupon_id='".$_GET['cID']."' and product_id !='0'"); 58 59 while (!$get_result->EOF) { 60 if ($get_result->fields['coupon_restrict'] == 'N') { 61 $restrict = TEXT_ALLOWED; 62 } else { 63 $restrict = TEXT_DENIED; 64 } 65 $result = $db->Execute("SELECT * FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd WHERE p.products_id = pd.products_id and pd.language_id = '" . $_SESSION['languages_id'] . "'and p.products_id = '" . $get_result->fields['product_id'] . "'"); 66 $prods .= '<br />' . $result->fields['products_name'] . $restrict; 67 $get_result->MoveNext(); 68 } 69 if ($prods=='') $prods = '<br />NONE'; 70 $text_coupon_help .= $prods . '<br /><br />' . TEXT_COUPON_GV_RESTRICTION; 71 echo $text_coupon_help; 72 ?> 73 <p class="smallText" align="right"><?php echo '<a href="javascript:window.close()">' . TEXT_CURRENT_CLOSE_WINDOW . '</a>'; ?></p> 74 75 </body>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 16:45:43 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |