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

📄 modify.asp

📁 设置员工上下班时间
💻 ASP
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改用户</title>
</head><!--#include file="connection.asp"-->
<%
	
		id=session("employeeid")
	isPostBack=trim(Request("IsPostBack")+"")
	if isPostBack="PostBack" then		
		name=trim(Request("name"))		
		sex=trim(Request("sex"))
		job=trim(Request("job"))
        account=trim(Request("account"))
        password=trim(Request("password"))
	
		checked=true '用于判断所有信息是否合法,如合法则保存数据
		if len(job)<1 then
Response.Write "<script>alert('请输入员工部门!');history.go(-1);</script>"
elseif len(account)<1 then
Response.Write "<script>alert('请输入员工账号!');history.go(-1);</script>"
elseif len(password)<1 then
Response.Write "<script>alert('请输入员工密码!');history.go(-1);</script>"
		end if                 
		if checked then		
			strsql="update employee set sex='"&sex&"'"
strsql=strsql+",job='"&job&"',account='"&account&"',password='"&password&"'"
strsql=strsql+"where keyid="&id
		
			con.Execute strsql
			Response.Write "<script>alert('保存用户信息成功!');history.go(-1);</script>"
		end if		
	end if
	

	
	Set user_rs=Server.CreateObject("ADODB.Recordset")		
	strsql="select * from employee "
	user_rs.Open  strsql,con	
%>
<body>
<form name="form1" method="post" action="">
  <input name="IsPostBack" type="hidden" value="PostBack">
  <table width="647" border="1" align="center">
    <tr>
    
      <td width="98" align="right">用户姓名:</td>
      <td width="533">
  	  <input type="text" name="name" value="<%=session("name")%>" readonly ></td>
    </tr>
    <tr>
      <td align="right"> 性别:</td>
      <td><select name="Sex" id="Sex">
        <option value="0" <%if user_rs("sex")="0" then %> selected <%end if%>>男</option>
        <option value="1" <%if user_rs("sex")="1" then %> selected <%end if%>>女</option>       
      </select></td>
      
    </tr>
    <tr>
      
      <td><div align="right">部门:</div></td>
    <td><input type="text" name="job" /></td>
    </tr>
     <tr>
    <td><div align="right">账号:</div></td>
    <td><input type="text" name="account" /></td>
  </tr>
  <tr>
    <td><div align="right">密码:</div></td>
    <td><input type="text" name="password" /></td>
  </tr>
  <tr>
    <td colspan="2"><div align="right">         
          <input type="submit" name="Submit" value="保存" />              
      </div></td>
  </tr>
  </table>
  <%con.Close%>
</form>
</body>
</html>

⌨️ 快捷键说明

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