<%@ page language="C#" autoeventwireup="true" inherits="User_Gift_ExchangeGiftInputOrderInfo, DoodiiShop" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<!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" runat="server" id="lnkJFSC" />

    <script type="text/javascript" src="/js/jquery.js"></script>

    <script type="text/javascript" src="/js/func.js"></script>

    <script type="text/javascript" src="/js/unitpngfix.js"></script>

    <script type="text/javascript">
function UserGiftAdd()
{
   var username=$("#<%=inUserName.ClientID %>").val();
   var Phone=$("#<%=Phone.ClientID %>").val();
   var Address=$("#Address").val();
   var PostCode=$("#PostCode").val();
   var Content=$("#content").val();
   var gid='<%=Gid %>';
   var qy='<%=Quantity %>';
   var exit=$("#<%=TotalExIt.ClientID %>").val();
   var spit=$("#<%=TotalSpIt.ClientID %>").val();
   var uservalue=$("#<%=TotalUserValue.ClientID %>").val();
   if(trim(username)=="")
   {alert("请填写您的姓名！");return}
   if(trim(Phone)=="")
   {alert("请填写您的电话！");return}
   if(trim(Address)=="")
   {alert("请填写您的地址！");return}
   if(trim(PostCode)=="" || trim(PostCode).length < 6)
   {alert("邮编格式不正确！");return}
   if(Content.length > 100)
   {alert("备注不能超过100字");return}
   var ret=User_Gift_ExchangeGiftInputOrderInfo.Add(gid,qy,username,Phone,Address,PostCode,Content,exit,uservalue,spit).value;
   if(ret > 0 )
   {
     parent.tb_setTitle("兑换成功");
     window.location="/User/Gift/ExchangeGiftOrderSuccess.aspx?Gid="+ret;
   }
   else if(ret==null)
   {alert("发生错误请刷新本页！");}
   else if(ret=="-4")
   {alert("您已推出，请重新登录！");}
   else
   {alert(ret);}
}
function trim(string)
{
   return string.replace(/(^\s*)|(\s*$)/g, "");
}
 //浮动提示信息
 function ShowMsg3(obj)
    {
        var divPopMessage = document.getElementById("statenotice");
        divPopMessage.style.left = (getPosition(obj).x +0) + "px";
        divPopMessage.style.top = (getPosition(obj).y + 14) + "px"; 
        divPopMessage.style.display = ""; 
    }
    function CloseMsg3()
    {
        var divPopMessage = document.getElementById("statenotice");  
        divPopMessage.style.display = "none";
    }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <input type="hidden" value="" id="TotalExIt" runat="server" />
        <input type="hidden" value="" id="TotalSpIt" runat="server" />
        <input type="hidden" value="0" id="TotalUserValue" runat="server" />
        <div class="fenyi">
                <div class="fener">
            <div style="display: none;">
                积分兑换礼品<br />
                <div style="float: right;">
                    我的积分：<span class="f_import" id="lblIntegralExpendValue" runat="server">666675565分</span>
                    我的钱包：<span class="f_import" id="LblIntegralSpreadValue" runat="server">666675565金豆</span>
                    兑换礼品总数：<span class="f_import" runat="server" id="gifnum">1个</span></div>
            </div> 
            <table class="Gift_table">
                <tr>
                    <th>
                        礼品名称</th>
                    <th>
                        价格</th>
                    <th>
                        数量</th>
                    <th>
                        总花费</th>
                </tr>
                <tr>
                    <td>
                        <span id="gifname" runat="server">豆丁吉祥物1</span>
                    </td>
                    <td class="f_import">
                        <span id="jiage" runat="server"></span>
                    </td>
                    <td>
                        <span id="spquantity" runat="server"></span>
                    </td>
                    <td class="f_import">
                        <span id="huafei" runat="server"></span><span id="jindou" runat="server"></span>
                        <span id="RMB" runat="server"></span>
                    </td>
                </tr>
            </table>
            <div class="InputOrderInfo_tbl">
                <table class="InputOrderInfo_tblInfo">
                    <tr>
                        <th>
                            <span class="f_import">*</span>&nbsp;&nbsp;&nbsp;姓名：</th>
                        <td>
                            <input type="text" id="inUserName" runat="server" maxlength="10" /></td>
                        <td>
                            您的真实姓名（10个字符内）</td>
                    </tr>
                    <tr>
                        <th>
                            <span class="f_import">*</span>&nbsp;&nbsp;&nbsp;电话：</th>
                        <td>
                            <input type="text" runat="server" id="Phone" maxlength="25" /></td>
                        <td>
                            例如010***或135*****（25个字符内）</td>
                    </tr>
                    <tr>
                        <th>
                            <span class="f_import">*</span>&nbsp;&nbsp;&nbsp;地址：</th>
                        <td colspan="2">
                            <input style="width: 230px;" type="text" id="Address" maxlength="50" />（50个字符内）</td>
                    </tr>
                    <tr>
                        <th>
                            <span class="f_import">*</span>&nbsp;&nbsp;&nbsp;邮编：</th>
                        <td>
                            <input type="text" maxlength="6" onblur="value=this.value.replace(/\D+/g,'')" onkeyup="value=this.value.replace(/\D+/g,'')"
                                id="PostCode" /></td>
                        <td>
                            邮编的格式是6位数字</td>
                    </tr>
                    <tr style="height:90px;">
                        <th style="padding-left:9px;">
                            &nbsp;&nbsp;&nbsp;备注：</th>
                        <td colspan="2">
                            <textarea  class="fensan" id="content"></textarea>（100字内）</td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td colspan="2" style=" margin-left:55px; display:inline;">
                            <a class="All_Input_5" href="javascript:UserGiftAdd()" style="float: left;">提&nbsp;&nbsp;交</a>
                            <a class="Style_Input6" href="javascript:parent.tb_remove()" style="float: left; margin-left: 10px;">取&nbsp;&nbsp;消</a></td>
                    </tr>
                </table>
            </div>
        </div>
        </div>
    </form>
</body>
</html>
