downinfoedit.asp

来自「ASP编写的一个公司网站的源程序」· ASP 代码 · 共 161 行

ASP
161
字号
<%@ Language=VBScript %>
<%

Response.Buffer = True


%>
<!--#include virtual="/Include/IncSelectConst.asp"-->
<!--#include virtual="/Include/DBConn.asp"-->
<!--#include virtual="/Include/ChkSession.asp"-->
<!--#include virtual="/Include/FuncPub.asp"-->
<!--#include file="Function.asp"-->
<html>
<head>
<title>EditUsers</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content=" ">
<meta name="keywords" content=" ">

<link rel="stylesheet" href="../Css/css.css" type="text/css">

<script language="Javascript" src="/JS/CheckInput.js"></script>

</head>
<script language="javascript">
	function formCheck() {
	  if (document.frmUsers.Type_ID.value=="") {
	    alert("请选择类别");
	    document.frmUsers.Type_ID.focus();
	    return false;
	  }
	  if (document.frmUsers.down_title.value=="") {
	    alert("请填写下载标题");
	    document.frmUsers.down_title.focus();
	    return false;
	  }
	  if (document.frmUsers.down_path2.value=="") {
	    alert("请输入上传文件路径");
	    document.frmUsers.down_path2.focus();
	    return false;
	  }
	  if (IsInteger(document.frmUsers.Orderline.value,'+')==false) {
	    alert("排序要是大于零整数");
	    document.frmUsers.Orderline.focus();
	    return false;
	  }
	   return true;
	   }
</script>	
<!--#include file="Menu.asp"-->
<!------------------------->
<!--修改Users<-->
<!--注意事项<-->

<!-- 以下内容由程序自动生成 -->

<%
Dim down_ID,type_ID
	down_ID = ModifyInput(trim(Request("down_ID")))
	type_ID = ModifyInput(trim(Request("type_ID")))
Dim rs,StrSQL
Set rs = Server.CreateObject("Adodb.Recordset")	
IF Request.Form<>"" then
	Dim down_title,down_path1,down_path2,down_path,down_content,state
	down_title = ModifyInput(trim(Request.Form("down_title")))
	down_path1 = ModifyInput(trim(Request.Form("down_path1")))
	down_path2 = ModifyInput(trim(Request.Form("down_path2")))
	down_path = down_path2
    down_content = ModifyInput(Request.Form("down_content"))
    state = ModifyInput(Request.Form("state"))
    orderline = ModifyInput(Request.Form("orderline"))
	'On Error Resume Next

       CheckInput
    rs.CursorLocation=3
    StrSQL = "Select * From DownInfo Where down_ID="&down_ID&"" 
    rs.Open StrSQL,conn,1,3 
		rs("Type_ID") = Type_ID
		rs("down_title") = down_title
		rs("down_path") = down_path
		rs("down_content") = down_content
		rs("state") = state
		rs("orderline") = Orderline
    rs.Update
    rs.Close
    If Err.number<>0 then
		Call MsgBack("数据库操作错误!","4")
    Else
		Response.Redirect "DownInfoManage.asp"
    End IF 
    Set rs = Nothing
    
    
    Sub CheckInput
	StrSQL="select count(*) as cou from DownInfo where Type_ID="&Type_ID&" and down_title='"&down_title&"' and down_ID<>"&down_ID&""
	Rs.open StrSQL,conn,1,3 
	If Rs("cou")<>0 then
		Rs.close 
		Call MsgBack("下载标题重复!","4")
		exit Sub
	End If
	Rs.Close
	End Sub
 End IF
 
%>
<%
StrSQL = "Select * From DownInfo Where down_ID="&down_ID&""
rs.Open StrSQL,conn,1,3
If rs.EOF or rs.BOF then
	Call MsgBack("此记录可能已被删除!","4")
End IF
%>
<form name="frmUsers" method="POST" action="DownInfoEdit.asp"  ID="Form1" onsubmit="return formCheck()">
	<input type="hidden" name="down_ID" value="<%=down_ID%>" ID="Hidden1">
	<table border=0 cellspacing=1 cellpadding=2  class=list width=98% ID="Table1">
	<tr class=header><td colspan=2>添加下载文件</td></tr>
	<tr>
		<td  class=list>类别:</td>
		<td  class=list>
				<SELECT ID="Select1" NAME="Type_ID">
		<option value="">---请选择下载类别---</option>
			<%Call DispdownTypeSel(0,rs("type_ID"))%>
		</SELECT><font color=red>*</font></td>
	</tr>
	<tr>
		<td  class=list>下载标题:</td>
		<td  class=list><input type="text" name="down_title" maxlength=60  size="40"  ID="Text1" value="<%=DeModifyInput(rs("down_title"))%>" ><font color=red>*</font></td>
	</tr>
	<tr>
		<td  class=list>上传文件路径:</td>
		<td  class=list><input type="text" name="down_path1" maxlength=20  size="14"  ID="Text2" value="\Upfiles\Files\" readonly style="color:gray"><input type="text" name="down_path2" maxlength=50  size="24"  ID="Text3" value="<%=rs("down_path")%>">(此路径为ftp的上传路径)<font color=red>*</font></td>
	</tr>
	<tr>
		<td  class=list>下载说明:</td>
		<td  class=list>
		<textarea cols="50" rows="8" name="down_content" ID="Textarea1"><%=DeModifyInput(rs("down_content"))%></textarea></td>
	</tr>
	<tr>
		<td  class=list>排序:</td>
		<td  class=list><input type="text" name="Orderline" maxlength=5 value=<%=rs("Orderline")%> size="3"  ID="Text4"><font color=red>*</font></td>
	</tr>
		<tr>
		<td  class=list>是否开放:</td>
		<td  class=list>是
        <input value=1 name=state type=radio  ID="Radio2" checked>
        &nbsp;&nbsp;&nbsp; 否 
        <input id="Radio7" value=0 name=state type=radio></td>
	</tr>
	</table>
	<p><input type="submit" value="提交" name="btnSubmit" ID=Submit> <input type="reset" value="重写" name="B2" ID=Reset1>
<input type=button name=back value="返回" onclick="window.history.go(-1);" ID="Button1">  	
	</p> 
</form>
<!------------------------->
<%Set rs = Nothing%>

</body>
</html>
<!--#include virtual="/Include/DBClose.asp"-->

⌨️ 快捷键说明

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