📄 agent_add.asp
字号:
<!--#include file="chklogin.asp"-->
<%
call myobj.chkrq()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>增加代理商</title>
<link href="images/style2.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
a:link {
color: #0000FF;
text-decoration: none;
}
a:visited {
color: #0000FF;
text-decoration: none;
}
a:hover {
color: #FF0000;
text-decoration: underline;
}
a:active {
text-decoration: none;
}
-->
</style></head>
<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<%
action_e=request.QueryString("action")
Select Case action_e
Case ""
Call main()
Case "save_agent"
Call save_agent()
end select
%>
<%
sub main
%>
<form name="form1" method="post" action="<%=filename%>?action=save_agent">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="500" height="25" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#3975CE">
<tr>
<td align="center" class="font1"><strong class="font1">增加新代理商</strong></td>
</tr>
</table>
<table width="500" height="350" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td align="center" bgcolor="#F7F7F7"><table width="300" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100" height="25" align="right">代理商账号:</td>
<td><input name="agent_id" type="text" class="input1" id="agent_id" size="20" maxlength="12"></td>
</tr>
<tr>
<td height="25" align="right">代理商密码:</td>
<td><input name="agent_pwd" type="password" class="input1" id="agent_pwd" size="20" maxlength="24"></td>
</tr>
<tr>
<td height="25" align="right">确认密码:</td>
<td><input name="re_agent_pwd" type="password" class="input1" id="re_agent_pwd" size="20" maxlength="24"></td>
</tr>
<tr>
<td height="25" align="right">代理预付金:</td>
<td><input name="agent_money" type="text" class="input1" id="agent_money" size="3"></td>
</tr>
<tr>
<td height="25" align="right">可透支金额:</td>
<td><input name="agent_money2" type="text" class="input1" id="agent_money2" size="3"></td>
</tr>
<tr>
<td height="25" align="right">真实姓名:</td>
<td><input name="agent_name" type="text" class="input1" id="agent_name" size="20" maxlength="4"></td>
</tr>
<tr>
<td height="25" align="right">所在地区:</td>
<td><select name="agent_from" size="1" class="select1" id="agent_from">
<option value="" selected>-请选择-</option>
<option value="北京">* 北京</option>
<option value="上海">* 上海</option>
<option value="天津">* 天津</option>
<option value="重庆">* 重庆</option>
<option value="台湾">* 台湾</option>
<option value="香港">* 香港</option>
<option value="澳门">* 澳门</option>
<option value="安徽">a 安徽</option>
<option value="福建">f 福建</option>
<option value="甘肃">g 甘肃</option>
<option value="贵州">g 贵州</option>
<option value="广东">g 广东</option>
<option value="广西">g 广西</option>
<option value="黑龙江">h 黑龙江</option>
<option value="河北">h 河北</option>
<option value="湖北">h 湖北</option>
<option value="湖南">h 湖南</option>
<option value="河南">h 河南</option>
<option value="海南">h 海南</option>
<option value="吉林">h 吉林</option>
<option value="江苏">h 江苏</option>
<option value="江西">h 江西</option>
<option value="辽宁">l 辽宁</option>
<option value="宁夏">l 宁夏</option>
<option value="内蒙古">l 内蒙古</option>
<option value="青海">q 青海</option>
<option value="陕西">s 陕西</option>
<option value="山西">s 山西</option>
<option value="四川">s 四川</option>
<option value="山东">s 山东</option>
<option value="新疆">x 新疆</option>
<option value="西藏">x 西藏</option>
<option value="云南">y 云南</option>
<option value="浙江">z 浙江</option>
</select></td>
</tr>
<tr>
<td height="25" align="right">联系电话:</td>
<td><input name="agent_tel" type="text" class="input1" id="agent_tel" size="20" maxlength="11"></td>
</tr>
<tr>
<td height="25" align="right">联系QQ:</td>
<td><input name="agent_qq" type="text" class="input1" id="agent_qq" size="20" maxlength="50">
(选填)</td>
</tr>
<tr>
<td height="25" align="right">联系MSN:</td>
<td><input name="agent_msn" type="text" class="input1" id="agent_msn" size="20" maxlength="50">
(选填)</td>
</tr>
<tr>
<td height="25" align="right">联系E-Mail:</td>
<td><input name="agent_email" type="text" class="input1" id="agent_email" size="20" maxlength="50">
(选填)</td>
</tr>
<tr align="center">
<td height="50" colspan="2"><input name="Submit" type="submit" class="button1" value="确 定"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<%end sub%>
<%
sub save_agent()
if request.form("agent_id")="" or request.form("agent_pwd")="" or request.form("agent_money")="" or request.form("agent_money2")="" or request.form("agent_name")="" or request.form("agent_from")="" or request.form("agent_tel")="" then
response.write"<script language=javascript>alert('请将表单填写完整');history.back();</Script>"
response.end
end if
if myobj.ChkID(request.form("agent_id"))=false or len(request.form("agent_id"))<3 or len(request.form("agent_id"))>12 then
response.write"<script language=javascript>alert('账号只能是数字、字母及下划线,并且长度不能小于3个字符或大于12个字符');history.back();</Script>"
response.end
end if
if len(request.form("agent_pwd"))<6 or len(request.form("agent_pwd"))>24 then
response.write"<script language=javascript>alert('密码长度不能小于6个字符或大于24个字符');history.back();</Script>"
response.end
end if
if request.form("re_agent_pwd")<>request.form("agent_pwd") then
response.write"<script language=javascript>alert('两次输入的密码必须相同');history.back();</Script>"
response.end
end if
if myobj.chkmoney(request.form("agent_money"))=false then
response.write"<script language=javascript>alert('代理预付金只能填写数字和小数点');history.back();</Script>"
response.end
end if
if CCur(request.form("agent_money"))<0 then
response.write"<script language=javascript>alert('代理预付金不能小于0');history.back();</Script>"
response.end
end if
if myobj.chkmoney(request.form("agent_money2"))=false then
response.write"<script language=javascript>alert('可透支金额只能填写数字和小数点');history.back();</Script>"
response.end
end if
if CCur(request.form("agent_money2"))<0 then
response.write"<script language=javascript>alert('可透支金额不能小于0');history.back();</Script>"
response.end
end if
if myobj.chkcn(request.form("agent_name"))=false then
response.write"<script language=javascript>alert('代理商名称只能填写汉字');history.back();</Script>"
response.end
end if
if len(request.form("agent_name"))>4 then
response.write"<script language=javascript>alert('代理商名称不能超过4个汉字');history.back();</Script>"
response.end
end if
if myobj.chkcn(request.form("agent_from"))=false then
response.write"<script language=javascript>alert('所在地区的值错误');history.back();</Script>"
response.end
end if
if myobj.ChkNum(request.form("agent_tel"))=false or len(request.form("agent_tel"))<>11 then
response.write"<script language=javascript>alert('联系电话必须为11位的数字,并且第一个数字必须为0');history.back();</Script>"
response.end
end if
if left(request.form("agent_tel"),1)<>0 then
response.write"<script language=javascript>alert('联系电话的第一个数字必须为0');history.back();</Script>"
response.end
end if
if request.form("agent_qq")<>"" then
if myobj.ChkNum(request.form("agent_qq"))=false or len(request.form("agent_qq"))<5 or len(request.form("agent_qq"))>50 then
response.write"<script language=javascript>alert('联系QQ只能填写小于50位大于5位的数字');history.back();</Script>"
response.end
end if
if left(request.form("agent_qq"),1)=0 then
response.write"<script language=javascript>alert('联系QQ的第一个数字不能为0');history.back();</Script>"
response.end
end if
end if
if request.form("agent_msn")<>"" then
if myobj.ChkEmail(request.form("agent_msn"))=false then
response.write"<script language=javascript>alert('MSN地址格式错误');history.back();</Script>"
response.end
end if
if len(request.form("agent_msn"))>50 then
response.write"<script language=javascript>alert('MSN地址不能超过50个字符');history.back();</Script>"
response.end
end if
end if
if request.form("agent_email")<>"" then
if myobj.ChkEmail(request.form("agent_email"))=false then
response.write"<script language=javascript>alert('E-Mail地址格式错误');history.back();</Script>"
response.end
end if
if len(request.form("agent_email"))>50 then
response.write"<script language=javascript>alert('E-Mail地址不能超过50个字符');history.back();</Script>"
response.end
end if
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where (id is null)",conn,1,3
rs.addnew
rs("agent_id")=request.form("agent_id")
rs("agent_pwd")=md5(request.form("agent_pwd"))
rs("agent_from")=request.form("agent_from")
rs("agent_money")=CCur(request.form("agent_money"))
rs("agent_money2")=CCur(request.form("agent_money2"))
rs("agent_name")=request.form("agent_name")
rs("agent_tel")=request.form("agent_tel")
if request.form("agent_qq")<>"" then
rs("agent_qq")=request.form("agent_qq")
end if
if request.form("agent_msn")<>"" then
rs("agent_msn")=request.form("agent_msn")
end if
if request.form("agent_email")<>"" then
rs("agent_email")=request.form("agent_email")
end if
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="500" height="25" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#3975CE">
<tr>
<td align="center" class="font1"><strong class="font1">代理商增加成功</strong></td>
</tr>
</table>
<table width="500" height="150" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td align="center" bgcolor="#F7F7F7"><p>代理商增加成功!</p>
<p><a href="agent_manage.asp">进入代理商管理</a> <a href="<%=filename%>">继续增加新代理商</a></p></td>
</tr>
</table>
<%
end sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -