<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderEdit.aspx.cs" Inherits="LMN.Web.Admin.Order.OrderEdit" %>
<%@ Import Namespace="LMN.Common" %>

<!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 id="Head1" runat="server">
<title></title>
<link href="../css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
<script src="../../ckeditor/fckeditor.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server" target="iframe">
    <div style="padding: 20px;">
        <h4 class="title"><strong>正在编辑:</strong>订单号 -
            <%=obj.no %></h4>
        <h4>商品信息</h4>
        <div class="division">
            <table width="100%" id="order_items" border="0" cellspacing="0" cellpadding="2" class="gridlist">
                <thead>
                    <tr class="left">
                        <th>货号</th>
                        <th>商品名称</th>
                        <th>价格</th>
                        <th>购买数量</th>
                        <th>小计</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <% foreach (var o in obj.items) {%>
                    <tr>
                        <td><input type="hidden" name="order_item_id" value="<%=o.id %>" />
                            <%=o.no %></td>
                        <td>
                            <%=o.name%><%
                           var str = "";
                           if (!string.IsNullOrEmpty(o.color)) {
                               str += "(" + o.color;
                               if (!string.IsNullOrEmpty(o.size)) {
                                   str += "、" + o.size;
                               }
                               str += ")";
                               Response.Write(str);
                           }%></td>
                        <td><input type="text" name="order_item_price" value="<%=o.price %>" size="8" /></td>
                        <td><input type="text" name="order_item_num" value="<%=o.num %>" size="4" /></td>
                        <td>
                            <%=o.price*o.num %></td>
                        <td><a href="javascript:;" onclick="delgoods(this)">删除</a></td>
                    </tr>
                    <%}%>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="6">输入商品货号： <input class="" type="text" name="newbn" vtype="text" /> <input type="button" id="newbtn" name="newbtn" onclick="" value="添加"></td>
                    </tr>
                </tfoot>
            </table>
        </div>
        <h4>订单信息</h4>
        <div class="division">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <th style="width: 15%; ">订单号：</th>
                    <td style="width: 35%; ">
                        <%=obj.no %></td>
                    <th style="width: 15%; ">下单日期：</th>
                    <td>
                        <%=obj.datetime %></td>
                </tr>
                <tr>
                    <th>商品总金额：</th>
                    <td><input id="amount" type="text" name="amount" value="<%=obj.amount %>" size="10" disabled="disabled"></td>
                    <th>配送方式：</th>
                    <td>
                        <asp:DropDownList ID="delivery" runat="server">
                        </asp:DropDownList>
                        <%--<select name="shipping_id">
                        <option label="EMS-中国邮政（示范）" value="1">EMS-中国邮政（示范）</option>
                        <option label="快递-申通深圳（示范）" value="2">快递-申通深圳（示范）</option>
                        <option label="快递-顺丰上海（示范）" value="3" selected="selected">快递-顺丰上海（示范）</option>
                        <option label="上海同城快递（示范）" value="4">上海同城快递（示范）</option>
                        <option label="平邮（示范）" value="8">平邮（示范）</option>
                        <option label="上门自取（示范）" value="10">上门自取（示范）</option>
                        <option label="货到付款（示范）" value="9">货到付款（示范）</option>
                    </select>--%></td>
                </tr>
                <tr>
                    <th>配送费用：</th>
                    <td><input id="freight" name="freight" value="<%=obj.freight %>" type="text" size="10" /></td>
                    <th>支付方式：</th>
                    <td>
                        <%--<select name="payment">
                        <option label="货到付款" value="-1">货到付款</option>
                        <option label="运筹宝" value="31">运筹宝</option>
                        <option label="预存款支付" value="1" selected="selected">预存款支付</option>
                        <option label="汇款-工商银行（示范）" value="28">汇款-工商银行（示范）</option>
                        <option label="支付宝（示范）" value="30">支付宝（示范）</option>
                        <option label="腾讯财付通（示范）" value="27">腾讯财付通（示范）</option>
                    </select>--%></td>
                </tr>
                <tr>
                    <th>保价：</th>
                    <td><input id="protect" type="text" name="protect" size="10" value="<%=obj.protect %>" /> 是否要保价 <input id="isprotect" name="isprotect" type="checkbox" value="1"<%=obj.isprotect==1?" checked=\"checked\"":"" %> /"></td>
                    <th>商品重量：</th>
                    <td><input name="weight" id="weight" type="text" size="10" value="<%=obj.weight %>" /></td>
                </tr>
                <tr>
                    <th>支付手续费：</th>
                    <td><input id="fees" name="fees" type="text" size="10" value="<%=obj.fees %>" /></td>
                    <th>发票抬头：</th>
                    <td><input id="tax_name" name="tax_name" value="<%=obj.tax_name %>" type="text" /></td>
                </tr>
                <tr>
                    <th>税金：</th>
                    <td><input id="tax" name="tax" type="text" size="10" value="<%=obj.tax %>" /> 是否开发票 <input id="istax" name="istax" type="checkbox" value="1"<%=obj.istax==0?"":" checked=\"checked\"" %> /></td>
                    <th>订单折扣或涨价：</th>
                    <td><input id="promote" name="promote" value="<%=obj.promote %>" size="10"> <a href="javascript:;" title="要给顾客便宜100元，则输入“-100”;要提高订单价格100元，则输入“100”">?</a>
                </tr>
                <%--<tr>
                    
                </tr>--%>
                <tr>
                    <th>订单总金额：</th>
                    <td><input id="total" name="total" value="<%=obj.total %>" disabled="disabled" /></td>
                    <th>折扣：</th>
                    <td><input id="discount" name="discount" value="<%=obj.discount %>" size="10"></td>
                </tr>
            </table>
        </div>
        <h4>收货人信息</h4>
        <div class="division" id="order_edit_receiver">
            <table width="100%">
                <tr>
                    <th style="width: 15%; ">收货人姓名：</th>
                    <td style="width: 35%; "><input type="text" name="addr_name" id="addr_name" value="<%=obj.addr.name %>" vtype="text" /> *</td>
                    <th style="width: 15%; ">联系手机：</th>
                    <td><input type="text" name="addr_mobile" id="addr_mobile" value="<%=obj.addr.mobile %>" class="" /></td>
                </tr>
                <tr>
                    <th>联系电话：</th>
                    <td><input type="text" name="addr_tele" id="addr_tele" value="<%=obj.addr.tele %>" /></td>
                    <th>邮政编码：</th>
                    <td><input name="addr_zip" id="addr_zip" value="<%=obj.addr.zip %>" type="text" /></td>
                </tr>
                <%--<tr>
                    <th>送货时间：</th>
                    <td><input type="text" name="addr_date" value="任意日期 " class=""></td>
                </tr>--%>
                <tr>
                    <th>收货地址：</th>
                    <td colspan="3"><span package="mainland" vtype="area"><input type="hidden" value="mainland:上海/上海市/黄浦区:23" name="ship_area" /> </span><input type="text" name="addr_addr" value="<%=obj.addr.addr %>" size="60" style="width: 60%;" /> *</td>
                </tr>
            </table>
        </div>
        <h4>运单及备注</h4>
        <div class="division" id="Div1">
            <table width="100%">
                <tr>
                    <th>用户备注：</th>
                    <td colspan="3"><input type="text" name="remarks" id="remarks" value="<%=obj.remarks %>" vtype="text" /> *</td>
                </tr>
                <tr>
                    <th style="width: 15%; ">运单编号：</th>
                    <td style="width: 35%; "><input type="text" name="waybill" id="waybill" value="<%=obj.waybill %>" class="" /></td>
                    <th style="width: 15%; ">发货时间：</th>
                    <td><input type="text" name="delivered" id="delivered" value="<%=obj.delivered %>" /></td>
                </tr>
                <tr>
                    <th>管理备注：</th>
                    <td colspan="3"><textarea type="text" name="notice" id="notice" value="<%=obj.notice %>"></textarea></td>
                </tr>
            <%--</table>
        </div>
        <div class="division">
            <table width="100%">--%>
                <tfoot>
                    <tr>
                        <th>&nbsp;</th>
                        <td colspan="3"><b class="submitBtn">
                            <button onclick="subOrderForm(1);">
                                <span class="iconbutton savetolist">保存并关闭窗口</span>
                            </button>
                        </b><b class="submitBtn blue">
                            <button onclick="subOrderForm()">
                                <span class="iconbutton savebutton">保存当前</span>
                            </button>
                        </b></td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
</form>
<iframe id="iframe" name="iframe" src="about:blank" style="display: ;"></iframe>
<script type="text/javascript">
<!--
    $(document).ready(function() {
//        // ckeditor
//        var oFcKeditor = new FCKeditor('remarks');
//        oFcKeditor.Config['ToolbarStartExpanded'] = false;
//        oFcKeditor.BasePath = "<%=Config.SitePath %>ckeditor/";
//        oFcKeditor.Height = 80;
//        oFcKeditor.ToolbarSet = 'Desc';
//        oFcKeditor.ReplaceTextarea();

//        var nFcKeditor = new FCKeditor('notice');
//        nFcKeditor.Config['ToolbarStartExpanded'] = false;
//        nFcKeditor.BasePath = "<%=Config.SitePath %>ckeditor/";
//        nFcKeditor.Height = 80;
//        nFcKeditor.ToolbarSet = 'Desc';
//        nFcKeditor.ReplaceTextarea();
    });
//-->
</script>
</body>
</html>
