📄 admin_databasedel.asp
字号:
<!--#include file="Admin_IsLogin.asp" -->
<!--#include file="dataconn.asp"-->
<%
dim checkdel
if request("action")="alldel" then
checkdel=request.form("checkbox")
checkdel=split(checkdel,",")
if ubound(checkdel)=0 then
checkdel1=checkdel(0)
select case checkdel1
case 1
on error resume next
conn.execute("delete from studentpmb")
conn.execute("ALTER TABLE studentpmb ALTER COLUMN id COUNTER (1, 1)")
if err then
response.write "<script>alert('成绩信息库还没有创建,请导入成绩!');location.href=""admin_databasedel.asp"";</Script>"
response.end
else
response.write "<script>alert('成绩信息库清空成功!');location.href=""admin_databasedel.asp"";</Script>"
Response.end
end if
case 2
conn.execute("delete from testmdb")
conn.execute("ALTER TABLE testmdb ALTER COLUMN testid COUNTER (1, 1)")
conn.execute("delete from subjectks")
conn.execute("ALTER TABLE subjectks ALTER COLUMN id COUNTER (1, 1)")
response.write "<script>alert('当前考试名称库清空成功!');location.href=""admin_databasedel.asp"";</Script>"
Response.end
case 3
conn.execute("delete from nj")
conn.execute("ALTER TABLE nj ALTER COLUMN njid COUNTER (1, 1)")
conn.execute("delete from bj")
conn.execute("ALTER TABLE bj ALTER COLUMN bjid COUNTER (1, 1)")
response.write "<script>alert('二级分类库清空成功!');location.href=""admin_databasedel.asp"";</Script>"
Response.end
case 4
conn.execute("delete from tempcj")
set rs=conn.execute("select subjectname from subject")
do while not rs.eof
strsubject=rs("subjectname")
sql="alter table tempcj drop "&strsubject&""
conn.execute(sql)
rs.movenext
loop
set rs=nothing
conn.execute("delete from subject")
conn.execute("ALTER TABLE subject ALTER COLUMN id COUNTER (1, 1)")
response.write "<script>alert('科目库清空成功!');location.href=""admin_databasedel.asp"";</Script>"
Response.end
case 5
conn.execute("delete from term")
conn.execute("ALTER TABLE term ALTER COLUMN tid COUNTER (1, 1)")
response.write "<script>alert('时段库清空成功!');location.href=""admin_databasedel.asp"";</Script>"
Response.end
case 6
on error resume next
conn.execute("drop table studentpmb")
if err then
response.write "<script>alert('临时库还未创建,无须删除!');location.href=""admin_databasedel.asp"";</Script>"
response.end
else
response.write "<script>alert('临时库删除成功!');location.href=""admin_databasedel.asp"";</Script>"
Response.end
end if
end select
else
response.write "<script>alert('对不起,为了安全,请逐条选择进行数据库的清空!!');location.href=""admin_databasedel.asp"";</Script>"
response.end
end if
end if
%>
<HTML>
<HEAD>
<TITLE>数据库管理</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
.STYLE3 {color: #FF0000}
-->
</style>
<SCRIPT language=javascript>
function unselectall()
{
if(document.del.chkAll.checked){
document.del.chkAll.checked = document.del.chkAll.checked&0;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll")
e.checked = form.chkAll.checked;
}
}
function ConfirmDel()
{
if(confirm("确定要删除选中的选项吗?一旦删除将不能恢复!"))
return true;
else
return false;
}
</SCRIPT>
</HEAD>
<BODY bgColor=#FFFFFF topMargin=0 leftmargin="0">
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td> </td>
</tr>
</table>
<div align="center">
<table width="95%" border="1" cellspacing="1" cellpadding="3" style="border-collapse: collapse" bordercolor="#F3F3F3">
<tr>
<td ><table width="96%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td height="22" valign="top" style="FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#3b839f,endColorStr=#eff4ff)"><span class="style1"> </span><span class="topbg STYLE1"><strong>数据库管理</strong></span> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="100%" bgcolor="eff4ff" height="125" align="center"><table border="0" width="96%" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<style type="text/css">
<!--
body {
margin-left: 15px;
margin-top: 15px;
margin-right: 15px;
margin-bottom: 15px;
}
-->
</style></head>
<div align="center">
<form name="del" method="post" action="?action=alldel" onSubmit="return ConfirmDel();">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table001" style="border:1PX SOLID #39867B; ">
<tr class="title">
<td height="47" align="center" valign="middle" class="table003"><b>清 空 数 据 库</b></td>
</tr>
<tr class="tdbg">
<td height="150" align="center" valign="middle"><table width="90%" border="0" cellpadding="3" cellspacing="1">
<tr>
<td height="34" align="right"><input name="checkbox" type="checkbox" id="checkbox" value="1"></td>
<td width="267" height="34">清空成绩库所有记录</td>
<td width="435" height="34"><input name="checkbox" type="checkbox" id="checkbox" value="6">
系统第一次使用前要删除临时库</td>
</tr>
<tr>
<td width="155" height="34" align="right"><input name="checkbox" type="checkbox" id="checkbox" value="2"></td>
<td height="34">清空考试名称库所有记录</td>
<td height="34"> </td>
</tr>
<tr>
<td height="34" align="right"><input name="checkbox" type="checkbox" id="checkbox" value="3"></td>
<td height="34">清空二级分类库所有记录</td>
<td height="34"> </td>
</tr>
<tr>
<td height="34" align="right"><input name="checkbox" type="checkbox" id="checkbox" value="4"></td>
<td height="34">清空科目库所有记录</td>
<td height="34"> </td>
</tr>
<tr>
<td height="34" align="right"><input name="checkbox" type="checkbox" id="checkbox" value="5"></td>
<td height="34">清空时段库所有记录</td>
<td height="34"> </td>
</tr>
<tr>
<td height="34" align="right"> </td>
<td height="34" colspan="2"> <input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">清空以上所有信息库</td>
</tr>
<tr>
<td height="34" align="right"> </td>
<td height="34" colspan="2"><span class="STYLE3">注:清空数据库将带来不可挽回的数据删除!清空前请先备份数据库,慎重操作!</span></td>
</tr>
<tr align="center">
<td height="40" colspan="3"><input name="submit" type=submit value=" 开始清空 "></td>
</tr>
</table></td>
</tr>
</table>
</form>
</div>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -