tclassnoupdate.asp

来自「《动态网页设计基础教程》,胡杰,科学出版社」· ASP 代码 · 共 120 行

ASP
120
字号
<!-- #include file="adoconn.asp" -->
<%
IF request.form("cmdadd")="添加" then
    response.redirect "CollegeChoice.asp"
END IF

IF request.form("cmdDel")="删除" then 
    Adoconnection()
    for each item in request("Selected") 
        Adoconn.Execute "delete from ClassofTeacher where ClassNo='" & item & "' and Tid='" & session("Tid") & "'" ,,1 
    next 
    set Adoconn=nothing 
    %>
    <script language=vbscript>
     history.go(-2)
    </script>
    <%
END IF
 
%>

<html>

<head>
<link rel="stylesheet" href="comCSS.css">
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>教师授课班级选择</title>

<base target="rbottom">
<meta name="Microsoft Border" content="t, default">
</head>

<body ><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td>

<p align="left"> </p>

</td></tr><!--msnavigation--></table><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><!--msnavigation--><td valign="top">
 
   
<% 
Dim sql 
Dim reccount 
Dim fieldi,recordi 
Dim ps,mypagesize,ys,mypage 
Dim maxcount 
Dim Rs

Session("Tid")=request("T1")

set RS=GetRecordset("select * from Teachers where TID='" & Session("Tid") & "' and Tpw='" & Request("T2") & "'") 
If Rs.recordcount <> 1 Then 
set rs=nothing
%>
<script language="VBscript">
        msgbox "没有该教师信息,请重新输入或注册!"   
        History.Back
</script> 
<%End If %>

<%
Session("Tname")=rs(1)
SQL="select * from Classofteacher Where Tid='" & Session("Tid") & "'"

Set rs=nothing
Set rs=GetRecordset(sql)
 
IF not rs.eof then  
   Reccount=rs.RecordCount 
END IF 
%> 
 
<form method="post"> 
<table border=0 cellspacing="0"> 
<tr> 
<td><font face="华文行楷" size="4" color="#FF0000"><b>教师授课班级列表</b></font>[  记录总数:<%=Reccount%>]</td>              
</table>                                         
<div align="left">              
  <table border="1" width="425" height="40">            
  <tr bgcolor=#ccccc7>          
    <td width="133" align="center" height="21">            
        <p align="left"><font color="#000080" face="楷体_GB2312" size="4"><b>&nbsp; 班级代码 </b></font>    
    </td>         
    <td width="276" align="center" height="21">            
        <font face="楷体_GB2312" size="4" color="#000080"><b>所在院系</b></font></td>         
   </tr>    
        
    <%for recordi=1 to Reccount      
      if rs.Eof then Exit for       
      if recordi mod 2=0 then    
         color="#ddddd7"    
      else    
         color="#eeeeef"    
      end if    
        
      response.write ("<tr bgcolor=" + color +">")    
    %>         
            
      <td width="133" height="11"><input type="checkbox" name="Selected" value="<%=rs(2) %>"><%=rs(2) %></td>           
            
      <td width="276" height="11"><%=rs(3) %></td>           
    <%response.write ("</tr>")%>         
    <% rs.movenext%>         
    <%next%>         
  </table>
  <% set rs=nothing %>         
</div>         
<p>             
<input type="submit" value="删除" name="cmddel">&nbsp;&nbsp; &nbsp;&nbsp;<input type="submit" value="添加" name="cmdadd">&nbsp;&nbsp;&nbsp;&nbsp;             
<a href="javascript:history.back(2)">返回</a>       
  
</p>      
      
</form>      

 <!--msnavigation--></td></tr><!--msnavigation--></table></body>    
</html>           

⌨️ 快捷键说明

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