<!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}" />
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Cache-Control" content="no-store">
<link href="admin/styles/general.css" rel="stylesheet" type="text/css" />
{script src="ecmall,ajax,ui.utils"}
<script type="text/javascript" src="admin.php?app=order&act=jslang"></script>
<script type="text/javascript">
  Event.observe(window, "load", function() {
   //new ui.utils.tabForm("tab-form");
   //new ui.utils.tabForm("order-info");
   if (navigator.userAgent.toLowerCase().indexOf("firefox/3") != - 1){
     $doc_last_date = new Date(document.lastModified);
     $cookie_last_date = new Date(document.getCookie('lastModified').replace(/\+/g, ' ') + " GMT");
     if ($doc_last_date.getTime() < $cookie_last_date.getTime()){
        location.href = location.href + '&time=' + $cookie_last_date.getTime();
     }
   }
  });
  function submitConfirm() {
    statusNo = $('order_status').value;
    remark   = $('remark').value;
    /*
    if (!remark)
    {
      alert(lang.remark_required);
      return false;
    }
    */
    if (statusNo == 8)
    {
      if(!confirm('{$lang.refuntment_confirm}'))
        return false;
    }
    if (statusNo == 5)
    {
      if (!$('invoice_no').value)
      {
        alert('{$lang.invoice_no_required}');
        $('invoice_no').focus();
        return false;
      }
    }
    if (statusNo == 7) {
      if (!confirm('{$lang.invalid_order_confirm}')) {
        return false;
      }
    }
    if ({$order.is_online} && statusNo == 3) {
      if (!confirm('{$lang.pay_online_order_notice}')) {
        return false;
      }
    }
    return true;
  }
  function inputInvoiceNo(){

      var invoiceNo = prompt(lang.input_invoice_no, '{$order.invoice_no}');
      if (invoiceNo === null)
      {
        return false;
      }
      if (!invoiceNo)
      {
        alert(lang.error_invoice_no);
        return false;
      }
      else
      {
        $('invoice_no').value = invoiceNo;
      }
      return true;
  }
  function visibilitySwitch(obj){
    if (obj.style.display == 'none')
    {
      obj.style.display = '';
    }
    else
    {
      obj.style.display = 'none';
    }
  }
  </script>
  <style type="text/css">
    .order-table-header { font-size:14px; color:#1a5499; background: #FBFDFF url(admin/images/tips_bg.jpg) repeat-x; border-top: 1px solid #dde4c3; border-bottom: 1px solid #c3de71; padding: 10px 30px; clear: both; font-weight:bold; }
    .order-table-header.first { border-top:0; }
    .order-table-header form { padding-left: 20px; background: url(admin/images/icon_search.gif) no-repeat left; }
    .order-table-body { padding-bottom:30px; }
    .anonymous { color:#ccc; }
    .price-item { margin-right:10px; }
    .price { font-weight:bold; }
    .order-info .order-th { text-align:center; }
    .order-info td { padding:5px 5px; font-weight:normal; }
    .order-info .order-key { width:15%; font-weight:bold; padding-left:30px; }
    .order-info .order-val { text-align:left; width:35%; font-weight:normal; }
  </style>
</head>
<body align="center">
<ul id="container">
  <li id="header">
    <h1>{$lang.process_order}</h1>
    <div class="link">[<a href="admin.php?app=order&amp;act=view">{$lang.view_order}</a>]{if $order.order_status lt ORDER_STATUS_ACCEPTTED}&nbsp;&nbsp;[<a href="admin.php?app=order&amp;act=edit&amp;order_id={$order.order_id}">{$lang.edit_charge_info}</a>]{/if}</div>
    <div id="desc">{$status_comment}</div>
  </li>
  <li id="wrapper">
  <li class="order-table-header"> {$lang.order_base_info} </li>
  <li class="order-table-body">
    <table class="grid order-info" cellspacing="0">
      <tr>
        <td class="first-cell order-key">{$lang.order_sn}:</td>
        <td class="order-val">{$order.order_sn}</td>
        <td class="order-key">{$lang.order_status}:</td>
        <td class="order-val">{$lang.$curr_status}</td>
      </tr>
      <tr>
        <td class="first-cell order-key">{$lang.order_user_name}:</td>
        <td class="order-val">{if $order.user_id}{$order.user_name}{else}<span class="anonymous">{$lang.anonymous}</span>{/if}</td>
        <td class="order-key">{$lang.order_add_time}:</td>
        <td class="order-val">{$order.add_time|date:Y-m-d H:i}&nbsp;</td>
      </tr>
      <tr>
        <td class="first-cell order-key">{$lang.order_payment}:</td>
        <td class="order-val">{$order.pay_name|escape}{if $order.log_id}(<span style="cursor:help;color:#1a5499;" title="{$lang.out_trade_no_help}">{$lang.out_trade_no}:{$order.log_id}</span>){/if}&nbsp;</td>
        <td class="order-key">{$lang.order_pay_time}:</td>
        <td class="order-val">{$order.pay_time|date:Y-m-d H:i}&nbsp;</td>
      </tr>
      <tr>
        <td class="first-cell order-key">{$lang.order_shipping_method}:</td>
        <td class="order-val">{$order.shipping_name|escape}</td>
        <td class="order-key">{$lang.order_ship_time}:</td>
        <td class="order-val">{$order.ship_time|date:Y-m-d H:i}&nbsp;</td>
      </tr>
      <tr>
        <td class="first-cell order-key">{$lang.order_invoice_no}:</td>
        <td class="order-val">{$order.invoice_no|escape}&nbsp;</td>
        <td class="order-key">{$lang.order_from}:</td>
        <td class="order-val">{$order.referer|escape}&nbsp;</td>
      </tr>
    </table>
  </li>
  <li class="order-table-header"> {$lang.order_consignee_info} </li>
  <li class="order-table-body">
    <table class="grid order-info" cellspacing="0">
      <tr>
        <td class="first-cell order-key">{$lang.order_consignee}:</td>
        <td class="order-val">{$order.consignee|escape}&nbsp;</td>
        <td class="order-key">{$lang.order_email}:</td>
        <td class="order-val">{$order.email}&nbsp;</td>
      </tr>
      <tr>
        <td class="first-cell order-key">{$lang.order_address}:</td>
        <td class="order-val">[{$order.region|escape}]{$order.address|escape}&nbsp;</td>
        <td class="order-key">{$lang.order_zipcode}:</td>
        <td class="order-val">{$order.zipcode|escape}&nbsp;</td>
      </tr>
      <tr>
        <td class="first-cell order-key">{$lang.order_home_phone}:</td>
        <td class="order-val">{$order.home_phone|escape}&nbsp;</td>
        <td class="order-key">{$lang.order_mobile_phone}:</td>
        <td class="order-val">{$order.mobile_phone|escape}&nbsp;</td>
      </tr>
      <tr>
        <td class="first-cell order-key">{$lang.order_office_phone}:</td>
        <td class="order-val">{$order.office_phone|escape}&nbsp;</td>
        <td class="order-key">{$lang.order_best_time}:</td>
        <td class="order-val">{$order.best_time|escape}&nbsp;</td>
      </tr>
      <!--<tr>
        <td class="first-cell order-key">{$lang.order_sign_building}:</td>
        <td class="order-val" colspan="3">{$order.sign_building}&nbsp;</td>
      </tr>-->
    </table>
  </li>
  <li class="order-table-header"> {$lang.order_goods_info} </li>
  <li class="order-table-body">
    <table class="grid" cellspacing="0">
      <tr>
        <th class="first-cell">{$lang.goods_name}</th>
        <th>{$lang.goods_sku}</th>
        <th>{$lang.goods_price}</th>
        <th>{$lang.goods_attr}</th>
        <th>{$lang.goods_color}</th>
        <th>{$lang.goods_number}</th>
        <th>{$lang.order_subtotal}</th>
      </tr>
      {foreach from=$goods_list item=g}
      <tr>
        <td class="first-cell"><a href="index.php?app=goods&spec_id={$g.spec_id}" target="_blank">{$g.goods_name|escape}</a></td>
        <td><a href="index.php?app=goods&spec_id={$g.spec_id}" target="_blank">{$g.sku|escape}</a></td>
        <td>{$g.goods_price}</td>
        <td>{$g.spec_name|escape}&nbsp;</td>
        <td>{$g.color_name|escape}&nbsp;</td>
        <td>{$g.goods_number}</td>
        <td>{$g.subtotal|price}</td>
      </tr>
      {/foreach}
    </table>
  </li>
  <li class="order-table-header"> {$lang.other_info} </li>
  <li class="order-table-body">
    <table class="grid order-info" cellspacing="0">
      <tr>
        <!--<td class="first-cell order-key">{$lang.order_inv_type}:</td>
        <td class="order-val">{$order.inv_type}&nbsp;</td>-->
        <td class="order-key">{$lang.order_inv_payee}:</td>
        <td class="order-val">{$order.inv_payee|escape}&nbsp;</td>
        <td class="first-cell order-key">{$lang.order_inv_content}:</td>
        <td class="order-val" colspan="3">{$order.inv_content|escape}&nbsp;</td>
      </tr>
      <!--<tr>
        <td class="first-cell order-key">{$lang.order_to_buyer}:</td>
        <td class="order-val" colspan="3">{$order.to_buyer}&nbsp;</td>
      </tr>-->
      <tr>
        <td class="first-cell order-key">{$lang.order_post_script}:</td>
        <td class="order-val" colspan="3">{$order.post_script|escape}&nbsp;</td>
      </tr>
    </table>
  </li>
  <li class="order-table-header"> {$lang.order_charge_info} </li>
  <li class="order-table-body">
       <table class="grid order-info" cellspacing="0">
        <tr>
          <td style="text-align:right;" colspan="4">
                <span class="price-item">{$lang.goods_amount}:<span class="price">{$order.goods_amount|price}</span></span>
                +
                <span class="price-item">{$lang.order_inv_fee}:<span class="price">{$order.inv_fee|price}</span></span>
                +
                <span class="price-item">{$lang.order_shipping_fee}:<span class="price">{$order.shipping_fee|price}</span></span>
                +
                <span class="price-item">{$lang.order_pay_fee}:<span class="price">{$order.pay_fee|price}</span></span><br />
                =
                <span class="price-item">{$lang.order_amount}:<span class="price">{$order.order_amount|price}</span></span>
          </td>
        </tr>
        <tr>
          <td style="text-align:right;" colspan="4">
                -
                <span class="price-item">{$lang.order_discount}:<span class="price">{$order.discount|price}</span></span>
                -
                <span class="price-item">{$lang.order_coupon_sn}:<span class="price">{$order.coupon_value|price}</span></span>
                -
                <span class="price-item">{$lang.order_money_paid}:<span class="price">{$order.money_paid|price}</span></span>
                <br />
                =
                <span class="price-item">{$lang.order_payable}:<span class="price">{$order.payable|price}</span></span>
           </td>
        </tr>
       </table>
  </li>
  {if $order.order_status lt ORDER_STATUS_DELIVERED}
  <li class="order-table-header"> {$lang.order_operate_info} </li>
  <li class="order-table-body">
    {if $order_status_options}
    <form onsubmit="return submitConfirm();" method="post">
      <table class="grid order-info" cellspacing="0">
        <tr>
          <td class="first-cell order-key" style="width:5%;">{$lang.action_note}:</td>
          <td class="order-val"><textarea cols="60" rows="5" name="remark" id="remark"></textarea></td>
        </tr>
        {if $order.order_status eq ORDER_STATUS_PROCESSING or $order.order_status eq ORDER_STATUS_ACCEPTTED}
        <tr>
          <td class="first-cell order-key" style="width:5%;">{$lang.order_invoice_no}:</td>
          <td class="order-val"><input type="text" name="invoice_no" id="invoice_no" value="{$order.invoice_no}" /></td>
        </tr>
        {/if}
        <tr>
          <td class="first-cell order-key" style="width:5%;"> {$lang.handler}: </td>
          <td><input style="display:none;" type="hidden" name="order_id" value="{$order.order_id}" />
            <input style="display:none;" type="hidden" name="order_status" id="order_status" value="{$order.order_status}" />
            <input style="display:none;" type="hidden" name="submit" value="yes" />
            {foreach from=$order_status_options item=status_code key=status_no}
            <button type="submit" onclick="$('order_status').value={$status_no};">{$status_code}</button>
            {/foreach}
            {if $order.order_status eq ORDER_STATUS_DELIVERED}
            <button type="submit" onclick="$('order_status').value=5;">{$lang.edit_invoice_no}</button>
            {/if} </td>
        </tr>
      </table>
    </form>
    {else}
      <table class="grid order-info" cellspacing="0">
        <tr>
          <td class="first-cell order-key" colspan="2">{$lang.no_enable_action}</td>
        </tr>
    {/if}
  </li>
  {elseif $order.order_status gt ORDER_STATUS_DELIVERED}

  {elseif $order.buyer_evaluation eq ORDER_EVALUATION_UNEVALUATED}
  <li class="order-table-header"> {$lang.order_operate_info} </li>
  <li class="order-table-body">
    <table class="grid order-info" cellspacing="0">
    {if $order.is_cod}
      <tr>
        <td class="first-cell order-key" colspan="2"> {$lang.eval_note}</td>
      </tr>
    {/if}
      <tr>
        <td class="first-cell order-key" style="width:10%;"> {$lang.seller_evaluation}:</td>
        <td><input type="button" value="{$lang.order_evaluation_poor}" onclick="window.location.href='admin.php?app=order&act=evaluation&order_id={$order.order_id}&rank=1'" />
          <input type="button" value="{$lang.order_evaluation_common}" onclick="window.location.href='admin.php?app=order&act=evaluation&order_id={$order.order_id}&rank=2'" />
          <input type="button" value="{$lang.order_evaluation_good}" onclick="window.location.href='admin.php?app=order&act=evaluation&order_id={$order.order_id}&rank=3'" />
        </td>
      </tr>
    </table>
  </li>
  {/if}
  <li class="order-table-header"> <a href="javascript:;" onclick="visibilitySwitch($('action_logs_table'));">{$lang.action_logs}</a> </li>
  <li class="order-table-body">
    <table class="grid" cellspacing="0" id="action_logs_table" style="display:none;">
      <tr>
        <th class="first-cell">{$lang.action_user}</th>
        <th>{$lang.action_time}</th>
        <th>{$lang.order_status}</th>
        <th width="50%">{$lang.action_note}</th>
      </tr>
      {foreach from=$action_logs.data item=log}
      <tr>
        <td class="first-cell">{if $log.action_user eq '0'}{$lang.system_user}{else}{$log.action_user}{/if}</td>
        <td>{$log.action_time}</td>
        <td>{$lang.$log.order_status}</td>
        <td>{$log.action_note|escape}</td>
      </tr>
      {foreachelse}
      <tr>
        <td colspan="4" class="no-records">{$lang.no_records}</td>
      </tr>
      {/foreach}
    </table>
  </li>
  {include file="admin/templates/footer.html"}
</ul>
</body>
</html>
