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

📄 adminsave.asp

📁 网佳网络办公系统(以下简称OA)是一套基于B/S模式的无纸化办公系统。[显著特点:无须安装客户端] 主要功能模块:管理 公文 车辆 通知 档案 值班 人事 审批 仓库 主界面 软件下载 个人办公室
💻 ASP
字号:
<%
  	if session("admin")="" then
  		response.redirect "admin.asp"
  	end if
%>
<!--#include file="conn.asp"-->
<!--#include file="char.asp"-->
<%
	dim rs,sql
	dim title
	dim content
	dim articleid
	dim classid,Nclassid
	dim Nkey
	dim writer
	dim writefrom
	dim errmsg
	dim founderr
	dim baomi
	dim wendang
	founerr=false
	if trim(request.form("txttitle"))="" then
  		founderr=true
  		errmsg="<li>文章名不能为空</li>"
	end if
	if trim(request.form("txtcontent"))="" then
  		founderr=true
  		errmsg=errmsg+"<li>文章内容不能为空</li>"
	end if
	if trim(request.form("key"))="" then
  		founderr=true
  		errmsg=errmsg+"<li>请输入文章关键字</li>"
	end if
		if trim(request.form("wendang"))="" then
  		founderr=true
  		errmsg=errmsg+"<li>下载地址非空,如果没有请填写无</li>"
	end if
	if founderr=false then
		title=htmlencode(request.form("txttitle"))
		Nkey=htmlencode(trim(request.form("key")))
		classid=request.form("classid")
		Nclassid=request.form("Nclassid")
        baomi=request.form("baomi")
        wendang=request.form("wendang")
		if request("htmlable")="yes" then
		content=htmlencode2(request("txtcontent"))
		else
		content=ubbcode(request.form("txtcontent"))
		end if

	set rs=server.createobject("adodb.recordset")
	if request("action")="add" then
		call newsoft()
	elseif request("action")="edit" then
		call editsoft()
	else
		founderr=true
		errmsg=errmsg+"<li>没有选定参数</li>"
	end if
sub newsoft()
	sql="select * from article where (articleid is null)" 
	rs.open sql,conn,1,3
	rs.addnew
	rs("title")=title
	rs("content")=content
	rs("classid")=classid
	rs("Nclassid")=Nclassid
	rs("Nkey")=Nkey
	rs("hits")=0
	rs("baomi")=baomi
	rs("wendang")=wendang
	if request.form("writer")<>"" then
		rs("writer")=trim(request.form("writer"))
	end if
	if request.form("writefrom")<>"" then
		rs("writefrom")=trim(request.form("writefrom"))
	end if
	rs("dateandtime")=date()
	rs.update
	articleid=rs("articleid")
end sub
sub editsoft()
	sql="select * from article where articleid="&request("id")
	rs.open sql,conn,1,3
	rs("title")=title
	rs("content")=content
	rs("Nclassid")=Nclassid
	rs("classid")=classid
	rs("Nkey")=Nkey
	rs("baomi")=baomi
	rs("wendang")=wendang
	if request.form("writer")<>"" then
		rs("writer")=trim(request.form("writer"))
	end if
	if request.form("writefrom")<>"" then
		rs("writefrom")=trim(request.form("writefrom"))
	end if
	rs.update
	articleid=rs("articleid")
end sub

	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
%>
<html>

<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">

</head>

<body>
<div align="center"><center>
<br><br>
<table width="50%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
  <tr>
    <td width="100%" bgcolor="#000080" height="20" bordercolor="#000080"><p align="center"><font color="#FFFFFF"><b>
<%if request("action")=add then%>添加<%else%>修改<%end if%>文件成功</b></font></td>
  </tr>
  <tr>
    <td width="100%" bordercolor="#000080"><p align="left"><br>
        文件序号为:<%response.write "article"&articleid%><br>
        文件标题为:<%response.write title%></p>
    您可以进行其他操作
    </td>
  </tr>
</table>
</center></div>
<%
else
 response.write "由于以下的原因不能保存数据:"
 response.write errmsg
end if
%>

</body>
</html>

⌨️ 快捷键说明

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