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

📄 sendticketcity.asp

📁 机票预定系统 各个模块的设计-ticket reservation systems detailed design system modules of the design
💻 ASP
字号:
<!--#include file="function/m_conn.asp"-->
<!--#include file="../../config.asp"-->
<%login_grade=session("login_grade")
admin_Remark_bak=session("Adm_Remark")
    if len(session("login_name"))=0 then
%>
<script language="javascript">
    alert("您没有权限访问,请登陆!")
    window.location="index.asp"
</script>
<%response.end 
elseif instr(login_grade,"4")=0 and admin_Remark_bak<>"super" then
%>
<script language="javascript">
    alert("您的权限不够,不能访问该页面,请登陆!")
//    window.location="index.asp"
window.history.back(-1);
</script>
<%response.end 
    end if
	dim szSQL,oRderStatus
    set oRst=Server.CreateObject("AdoDb.recordset")
    MyAction=request("MyAction")
	MyOp="操作"
if myAction="alter" then
alterBtn=""
myAction1="alter"
mynext="修改"
MyOp="是否默认城市"
alterBtn1="<input type='radio' name='ifChecked' value='"
alterBtn2="' "
alterBtn3=">"
else
alterBtn1="<input type='checkbox' name="
alterBtn2=" value='OFF' "
alterBtn3=">"
alterT1=""
alterT2=""
mynext="删除"
myAction1="del"
end if
	 '--------------------------------------------

	  szSQL="select * from SendTicketCity order by auto desc"
    oRst.Open szSQL,conn,1,3

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>后台管理机票系统</title>
<link rel="stylesheet" type="text/css" href="../../system_manage/style/content_default.css" />
<link rel="stylesheet" type="text/css" href="../../system_manage/style/comm.css" />
<link rel="stylesheet" type="text/css" href="../../system_manage/style/skin0.css" />
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="98%" align="right" valign="top">
	<span id="ADdSendCity" style="display:none">
	<table width="98%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td height="20" colspan="3" valign="middle" class="b-14"><strong>添加送票城市</strong>
         <hr size="1"> </td>
        </tr>
      </table>
	  <script language="javascript">
	  function checkAddCity(){
	if (FrmAddCity.cityname.value==""){
			alert('送票城市不能为空!');
			FrmAddCity.cityname.focus();
			return false;
			}
	  }
	  </script>
      <TABLE width="98%" border=0 cellPadding=0 cellSpacing=1 bgcolor="#999999" id=TABLE1 style="FONT-SIZE: 9pt">
        <form name="FrmAddCity" method="post" action="sendTicketCity.asp" onSubmit="return checkAddCity();">
		<TBODY>
          <TR bgColor=#C3E7F9>
            <TH width="82" height="20">送票城市</TH>
            <TH width="416">
              <input type="text" name="cityname">            </TH>
            <TH width="119">
           <input type="hidden" name="MyAction" value="add">
		      <input type="submit" name="Submit" value="添加">            </TH>
          </TR>    
        </TBODY>
		</form>
      </TABLE>
	<hr size="1"> 
	</span>
	<%
	if MyAction="add" then
		response.write "<script language=Javascript>document.getElementById('ADdSendCity').style.display='';</script>"
	end if
	%>
	
	<table width="98%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td height="25" colspan="3" valign="middle" class="b-14"><a href="#" onClick="javascript:document.getElementById('ADdSendCity').style.display='';" class="back-12">添加城市</a>&nbsp;&nbsp;<span class="manLoftTd"><font color="#FFFFFF" class="back-12"><a href="SendTicketCity.asp?MyAction=del">删除城市</a>&nbsp;&nbsp;<a href="SendTicketCity.asp?MyAction=alter">修改城市</a></font></span></td>
        </tr>
        <tr> 
          <td height="25" colspan="3" valign="middle" class="b-14"><strong>管理送票城市</strong> </td>
        </tr>
		<tr><td height="1" colspan="3" style="height:1px">
		  </td>
		</tr>
        <tr> 
          <td width="84" height="30" align="center" class="editor_dialog_titlebar">序号          </td>
          <td width="418" align="center" class="editor_dialog_titlebar">城市</td>
          <td width="119" align="center" class="editor_dialog_titlebar"><%=MyOp%></td>
        </tr>
      </table>
      <TABLE width="98%" border=0 cellPadding=0 cellSpacing=1 bgcolor="#CCCCCC" id=TABLE1 style="FONT-SIZE: 9pt">
	<form name="FrmMyAction" action="SendTicketCity.asp" method="post">
		  <%
            i=0
			    bc="bgcolor='#eff3f7'"
			while not oRst.eof 			
                i=i+1
            
                if i mod 2=0 then bc="bgcolor='#FFFFFF'"
				myRadio=""
                if oRst("ifChecked")="1" and myAction="alter" then myRadio="checked"
		  %>
          <TR <%=bc%> > 
            <TD width="82" height="25" align=center><%=i%>、</TD>
            <TD width="416" height="25" align=center>
			<%if myAction="alter" then%>
			<input name="myCity<%=i%>" type="text" value="<%=oRst("city")%>" maxlength="30">
			<%else%>
			<%=alterT1&oRst("city")&alterT2%>
			<%end if%>			</TD>
            <TD width="119" height="25" align=center><%=alterBtn1&oRst("auto")&alterBtn2&" "&myRadio&alterBtn3%></TD>
          </TR>
			<%
			oRst.MoveNext
			wend
			%>
          <TR <%=bc%> > 
            <TD height="25" align=center colspan=3>
			<table width="98%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="49%">&nbsp;</td>
                <td width="49%"><div align="right">
                  <input type="submit" name="Submit" value="<%=mynext%>">
				 <input type="hidden" name="MyAction" value="<%=myAction1%>">
                </div></td>
                <td width="2%" height="30">&nbsp;</td>
              </tr>
            </table></TD>
          </TR>
        </TBODY></form>
      </TABLE>
   </td>
  </tr>
</table>
</body>
</html>
<%
if Request.ServerVariables("REQUEST_METHOD")="POST"  then
	if request.form("Myaction")="del" then
		dim n
		if oRst.eof then	
		oRst.movefirst
		end if
	   do while not oRst.eof
	   n=trim(cstr(oRst("Auto")))

	        if request.form(n)="OFF" then
	         oRst.delete
	         oRst.update
	      end if
	   oRst.movenext
	   loop
	   response.redirect "sendticketcity.asp" 
	elseif request.form("Myaction")="alter" then

		if oRst.eof then	
		oRst.movefirst
		end if
		i=1
	   do while not oRst.eof
			 n=trim(cstr(oRst("Auto")))
			 myTemp="myCity"&i
			 myTempCity=request.form(myTemp)
	         myTempChecked=Clng(request.form("ifChecked"))

			 if oRst("Auto")=myTempChecked then 
			 oRst("ifChecked")="1"
			 else
			 oRst("ifChecked")="0"
			 end if
			oRst("city")=myTempCity
	         oRst.update
			i=i+1
			oRst.movenext
	   loop
	   response.redirect "sendticketcity.asp?myAction=alter" 

  elseif request.form("Myaction")="add" then  
	mycity=request.form("cityname")
	conn.execute "insert into SendTicketCity(city) values ('"&mycity&"')"
	response.redirect "sendticketcity.asp?myAction=add" 
  end if
end if

oRst.close
set oRst=nothing
call conn_close()
%>

⌨️ 快捷键说明

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