<%@ page language="C#" autoeventwireup="true" inherits="OrderForm, 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><%=model_t.Title%>-订单</title>
    <meta name="description" content=<%=model_t.Description %> />
    <meta name="keywords" content=<%=model_t.Keywords %> />
    <meta name="generator" content="LBMall 3.0.0" />
    <link href="images/css/css.css" rel="stylesheet" type="text/css" />
    <link href="images/css/cart.css" rel="stylesheet" type="text/css" />
    <link href="images/css/css3.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="images/js/shopjs.js"></script>
    <script type="text/javascript" src="images/js/prototype-1.4.0.js"></script>
    <link href="images/css/s-4.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="images/js/dialog-4c.js"></script>
    <script type="text/javascript" src="images/js/Ajax.js"></script>
    <script type="text/javascript" src="images/js/cartdiv.js"></script>
    <script type="text/javascript" src="images/js/valorder.js"></script>
    <script type="text/javascript">
        function getCookies(name)
        {
            var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
            if(arr != null) return decodeURI(arr[2]); return null;
        }
       function radioCh(id,sump,prices,shopid){
           var list_l="";
           var str_r = document.getElementsByName("radio"+id);
           for(var i=0;i<str_r.length;i++){
                if(str_r[i].checked){
                    list_l=str_r[i].value;
                }
           }
           list_pc=list_l.split("|");
           var zsum=sump/1+list_pc[2]/1+prices/1;
           document.getElementById("hj"+shopid).innerHTML=zsum;
       }
       function valsubmit(){
            
            var sub_h="";
            var list_in=document.getElementsByTagName("input");
            for(var s=0;s<list_in.length;s++){
                if(list_in[s].type=="radio"){
                    if(list_in[s].checked){
                        sub_h+=list_in[s].value+",";
                    }
                }
            }
            var list_sub_h=sub_h.split(',');
            if(list_sub_h[0].indexOf('|')!=-1){

                document.getElementById("yan_msg").innerHTML="请填写收货地址！";
                document.getElementById("yan_msg").style.display="block";
                return false;
                
            }
            document.getElementById("value_r").value=sub_h;
            var checkfc=getCookies('CheckCodef');
            var txt_=document.getElementById("Text1").value;
            if(txt_==""){
            
                document.getElementById("yan_msg").innerHTML="请输入校验码";
                document.getElementById("yan_msg").style.display="block";
                return false;
                
            }else if(checkfc==txt_){
                
               document.getElementById("yan_msg").style.display="none";
               return true;
                
            }else{
                document.getElementById("yan_msg").innerHTML="请正确填写校验码";
                document.getElementById("yan_msg").style.display="block";
                return false;
            }
       }
        function search2(){
            var texts2=document.getElementById("ser2").value;
            var select_v2=document.getElementById("Select3").value;
            window.location="list.aspx?tid="+select_v2+"&titlec="+escape(texts2);
        }
    </script>

</head>
<body onload="radioCheck()">
    <form id="form1" runat="server">

        <div id="top-menu02">
        <div id="top-menu">
            <div class="right">
                <script type="text/javascript">indexhead();</script>
            </div>
        </div>
    </div>
    <div id="top">
        <div id="logo">
            <a href="http://<%=Request.Url.Host %><%=model_t.WebPath %>/">
                <img src="Upload/WebAdminImages/<%=model_t.Logoimg %>" border="0" /></a></div>
    </div>
    <div id="sp-menu">
       <ul>
            <li><a href="http://<%=Request.Url.Host %><%=model_t.WebPath %>/">首页</a></li>
            <%for (int i = 0; i < ds_tab.Tables[0].Rows.Count; i++){ %>
            <li><%if (model_t.Tab == "1"){ %>
                <a href="<%= ds_tab.Tables[0].Rows[i]["tdirname"]%>/" target="_blank"><%= ds_tab.Tables[0].Rows[i]["tname"]%></a>
                <%}else{%>
                <a href="TopTab.aspx?type=<%= ds_tab.Tables[0].Rows[i]["tdirname"]%>" target="_blank"><%= ds_tab.Tables[0].Rows[i]["tname"]%></a>
                <%} %></li>
            <%} %>
            <li><a href="http://<%=Request.Url.Host %><%=model_t.WebPath %>/News/" target="_blank">资讯</a></li>
        </ul>
        <p>
            <span><a href="ShopCoupon.aspx">优惠券</a></span></p>
    </div>
        <div id="contenter2">
            <div id="contenter">
                <div class="cart_1">
                    <div class="cart_1_l">
                        您的位置：<a href="#">首页</a>&nbsp;&gt;&nbsp;确认订单</div>
                </div>
                <div class="oar_">
                    <div class="oar_title">
                        确认收货地址</div>
                    <div class="oar_content">
                        <ul>
                            <%for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                          { %>
                            <li id="lir<%=ds.Tables[0].Rows[i]["id"]%>">
                                <% if (i == 0)
                               {%>
                                <input id="r<%=ds.Tables[0].Rows[0]["id"]%>" type="radio" name="radio" value="<%=ds.Tables[0].Rows[i]["id"]%>"
                                    checked onclick="radioCheck()" /><a onclick="onradioCheck(document.getElementById('r<%=ds.Tables[0].Rows[i]["id"]%>'))"
                                        class="hand">&nbsp;<%=ds.Tables[0].Rows[i]["Saddress"]%>(收货人：<%=ds.Tables[0].Rows[i]["sname"]%>)</a>
                                <%}
                              else
                              { %>
                                <input id="r<%=ds.Tables[0].Rows[i]["id"]%>" type="radio" name="radio" value="<%=ds.Tables[0].Rows[i]["id"]%>"
                                    onclick="radioCheck()" /><a onclick="onradioCheck(document.getElementById('r<%=ds.Tables[0].Rows[i]["id"]%>'))"
                                        class="hand">&nbsp;<%=ds.Tables[0].Rows[i]["Saddress"]%>(收货人：<%=ds.Tables[0].Rows[i]["sname"]%>)</a>
                                <%} %>
                            </li>
                            <%} %>
                            <li>
                                <input type="button" value="添加其他地址" onclick="opendiv()" /></li>
                        </ul>
                    </div>
                    <div class="oar_msg" style="display: none;" id="add_f">
                        <table cellspacing="0" cellpadding="0" class="tablec">
                            <tr>
                                <td valign="top" align="right" class="tdt2">
                                    地址：<span style="color: Red;">*</span>
                                </td>
                                <td class="tdt3">
                                    <div style="float: left">
                                        <textarea id="txt_address" class="texta" runat="server"></textarea></div>
                                    <div>
                                        &nbsp;<em class="re_div">填写如：河北省 秦皇岛市 海港区 ××街道××号</em></div>
                                    <div style="clear: both;">
                                    </div>
                                    <div class="v_div" style="display: none;" id="msg_address">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td valign="top" align="right" class="tdt2">
                                    邮政编码：<span style="color: Red">*</span>
                                </td>
                                <td class="tdt3">
                                    <input id="txt_postalcode" type="text" class="youz" runat="server" />
                                    <div class="v_div" style="display: none;" id="msg_pcode">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td valign="top" align="right" class="tdt2">
                                    收货人姓名：<span style="color: Red">*</span>
                                </td>
                                <td class="tdt3">
                                    <input id="txt_name" type="text" class="xingm" runat="server" />
                                    <div class="v_div" style="display: none;" id="msg_name">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td valign="top" align="right" class="tdt2">
                                    电话：
                                </td>
                                <td class="tdt3">
                                    <input id="txt_qu" type="text" class="dianh1" runat="server" />-<input id="txt_code"
                                        type="text" runat="server" class="dianh2" />-<input id="txt_fen" type="text" class="dianh3"
                                            runat="server" />&nbsp;&nbsp;<em>格式：区号 - 电话号码 - 分机号</em>
                                </td>
                            </tr>
                            <tr>
                                <td valign="top" align="right" class="tdt2">
                                    手机：
                                </td>
                                <td class="tdt3">
                                    <input id="txt_phone" type="text" class="shouj" runat="server" />&nbsp;&nbsp;<em>电话和手机请至少填写一个
                                    </em>
                                    <div class="v_div" style="display: none;" id="msg_phone">
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    <asp:Button ID="Button1" runat="server" Text="确定" OnClick="Button1_Click" OnClientClick="return val()" />
                                    <input type="button" value="关闭" onclick="closediv()" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="oar2_">
                    <div class="oar_title">
                        确认订单</div>
                    <div class="oar_content2">
                        <table cellpadding="0" cellspacing="0" class="table_t">
                            <tr>
                                <td class="oar_c2t1" align="center">
                                    店铺商品
                                </td>
                                <td class="oar_c2t2" align="center">
                                    单价（元）
                                </td>
                                <td class="oar_c2t3" align="center">
                                    数量
                                </td>
                                <td class="oar_c2t4" align="center">
                                    小计（元）
                                </td>
                                <td class="oar_c2t5" align="center">
                                    运送方式
                                </td>
                                <td class="oar_c2t6" align="center">
                                    服务费
                                </td>
                            </tr>
                        </table>
                        <div id="tables" runat="server">
                        </div>
                    </div>
                </div>
                <div class="oar3_">
                    <div id="zhif" runat="server">
                        <div id="Div1" class="oar_title" runat="server">
                            支付方式</div>
                        <div>
                            <input id="Radio1" type="radio" name="radiofs" checked value="yh" />银行汇款<br />
                            <input id="Radio2" type="radio" name="radiofs" value="zx" />在线交易
                        </div>
                    </div>
                    <table align="right">
                        <tr>
                            <td align="right" class="tdyz">
                                校验码：<span style="color: Red;">*</span>
                            </td>
                            <td>
                                <input id="Text1" type="text" maxlength="5" size="5" class="txt_t1" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="tdyz">
                                <a onclick="javascript:document.getElementById('img1').src=document.getElementById('img1').src+'?'"
                                    class="dian_div" onmouseout="this.className='dian_out'" onmouseover="this.className='dian_over'">
                                    看不清？换一张</a>
                            </td>
                            <td>
                                <img class="img_c" id="img1" src="imgcheck2.aspx" language="javascript" onclick="this.src=this.src+'?'">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <div class="v_div2" style="display: none;" id="yan_msg">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <a href="Cart.aspx">返回购物车</a>
                                <asp:Button ID="Button2" runat="server" Text="确认订单" OnClick="Button2_Click" OnClientClick="return valsubmit()" />
                                <input type="hidden" id="value_r" runat="server" />
                            </td>
                        </tr>
                    </table>
                </div>

                <div id="footer">
                <div id="copyright">
                    <div class="search">
                        <div class="search-left">
                            <div class="search-left-title">
                                搜索：</div>
                            <div class="search-left-form">
                                <input type="text" runat="server" id="ser2" size="30" /></div>
                            <div class="search-left-list">
                                <select id="Select3" runat="server">
                                </select>
                            </div>
                            <div class="search-left-button">
                                <img src="images/search-buttom.gif" width="60" height="20" onclick="search2()" /></div>
                        </div>
                        <div class="search-right">
                            <div runat=server id="div_s2"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="copyright" runat="server" id="copr"></div>
            </div>
        </div>
      
    </form>
</body>
</html>
