salist.asp

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

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

IF request.form("cmdDel")="删除" then 
    Adoconnection()
    for each item in request("Selected") 
        Adoconn.Execute "delete from operators where DbaCode='" & item & "'" ,,1 
    next 
    set Adoconn=nothing 
    response.redirect ("Salist.asp") 
END IF
 
IF request.form("cmdMdy")="修改" THEN
 Dim RecordsetArray 
 Dim LocalArray(100) 
 Dim fi 
    
    Adoconnection()
    
    for each item in request("Selected") 
        Session("DbaCode")=item     
        Session("EditFlag")="MODIFY" 
    
        set RS=Adoconn.Execute ("select * from Operators where DbaCode='" & item & "'") 
        RecordArray=RS.GetRows() 
         
        for fi=0 to RS.FIELDS.COUNT-1 
            LocalArray(fi)=RecordArray(fi,0) 
        next  
         
        session("DataArray")=LocalArray 
                 
        Set RS=nothing 
        set Adoconn=nothing 
    
        Response.Redirect ("Saedit.asp") 
    next
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 6.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 

CA_Supervisor()
 
SQL="select * from operators ORDER BY DbaNAME"

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="565" height="40">            
  <tr bgcolor=#ccccc7>          
    <td width="77" colspan="2" align="center" height="21">            
        <p align="right"><font color="#000080"><b>&nbsp; 代码 </b></font>    
    </td>         
    <td width="113" align="center" height="21">       
        <p align="center"><font color="#000080"><b>姓名</b></font></p>       
    </td>         
    <td width="181" align="center" height="21"><font color="#000080"><b>所在部门</b></font></td>         
    <td width="181" align="center" height="21"><font 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="1" height="11"><input type="checkbox" name="Selected" value="<%=rs(0) %>"></td>           
      <td width="92" height="11"><% =rs(0) %></td>         
      <td width="113" height="11"><% =rs(1) %></td>         
      <td width="181" height="11"><% =rs(3) %></td>         
      <td width="181" height="11"><% =rs(4) %></td>         
    <%response.write ("</tr>")%>         
    <% rs.movenext%>         
    <%next%>         
  </table>         
</div>         
<p>             
<input type="submit" value="删除" name="cmddel">&nbsp;&nbsp; &nbsp;&nbsp;<input type="submit" value="添加" name="cmdadd">&nbsp;&nbsp;&nbsp;&nbsp;             
<input type="submit" value="修改" name="cmdmdy">&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 + -
显示快捷键?