<?php
 include template("header"); ;echo '<div id="menu2">
    <a href="'; echo WEB_ROOT; ;echo '/manage/order.php?state=pay">待发货订单</a>&nbsp;｜
    <a href="'; echo WEB_ROOT; ;echo '/manage/order.php?state=send">已发货订单</a>&nbsp;｜
    <a href="'; echo WEB_ROOT; ;echo '/manage/order.php?state=refund">已退款订单</a>&nbsp;｜
    <a href="'; echo WEB_ROOT; ;echo '/manage/order.php?state=unpay">未支付订单</a>&nbsp;｜
    <a href="'; echo WEB_ROOT; ;echo '/manage/order.php">全部订单</a>&nbsp;｜
    <a href="'; echo WEB_ROOT; ;echo '/manage/order_export.php?act=export_pay">待发货订单XLS</a>&nbsp;｜
    <a href="'; echo WEB_ROOT; ;echo '/manage/order_export.php?act=export_all">全部订单XLS</a>&nbsp;｜
    <a href="'; echo WEB_ROOT; ;echo '/manage/order_export.php?act=export_pay_print">待发货打印XLS</a>&nbsp;｜
    <a href="'; echo WEB_ROOT; ;echo '/manage/order_export.php?act=export_all_print">全部打印XLS</a>
</div>
<div id="info" style="display:none">info</div>
<div id="data">
    <form action="" method="post">
        订单号：<input type="text" name="order_number" />
        会员名：<input type="text" name="user_name" /> <!--付款日期：<input type="text" name="pay_time" /-->
        收件人：<input type="text" name="real_name" />
        供货商：
        <select name="provider">
            <option value="">请选择...</option>
            '; foreach($provider as $one){;echo '            <option value="'; echo $one['id']; ;echo '">'; echo $one['name']; ;echo '</option>
            '; } ;echo '        </select>
        <input type="submit" value="订单查询" />
    </form>
    <table>
        <form id="order_manage" action="'; echo WEB_ROOT; ;echo '/manage/order.php?act=send" method="post">
        <thead><tr><th>订单号</th><th>会员名</th><th>收货人</th><th>商品列表</th><th>提供商</th><th>付款日期</th><th>总金额</th><th>订单状态</th><th>操作</th></tr></thead>
        '; if(is_array($order_info)){foreach($order_info AS $index=>$one) { ;echo '        <tr id="order_'; echo $one['id']; ;echo '" onmouseover="cart_item_over(\'order_'; echo $one['id']; ;echo '\')" onmouseout="cart_item_out(\'order_'; echo $one['id']; ;echo '\')">
            <td><a href="'; echo WEB_ROOT."/manage/order_item.php?order_number=".$one['order_number']; ;echo '">'; echo $one['order_number']; ;echo '</a></td>
            <td><a href="#">'; echo $one['username']; ;echo '</a></td>
            <td>'; echo $one['realname']; ;echo '<br />（'; echo $one['province']; ;echo '）</td>
            <td>'; echo OOrder::getItemList($one['order_number']); ;echo '</td>
            <td>'; echo $one['provider_name']."-".$one['brand']."-".$one['channel'] ;echo '</td>
            <td>'; echo date('Y-m-d\<\b\r\>H:i:s',$one['pay_time']) ;echo '</td>
            <td>'; echo $one['sum'] ;echo '<br />
                <font color="green">('; echo ($one['weight']==0) ? 0: $one['mll']; ;echo ')</font>
            </td>
            <td id="state'; echo $one['order_number']; ;echo '">

            ';
                echo state($one['state']);
                if($one['state']=='send'){
                    echo "<br />".$one['express_name'].":".$one['express_no'];
                }elseif($one['state']=='pay'){
            ;echo '                <br /><input id="express_no'; echo $one['id']; ;echo '" type="input" name="express_no['; echo $one['order_number']; ;echo ']" value="'; echo $one['express_name'] ;echo '：单号" onfocus="this.value=\'\'" />
            '; } ;echo '            </td>
            <td>'; if($one['state']=="unpay") { 
;echo '                删除&nbsp;<a href="javascript:order_pay(\''; echo $one['order_number'] ;echo '\')" >支付</a>
                '; }elseif($one['state']=="pay"){ ;echo '                <a href="javascript:order_send(\''; echo $one['order_number']; ;echo '\',$(\'#express_no'; echo $one['id']; ;echo '\')[0].value)">发货</a>
                '; }elseif($one['state']=="send"){ ;echo '                退款
                '; }elseif($one['state']=="refund"){ ;echo '                备注
                '; } ;echo '            </td>
        </tr>
        '; }} ;echo '        <tr><td colspan="9">'; echo $pagestring; ;echo '</td></tr>
        </form>
    </table>
</div>
<div id="fm">
    <h2></h2>
</div>
<div id="op">
    <h2>[<a href="javascript:if(confirm(\'确定发货吗？\'))$(\'#order_manage\').submit()">全部发货</a>]</h2>
</div>
<div id="help">帮助：<br />
    1 点击二级菜单“待发货订单”、“已发货订单”，“未支付订单”，“全部订单”，可以查询到相对应的订单。<br />
    2 点击二级菜单后，再输入“订单号”或“会员名”，可以二次筛选订单。<br />
    3 总金额下面的绿色括号里面为“本单毛利”
</div>
'; include template("footer"); ?>
