在发个 邮件发送装备的网页
<!--#include file="config.asp"-->
<%
action=trim(request("action"))
if action="send" then
strUserID=trim(CheckStr(request.form("strname")))
smethod=trim(CheckStr(request.form("smethod")))
If strUserID<>"" Then
dwid=Trim(request("dwid"))
dur=Trim(request("dur"))
amount=Trim(request("amount"))
strnote=Trim(request("strnote"))
If dwid="" Or dur="" Or amount="" Or Not IsNumeric(dwid) Or Not IsNumeric(dur) Or Not IsNumeric(amount) or strnote="" Then
msg="需要输入装东西的理由;或者输入了错误的参数,只能输入数字!"
Else
Set rs=ConnGame.execute("select strUserID from USERDATA where strUserID='" & strUserID & "'")
if not rs.eof then
If smethod<>"" Then
ConnGame.execute("Insert Into "&GameDB&".dbo.MAIL_BOX(strSendUserID,strRecvUserID,strSubject,strMail,bItemState,nSendItemID,sCount,tUpdateDate) Values('管理员','"&strUserID&"','商品发放','商品发放','2',"&dwid&",1,'"&Date()&"')")
msg="在线发送成功 - 时间:"&now()&"!"
else
Set rs1=ConnAccount.execute("select strCharID from CURRENTUSER where strCharID='" & strUserID & "'")
If rs1.eof Then
If sendItem(dwid,dur,amount,strUserID)=0 Then
msg="离线发送成功 - 时间:"&now()&"!"
Else
msg="发送失败!"
End If
Else
msg="人物在线,无法发送!"
End If
rs1.close:Set rs1=nothing
end if
else
msg="未找到相应的角色!"
End If
'rs.close:set rs=nothing
End if
else
msg="需要输入人物名"
End if
'response.write("<script>parent.document.getElementById('strnote').value='';</script>")
response.write("<script>parent.document.getElementById('sendresult').innerHTML='"&msg&"';</script>")
response.write("<script>alert('"&msg&"');</script>")
response.end
end if
if action="search" then
strname1=trim(request("strname1"))
strname2=trim(request("strname2"))
strnum=trim(request("strnum"))
stype=trim(request("stype"))
result=""
if stype="bynum" then
if strnum<>"" and isnumeric(strnum) then
set rs=ConnGame.execute("select top 1 * from ITEM where num="&strnum)
if not rs.eof then
result="物品代码:"&rs("num")&" / 物品名称:"&rs("strname")
else
result="未找到相关物品!"
end if
rs.close:set rs=nothing
else
result="代码填写有误!"
end if
response.write("<script>parent.document.getElementById('result2').innerHTML='"&result&"';</script>")
else
if strname1<>"" and strname2<>"" then
set rs=ConnGame.execute("select top 1 * from ITEM where strname like '%"&strname1&"%' and strname like '%"&strname2&"%'")
elseif strname1<>"" then
set rs=ConnGame.execute("select top 1 * from ITEM where strname like '%"&strname1&"%'")
else
set rs=ConnGame.execute("select top 1 * from ITEM where num=379156000")
end if
if not rs.eof then
result="物品代码:"&rs("num")&" / 物品名称:"&rs("strname")
else
result="未找到相关物品!"
end if
rs.close:set rs=nothing
response.write("<script>parent.document.getElementById('result1').innerHTML='"&result&"';</script>")
end if
response.end
end if
Function sendItem(dwid,dur,amount,strUserID)
sendItem=0
if dwid<>0 then
dim i
dim j
dim EqItem(2,41)
i = 0
j = 0
Do While j < 42
Sql = "select cast(cast(substring(cast(strItem as varbinary(400))," & i + 4 & ", 1)+substring(cast(strItem as varbinary(400)), " & i + 3 & ", 1)+substring(cast(strItem as varbinary(400)), " & i + 2 & ", 1)+substring(cast(strItem as varbinary(400))," & i + 1 & ", 1) as varbinary(4)) as int(4)) as id,cast(cast(substring(cast(strItem as varbinary(400))," & i + 6 & ", 1)+substring(cast(strItem as varbinary(400)), " & i + 5 & ", 1) as varbinary(2)) as smallint(2)) as dur,cast(cast(substring(cast(strItem as varbinary(400))," & i + 8 & ", 1)+substring(cast(strItem as varbinary(400)), " & i + 7 & ", 1) as varbinary(2)) as smallint(2)) as Count from USERDATA where strUserId='" & strUserID & "'"
set rs= Server.CreateObject("ADODB.Recordset")
Rs.Open Sql, ConnGame, 1, 1
If Rs("Id") >= 0 Then
EqItem(0, j) = Rs("Id")
EqItem(1, j) = Rs("Dur")
EqItem(2, j) = Rs("Count")
End If
j = j + 1
i = i + 8
Rs.Close
Loop
dim flag
flag=false
for i=0 to 41
if EqItem(2,i)=0 and i>13 then
flag=true
exit for
end if
next
if flag=false then
sendItem=1'没有空位了
Exit function
end if
EqItem(0,i)=dwid
EqItem(1,i)=dur
EqItem(2,i)=amount
i = 0
j = 0
Do While j < 42
Sql = "update USERDATA set strItem=cast(substring(cast(strItem as varbinary(400)),1," & i & ")+"
Sql = Sql + "substring(cast(" & EqItem(0, j) & " as varbinary(4)),4,1)+"
Sql = Sql + "substring(cast(" & EqItem(0, j) & " as varbinary(4)),3,1)+"
Sql = Sql + "substring(cast(" & EqItem(0, j) & " as varbinary(4)),2,1)+"
Sql = Sql + "substring(cast(" & EqItem(0, j) & " as varbinary(4)),1,1)+"
Sql = Sql + "substring(cast(" & EqItem(1, j) & " as varbinary(2)),2,1)+"
Sql = Sql + "substring(cast(" & EqItem(1, j) & " as varbinary(2)),1,1)+"
Sql = Sql + "substring(cast(" & EqItem(2, j) & " as varbinary(2)),2,1)+"
Sql = Sql + "substring(cast(" & EqItem(2, j) & " as varbinary(2)),1,1) as varbinary(400)) where strUserId='" & strUserID & "'"
ConnGame.Execute Sql
j = j + 1
i = i + 8
Loop
End if
End Function
function getitemname(num)
set gis=conngame.execute("select num,strname from item where num="&num)
if not gis.eof then
getitemname=gis("strname")
else
getitemname=num
end if
gis.close:set gis=nothing
end function
%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="style.css" rel="Stylesheet" type="text/css" />
</head>
<body id="content">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="introTbl">
<tr>
<td colspan="2" class="t" height="25">装备发送</td>
</tr>
<tr>
<td height="25" width="50" align="right"> </td>
<td align="left">
<form id="searchFrm" name="searchFrm" method="POST" action="fzb.asp?action=send" style="margin:5px;" target="postFrm">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="25">理由:</td>
<td align="left"><input name="strnote" type="text" class="input" id="strnote" style="width:200px;" value="GM赠送物品" readonly="readonly" /></td>
</tr>
<tr>
<td height="25" width="70">角色名:</td>
<td align="left"><input type="text" name="strName" class="input" style="width:200px;" /></td>
</tr>
<tr>
<td height="25">物品ID:</td>
<td align="left"><input type="text" name="dwid" class="input" style="width:200px;" value="1" /></td>
</tr>
<tr>
<td height="25">耐久:</td>
<td align="left"><input name="dur" type="text" class="input" style="width:200px;" value="1" readonly="readonly" /></td>
</tr>
<tr>
<td height="25">数量:</td>
<td align="left"><input name="amount" type="text" class="input" style="width:200px;" value="1" readonly="readonly" /></td>
</tr>
<tr>
<td height="25">方式:</td>
<td align="left"><input name="smethod" type="checkbox" value="1" checked="checked" />
打勾即为在线发送。</td>
</tr>
<tr>
<td height="35"> </td>
<td align="left"><input type="submit" class="btns" value="发送" /></td>
</tr>
<tr>
<td height="25"> </td>
<td id="sendresult" align="left" style="color:green;font-weight:bold;"> </td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td colspan="2" class="t" height="25">按名称搜代码</td>
</tr>
<tr>
<td height="25" width="50" align="right"> </td>
<td align="left">
<form id="searchFrm" name="searchFrm" method="POST" target="postFrm" action="fzb.asp?action=search" style="margin:5px;">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="25" width="70">字符一:</td>
<td align="left"><input type="text" name="strName1" class="input" style="width:200px;" /> *</td>
</tr>
<tr>
<td height="25" width="70">字符二:</td>
<td align="left"><input type="text" name="strName2" class="input" style="width:200px;" /></td>
</tr>
<tr>
<td height="25"> </td>
<td align="left"><input type="submit" class="btns" value="搜索" /></td>
</tr>
<tr>
<td height="25"> </td>
<td id="result1" align="left" style="color:green;font-weight:bold;"> </td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td colspan="2" class="t" height="25">按代码搜名称</td>
</tr>
<tr>
<td height="25" width="50" align="right"> </td>
<td align="left">
<form id="searchFrm" name="searchFrm" method="POST" target="postFrm" action="fzb.asp" style="margin:5px;">
<input type="hidden" name="action" value="search" />
<input type="hidden" name="stype" value="bynum" />
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="25" width="70">代码:</td>
<td align="left"><input type="text" name="strnum" class="input" style="width:200px;" /> *</td>
</tr>
<tr>
<td height="25"> </td>
<td align="left"><input type="submit" class="btns" value="搜索" /></td>
</tr>
<tr>
<td height="25"> </td>
<td id="result2" align="left" style="color:green;font-weight:bold;"> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<iframe id="postFtm" name="postFrm" height="0" width="0" scrolling="no" frameborder="0" src="about:blank"></iframe>
</body>
</html>
<%closeconn()%>
|