admin_expertdelaffirm.asp

来自「医院专家挂号系统设计」· ASP 代码 · 共 107 行

ASP
107
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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>
<link href="../Style.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--#include file="../Inc/adovbs.asp"-->
<!--#include file="Inc/Conn.asp"-->
<!--#include file="Inc/Admin_Check.asp"-->
<!--#include file="../inc/SQLCHK.asp"-->
<%
If Request.QueryString("ID")<>"" Then
	Dim IDToDel
	IDToDel = Request.QueryString("ID")
	If IDToDel<>"" And IsNumeric(IDToDel) Then
		Dim RS
    Set RS=Server.CreateObject("ADODB.RecordSet")
    RS.ActiveConnection=Conn
		RS.Source = "Select * From [EXPERT] Where ID="&IDToDel
    RS.CursorType = adOpenKeyset
    RS.CursorLocation = adUseServer
    RS.LockType = adLockOptimistic
    RS.Open
		If RS.EOF OR RS.BOF Then
			Response.write "<script language='javascript'>" &Chr(13)
			Response.write "alert('ID号不存在!');" &Chr(13)
			Response.write "javascript:history.go(-1);"&Chr(13)
			Response.write "</script>" &Chr(13)
    	Response.End 
		Else
			'判断是否还有预约
			Dim RegCount1, RegCount2 
			Set RegCount1 = Conn.Execute("Select Count(*) From [Registration] Where ExpertID="&IDToDel)
			'如果没有记录了
			If RegCount1.EOF OR RegCount1.BOF Then
				RS.Delete
				RS.Update
				Response.write "<script language='javascript'>" &Chr(13)
				Response.write "alert('删除成功!');" &Chr(13)
				Response.write "location = 'Admin_Expert.asp'"&Chr(13)
				Response.write "</script>" &Chr(13)
    		Response.End
			'如果还有记录! 
			Else
				Set RegCount2 = Conn.Execute("Select Count(*) From [Registration] Where ExpertID="&IDToDel&" And DiagDate<=#"&Date()&"#")
%>
<!--#include file="Inc/Head.asp"-->
<table width="772" height="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td width="11" background="../Image/LeftMargin.gif"></td>
    <td width="750" height="400" align="center" valign="top" background="../Image/BGBlock.gif"><br>
<!--/////////////////////////////////////////////////////////////////////////////////////////////-->
		<form name="Form_DelAffirm" method="post" action="Admin_ExpertDel.asp">
			<input name="IDToDel" type="hidden" value="<%=IDToDel%>">
			<table width="700" border="0" cellspacing="0" cellpadding="0" align="center" class="TableInfo">
  			<tr>
    			<td height="50" align="center" class="TextTitle">删除信息确认</td>
  			</tr>
				<tr>
					<td><hr width="96%" color="#BBBBBB" size="1"></td>
				</tr>
				<tr>
					<td height="50" align="center" class="TextBorder">您要删除的专家姓名为:<span class="Text1"><%=RS("Name")%></span>,其预约总数为:<span class="Text1"><%=RegCount1(0)%></span>,其中过期预约数为:<span class="Text1"><%=RegCount2(0)%></span></td>
				</tr>
				<tr>
					<td height="50" align="center" class="Text1">注意!如果继续,将会删除该专家和其全部预约记录。</td>
				</tr>
				<tr>
					<td height="50" align="center" class="Text1">推荐您先中止该专家的工作计划,等预约全部过期后再进行删除。</td>
				</tr>
				<tr>
					<td height="100" align="center"><input class="Input" type="submit" value="已 经 确 认 继 续 删 除"></td>
				</tr>
			</table>
			</form> 
<!--/////////////////////////////////////////////////////////////////////////////////////////////-->
		</td>
		<td width="11" background="../Image/RightMargin.gif"></td>
  </tr>
</table>
<!--#include file="Inc/Trail.asp"-->
</body>
</html>
<%
				RegCount1.Close
				RegCount2.Close
				RS.Close
			End If
		End If
	Else
		Response.write "<script language='javascript'>" &Chr(13)
		Response.write "alert('ID错误!');" &Chr(13)
		Response.write "javascript:history.go(-1);"&Chr(13)
		Response.write "</script>" &Chr(13)
   	Response.End 
	End If
Else
	Response.write "<script language='javascript'>" &Chr(13)
	Response.write "alert('没有指定ID号!');" &Chr(13)
	Response.write "javascript:history.go(-1);"&Chr(13)
	Response.write "</script>" &Chr(13)
  Response.End 
End If
%>

⌨️ 快捷键说明

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