<%@ page language="C#" autoeventwireup="true" inherits="WebAdmin_OrderDetail, LebiMall" %>
<!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 rel="stylesheet" type="text/css" href="css/css.css" media="screen"/>
    <script type="text/javascript" language="javascript" src="js/topHead.js"></script>
    <link href="css/tipswindown.css" type="text/css" rel="stylesheet" />
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/tipswindown.js" type="text/javascript"></script>
    <script type="text/javascript">
        var $=jQuery;
        function init(){
            var list=document.getElementById("select1");
            var state="<%=state %>";
            for(i=0;i<list.length;i++){
                if(state==list[i].value){
                    list[i].selected=true;
                    if(i==2){
                        document.getElementById("div_c").style.display="block";
                        document.getElementById("div_code").style.display="block";
                    }
                }
            }
        }
        function getSelect(obj){
            if(obj.value==2){
                document.getElementById("div_c").style.display="block";
                document.getElementById("div_code").style.display="block";
            }else{
                document.getElementById("div_c").style.display="none"; 
                document.getElementById("div_code").style.display="none";
            }
        }
        function validate(){
            var flag=true;
            var list=document.getElementById("select1");
            if(list[2].selected){
                if(document.getElementById("txt_company").value==""){
                    document.getElementById("msg_company").innerHTML="<span  class='msg_submit'>快递公司不能为空！</span>"
                    flag=false;
                }else{
                    document.getElementById("msg_company").innerHTML="";
                }
                if(document.getElementById("txt_code").value==""){
                    document.getElementById("msg_code").innerHTML="<span  class='msg_submit'>发货单号不能为空！</span>"
                    flag=false;
                }else{
                    document.getElementById("msg_code").innerHTML="";
                }
            }
            if(flag){
                return true;
            }else{
                return false;
            }
        }
        function validate2(){
            var flag=true;
            if(document.getElementById("txt_jiage").value==""){
                document.getElementById("msg_jiage").innerHTML="<span  class='msg_submit'>价格调整不能为空！</span>"
                flag=false;
            }else{
                document.getElementById("msg_company").innerHTML="";
            }
            if(document.getElementById("txt_zhekou").value==""){
                document.getElementById("msg_zhekou").innerHTML="<span  class='msg_submit'>折扣不能为空！</span>"
                flag=false;
            }else{
                document.getElementById("msg_zhekou").innerHTML="";
            }
            if(document.getElementById("txt_yufei").value==""){
                document.getElementById("msg_yufei").innerHTML="<span  class='msg_submit'>运费不能为空！</span>"
                flag=false;
            }else{
                document.getElementById("msg_yufei").innerHTML="";
            }
            if(flag){
                return true;
            }else{
                return false;
            }
        }
        function validate3(){
            var flag=true;
            if(document.getElementById("code").value==""){
                document.getElementById("msg_biaoh").innerHTML="<span class='msg_submit'>商品编号不能为空！</span>"
                flag=false;
            }else{
                document.getElementById("msg_biaoh").innerHTML="";
            }
            if(document.getElementById("xin_num").value==""){
                document.getElementById("msg_xin_num").innerHTML="<span class='msg_submit'>数量不能为空！</span>"
                flag=false;
            }else{
                document.getElementById("msg_xin_num").innerHTML="";
            }
            if(document.getElementById("xin_price").value==""){
                document.getElementById("msg_xin_price").innerHTML="<span class='msg_submit'>价格不能为空！</span>"
                flag=false;
            }else{
                document.getElementById("msg_xin_price").innerHTML="";
            }
            if(flag){
                return true;
            }else{
                return false;
            }
        }
        function del(id){
            if (confirm("确认要删除？")) {
                window.location.href="OrderFormcDel.aspx?id="+id+"&pid="+'<%=id %>';
            }
        }
        function resizeEditor2(name,size) {   
	        var newheight = parseInt(document.getElementById(name).style.height) + size;
	        if(newheight >= 60) {   
		        document.getElementById(name).style.height = newheight + 'px';   
	        }   
        }
        function maxCount(){
            var tt=document.getElementById("TextArea2");

            if(tt.value.length>100){
                tt.value=tt.value.substring(0,100);
            }
        }
        function maxCount2(){
            var tt=document.getElementById("TextArea1");

            if(tt.value.length>100){
                tt.value=tt.value.substring(0, 100);
            }
        }
    </script>
</head>
<body onload="init()">
    <div id="dhtmltooltip"><img src=""></div>
    <script type="text/javascript" language="javascript" src="js/js_link.js"></script>
    <form id="form1" runat="server">
        <!--顶部logo区域-->
        <script>header(3,0,"images/");</script>
        <div class="blank clearfix"></div>
        <!--功能区-->
        <div class="tabmenus mainwidth">
            <ul>
                <li><a href="Orderlist.aspx"><span>全部订单</span></a></li>
                <li class="current"><a href="#"><span>订单明细</span></a></li>
            </ul>
        </div>
        <div class="tab-mainbody">
            <div class="tab-mainbody2">
                <div class="functionHandleArea clearfix" style="padding:5px;">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="30" width="80%" align="left">
                                <input type="image" src="images/bt_toword.gif" title=" 导出WORD " onclick="window.open('OrderForm_out.aspx?id=<%=id %>&type=Word');return false;" align="absmiddle">
                                <input type="image" src="images/bt_toexcel.gif" title=" 导出EXCEL " onclick="window.open('OrderForm_out.aspx?id=<%=id %>&type=Excel');return false;" align="absmiddle">
                                <input type="image" src="images/bt_print.gif" title=" 打印 " onclick="window.open('OrderFormPrint.aspx?id=<%=id %>');return false;" align="absmiddle">
                            </td>
                            <td width="20%" align="right">
                                <input type="image" src="images/bt_quick_back.gif"  alt=" 返回 " title=" 返回 " onclick="location.href='javascript:history.back()';return false;" align="absmiddle">
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="datalist">
                    <table cellpadding="0" cellspacing="0" width="100%" border="0" id="list4">
                        <tr>
                            <th colspan="4">订单信息</th>
                        </tr>
                        <tr>
                            <td width="15%">
                                订单编号：
                            </td>
                            <td width="35%">
                                 <%=ds.Tables[0].Rows[0]["OCode"]%>
                            </td>
                            <td>
                                订购时间：
                            </td>
                            <td>
                                 <%=ds.Tables[0].Rows[0]["Submittime"]%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                订单金额：
                            </td>
                            <td colspan="3">
                               <%=pricesum %>  = (商品总额：<%=ds.Tables[0].Rows[0]["Summoney"]%> × 折扣：<%=ds.Tables[0].Rows[0]["tz_zk"].ToString() %>%)+ 金额调整：<%=ds.Tables[0].Rows[0]["tz_jg"]%> + 运费：<%=ds.Tables[0].Rows[0]["OFreightprice"]%> + 运费调整：<%=ds.Tables[0].Rows[0]["tz_yf"]%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                支付方式：
                            </td>
                            <td>
                                 <%=zffs %>
                            </td>
                            <td>
                                配送方式：
                            </td>
                            <td>
                                 <%=peisong %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                发货单号：
                            </td>
                            <td colspan="3">
                               <%=danhao %>
                            </td>
                        </tr>
                        <tr><th colspan="4">收货人信息</th></tr>
                        <tr>
                            <td>
                                姓名：
                            </td>
                            <td>
                                 <%=ds.Tables[0].Rows[0]["oname"]%>
                            </td>
                            <td>
                                手机号码：
                            </td>
                            <td>
                                 <%=ds.Tables[0].Rows[0]["Sphone_c"]%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                联系电话：
                            </td>
                            <td>
                                 <%=ds.Tables[0].Rows[0]["Sphone"]%>
                            </td>
                            <td>
                                邮政编码：
                            </td>
                            <td>
                                 <%=ds.Tables[0].Rows[0]["Opostalcode"]%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                联系地址：
                            </td>
                            <td colspan=3>
                                 <%=ds.Tables[0].Rows[0]["Oaddress"]%>
                            </td>
                        </tr>
                        <tr><th colspan="4">订购人信息</th></tr>
                        <tr>
                            <td>
                                会员帐号：
                            </td>
                            <td>
                                 <%=ds.Tables[0].Rows[0]["username"]%>
                            </td>
                            <td>
                                姓名：
                            </td>
                            <td>
                                 <%=ds.Tables[0].Rows[0]["Uname"]%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                联系电话：
                            </td>
                            <td>
                                 <%=ds.Tables[0].Rows[0]["Utel"]%>
                            </td>
                            <td>
                                手机号码：
                            </td>
                            <td>
                                 <%=ds.Tables[0].Rows[0]["Ucellphone"]%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                电子邮件：
                            </td>
                            <td>
                                 <%=ds.Tables[0].Rows[0]["Uemail"]%>
                            </td>
                            <td>
                                邮政编码：
                            </td>
                            <td>
                                 <%=ds.Tables[0].Rows[0]["Opostalcode"]%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                联系地址：
                            </td>
                            <td colspan=3>
                                 <%=ds.Tables[0].Rows[0]["oaddress"]%>
                            </td>
                        </tr>
                    </table>
                    
                    <div class="functionHandleArea clearfix" style=" margin-top:5px">
                            <asp:Button ID="Button1" runat="server"  CssClass="btn-app" OnClick="Button1_ServerClick" OnClientClick="return validate();"/>
                                <input type="image" title=" 重填 " onclick="reset();return false;" src="images/bt_res.gif"align="absmiddle" />
                            
                    </div>
                    <table cellpadding="0" cellspacing="0" width="100%" border="0" id="list">
                        <tr>
                            <th colspan=2>更改订单</th>
                            
                        </tr>
                        <tr>
                            <td >商家名称：</td>
                            <td>
                                <a href="../Shop.aspx?id=<%=ds.Tables[0].Rows[0]["shopid"]%>"><%=ds.Tables[0].Rows[0]["sname"]%></a>     
                            </td>
                        </tr>
                        <tr>
                            <td >订单状态：</td>
                            <td>
                                 <select id="select1" runat=server onchange="getSelect(this);">
                                     <option value=0>未付款</option>
                                     <option value=1>已付款</option>
                                     <option value=2>已发货</option>
                                     <option value=3>已收货</option>
                                     <option value=4>已归档</option>
                                     <option value=9>无效</option>
                                 </select>
                            </td>
                        </tr>
                        <tr id="div_c" style="display:none;">
                            <td>
                                快递公司：
                            </td>
                            <td>
                                <input type=text class="input" id="txt_company" runat=server/>&nbsp;<span id="msg_company" runat="server"></span>
                            </td>
                        </tr>
                        <tr id="div_code" style="display:none;">
                            <td>
                                发货单号：
                            </td>
                            <td>
                                <input type=text class="input" id="txt_code" runat=server/>&nbsp;<span id="msg_code" runat="server"></span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                附加信息：
                                <em>100字以内</em>
                            </td>
                            <td>
                                <textarea id="TextArea2" cols="60" class="input-textarea"  style="height:60px;margin-bottom:4px"  onkeyup="maxCount()"  onkeydown="maxCount()" runat="server"></textarea><br />
                                <a href="javascript:resizeEditor2('TextArea2',-50)"><img src="images/bt_close.gif" border='0'></a>
                                <a href="javascript:resizeEditor2('TextArea2',50)"><img src="images/bt_open.gif" border='0'></a></td>
                        </tr>
                        <tr>
                            <td>
                                内部标识：
                            </td>
                            <td>
                                <input id="Radio1" type="radio" name="radio" runat=server /> <img src="images/mark/1.gif" />
                                <input id="Radio2" type="radio" name="radio" runat=server /> <img src="images/mark/2.gif" />
                                <input id="Radio3" type="radio" name="radio" runat=server /> <img src="images/mark/3.gif" />
                                <input id="Radio4" type="radio" name="radio" runat=server /> <img src="images/mark/4.gif" />
                                <input id="Radio5" type="radio" name="radio" runat=server /> <img src="images/mark/5.gif" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                内部备注：<br />
                                <em>100字以内</em>
                            </td>
                            <td>
                                <textarea id="TextArea1" cols="60"  class="input-textarea" style="height:60px;margin-bottom:4px" onkeyup="maxCount1()"  onkeydown="maxCount1()" runat="server"></textarea><br />
                                <a href="javascript:resizeEditor2('TextArea1',-50)"><img src="images/bt_close.gif" border='0'></a>
                                <a href="javascript:resizeEditor2('TextArea1',50)"><img src="images/bt_open.gif" border='0'></a>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                开具发票：
                            </td>
                            <td>
                                <input type=checkbox id="ch_is" runat="server" />是
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="list-foot">
                                <asp:Button ID="Button2" runat="server"  CssClass="btn-app" OnClick="Button1_ServerClick" OnClientClick="return validate();"/>
                                <input type="image" title=" 重填 " onclick="reset();return false;" src="images/bt_res.gif"align="absmiddle" />
                            </td>
                        </tr>
                    </table>
                    <div class="both"></div>
                    <div class="functionHandleArea clearfix" style=" margin-top:5px">
                        <asp:Button ID="Button3" runat="server"  CssClass="btn-app" OnClick="Button3_Click" OnClientClick="return validate2();"/>
                        <input type="image" title=" 重填 " onclick="reset();return false;" src="images/bt_res.gif"align="absmiddle" />
                    </div>
                    <table cellpadding="0" cellspacing="0" width="100%" border="0" id="list2">
                        <tr>
                            <th style="width:12%">金额调整</th>
                            <th style="width:88%"><span class="title_r" id="Span1"></span></th>
                        </tr>
                        <tr>
                            <td>
                                折扣调整（%）：
                            </td>
                            <td>
                                 <input type=text class="input" value=0 id="txt_zhekou" runat=server  />&nbsp;<span id="msg_zhekou" runat="server"></span>
                            </td>
                        </tr>
                        <tr>
                            <td >
                                价格调整（元）：
                            </td>
                            <td>
                                 <input type=text class="input" value=0 id="txt_jiage" runat=server />&nbsp;<span id="msg_jiage" runat="server"></span>
                            </td>
                        </tr>
                        <tr>
                            <td >
                                运费调整（元）：
                            </td>
                            <td>
                                 <input type=text class="input" value=0 id="txt_yufei"  runat=server />&nbsp;<span id="msg_yufei" runat="server"></span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="list-foot">
                                <asp:Button ID="Button4" runat="server"  CssClass="btn-app" OnClick="Button3_Click" OnClientClick="return validate2();"/>
                                <input type="image" title=" 重填 " onclick="reset();return false;" src="images/bt_res.gif"align="absmiddle" />
                            </td>
                        </tr>
                    </table>
                    <table cellpadding="0" cellspacing="0" width="100%" border="0" id="list3" style="margin-top:5px;">
                        <tr>
                            <th>操作日志</th>
                        </tr>
                        <%for (int i = 0; i < ds_log.Tables[0].Rows.Count;i++) {%>
                        <tr>
                            <td>
                                管理员：<%=ds_log.Tables[0].Rows[i]["Oadminname"] %>&nbsp;<%=ds_log.Tables[0].Rows[i]["Ocontent"] %>，(<%=ds_log.Tables[0].Rows[i]["Submittime"] %>)
                            </td>
                        </tr>
                        <%} %>
                    </table>
                    <div class="both"></div>
                    <div class="functionHandleArea clearfix" style=" margin-top:5px">
                        <input id="Button5" type="button" runat="server" class="btn-app" onserverclick="Button5_ServerClick"/>
                        <input type="image" title=" 重填 " onclick="reset();return false;" src="images/bt_res.gif"align="absmiddle" />
                    </div>
                    <table cellpadding="0" cellspacing="0" width="100%" border="0" id="list5">
                        <tr>
                            <th width="10%">缩图</th>
                            <th width="15%">商品编号</th>
                            <th width="15%">商品名称</th>
                            <th width="15%">数量</th>
                            <th width="15%">金额</th>
                            <th width="15%">小计</th>
                            <th width="15%">操作</th>
                        </tr>
                        <%for(int i=0;i<ds.Tables[1].Rows.Count;i++) {%>
                        <tr>
                            <td>
                                <img src="images/img.gif" align='absmiddle' onmouseover="javascript:ddrivetip('<div class=hideimg><img src=../Upload/commodity/<%=ds.Tables[1].Rows[i]["oimg"] %>></div>', '#ffffff', '150')"
                                    onmouseout="hideddrivetip()" />
                            </td>
                            <td><%=ds.Tables[1].Rows[i]["ocode"] %>
                            </td>
                            <td><%=ds.Tables[1].Rows[i]["oname"] %>
                            </td>
                            <td>
                                <input type=hidden id="oidc<%=i %>" name="oidc<%=i %>" value="<%=ds.Tables[1].Rows[i]["id"] %>" />
                                <input type=text class="input" id="onum<%=i %>" name="onum<%=i %>"  style="width:90px;" value="<%=ds.Tables[1].Rows[i]["onum"] %>" />
                            </td>
                            <td>
                                <input type=text class="input" id="opriced<%=i %>" name="opriced<%=i %>" style="width:90px;" value="<%=ds.Tables[1].Rows[i]["opriced"] %>" />
                            </td>
                            <td>
                                <%=ds.Tables[1].Rows[i]["xjprice"] %>
                            </td>
                            <td>
                              <a href="../Detail.aspx?cid=<%=ds.Tables[1].Rows[i]["cid"] %>" target="_blank"><img src="images/icon_view.gif" border=0 title="查看" alt="查看"/></a>  
                              <img src="images/icon_del.gif" title="删除" alt="删除" onclick="del(<%=ds.Tables[1].Rows[i]["id"] %>)" />
                            </td>
                        </tr>
                        <%} %>
                        <tr>
                            <td colspan="7" class="list-foot">
                                <input id="Button6" type="button" runat="server" class="btn-app" onserverclick="Button5_ServerClick"/>
                            </td>
                        </tr>
                    </table>
                    <div class="both"></div>
                    <div class="functionHandleArea clearfix" style=" margin-top:5px">
                        <asp:Button ID="Button7" runat="server" CssClass="btn-app" OnClick="Button7_ServerClick" OnClientClick="return validate3();" />
                        <input type="image" title=" 重填 " onclick="reset();return false;" src="images/bt_res.gif"align="absmiddle" />
                    </div>
                    <table cellpadding="0" cellspacing="0" width="100%" border="0" id="list6">
                        <tr>
                            <th width="15%">商品编号</th>
                            <th width="15%">数量</th>
                            <th width="70%">金额</th>
                        </tr>
                        <tr>
                            <td><input type=text class=input style="width:100px;" id="code" runat=server />
                            </td>
                            <td><input type=text class=input style="width:100px;" id="xin_num" runat=server />
                            </td>
                            <td><input type=text class=input style="width:100px;" id="xin_price" runat=server />&nbsp;<span id="msg_biaoh"></span>&nbsp;<span id="msg_xin_num"></span>&nbsp;<span id="msg_xin_price"></span>
                            </td>
                            <script type="text/javascript">
                                var i2 = 2;
                                var f2="<%=msg_ %>";
                                if(f2=="no"){
                                    document.getElementById("msg_biaoh").innerHTML="商品不存在！";
                                    document.getElementById("msg_biaoh").style.visibility="visible";
                                    setInterval("fun2()", 1000);
                                }
                                function fun2() {
                                    if (i2 == 1) {
                                       document.getElementById("msg_biaoh").style.visibility="hidden";
                                    }
                                    i2--;
                                }
                            </script>
                        </tr>
                    </table>
                     <script type="text/javascript">tdshowm("list");tdshowm("list2");tdshowm("list3");tdshowm("list4");tdshowm("list5");tdshowm("list6");</script>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
