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

📄 agent_edit.asp

📁 在线点播系统
💻 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
if request.QueryString("id")="" or myobj.ChkNum(request.QueryString("id"))=false then
response.write"<script language=javascript>alert('ID值错误');history.back();</Script>"
response.end 
else
	set rs=server.createobject("adodb.recordset")
	rs.open "select * from agents where id="&request.Querystring("id")&"",conn,1,1
	if rs.eof then
		rs.close
		set rs=nothing
		conn.close
		set conn=nothing
		response.write"<script>alert('该代理商并不存在');history.back();</Script>"
		response.end
	else
		var_agent_id=rs("agent_id")
		var_agent_from=rs("agent_from")
		var_agent_money=rs("agent_money")
		var_agent_money2=rs("agent_money2")
		var_reg_time=rs("reg_time")
		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")
		rs.close
	end if
end if
%>
<form name="form1" method="post" action="<%=filename%>?action=save_agent">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</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="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
  <tr>
    <td align="center" bgcolor="#F7F7F7"><table width="400" height="40" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td align="center"><a href="agent_cz_log.asp?agent_id=<%=var_agent_id%>">查看账号充值记录</a></td>
        </tr>
    </table>
    <table width="350" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="120" height="25" align="right">代理商账号:</td>
        <td>&nbsp;<%=var_agent_id%></td>
      </tr>
      <tr>
        <td height="25" align="right">注册时间:</td>
        <td>&nbsp;<%=var_reg_time%></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" value="<%=var_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" value="<%=var_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" 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="<%=request.Querystring("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_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 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.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="&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_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
end if
%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</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_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 + -