📄 edit.asp
字号:
<!--#include file="chklogin.asp"-->
<%
call myobj.chkrq()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改资料</title>
<link href="style.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
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where agent_id='"&request.cookies("username")&"'",conn,1,1
if rs.eof then
rs.close
set rs=nothing
response.write"<script>alert('该代理商并不存在');history.back();</Script>"
response.end
else
var_id=rs("id")
var_agent_from=rs("agent_from")
var_agent_name=rs("agent_name")
var_agent_tel=rs("agent_tel")
var_agent_qq=rs("agent_qq")
var_agent_msn=rs("agent_msn")
var_agent_email=rs("agent_email")
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<form name="form1" method="post" action="<%=filename%>?action=save_agent">
<table width="500" height="50" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">[<a href="agent_index.asp">管理中心首页</a>] [<span class="font3">修改资料</span>] [<a href="cz.asp">账号充值</a>] [<a href="cz_log.asp">充值记录</a>] [<a href="login.asp?action=logout">注销登陆</a>]</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="270" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<td align="center" bgcolor="#F7F7F7"><table width="350" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="120" 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_name" type="text" class="input1" id="agent_name" value="<%=var_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="北京" <%if var_agent_from="北京" then%>selected<%end if%>>* 北京</option>
<option value="上海" <%if var_agent_from="上海" then%>selected<%end if%>>* 上海</option>
<option value="天津" <%if var_agent_from="天津" then%>selected<%end if%>>* 天津</option>
<option value="重庆" <%if var_agent_from="重庆" then%>selected<%end if%>>* 重庆</option>
<option value="台湾" <%if var_agent_from="台湾" then%>selected<%end if%>>* 台湾</option>
<option value="香港" <%if var_agent_from="香港" then%>selected<%end if%>>* 香港</option>
<option value="澳门" <%if var_agent_from="澳门" then%>selected<%end if%>>* 澳门</option>
<option value="安徽" <%if var_agent_from="安徽" then%>selected<%end if%>>a 安徽</option>
<option value="福建" <%if var_agent_from="福建" then%>selected<%end if%>>f 福建</option>
<option value="甘肃" <%if var_agent_from="甘肃" then%>selected<%end if%>>g 甘肃</option>
<option value="贵州" <%if var_agent_from="贵州" then%>selected<%end if%>>g 贵州</option>
<option value="广东" <%if var_agent_from="广东" then%>selected<%end if%>>g 广东</option>
<option value="广西" <%if var_agent_from="广西" then%>selected<%end if%>>g 广西</option>
<option value="黑龙江" <%if var_agent_from="黑龙江" then%>selected<%end if%>>h 黑龙江</option>
<option value="河北" <%if var_agent_from="河北" then%>selected<%end if%>>h 河北</option>
<option value="湖北" <%if var_agent_from="湖北" then%>selected<%end if%>>h 湖北</option>
<option value="湖南" <%if var_agent_from="湖南" then%>selected<%end if%>>h 湖南</option>
<option value="河南" <%if var_agent_from="河南" then%>selected<%end if%>>h 河南</option>
<option value="海南" <%if var_agent_from="海南" then%>selected<%end if%>>h 海南</option>
<option value="吉林" <%if var_agent_from="吉林" then%>selected<%end if%>>h 吉林</option>
<option value="江苏" <%if var_agent_from="江苏" then%>selected<%end if%>>h 江苏</option>
<option value="江西" <%if var_agent_from="江西" then%>selected<%end if%>>h 江西</option>
<option value="辽宁" <%if var_agent_from="辽宁" then%>selected<%end if%>>l 辽宁</option>
<option value="宁夏" <%if var_agent_from="宁夏" then%>selected<%end if%>>l 宁夏</option>
<option value="内蒙古" <%if var_agent_from="内蒙古" then%>selected<%end if%>>l 内蒙古</option>
<option value="青海" <%if var_agent_from="青海" then%>selected<%end if%>>q 青海</option>
<option value="陕西" <%if var_agent_from="陕西" then%>selected<%end if%>>s 陕西</option>
<option value="山西" <%if var_agent_from="山西" then%>selected<%end if%>>s 山西</option>
<option value="四川" <%if var_agent_from="四川" then%>selected<%end if%>>s 四川</option>
<option value="山东" <%if var_agent_from="山东" then%>selected<%end if%>>s 山东</option>
<option value="新疆" <%if var_agent_from="新疆" then%>selected<%end if%>>x 新疆</option>
<option value="西藏" <%if var_agent_from="西藏" then%>selected<%end if%>>x 西藏</option>
<option value="云南" <%if var_agent_from="云南" then%>selected<%end if%>>y 云南</option>
<option value="浙江" <%if var_agent_from="浙江" then%>selected<%end if%>>z 浙江</option>
</select></td>
</tr>
<tr>
<td height="25" align="right">联系电话:</td>
<td><input name="agent_tel" type="text" class="input1" id="agent_tel" value="<%=var_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" value="<%=var_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" value="<%=var_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" value="<%=var_agent_email%>" size="20" maxlength="50">
(选填)</td>
</tr>
<tr align="center">
<td height="50" colspan="2"><input name="Submit" type="submit" class="button1" value="保存修改">
<input name="id" type="hidden" id="id" value="<%=var_id%>"> </td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<%end sub%>
<%
sub save_agent()
if request.form("id")="" or myobj.ChkNum(request.form("id"))=false then
response.write"<script language=javascript>alert('ID值错误');history.back();</Script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where id="&request.form("id")&"",conn,1,1
if rs.eof then
rs.close
set rs=nothing
response.write"<script>alert('该代理商并不存在');history.back();</Script>"
response.end
else
if 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 request.form("agent_pwd")<>"" then
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
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="&request.form("id")&"",conn,1,3
if request.form("agent_pwd")<>"" then
rs("agent_pwd")=md5(request.form("agent_pwd"))
end if
rs("agent_from")=request.form("agent_from")
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
end if
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="<%=filename%>?id=<%=request.form("id")%>">继续修改资料</a> <a href="agent_index.asp">返回管理中心首页</a><a href="<%=filename%>"></a></p></td>
</tr>
</table>
<%
end sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -