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

📄 logbook_add.asp

📁 OFFICE办公自动化
💻 ASP
字号:
<%
'功能:增加日志
'参数:request.form("addedit_subed")="true"#表单提交; request("selectdate")="date" #日志日期
%>
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->

<%
'response.buffer=false

'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
selectdate=request("selectdate") : if selectdate="" then selectdate=Date '日志日期
'------------------------------------------------
'------------------------------------------------增加记录
table="tbioaLogbook" '表名
if request.form("addedit_subed")="true" then 
'表单提交后
	AddDate=Request.Form("AddDate")'填写日期
	Body=Request.Form("Body")'内容
	
	' 防止二义性信息逻辑****************
	set rs_test=Server.CreateObject("ADODB.RECORDSET")
	rs_test.Open "select count(*) as counter from " & table & " where AddDate='" & AddDate & "' and UserID=" & LoginID,oConn
	if  rs_test("counter")>0 then
		call Msgout("("&AddDate&")的日志已经填写, 不能添加!","javascript:history.back()",1)
		Response.End
	end if
	rs_test.Close
	'************************************
	
	'添加时使用的字段
	field1=array("UserID","AddDate","Body")
	value1=array(LoginID,AddDate,Body)
	for i=0 to ubound(field1)
		value1(i)=replace(value1(i),"'","''")
	next
	sql = "INSERT INTO " & table & " (" & Join(field1, ",") & ") VALUES ('" & Join(value1, "','") & "')"
	oConn.Execute sql
	
	set rs_id=Server.CreateObject("ADODB.RECORDSET")
	rs_id.Open "SELECT MAX(id) AS id FROM " & table,oConn
	word="<p>日志信息已成功加入!</p><p><img border=0 src=../images/icon_show.gif align=left width=16 height=16><a href=logbook_show.asp?id="&rs_id("id")&">查看该日志</a>"
	rs_id.close
end if
'------------------------------------------------
%>


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>main</title>
<base target="FrmMain">
<script src="../js/Popup.js"></script>
<script src="../js/front_chec.js"></script>
<script language="JavaScript">
<!--
 function require(form){
	return checnull(form.AddDate,"请确定日志填写日期!")&&
	checnull(form.Body,"请填写日志内容!");
 }
-->
</script>
</head>

<body topmargin="10" leftmargin="10">

<!--#include file="logbook_menu.html"-->

<hr width="100%" size=1 color="#000000">
<br>

<div align="center">
<table width="400" cellspacing="1" cellpadding="2" class="tab">
  <tr>
    <td width="100%" class="tdTop">
      <table border="0" width="100%" cellspacing="0" cellpadding="0">
        <tr>
          <td class="tdTop">
            <p align="left"><img border="0" src="../images/icon_title.gif" align="left">填写日志</p>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td width="25%" class="td1">
    
    <% if request.form("addedit_subed")="true" then %>
      <table border="0" width="100%" cellspacing="10" cellpadding="0">
        <tr>
          <td width="36%">
            <p align="right"><img border="0" src="../images/edit.gif" width="32" height="32">
          </td>
          <td width="64%"><p> </p>
            <%=word%>
          </td>
        </tr>
        <tr>
          <td width="100%" colspan="2">
          </td>
        </tr>
      </table> 
    <% else %>
    <form name="eventfrm" method="POST" action="" onSubmit="return require(this)">
      <input type=hidden name="addedit_subed" value="true">
      <table border="0" width="100%" cellspacing="10" cellpadding="0">
        <tr>
          <td width="100%">
            填写日期:
            <input TYPE="TEXT" SIZE="12" MAXLENGTH="12" NAME="AddDate" value="<%=selectdate%>" class="input" readonly> <a href=# title="选择日期" onClick="fPopUpDlg('../js/calendar.htm', document.eventfrm.AddDate, 'winpop', 234, 261);return false"><img src="../images/datetime.gif" border=0></a> <font COLOR="RED">*</font>
          </td>
        </tr>
        <tr>
          <td width="100%">日志内容: <font COLOR="RED">*</font><br>
            <textarea rows="10" name="Body" cols="50" class="textarea"></textarea><br>
          </td>
        </tr>
        <tr>
          <td width="100%">
           <input type="submit" value="确定" name="B1" class="button0" onmouseout=className="button0" onmouseover=className="button1"> <input type="reset" value="全部重写" name="B2" class="button0" onmouseout=className="button0" onmouseover=className="button1">
          </td>
        </tr>
      </table>
    </form>
    <% end if %>
    
    </td>
  </tr>
  <tr>
    <td width="25%" class="tdBottom">
    </td>
  </tr>
</table>
</div>
</body>

</html>

<%'释放对象变量
oConn.close
%> 

⌨️ 快捷键说明

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