<!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> new document </title>
  <meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
  <link href="admin/styles/general.css" rel="stylesheet" type="text/css" />
  {script src="ecmall,ajax,ui.dropdownmenu,ui.calendar,ui.tip"}
  <script type="text/javascript" src="admin.php?act=jslang"></script>
  <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">
  Event.observe(window, "load", function() {
     $("start_date").onclick = function() {
       if(!$("start_date").calendar) {
         $("start_date").calendar = new ui.calendar(this, $('start_date'));
       } else {
         $("start_date").calendar.show();
       }
     }
     $("end_date").onclick = function() {
       if(!$("end_date").calendar) {
         $("end_date").calendar = new ui.calendar(this, $('end_date'));
       } else {
         $("end_date").calendar.show();
       }
     }
     var tip = new ui.tip($('search_keywords'));
     tip.setText('{$lang.tip}', '{$lang.search_keywords_tip}');
     tip.width = 200;
     tip.height = 80;
     tip.show();
     tip.hide(5000);
  });
  </script>
 </head>
 <body>
  <ul id="container">
    <li id="header">
      <h1>{$lang.view_order}</h1>
      <div class="link">[<a href="admin.php?app=order&amp;act=view">{$lang.all_order}</a>]</div>
      <div id="desc">
        <div id="page-selector">
          {page_selector from=$page_info url=$url_format}
        </div>
        <span>{$order_stats}</span>
      </div>
    </li>
    <li id="tips" style="border-bottom:1px solid #dadada">
      <form method="get" name="queryForm">
        {$lang.keyword}: <input type="text" name="keywords" value="{$smarty.get.keywords}" id="search_keywords" />&nbsp;&nbsp;
      <select name="order_status">
        <option value="-1">{$lang.order_status_all}</option>
        {html_options options=$order_status selected=$search_by_status}
      </select>
      {$lang.order_add_time}:
      <input type="input" name="start_date" id="start_date" value="{$smarty.get.start_date}" size="8" /> <span>-</span> <input type="input" name="end_date" value="{$smarty.get.end_date}" id="end_date" size="8" />
      {$lang.order_amount}:
      <input type="input" name="order_amount_start" value="{$smarty.get.order_amount_start}" size="5" /> <span>-</span> <input type="input" name="order_amount_end" value="{$smarty.get.order_amount_end}" size="5" /> &nbsp;&nbsp;
      <input type="hidden" name="app" value="order" />
      <input type="hidden" name="act" value="view" />
      <input type="submit" value="{$lang.button_search}" />
      </form>
    </li>
    <li id="wrapper">
      <table class="grid" cellspacing="0" id="orderListGrid">
        <tr>
          <th class="first-cell">{$lang.store_name}</th>
          <th>{sort_link by=order_sn text=$lang.order_sn}</th>
          <th>{sort_link by=add_time text=$lang.order_add_time}</th>
          <th>{sort_link by=order_amount text=$lang.order_amount}</th>
          <th>{sort_link by=order_status text=$lang.order_status}</th>
          <th>{sort_link by=consignee text=$lang.order_consignee}</th>
          <th>{sort_link by=pay_id text=$lang.order_payment}</th>
          <th>{sort_link by=user_name text=$lang.order_user_name}</th>
          <th>{$lang.handle}</th>
        </tr>
        {foreach from=$orders item=order}
        <tr>
          <td class="first-cell"><a href="?app=order&act=view&store_id={$order.store_id}" title="{$lang.view_by_store}">{$order.store_name}</a></td>
          <td><a href="admin.php?app=order&act=show&order_id={$order.order_id}">{$order.order_sn}</a>
          {if $order.extension_code eq 'GROUPBUY'}
            [<a href="index.php?app=groupbuy&amp;act=detail&amp;id={$order.extension_id}" target="_blank" class="ext_groupbuy">{$lang.groupbuy}</a>]
          {/if}</td>
          <td>{$order.add_time}</td>
          <td>{$order.order_amount|price}</td>
          <td>{$order.status}</td>
          <td>{$order.consignee}</td>
          <td>{$order.pay_name}</td>
          <td>{if $order.user_name neq ''}<a href="admin.php?app=order&act=view&user_id={$order.user_id}" title="{$lang.search_order_by_user_name}">{$order.user_name}</a>{else}<span style="color:#bbb;">{$lang.anonymous}</span>{/if}</td>
          <td><a href="admin.php?app=order&act=show&order_id={$order.order_id}">{$lang.view}</a></td>
        </tr>
        {foreachelse}
        <tr><td colspan="8" class="no-records">{$lang.no_records}</td></tr>
        {/foreach}
      </table>
      <div id="page-list">{page_links from=$page_info url=$url_format}</div>
    </li>
    {include file="admin/templates/footer.html"}
  </ul>
 </body>
</html>
