⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addsv.asp

📁 一个漂亮的网络工作室源码 后台地址:/admin 用户名:admin 密码:admin888
💻 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=addsv.asp>添加数据</a></td></tr></table>")
select case request("action")
case "savesv"
call savesv()
case else
call normal()
end select
sub normal()
dim id,Uid,userid,Sname,Srice,Sok,Sno,Stime,Etime,oper,States,Groups,content
id=request.QueryString("id")
if id<>"" then
dim rs
set rs=conn.execute("select * from cust 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")
sname=rs("sname")
srice=rs("srice")
sok=rs("sok")
sno=rs("sno")
stime=rs("stime")
etime=rs("etime")
oper=rs("oper")
states=rs("states")
Groups=rs("Groups")
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=savesv' 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>&nbsp;<font color=red>请认真选择相应的客户ID...</font></td></tr>")
%>
<%
set lrs=server.CreateObject("adodb.recordset")
lrs.open "select id,userid,username from Users",conn,1,1
%>
<input name='uId' type='hidden' value='<%=lrs("id")%>'>
<%lrs.close
set lrs=nothing
response.Write("<tr><td class='tablebody'><strong>客户等级</strong></td><td class='tablebody'><input name='Groups' type='text' id='Groups' value='"&Groups&"' maxlength='50' size='30'></td></tr>")
response.Write("<tr><td width='30%' class='tablebody'><strong>服务名称</strong></td><td class='tablebody'><input name=sname class=FormClass value='"&sname&"' maxlength=255 size='30'></td></tr>")
response.Write("<tr><td class='tablebody'><strong>服务金额</strong></td><td class='tablebody'><input name='Srice' type='text' id='Srice' value='"&Srice&"' maxlength='50' size='30'>&nbsp;¥</td></tr>")
response.Write("<tr><td class='tablebody'><strong>已付金额</strong></td><td class='tablebody'><input name='Sok' type='text' id='Sok' value='"&Sok&"' maxlength='50' size='30'>&nbsp;¥</td></tr>")
response.Write("<tr><td class='tablebody'><strong>未付金额</strong></td><td class='tablebody'><input name='Sno' type='text' id='Sno' value='"&Sno&"' maxlength='50' size='30'>&nbsp;¥</td></tr>")
response.Write("<tr><td class='tablebody'><strong>购买日期</strong></td><td class='tablebody'><input name='stime' type='text' id='stime' value='"&stime&"' maxlength='50' size='30'>&nbsp;<font color=red>格式:2004-9-10</font></td></tr>")
response.Write("<tr><td class='tablebody'><strong>到期日期</strong></td><td class='tablebody'><input name='etime' type='text' id='etime' value='"&etime&"' maxlength='50' size='30'>&nbsp;<font color=red>格式:2004-9-10</font></td></tr>")
response.Write("<tr><td class='tablebody'><strong>业 务 员</strong></td><td class='tablebody'><input name='oper' type='text' id='oper' value='"&oper&"' maxlength='50' size='30'></td></tr>")
response.Write("<tr><td class='tablebody'><strong>服务状态</strong></td><td class='tablebody'><select name='States'><option value=''>选择服务状态</option>")
if id<>"" then
response.write("<option value='"&States&"' selected>>> "&States&"</option>")
end if
response.write("<option value='开启' style='color:#ff3300'>>> 开启</option><option value='暂停' style='color:#009900'>>> 暂停</option><option value='关闭' style='color:#999999'>>> 关闭</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'>&nbsp;</td><td class='tablebody'><input type='hidden' name='id' value='"&id&"'><input type=Submit value='发 表' name=Submit>&nbsp;<input type=reset name=Submit2 value='清 除'>&nbsp; <a href='succeed.asp'>返回列表</a></td></tr></form></table>")
end sub
sub savesv()
dim id,Uid,userid,Sname,Srice,Sok,Sno,Stime,Etime,oper,States,Groups,content
id=request.Form("id")
uid=trim(request.form("uid"))
Userid=checkStr(request("userid"))
sname=checkStr(request.Form("sname"))
Srice=checkStr(request.Form("Srice"))
Sok=checkStr(request.Form("Sok"))
Sno=checkstr(request.Form("Sno"))
Stime=checkstr(request.Form("Stime"))
Etime=checkstr(request.Form("Etime"))
oper=checkstr(request.Form("oper"))
States=checkstr(request.form("States"))
Groups=checkstr(request.form("Groups"))
Content=checkstr(request.Form("Content"))
if userid="" then
response.Write("<script>alert('请选择客户人员!');history.back()</script>")
response.End()
end if
if sname="" then
response.Write("<script>alert('服务名称不能为空!');history.back()</script>")
response.End()
end if
if srice="" then
srice=0
end if
if sok="" then
sok=0
end if
if sno="" then
sno=0
end if
if not isnumeric(srice) or not isnumeric(sok) or not isnumeric(sno) then
response.Write("<script>alert('系统错误:金额非数字型字段!');history.back()</script>")
response.End()
end if
if stime="" or etime="" then
response.Write("<script>alert('购买日期和到到期日期不能为空!');history.back()</script>")
response.End()
end if
if States="" 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 cust set uid="&uid&",userid='"&userid&"',sname='"&sname&"',Srice='"&Srice&"',sok='"&sok&"',sno='"&sno&"',Stime='"&Stime&"',Etime='"&Etime&"',States='"&States&"',oper='"&oper&"',Groups='"&Groups&"',Content='"&Content&"' where id="&clng(id)&"")
response.Write("<script>alert('更新成功!');location='"&ip&"'</script>")
response.End()
else
conn.execute("insert into cust (Uid,userid,Sname,Srice,Sok,Sno,Stime,Etime,oper,States,Groups,content) values("&Uid&",'"&userid&"','"&Sname&"','"&Srice&"','"&Sok&"','"&Sno&"','"&Stime&"','"&Etime&"','"&oper&"','"&States&"','"&Groups&"','"&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 + -