<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title> ECMall </title>
  <meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
  <link href="admin/styles/general.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="?act=jslang"></script>
  {script src="ecmall,ajax,validator,ui.datagrid,ui.calendar"}
  <script type="text/javascript">
    Event.observe(window, 'load', function() {
      var grid = new ui.DataGrid($("data-grid"));
      grid.action = "modify";
    });
  </script>
 </head>

 <body>
  <ul id="container">
    <li id="header">
      <h1>{$lang.coupon_view}</h1>
      <div class="link">[<a href="admin.php?app=coupon&amp;act=add">{$lang.coupon_add}</a>]</div>
      <div id="desc">
        <div id="page-selector">
          {$lang.goto_page}{page_selector from=$list.info url=$url_format}
        </div>
        <span>{$stats}</span>
      </div>
    </li>
    <li id="wrapper">
      <table class="grid" cellspacing="0" id="data-grid">
        <tr>
          <th class="first-cell" readOnly="false" columnName="coupon_name" dataType="string" required="true">{sort_link by=coupon_name text=$lang.coupon_name}</th>
          <th readOnly="false" columnName="coupon_value" dataType="int" required="true">{sort_link by=coupon_value text=$lang.coupon_value}</th>
          <th readOnly="false" columnName="max_times" dataType="int" required="true">{sort_link by=max_times text=$lang.max_times}</th>
          <th readOnly="false" columnName="start_time" dataType="date" required="true">{sort_link by=start_time text=$lang.start_time}</th>
          <th readOnly="false" columnName="end_time" dataType="date">{sort_link by=end_time text=$lang.end_time}</th>
          <th readOnly="false" columnName="min_amount" dataType="int" required="true">{sort_link by=min_amount text=$lang.min_amount}</th>
          <th>{$lang.handler}</th>
        </tr>
        {foreach from=$list.data item=coupon}
        <tr id="{$coupon.coupon_id}">
          <td class="first-cell"><span>{$coupon.coupon_name}</span>&nbsp;</td>
          <td><span>{$coupon.coupon_value}</span>&nbsp;</td>
          <td><span>{$coupon.max_times}</span>&nbsp;</td>
          <td><span>{$coupon.start_time}</span>&nbsp;</td>
          <td><span>{$coupon.end_time}</span>&nbsp;</td>
          <td><span>{$coupon.min_amount}</span>&nbsp;</td>
          <td>
            <a href="admin.php?app=coupon&amp;act=sent&amp;coupon_id={$coupon.coupon_id}">{$lang.sent_coupon}</a>
            <a href="admin.php?app=coupon&amp;act=export&amp;coupon_id={$coupon.coupon_id}')">{$lang.export}</a>
          </td>
        </tr>
        {foreachelse}
        <tr><td colspan="7" class="no-records">{$lang.no_records}</td></tr>
        {/foreach}
      </table>
      <div id="page-list">{page_links from=$list.info url=$url_format}</div>
    </li>
    {include file="admin/templates/footer.html"}
  </ul>
 </body>
</html>
