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

📄 admin.asp

📁 用于学生查询成绩用,前台ASP动态网页,通过此学生在线查成绩,后台用ACCESS数据库
💻 ASP
字号:
<%if session("password")<>"" then%>
<!--#include file="conn.asp"--> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>计科二班</title>
<script language="JavaScript">
                   <!--
      function test(){ 
          if (document.form2.page.value=="" || isNaN(document.form2.page.value))  {
               alert("输入页数必须为数值型");
               document.form2.page.focus();
               return false;
              }
  return true;
}
// -->
</script>
<script>
function del ()  //用于判断记录有没有选中的函数
{
var flag=true;
var temp="";
var  tmp;
if((document.form1.answer.length+"")=="undefined") {tmp=1}else{tmp=document.form1.answer.length}
if (tmp==1){
if (document.form1.answer.checked){
    flag=false;
  temp=document.form1.answer.value
}
}else{
for (i=0;i<document.form1.answer.length;i++) {
if (document.form1.answer[i].checked){
if (temp==""){
flag=false;
temp=document.form1.answer[i].value
}else{
flag=false;
temp = temp +","+ document.form1.answer[i].value
}
}
}
}
if (flag){ alert("对不起,你还没有选择!")}
else{   name=document.form1.name.value
        //alert(name)
          if (confirm("确实要删除?")){
        window.location="delnews.asp?id=" + temp;
}
}
return !flag;
}
</script>
<style type="text/css">
<!--
body {
	scrollbar-face-color: #FFC4B0;
	scrollbar-highlight-color: #FFC4B0;
	scrollbar-shadow-color: #FF7142;
	scrollbar-3dlight-color: #FF7142;
	scrollbar-arrow-color: #FF7142;
	scrollbar-darkshadow-color:#FFC4B0;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-image:  url(img/bg3.gif);
	background-position:center;
	margin-left: 0px;
}
body,td,th {
	font-size: 12px;
	color: #FF7142;
	font-family: 宋体;
}
a {
	font-family: 宋体;
	font-size: 12px;
}
a:link {
	text-decoration: none;
	color: #FF7142;
}
a:visited {
	text-decoration: none;
	color: #FF7142;
}
a:hover {
	text-decoration: none;
	color: #FFB59D;
}
a:active {
	text-decoration: none;
	color: #FFB59D;
}
h1,h2,h3,h4,h5,h6 {
	font-family: 宋体;
}
.style2 {color: #ff41b5}
-->
</style>
</head>
<body>
<script language=Javascript>
function checkall(all)//用于判断全选记录的函数
{
  var a = document.getElementsByName("answer");
  for (var i=0; i<a.length; i++) a[i].checked = all.checked;
}
</script>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from bbs1 order by xh desc"
rs.open sql,conn,1,3 %> 
<table width="495" height="578"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td width="495" height="83" align="center" valign="top" background="img/top3.gif">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="421" valign="top">
	
<table width="430"  border="0" height="90%" align="center" cellpadding="0" cellspacing="0">
	<tr><td width="478" height='321' valign='top' background="img/bg33.gif"><div align=center>

	  <table width="429" border="0" align="center">
        <tr>
          <td align="center">后台管理页面</td>
          </tr>
      </table>
	
	      <!--#include file="conn1.asp"--> 
          <% 
	page = CLng(request("page"))							'利用CLng函数把page值转换为Long型
	judge=request("judge")
	judge2=request("judge2")
	judge3=0
	sqlcmd="select * from bbs1 Order By xh Desc"
	rs.Open sqlcmd,newconn,1,2
%> 
 

	      <table width="447" border="0" align="center">
            <tr>
              <td width="141" align="center"><a href="add.asp" target="_parent">添加单个成绩</a></td>
              <td width="158" align="center"><a href="adds.asp" target="_parent">批量添加成绩</a></td>
              <td width="134" align="center"><a href="res.asp" target="_parent">通过学号搜索并修改</a></td>
            </tr>
          </table>
	      <p>
	      <form method="POST" id=form1 name=form1>
<table width="90%" border="0" align="center" class="tabDocborder" ID="Table3">
<tr>
    <td>
      <table width="433"  align="center" id=TabDocMain border='1' cellspacing='0' cellpadding='0'   bordercolorlight='#FFCC66' bordercolor='#FFCC66' class="TabDocMain">
  <tr> 
     <td width="53" align=center>
      删除框
    </td>
    <td width="84" align=center> 学号
</td>
    <td width="87" align=center>姓名</td>
    <td width="111" align=center>
科目成绩</td>
    <td width="86"  align=center>
     操作</td>
  </tr>
         <%
			if not (rs.EOF or rs.BOF) then
			rs.MoveFirst
			rs.PageSize = 12  '每页显示的条数  
			If page < 1 Then page = 1 
			If page > rs.PageCount Then page = rs.PageCount  
			rs.AbsolutePage = page
			For ipage = 1 To rs.PageSize%>

  <tr> 
<td align=center><input type="checkbox" name="answer" value="<%=rs("id")%>" ID="Checkbox1">
</td>
   <td align=left><%=rs("xh")%></td>
   <td align=left><%=rs("user")%></td>
   <td align=left><%=rs("cj")%></td>
<td align=center><a href="update.asp?id=<%=rs("id")%>">修改</a></td>
  </tr>

	  
	        <%   
				rs.MoveNext      
				If rs.EOF Then Exit For   
				Next   
			%>

<tr> 
<td height="22" colspan="8" align="center">
<input type="checkbox" name="chkall" value="on" onclick="checkall(this)" ID="Checkbox2">选中所有的显示新闻   
<input type="button" name="btnDelete" value="删除" style='font-family: 宋体; font-size: 9pt;' onclick="del()" ID="Button1"></td>
</tr>
  </table>
</form>	
 <table width="433" border="0" align="center" cellpadding="0" cellspacing="1">
    <tr bgcolor="7285CF"> 
      <form onSubmit="return test();" method="get" action="admin.asp" id=form2 name=form2>
        <td width="134" height="17" align="center" bgcolor="#FFCC99" ><font color="ffffff">页数:</font> 
          <%Response.Write "<input type=text size=2 maxlength=4 name=page class=editbox1><input type=hidden name=judge value=1>"  '显示输入页数框并将page,judge参数传递下去%></td>
        <td width="296" height="17"  align="center" bgcolor="#FFCC99" > 
          <%
				If page = 1 Then 
				   Response.Write "<font class='white'>第一页 上一页</font>" 
				End If
				If page <> 1 Then 
				   Response.Write "<a href=admin.asp?page=1 class='yellow'>第一页</a>" 
				   Response.Write " <a href=admin.asp?page=" & (page - 1) & " class='yellow'>上一页</a>" 
				End If
				If page <> RS.PageCount Then 
				   Response.Write " <a href=admin.asp?page=" & (page + 1) & " class='yellow'>下一页</a>" 
				   Response.Write " <a href=admin.asp?page=" & RS.PageCount & " class='yellow'>最后一页</a>" 
				End If 
				If page = RS.PageCount Then 
				   Response.Write " <font class='white'>下一页 最后一页</font>" 
				End If
			  %></td>
      </form>
    </tr>
	<tr>
	<td  bgcolor="#FFCC99" class="white" colspan="2" height="17" > 记录总数:<%=rs.recordCount%> 总页数:<%=rs.PageCount%> 当前页次:<%=page%>      </td>
	</tr>
  </table>
  <%else%>
  <table align=center >
      <td >对不起,还没有记录!</td>
  </table>
  <%end if%>
  <br>
</td>
  </tr>
  <tr>
    <td height="33" align="center"><img src="img/bott3.gif" width="495" height="33"></td>
  </tr>
</table>
</body>
</html>
<%else
Response.Redirect "admpost.asp"
end if%>

⌨️ 快捷键说明

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