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

📄 sort_add.asp

📁 这是一个物流网站的源代码
💻 ASP
字号:
<!--#include file="../inc/CheckAdmin.asp"-->
<!--#include file="../inc/Config.asp"-->
<!--#include file="../inc/Navtree.asp"-->
<!--#include file="../inc/Conn.asp"-->
<%

types=formatStr(Request("type"))
if types="" then types="1"
if types="1" then
	table="hfrom"
	zid="hf_id"
	ziduan="hf_name"
elseif types="2" then
	table="hto"
	zid="ht_id"
	zpid="ht_pid"
	ziduan="ht_name"
else
	table="harea"
	zid="ha_id"
	ziduan="ha_name"
end if

if request.form("add")=1 then
	names=formatStr(Request("name"))
	set rs = Server.createObject("ADODB.Recordset")
	rs.open"select * from "&table&" where "&ziduan&"='"&names&"'",conn,1,3
	if rs.eof then
		rs.addnew
		if types="2" then rs(zpid)=Trim(Request.Form("sel2"))
		rs(ziduan)=names
		rs.update
	else
		check_alert "已经存在这条记录了!","Sort_admin.asp?type="&types
	end if
	rs.close
	set rs=nothing
	response.Redirect("Sort_add.asp?type="&types)
end if   
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网站管理系统</title>
<link href="../Css_Main.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #CCCCCC}
.STYLE2 {color: #FF0000}
-->
</style>
<script language="JavaScript">
function  Check()
{
if (form.language.value=="")
  {alert ("请选择类别")
      	form.language.focus();
	   return false;
	   }
	 if (form.Name.value == "") 
	 {alert("名称不能为空");
	     form.Name.focus();
		return false;
		}
		document.form.submit();
		}
</script>
</head>
<body>
<table width="98%"  border="0" align="center" cellpadding="0" cellspacing="1" class="border">
  <tr>
    <td class="title_dh"><div align="center">路线管理——添加分类</div></td>
  </tr>
</table>
<form name="form" method="post" action="">
<table width="98%"  border="0" align="center" cellpadding="0" cellspacing="1" class="border">
  <tr class="title_top">
    <td colspan="2"><div align="center">添加分类</div></td>
  </tr>
  <tr class="tdbg">
    <td width="20%">
    <div align="right"><strong>类别:</strong></div></td>
    <td><select name="language" onChange="location.href='?type='+this.options[selectedIndex].value">
	<option value="1" <% If types="1" Then Response.Write(" selected") %>>添加起运站</option>
      <option value="2" <% If types="2" Then Response.Write(" selected") %>>添加目的站</option>  
      <option value="3" <% If types="3" Then Response.Write(" selected") %>>添加区域</option>
</select>
      <input type="hidden" name="add" value=1 id="add">
      <span class="STYLE2">*</span></td>
  </tr>
  <tr class="tdbg" style="display:<% If types<>"2" Then response.Write("none") %>">
    <td><div align="right"><strong>所属区域:</strong></div></td>
    <td><select name="sel2" class="Maxl" id="sel2">
						<option value="">请选择区域</option>
						<%sql="select * from harea order by ha_id"
									set rs1=conn.execute(sql)
									do while not rs1.eof%>
                                      <option value="<%= rs1("ha_id") %>"<% If cstr(rs1("ha_id"))=hfrom Then response.Write(" selected")%>><%= rs1("ha_name") %></option>
									  <%rs1.movenext
									  loop
									  rs1.close
									  set rs1=nothing%>
                        </select></td>
  </tr>
  <tr class="tdbg">
    <td><div align="right"><strong>名称:</strong></div></td>
    <td><input name="Name" type="text" id="Name" size="16">
      <span class="STYLE2">*</span></td>
  </tr>
</table>
<table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="40">
      <div align="center"><span class="style1">
        <input type="button" name="Submit" value="确定" onClick="Check()">
&nbsp;
        <input type="reset" name="reset" value="取消">
    </span> </div></td>
  </tr>
</table>
</form>
</body>
</html>


⌨️ 快捷键说明

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