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

📄 admin_modify.asp

📁 公交车查询系统
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<% option explicit %>
<!--#include file="admin_check.asp"-->
<!--#include file="function.asp"-->
<%
dim busInfo,i
busInfo=getInfoByBusid(request("modifyID"))
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>增加车次</title>
<style type="text/css">
body,tr,td {
	font-family: 宋体;
	font-size: 13px
}
img{CURSOR: hand;}
</style>
<script language="JavaScript">
function addItem(){
	var t2=document.form1.text2;
	var t3=document.form1.text3;
	var flag=false;
	if (t2.value != ""){
		for (i=0;i<t3.length;i++){
			if (t2.value==t3.options[i].text){
				flag=true;
				break;
			}
		} 
		if (flag){
			alert("添加的站点名称已经存在");
		}else{
			t3[t3.length++].text=t2.value;
		}
		t2.value="";
		t2.focus();
	}
}
function delItem(){
	var t3=document.form1.text3;
	if (t3.selectedIndex >= 0){
		t3.remove(t3.selectedIndex++);
	}
}
function selectAllItem(){
	var t3=document.form1.text3;
	for (i=0;i<t3.length;i++){
		t3.options[i].selected=true;
	}
}
function keyDown(){
	//alert(window.event.keyCode);
	if(window.event.keyCode==13){
		addItem();
	}
}
function doCheck(){
	var f=document.form1;
	if (f.text1.value==""){
		alert("请填写车次!");
		f.text1.focus();
	}else if(f.text3.length < 2){ //至少要填写两个站点
		alert("至少要输入两个站点");
		f.text2.focus();
	}else{
		f.text1.disabled=false;
		selectAllItem();
		f.submit();
	}
}
</script>
</head>

<body bgcolor="#E8F3FF" leftmargin="0" topmargin="0">
<form action="admin_save.asp" method="post" name="form1">
<table width="100%" height="100%" border="0" bgcolor="#003399" cellpadding="3" cellspacing="1" align="center">
  <tr> 
    <td height="20" background="images/topbg.gif"></td>
  </tr>
  <tr bgcolor="#7DA4EC"> 
    <td><strong><font color="#FFFFFF">增加车次--管理员</font></strong></td>
  </tr>
  <tr bgcolor="#E8F3FF"> 
    <td><div align="left" style="font-size:20px"><strong><font color="#000099">步骤①</font></strong></div></td>
  </tr>
    <tr bgcolor="#E8F3FF"> 
      <td>请输入车次
        <input name="text1" type="text" id="text1" disabled value="<%=busInfo(0)%>"></td>
  </tr>
  <tr bgcolor="#E8F3FF"> 
    <td><div align="left" style="font-size:20px"><strong><font color="#000099">步骤②</font></strong></div></td>
  </tr>
    <tr bgcolor="#E8F3FF"> 
      <td><p>请依次在输入站点名称,添加到站点列表(<font color="#FF0000">*</font>站名不能包含以下字符:<font color="#FF0000">; 
          | 空格</font>)<br>
          添加:在左侧输入站名,然后按添加按扭,或者直接敲回车,也会添加到站点列表<br>
          移除:在右侧选中相应的站名,然后点移除按扭</p>
        <table width="442" border="1" cellspacing="0" cellpadding="0">
          <tr>
            <td width="123" align="center">站点名称<br>
			<input type="hidden" name="modifyID" value="<%=busInfo(0)%>">
              <input name="text2" type="text" id="text2" style="width:130px" onKeyDown="keyDown()"></td>
            <td width="116" align="center">
<p>
                <input type="button" name="button1" value="添  加 &gt;&gt;" onClick="addItem()">
              </p>
              <p>
                <input type="button" name="button2" value="&lt;&lt; 移  除" onClick="delItem()">
              </p></td>
            <td width="203"><select name="text3" multiple id="text3" style="width:200px;height:220px;">
				<%
				for i=3 to ubound(busInfo)
					response.Write("<option>"& busInfo(i) &"</option>")
				next
				%>
              </select>
              </td>
          </tr>
        </table></td>
  </tr>
  <tr bgcolor="#E8F3FF"> 
      <td height="20"><table width="441" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="376"><div align="center">
                <input type="button" name="Submit" value="保存车次修改" onClick="doCheck()">
              </div></td>
          </tr>
        </table> </td>
  </tr>
  <tr bgcolor="#E8F3FF"> 
    <td>&nbsp; </td>
  </tr>
  <tr>
    <td height="20" background="images/bottombg.gif"></td>
  </tr>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

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