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

📄 update_customer_sav.asp

📁 oracle9i程序事例集
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<html>
<%
  dim conn
  dim connstr
  Set conn=Server.CreateObject("ADODB.Recordset")
  connstr="Driver={Microsoft ODBC for Oracle};server=mylink;uid=system;pwd=system;"
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改客户信息</title>
</head>

<body background="../img/updateBG.gif">
<%
  function IsValidEmail(user_mail)

dim names, name, i, c

'Check for valid syntax in an email address.

IsValidEmail = true
names = Split(user_mail, "@")
if UBound(names) <> 1 then
   IsValidEmail = false
   exit function
end if
for each name in names
   if Len(name) <= 0 then
     IsValidEmail = false
     exit function
   end if
   for i = 1 to Len(name)
     c = Lcase(Mid(name, i, 1))
     if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
       IsValidEmail = false
       exit function
     end if
   next
   if Left(name, 1) = "." or Right(name, 1) = "." then
      IsValidEmail = false
      exit function
   end if
next
if InStr(names(1), ".") <= 0 then
   IsValidEmail = false
   exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
   IsValidEmail = false
   exit function
end if
if InStr(email, "..") > 0 then
   IsValidEmail = false
end if

end function

  dim rs,sql,id,password,username,idcard,province,city,address,zipcode,telphone,mobilephone,email,remark

  set rs=server.createobject("adodb.recordset")

  if trim(request("username"))="" then
    errmsg=errmsg+"<br>"+"<li>客户姓名不能为空"
    founderr=true
  else
   username=trim(request("username"))
  end if
  
  if trim(request("province"))="" then
    errmsg=errmsg+"<br>"+"<li>所在省份不能为空"
    founderr=true
  else
    province=trim(request("province"))
  end if
    if trim(request("address"))="" then
    errmsg=errmsg+"<br>"+"<li>客户地址不能为空"
    founderr=true
  else
    address=trim(request("address"))
  end if

  
  if trim(request("city"))="" then
    errmsg=errmsg+"<br>"+"<li>所在城市不能为空"
    founderr=true
  else
    city=trim(request("city"))
  end if
  
  if trim(request("telphone"))="" then
    errmsg=errmsg+"<br>"+"<li>联系电话不能为空"
    founderr=true
  else
    telphone=trim(request("telphone"))
  end if

  if trim(request("email"))<>"" then
    if isvalidemail(trim(request("email")))=false then
      errmsg=errmsg+"<br>"+"<li>您输入的email地址有误"
      founderr=true
    else
      email=trim(request("email"))
    end if
  end if

  idcard=trim(request("idcard"))
  zipcode=trim(request("zipcode"))
  mobilephone=trim(request("mobilephone"))
  remark=trim(request("Remark"))
%>

<div align="center">
<center>
<table border="0" width="600" cellspacing="0" cellpadding="0">
<%  
  if founderr=false then
    sql="select * from GSCOTT.user_info_table where user_id='"&request("id")&"'"
    rs.open sql,connstr,3,3
	user=rs("user_id")
	udate=rs("user_date")
    rs("user_name")=username
    rs("user_idcard")=idcard
    rs("user_province")=province
    rs("user_city")=city
    rs("user_address")=address
	rs("user_zipcode")=zipcode
	rs("user_telphone")=telphone
	rs("user_mobilephone")=mobilephone
	rs("user_email")=email
    rs("user_remark")=remark
    rs.update
    rs.close
    set rs=nothing
%>

<tr bgcolor="#999999"> 
  <td height="30" align="center" colspan="4">客户<%=user%>信息修改成功</td>
  <tr>
    <td width="30%" height="30" align="right">客户ID:</td>
    <td width="20%"><%=user%></td>
    <td colspan="2" align="right">&nbsp;</td>
    </tr>
  <tr>
    <td height="30"><div align="right"> 客户姓名:</div></td>
    <td><%=username%></td>
    <td width="20%"><div align="right">身份证号:</div></td>
    <td width="30%"><%=IDcard%></td>
  </tr>
  <tr>
    <td height="30"><div align="right"> 所在省份:</div></td>
    <td><%=province%></td>
    <td><div align="right"> 所在城市:</div></td>
    <td><%=city%></td>
  </tr>
  <tr>
    <td height="30"><div align="right"> 客户地址:</div></td>
    <td><%=address%></td>
    <td><div align="right">邮编: </div></td>
    <td><%=zipcode%></td>
  </tr>
  <tr>
    <td height="30"><div align="right">联系电话:</div></td>
    <td><%=telphone%></td>
    <td><div align="right">手机:</div></td>
    <td><%=mobilephone%></td>
  </tr>
  <tr>
    <td height="30"><div align="right">Email:</div></td>
    <td><%=email%></td>
    <td><div align="right">注册时间:</div></td>
    <td><%=udate%></td>
  </tr>
  <tr>
    <td height="30"><div align="right">备注:</div></td>
    <td colspan="3"><%=remark%></td>
  </tr>
  <tr align="center">
    <td height="30" colspan="4"><a href="update_customer.asp">修改删除客户信息</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../outlook_model/all_customer.asp">浏览全部客户信息</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../index.asp">返回主页</a></td>
  </tr>

<%else%>
<meta http-equiv="refresh" content="3;url=javascript:history.go(-1)">
<tr> 
  <td width="30%" height="20" align="center">输入的客户信息有问题</td> 
</tr>
<tr> 
  <td><%=errmsg%></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr><td align="center"><a href="javascript:history.go(-1)"><font size="-1">三秒钟后自动返回到上一页,如果您的浏览器没有返回,请单击此处</font></a></td></tr>
<%end if%>
</table>
</center>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -