ZenCart_Documentation  1.5.0
http://www.collinsharper.com
C:/xampp/htdocs/zen-cart/admin/gv_sent.php
Go to the documentation of this file.
00001 <?php
00002 //
00003 // +----------------------------------------------------------------------+
00004 // |zen-cart Open Source E-commerce                                       |
00005 // +----------------------------------------------------------------------+
00006 // | Copyright (c) 2003 The zen-cart developers                           |
00007 // |                                                                      |
00008 // | http://www.zen-cart.com/index.php                                    |
00009 // |                                                                      |
00010 // | Portions Copyright (c) 2003 osCommerce                               |
00011 // +----------------------------------------------------------------------+
00012 // | This source file is subject to version 2.0 of the GPL license,       |
00013 // | that is bundled with this package in the file LICENSE, and is        |
00014 // | available through the world-wide-web at the following url:           |
00015 // | http://www.zen-cart.com/license/2_0.txt.                             |
00016 // | If you did not receive a copy of the zen-cart license and are unable |
00017 // | to obtain it through the world-wide-web, please send a note to       |
00018 // | [email protected] so we can mail you a copy immediately.          |
00019 // +----------------------------------------------------------------------+
00020 //  $Id: gv_sent.php 3727 2006-06-09 02:42:39Z ajeh $
00021 //
00022 
00023   require('includes/application_top.php');
00024 
00025   require(DIR_WS_CLASSES . 'currencies.php');
00026   $currencies = new currencies();
00027 
00028 ?>
00029 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
00030 <html <?php echo HTML_PARAMS; ?>>
00031 <head>
00032 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
00033 <title><?php echo TITLE; ?></title>
00034 <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
00035 <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
00036 <script language="javascript" src="includes/menu.js"></script>
00037 <script type="text/javascript">
00038   <!--
00039   function init()
00040   {
00041     cssjsmenu('navbar');
00042     if (document.getElementById)
00043     {
00044       var kill = document.getElementById('hoverJS');
00045       kill.disabled = true;
00046     }
00047   }
00048   // -->
00049 </script>
00050 </head>
00051 <body onload="init()">
00052 <!-- header //-->
00053 <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
00054 <!-- header_eof //-->
00055 <!-- body //-->
00056 <table border="0" width="100%" cellspacing="2" cellpadding="2">
00057   <tr>
00058 <!-- body_text //-->
00059     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
00060       <tr>
00061         <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
00062           <tr>
00063             <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
00064             <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
00065           </tr>
00066         </table></td>
00067       </tr>
00068       <tr>
00069         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
00070           <tr>
00071             <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
00072               <tr class="dataTableHeadingRow">
00073                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_SENDERS_NAME; ?></td>
00074                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_VOUCHER_VALUE; ?></td>
00075                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_VOUCHER_CODE; ?></td>
00076                 <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_DATE_SENT; ?></td>
00077                 <td class="dataTableHeadingContent" align="right"><?php echo TEXT_HEADING_DATE_REDEEMED; ?></td>
00078                 <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
00079               </tr>
00080 <?php
00081   $gv_query_raw = "select c.coupon_amount, c.coupon_code, c.coupon_id, et.sent_firstname, et.sent_lastname, et.customer_id_sent, et.emailed_to, et.date_sent, crt.redeem_date, c.coupon_id
00082                   from " . TABLE_COUPONS . " c
00083                   left join " . TABLE_COUPON_REDEEM_TRACK . " crt
00084                   on c.coupon_id= crt.coupon_id, " . TABLE_COUPON_EMAIL_TRACK . " et
00085                   where c.coupon_id = et.coupon_id " . "
00086                   and c.coupon_type = 'G'
00087                   order by date_sent desc";
00088   $gv_split = new splitPageResults($_GET['page'], MAX_DISPLAY_SEARCH_RESULTS, $gv_query_raw, $gv_query_numrows);
00089   $gv_list = $db->Execute($gv_query_raw);
00090   while (!$gv_list->EOF) {
00091     if (((!$_GET['gid']) || (@$_GET['gid'] == $gv_list->fields['coupon_id'])) && (!$gInfo)) {
00092     $gInfo = new objectInfo($gv_list->fields);
00093     }
00094     if ( (is_object($gInfo)) && ($gv_list->fields['coupon_id'] == $gInfo->coupon_id) ) {
00095       echo '              <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . zen_href_link('gv_sent.php', zen_get_all_get_params(array('gid', 'action')) . 'gid=' . $gInfo->coupon_id . '&action=edit') . '\'">' . "\n";
00096     } else {
00097       echo '              <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . zen_href_link('gv_sent.php', zen_get_all_get_params(array('gid', 'action')) . 'gid=' . $gv_list->fields['coupon_id']) . '\'">' . "\n";
00098     }
00099 ?>
00100                 <td class="dataTableContent"><?php echo $gv_list->fields['sent_firstname'] . ' ' . $gv_list->fields['sent_lastname']; ?></td>
00101                 <td class="dataTableContent" align="center"><?php echo $currencies->format($gv_list->fields['coupon_amount']); ?></td>
00102                 <td class="dataTableContent" align="center"><?php echo $gv_list->fields['coupon_code']; ?></td>
00103                 <td class="dataTableContent" align="right"><?php echo zen_date_short($gv_list->fields['date_sent']); ?></td>
00104                 <td class="dataTableContent" align="right"><?php echo (empty($gv_list->fields['redeem_date']) ? TEXT_INFO_NOT_REDEEMED : zen_date_short($gv_list->fields['redeem_date'])); ?></td>
00105                 <td class="dataTableContent" align="right"><?php if ( (is_object($gInfo)) && ($gv_list->fields['coupon_id'] == $gInfo->coupon_id) ) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . zen_href_link(FILENAME_GV_SENT, 'page=' . $_GET['page'] . '&gid=' . $gv_list->fields['coupon_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
00106               </tr>
00107 <?php
00108     $gv_list->MoveNext();
00109   }
00110 ?>
00111               <tr>
00112                 <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2">
00113                   <tr>
00114                     <td class="smallText" valign="top"><?php echo $gv_split->display_count($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['page'], TEXT_DISPLAY_NUMBER_OF_GIFT_VOUCHERS); ?></td>
00115                     <td class="smallText" align="right"><?php echo $gv_split->display_links($gv_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['page']); ?></td>
00116                   </tr>
00117                 </table></td>
00118               </tr>
00119             </table></td>
00120 <?php
00121   $heading = array();
00122   $contents = array();
00123 
00124   $heading[] = array('text' => '[' . $gInfo->coupon_id . '] ' . ' ' . $currencies->format($gInfo->coupon_amount));
00125   $redeem = $db->Execute("select * from " . TABLE_COUPON_REDEEM_TRACK . "
00126                           where coupon_id = '" . $gInfo->coupon_id . "'");
00127   $redeemed = 'No';
00128   if ($redeem->RecordCount() > 0) $redeemed = 'Yes';
00129   $contents[] = array('text' => TEXT_INFO_SENDERS_ID . ' ' . $gInfo->customer_id_sent);
00130   $contents[] = array('text' => TEXT_INFO_AMOUNT_SENT . ' ' . $currencies->format($gInfo->coupon_amount));
00131   $contents[] = array('text' => TEXT_INFO_DATE_SENT . ' ' . zen_date_short($gInfo->date_sent));
00132   $contents[] = array('text' => TEXT_INFO_VOUCHER_CODE . ' ' . $gInfo->coupon_code);
00133   $contents[] = array('text' => TEXT_INFO_EMAIL_ADDRESS . ' ' . $gInfo->emailed_to);
00134   if ($redeemed=='Yes') {
00135     $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_REDEEMED . ' ' . zen_date_short($redeem->fields['redeem_date']));
00136     $contents[] = array('text' => TEXT_INFO_IP_ADDRESS . ' ' . $redeem->fields['redeem_ip']);
00137     $contents[] = array('text' => TEXT_INFO_CUSTOMERS_ID . ' ' . $redeem->fields['customer_id']);
00138   } else {
00139     $contents[] = array('text' => '<br />' . TEXT_INFO_NOT_REDEEMED);
00140   }
00141 
00142   if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
00143     echo '            <td width="25%" valign="top">' . "\n";
00144 
00145     $box = new box;
00146     echo $box->infoBox($heading, $contents);
00147 
00148     echo '            </td>' . "\n";
00149   }
00150 ?>
00151           </tr>
00152         </table></td>
00153       </tr>
00154     </table></td>
00155 <!-- body_text_eof //-->
00156   </tr>
00157 </table>
00158 <!-- body_eof //-->
00159 
00160 <!-- footer //-->
00161 <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
00162 <!-- footer_eof //-->
00163 <br />
00164 </body>
00165 </html>
00166 <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
 All Data Structures Namespaces Files Functions Variables Enumerations