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

📄 power.asp

📁 c++builder开发系统实现了成绩查寻
💻 ASP
字号:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<!--#include file="session_0.asp" -->
<!--#include file="Connections/conn1.asp" -->
<%
var rs = Server.CreateObject("ADODB.Recordset");
rs.ActiveConnection = MM_conn1_STRING;
rs.Source = "SELECT power  FROM admin  WHERE rank=0";
rs.CursorType = 0;
rs.CursorLocation = 2;
rs.LockType = 1;
rs.Open();
var rs_numRows = 0;
%>
<!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>
<style type="text/css">
<!--
body {
	background-image: url(imag/bjx.jpg);
}
.style18 {
	font-style: italic;
	font-size: 14px;
	color: #FFFF66;
}
.style28 {font-size: 12px}
.style30 {font-size: 12px; color: #FF6699; }
.style31 {color: #0000CC}
.style32 {color: #FF0000}
.style35 {color: #666633}
.style36 {color: #000000}
.style39 {color: #FFFFFF; font-weight: bold; font-size: 12px;}
.style40 {
	color: #666666;
	font-size: 12px;
}
-->
</style></head>

<body>
<script language="javascript">
function chk(){
 if(document.form1.userno.value=="")
   {window.alert("请输入学号");return false;}
   return true;
   }
   </script>
<table width="700" height="517" border="0" align="center" cellpadding="0" cellspacing="0" >
  <!--DWLayoutTable-->
  <tr>
    <td width="89" height="13"></td>
    <td width="713"><div align="center"><img src="imag/Top_logo.jpg" width="621" height="109"></div></td>
    <td width="48"></td>
  </tr>
  <tr>
    <td height="395"></td>
    <td valign="top"><table width="570" border="0" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr>
          <td width="850" height="395"><table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <th width="37" scope="col">&nbsp;</th>
                <td width="626" height="358" scope="col">
				<form action="power.asp" method="get" name="formx" target="_self" id="formx">
				<table width="570" border="1" align="center" cellpadding="0" cellspacing="0">
                  <tr bgcolor="#CCFF00">
                    <th width="189" scope="col"><div align="right"><span class="style30">班级管理员成绩录入状态:</span></div></th>
                    <th width="155" scope="col"><div align="center" class="style31"><span class="style28"><span class="style35"><em>录入开关已</em><span class="style36"> [</span></span>                        <span class="style32">
                      <% if(rs.EOF&&rs.BOF) Response.Write("关闭");else{var x=rs.Fields.Item("power").Value; if(x==1) Response.Write("开启"); if(x==0) Response.Write("关闭")}%>
                      <span class="style36">]</span></span></span></div></th>
                    <th width="97" scope="col"><div align="center"><span class="style28"><input name="open" type="submit" id="open" value="打开">
                    </span></div></th>
                    <th width="89" scope="col"><div align="center"><span class="style28">
                      <input name="close" type="submit" id="close" value="关闭">
                      <input name="xz" type="hidden" id="xz" value="<% Response.Write(x)%>">
                    </span></div></th>
                  </tr>
                  <tr bgcolor="#999999">
                    <th colspan="4" class="style39" scope="col">本开关主要是为了限制班级管理员定时间段的成绩录入</th>
                    </tr>
                </table>
				</form></td>
                <th width="37" scope="col">&nbsp;</th>
              </tr>
            </table>
          </td>
        </tr>
    </table></td>
    <td></td>
  </tr>
  <tr>
    <td height="13"></td>
    <td><div align="center" class="style18">
      <p class="style40">&nbsp;</p>
    </div></td>
    <td></td>
  </tr>
</table>
</body>
</html>
<%
rs.Close();
%>
<%
var on = "0";
if (String(Request("open")) != "undefined" && 
    String(Request("open")) != "") { 
  on= String(Request("open"));
}
var out = "0";
if (String(Request("close")) != "undefined" && 
    String(Request("close")) != "") { 
  out= String(Request("close"));
}
var p = "0";
if (String(Request("xz")) != "undefined" && 
    String(Request("xz")) != "") { 
 p = String(Request("xz"));
}
if(out=="关闭"&&p==0&&on==0)
  {Response.Write("<script language='javascript'>window.alert('录入已关闭');history.go(-1);</script>");
   Response.End();}
if(on=="打开"&&p==1&&out==0)
 {Response.Write("<script language='javascript'>window.alert('录入已打开');history.go(-1)</script>");
  Response.End();}
if(on=="打开"&&p==0&&out==0)
{
var cmd = Server.CreateObject("ADODB.Command");
cmd.ActiveConnection = MM_conn1_STRING;
cmd.CommandText = "UPDATE admin  SET power ='1' WHERE power ='0'";
cmd.CommandType = 1;
cmd.CommandTimeout = 0;
cmd.Prepared = true;
cmd.Execute();
Response.Redirect("power.asp")
Response.End();
}
if(out=="关闭"&&p==1&&on==0)
{
var cmd = Server.CreateObject("ADODB.Command");
cmd.ActiveConnection = MM_conn1_STRING;
cmd.CommandText = "UPDATE admin  SET power ='0' WHERE power ='1'";
cmd.CommandType = 1;
cmd.CommandTimeout = 0;
cmd.Prepared = true;
cmd.Execute();
Response.Redirect("power.asp")
Response.End();
}
%>

⌨️ 快捷键说明

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