<!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" />
  <link href="js/ui.tip/style.css" rel="stylesheet" type="text/css"  />
  <script type="text/javascript" src="?act=jslang"></script>
  {script src="ecmall,validator,ui.datagrid,ui.calendar,ajax,ui.tip"}
  <script type="text/javascript">
    Event.observe(window, 'load', function() {
      var grid = new ui.DataGrid($("data-grid"));
      grid.action = "modify";
    });

    var tip = null;
    function showAddTip()
    {
      if (!tip)
      {
        tip = new ui.tip($("add"), true);
        tip.setText("{$lang.add_tip_title}", "{$lang.add_tip}");
        tip.height = 50;
        tip.width = 320;
      }
      tip.show();
    }
  </script>
 </head>

 <body>
  <ul id="container">
    <li id="header">
      <h1>{$lang.group_buy_view}</h1>
      <div class="link"><a href="javascript:;" onclick="showAddTip();" id="add">[{$lang.group_buy_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">{sort_link by=goods_name text=$lang.goods_name}</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>{$lang.status}</th>
          <th>{$lang.handler}</th>
        </tr>
        {foreach from=$list.data item=group_buy}
        <tr id="{$group_buy.act_id}">
          <td class="first-cell"><span>{$group_buy.goods_name|escape}</span>&nbsp;</td>
          <td><span>{$group_buy.start_time}</span>&nbsp;</td>
          <td><span>{$group_buy.end_time}</span>&nbsp;</td>
          <td><span>{$group_buy.act_status}</span>&nbsp;</td>
          <td class="handlelist">
            <a href="admin.php?app=groupbuy&amp;act=edit&amp;act_id={$group_buy.act_id}">{$lang.edit}</a> |
            <a href="admin.php?app=groupbuy&amp;act=view_log&amp;act_id={$group_buy.act_id}">{$lang.view}</a> |
            <a href="admin.php?app=groupbuy&amp;act=drop&amp;act_id={$group_buy.act_id}" onclick="return confirm('{$lang.confirm_delete}')">{$lang.delete}</a>
          </td>
        </tr>
        {foreachelse}
        <tr><td colspan="5" 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>
