📄 addpl.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<!--#include file="top.asp"-->
<%
response.Write("<table border=0 align=center cellpadding=3 cellspacing=1 class=tablecolor>")
response.Write("<tr><td height=25 align=center class=banner>交易服务管理</td><td width='20%' align=center class=banner><a href=addpl.asp>添加数据</a></td></tr></table>")
select case request("action")
case "savepl"
call savepl()
case else
call normal()
end select
sub normal()
dim id,Uid,userid,Idate,Buyrice,payment,content
id=request.QueryString("id")
if id<>"" then
dim rs
set rs=conn.execute("select * from paylist where id="&clng(id))
if rs.bof and rs.eof then
response.Write("<script>alert('该条记录不存在或者已被删除!');history.back()</script>")
response.End()
end if
Uid=rs("Uid")
userid=rs("userid")
Idate=rs("Idate")
Buyrice=rs("Buyrice")
payment=rs("payment")
Content=rs("Content")
rs.close
set rs=nothing
end if
response.Write("<script src='../inc/ubbcode.js'></script>")
response.Write("<table border='0' align='center' cellpadding='3' cellspacing='1' class='tablecolor'>")
response.Write("<form action='?action=savepl' method=POST name=frmAnnounce>")
response.Write("<tr><td width='30%' class='tablebody'><strong>客户ID</strong></td><td class='tablebody'><select name='userid'><option value=''>--请选择客户--</option>")
response.write("<option value='"&userid&"'selected>"&userid&"</option>")
dim lrs
set lrs=server.CreateObject("adodb.recordset")
lrs.open "select id,userid,username from Users",conn,1,1
do while not lrs.eof
%>
<option value="<%=lrs("userid")%>">ID=<%=lrs("id")%>:<%=lrs("userid")%>(<%=lrs("username")%>)</option>
<%lrs.movenext
loop
lrs.close
set lrs=nothing
response.write("</select> <font color=red>请认真选择相应的客户ID...</font></td></tr>")
%>
<%
response.Write("<tr><td class='tablebody'><strong>交易日期</strong></td><td class='tablebody'><input name='Idate' type='text' id='Idate' value='"&Idate&"' maxlength='50'> 格式:2004-9-10</td></tr>")
response.Write("<tr><td width='30%' class='tablebody'><strong>交易金额</strong></td><td class='tablebody'><input name=Buyrice class=FormClass value='"&Buyrice&"' maxlength=255> ¥</td></tr>")
response.Write("<tr><td class='tablebody'><strong>支付方式</strong></td><td class='tablebody'><select name='payment'><option value='"&payment&"' selected>"&payment&"</option><option value='银行转帐'>银行转帐</option><option value='网上支付'>网上支付</option><option value='现金交款'>现金交款</option></select></td></tr>")
response.Write("<tr><td valign='top' class='tablebody'><b>备注</b><br><li>HTML标签:√<li>UBB标签:√<li>贴图标签:×<li>多媒体标签:×<p><br><br></p></td>")
response.Write("<td valign='top' class='tablebody'>")
%>
<!--#include file="../inc/getubb.asp"-->
<%
response.Write("<textarea cols=60 name=Content rows=12 wrap=VIRTUAL>"&Content&"</textarea></td></tr>")
response.Write("<tr><td align='center' class='tablebody'> </td><td class='tablebody'><input type='hidden' name='id' value='"&id&"'><input type=Submit value='发 表' name=Submit> <input type=reset name=Submit2 value='清 除'> <a href='succeed.asp'>返回列表</a></td></tr></form></table>")
end sub
sub savepl()
dim id,Uid,userid,Idate,Buyrice,payment,content
id=request.Form("id")
Uid=checkStr(request("uid"))
userid=checkstr(request("userid"))
Idate=checkStr(request.Form("Idate"))
Buyrice=checkStr(request.Form("Buyrice"))
payment=checkStr(request.Form("payment"))
Content=checkstr(request.Form("Content"))
if userid="" then
response.Write("<script>alert('请选择客户人员!');history.back()</script>")
response.End()
end if
if Idate="" then
response.Write("<script>alert('交易日期不能为空!');history.back()</script>")
response.End()
end if
if Buyrice="" then
response.Write("<script>alert('交易金额不能为空!');history.back()</script>")
response.End()
end if
if Buyrice="" then
Buyrice=0
end if
if not isnumeric(Buyrice) then
response.Write("<script>alert('系统错误:交易金额非数字型字段!');history.back()</script>")
response.End()
end if
if payment="" then
response.Write("<script>alert('请选择支付方式!');history.back()</script>")
response.End()
end if
dim ip
ip=Request.ServerVariables("HTTP_REFERER")
if id<>"" then
conn.execute("update paylist set userid='"&userid&"',Idate='"&Idate&"',Buyrice='"&Buyrice&"',payment='"&payment&"',Content='"&Content&"' where id="&clng(id)&"")
response.Write("<script>alert('更新成功!');location='"&ip&"'</script>")
response.End()
else
conn.execute("insert into paylist (Uid,userid,Idate,Buyrice,payment,content) values("&Uid&",'"&userid&"','"&Idate&"','"&Buyrice&"','"&payment&"','"&Content&"')")
response.Write("<script>alert('添加成功!');location='"&ip&"'</script>")
response.End()
end if
end sub
%>
<%CloseConn%>
<!--#include file="end.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -