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

📄 admin_addteacher.asp

📁 ASP开发学生成绩查询管理系统,能满足毕业设计的要求-ASP student achievement for the development of the management system, des
💻 ASP
字号:

<!--#include file="include/conn.asp"-->

<html>
<head>
<link rel="stylesheet" href="inc/css.css" type="text/css" />
</head>
<body>
<form name="form1" method="post" action="">
  <table width="550" border=0 align=center cellpadding=2 cellspacing=1 bordercolor="#799AE1" class=tableBorder>
    <tbody>
      <tr>
        <th colspan=7 align=center style="height: 23px">
		  <div align="center">

		 
		 添加教师</div></th>
      </tr>
      <tr bgcolor="#DEE5FA">
        <td colspan="7" align="left" bgcolor="#DEE5FA" class=txlrow>&nbsp;		</td>
      </tr>
      <tr align="center" bgcolor="#799AE1">
        <td width="68" align="center" bgcolor="#799AE1" class="txlHeaderBackgroundAlternate">
          
        <div align="left">编号</div>        </td>
        <td width="75" align="center" bgcolor="#799AE1" class="txlHeaderBackgroundAlternate">用户名</td>
        <td width="75" align="center" bgcolor="#799AE1" class="txlHeaderBackgroundAlternate">密码</td>
        <td width="75" align="center" bgcolor="#799AE1" class="txlHeaderBackgroundAlternate">姓名</td>
        <td width="75" align="center" bgcolor="#799AE1" class="txlHeaderBackgroundAlternate">性别</td>
        <td width="75" align="center" bgcolor="#799AE1" class="txlHeaderBackgroundAlternate">职称</td>
        <td width="90" align="center" bgcolor="#799AE1" class="txlHeaderBackgroundAlternate">所属学院名称</td>
      </tr>
      
      
      <tr bgcolor="#DEE5FA">
        <td width="36" align="center" class="txlrow"><input name="t_id" type="text" size="4"></td>
        <td align="center" bgcolor="#DEE5FA" class="txlrow"><input name="t_usename" type="text" size="10"></td>
        <td align="center" bgcolor="#DEE5FA" class="txlrow"><input name="t_password" type="text" size="10"></td>
        <td align="center" bgcolor="#DEE5FA" class="txlrow"><input name="t_name" type="text" size="10"></td>
        <td align="center" valign="middle" bgcolor="#DEE5FA" class="txlrow"><p>
          <label></label>
          <select name="sex">
            <option>男</option>
            <option>女</option>
          </select>
          
        </p></td>
        <td align="center" bgcolor="#DEE5FA" class="txlrow"><select name="jcheng">
          <option>研究生</option>
          <option>讲师</option>
          <option>教授</option>
          <option>副教授</option>
          <option>博士</option>
        </select>        </td>
        <td align="center" bgcolor="#DEE5FA" class="txlrow">
		<select name="institute">
		<option selected value="">所有学院</option>
		<% dim p
             p="select * from institute order by ins_id "
			 rs.open p,conn,3,3
			 do while not rs.eof
			     response.write"<option value="& rs("ins_name")& ">" & rs("ins_name")&"</option>"
				 rs.movenext
				 loop
				 rs.close
				 set rs=nothing
		 
		%>
		</select>		</td>
      </tr>
      <tr bgcolor="#DEE5FA">
        <td width="36" align="center" class="txlrow">&nbsp;</td>
        <td colspan="6" align="center" bgcolor="#DEE5FA" class="txlrow"><input type="submit" name="Submit" value="确定">
        <input type="submit" name="Submit2" value="取消"></td>
      </tr>
      <tr bgcolor="#DEE5FA">
        <td colspan="7" align="left" class="txlrow"><div align="center">
          <p>&nbsp;</p>
          <table width="545" border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="#ffffff">
              <tr>
                <td width="35" align="center" bgcolor="#799AE1">编号</td>
                <td width="50" align="center" bgcolor="#799AE1">用户名</td>
                <td width="50" align="center" bgcolor="#799AE1">密码</td>
                <td width="60" align="center" bgcolor="#799AE1">姓名</td>
                <td width="30" align="center" bgcolor="#799AE1">性别</td>
                <td width="50" align="center" bgcolor="#799AE1">职称</td>
                <td width="80" align="center" bgcolor="#799AE1">所属学院名称</td>
                <td width="60" align="center" bgcolor="#799AE1">编辑</td>
              </tr>
              <%
			 
  dim sql
 set rs=server.CreateObject("adodb.recordset") 
  sql="select * from teacher order by ID"
  rs.open sql,conn,1,1


 
  do while not rs.eof
  
%>
              <tr  align="center">
                <td height="10" align="center" width="35" ><% =rs("t_id") %>   </td>
                <td height="10" align="center" width="50"><% =rs("t_usename") %>  </td>
				<td height="10" align="center" width="50"><% =rs("t_password") %>  </td>
				<td height="10" align="center" width="60"><% =rs("t_name") %>  </td>
                <td height="10" align="center" width="30"><% =rs("t_sex") %>   </td>
                <td height="10" align="center"><% =rs("t_jcheng") %>   </td>
                <td height="10" align="center" width="100"><% =rs("ins_name") %>   </td>
                <td align="center" width="60">&nbsp;<a href="admin_editerteacher.asp?id=<%=rs("ID")%>">修改</a> <a href="DELETE_tea.asp?id=<%=rs("ID")%>">删除</a></div></td>
              </tr>
              <%
			  
rs.movenext
loop
rs.close
set rs=nothing

%>
            </table>
        </div></td>
      </tr>
    
      <tr bgcolor="#DEE5FA">
        <td colspan=7 align=center class=txlrow></td>
      </tr>
</tbody></table>
</FORM>
<%
dim s,t_id,usename,paw,t_name,t_sex,t_jcheng,t_ins
     t_id=request.form("t_id")
	paw=request.form("t_password")
	usename=request.form("t_usename")
	t_name=request.form("t_name")
	t_sex=request.form("sex")
	t_jcheng=request.form("jcheng")
	t_ins=request.form("institute")
if request.form("submit")="确定" then
if t_id="" or paw="" or usename="" or t_name="" or t_sex="" or t_jcheng="" or t_ins="" then
   response.write "<script> alert('输入框不能留空!');history.go(-1);</script>"
   else
    set rs=server.CreateObject("adodb.recordset") 
	s="select * from teacher where t_id='"&t_id&"'"
	rs.open s,conn,3,3
	if not rs.eof then
	    response.write "<script> alert('该教师编号已经存在!');history.go(-1);</script>"
		else
	rs.addnew
	rs("t_id")=t_id
	rs("t_password")=paw
	rs("t_usename")=usename
	rs("t_name")=t_name
	rs("t_sex")=t_sex
	rs("t_jcheng")=t_jcheng
	rs("ins_name")=t_ins
	rs.update
	response.write "<script> alert('添加成功!');history.go(-1);</script>"


   end if
   rs.close
   set rs=nothing
   end if
   end if
%>

</BODY>
  </HTML>

⌨️ 快捷键说明

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