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

📄 admin_editchk.asp

📁 体育馆预约系统,大家看看吧,好象没有数据库
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/gym.asp" -->
<!--#include file="inc/is_admin.asp" -->
<!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">
<!--
@import url("style.css");
-->
</style>
</head>

<body>

<div align="center">
  <table width="706" height="281" border="0" class="table_big">
    <tr>
      <td valign="top"><div align="center">
          <!--#include file="inc/admin_head.asp" -->
		  <%
			dim err(4)
			dim ground_id,ground_name,ground_type,cost,haveerr,rs_edit,sql
			'接收表单数据-------------
			ground_id=request.Form("ground_id")
			ground_name=request.Form("name")
			ground_type=request.Form("type")
			cost=request.Form("cost")
			'检查数据--------------------
			if len(ground_name) > 30 then err(1)="场地名称不能超过30个字符"
			if len(ground_name) < 2 then err(1)="场地名称不能少于2个字符"
			if not IsNumeric(cost) then err(2)="费用必须是数字"
			if ground_type="" then err(3)="场地类型不能位为空"
			if len(cost) >4 then err(4)="费用不能多于4位数"
			for i=1 to 4
				if err(i)<>"" then haveerr=1
			next
			'根据haveerr值进行不同操作显示不同结果---------------------
			If haveerr = 0 Then
				'打开场地数据库--------------------
				set rs_edit=server.CreateObject("adodb.recordset")
				sql = "select * from ground where ground_id=" & ground_id
				rs_edit.open sql,gym_conn,3,2
				rs_edit("name")=ground_name
				rs_edit("type")=ground_type
				rs_edit("cost")=cost
				rs_edit.update
		  %>
		  <br>
          <table width="421" border="0" class="table_small">
            <tr>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td class="text_title"><div align="left">场地维护成功</div></td>
            </tr>
            <tr>
              <td class="table_title">&nbsp;</td>
            </tr>
            <tr>
              <td class="text"><div align="left">ID为<%= ground_id %>的场地维护后其属性更改为</div></td>
            </tr>
            <tr>
              <td class="text"><div align="left">名称:<%= ground_name %></div></td>
            </tr>
            <tr>
              <td class="text"><div align="left">类型:<%= ground_type %>&nbsp;&nbsp;&nbsp;费用:<%= cost %></div></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
            </tr>
          </table>
          <% Else %>
		  <br>
          <table width="418" border="0" class="table_small">
            <tr>
              <td width="10">&nbsp;</td>
            </tr>
            <tr>
              <td class="text_title"><div align="left">发现以下错误:</div></td>
            </tr>
            <tr>
              <td class="table_title">&nbsp;</td>
            </tr>
            <tr>
              <td class="text_error">
			    <div align="left">
		          <%
			  	for i=1 to 4
					if err(i) <> "" then response.Write("●" & err(i) & "<br>")
			  	next
			  %>			  
              </div></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
            </tr>
          </table>
          <% End If %>
		  <br>
      </div></td>
    </tr>
  </table>
</div>
</body>
</html>

⌨️ 快捷键说明

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