<!--#include file="../check.asp"--><!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>
<title>商户后台 - 直接发货</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link type="text/css" rel="stylesheet" href="/css/reset.css" />
<link type="text/css" rel="stylesheet" href="/css/main.css" />
<link type="text/css" rel="stylesheet" href="/css/template_vendor.css" />
<script type="text/javascript" src="/scripts/common.js"></script>
<script type="text/javascript" src="/scripts/nav.js"></script>
<script type="text/javascript" src="/scripts/footerdock.js"></script>
</head>
<body>
<!--#include file="top.asp"-->
<%
if request("id")="" then
Response.Write "<script>alert('参数错误！');history.back();</script>"
Response.End()
End If

wooolid=request("id")




	Set Res = GrateRs("Select * From L_woool Where ID="& Cint(wooolid) &"  and userid="&trim(Session("Usr_userid"))&" ",3)
If Res.Eof And Res.Bof Then
	Response.Write "<script>alert('找不到相关信息！');history.back();</script>"
	Response.End()
End If

wooolName=Res("wooolName")

set res=nothing





if request("a")="sub" then

dim server_v1,server_v2
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
response.Write "<Script>alert('警告！你正在从外部提交数据！！请立即终止！！\r\n如果你不是在外部提交,可能是因为你重复提交数据,请不要重复提交！！');window.location.href='/';</Script>"
response.end
end if



'wanjia=request("wanjia")
wanjia=trim(YeSqlStr(request.Form("wanjia"),3))
If wanjia = "" Then 
Response.Write "<script>alert('请输入正确的充值账号！');history.back();</script>"
Response.End()
End If

'cash=trim(request("cash"))
cash=trim(YeSqlStr(request.Form("cash"),3))
If cash = "" or cash=0 or cash>5001 Then 
Response.Write "<script>alert('请输入充正确的充值金额！');history.back();</script>"
Response.End()
End If	

randomize timer
kk=int(100*rnd)
Num = "1230321"&Year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&kk&"1230321"
set Rs=GrateRs("select * from L_woool where id="&request("wooolid")&" and userid="&trim(Session("Usr_userid"))&"",1)
If Rs.Eof And Rs.Bof Then
Response.Write "<script>alert('找不到相关信息！');history.back();</script>"
Response.End()
End If
userid=rs("userid")
gameid=request("wooolid")
ip=rs("ip")
post=rs("post")
Qpay_keys=rs("wkey")
bili=rs("yuanbao")
rs.close
set rs=nothing


   set Rs=GrateRs("select * from member where username like '"&trim(Session("Usr_UserName"))&"' and bufa<>0 ",3)
   if not Rs.eof then 

Sql = "select * from [MirMoUrl1] "
Set Rss = Server.CreateObject("ADODB.Recordset")
Rss.Open Sql,conn,1,3
rss.addnew
rss("num") = Num
rss("codenum") = gameid
rss("username") = wanjia
rss("postkey") = Qpay_keys
rss("give")=1
rss("sendFlag")=1
rss("paymoney") = cash*bili
rss("money") = cash
rss("svrport") = post
rss("svrip") = ip
rss("userid") = userid
rss.update
rss.close


		ErrStr="分区ID"&gameid&" "&wanjia&"补充充值"&cash&"元成功。"







	  else
		ErrStr="你未定制补充充值功能！"

end if

   response.write "<script language='JavaScript'>{window.alert('"&Errstr&"');window.location='javascript:history.back();';}</script>"

end if

%>



<script   language="JavaScript">   
  function   ValidateInput()   
  {   



	var e=document.form1;
	if (e.cash.value==""){
		alert("充值金额不能为空！");
		e.cash.focus();
		return;
	}

	if (e.wanjia.value==""){
		alert("充值账号不能为空！");
		e.wanjia.focus();
		return;
	}

	if(confirm('确定操作吗...'))
	{
      document.form1.submit();   
      document.form1.Submit.disabled=true;   
	}
  }   
  </script>  




	<div id="mainborder">
		<div id="main">
			
		<div>
			<div class="fl"><h3 class="bigico bigico_shield">直接发货 (无实际交易支付)</h3></div>
			<div class="fr" style="margin-top:20px">
				<a href="PaidlessDeliveries.asp">查看直接发货记录</a><span class="gray simsun"> | </span>
				<a href="Merchandises.asp">返回分区列表</a>
			</div>
			<div class="vspace clear"></div>
		</div>

		<div class="shrink">	



		
		
			<form name="form1" method="post" action="">
				
				<table class="grid">
					<tr>
						<td width="160" height="30">分区:</td>
						<td><span class="ico_storage bold block"><%=wooolName%></td>


							</tr>
					<tbody id="inputs">
							<tr>
								<td height="30">模拟交易金额:</td>
								<td><input name="cash" type="text" maxlength="5" id="cash" style="width:200px;" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" /> 元</td>
								</td>
							</tr>
							<tr>
								<td height="30">发送给帐号ID:</td>
								<td><input name="wanjia" type="text" maxlength="100" id="wanjia" style="width:200px;"  /> <span class="gray"> * 请确认填写正确</span></td>
							</tr>
					</tbody>
						<tr>
							<td height="30">&nbsp;</td>
							<td>
								<div class="fl">
									<input type="button" name="Submit" value="发送" id="send" class="button" style="width:70px;" onClick="JavaScript:ValidateInput();"/>
									<input type="button" value="取消" style="width:70px" onclick="javascript:history.back();" class="button" />
<input name="a" type="hidden" id="a" value="sub">
<input name="wooolid" type="hidden" id="wooolid" value="<%=wooolid%>">
									&nbsp;
									</div>
								<div class="fl"></div>
								<div class="vspace clear"></div>
							</td>
						</tr>
					</table>
				</div>
			</form>
		</div>
	
		</div>
	</div>
</div>
</body>
</html>