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

📄 lxyy_list.asp

📁 OFFICE办公自动化
💻 ASP
字号:
<%
'功能:自定义离线原因
'作者:展亮
'日期:2004-5-23 23:28
'参数:	request.form("subed")="true"#表单提交; request("id")#要编辑记录的ID;
%>

<!--#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
pid=request("id") '记录ID
'------------------------------------------------
'------------------------------------------------修改记录
table="tbioaLxyy" '表名
if request.form("subed")="add" then 
'表单提交后

	'接受录入参数
	input_LXYY=Request.Form("input_LXYY")'离线原因


	'添加时使用的字段
	field1=array("UserID","LXYY")
	value1=array(LoginID,input_LXYY)
	
	for i=0 to ubound(field1)
		value1(i)=replace(value1(i),"'","''")
	next
	sql = "INSERT INTO " & table & " (" & Join(field1, ",") & ") VALUES ('" & Join(value1, "','") & "')"
	oConn.Execute sql
end if

if request.form("subed")="修改" then 
'表单提交后

	'接受录入参数
	input_LXYY=Request.Form("input_LXYY")'离线原因


	'添加时使用的字段
	field1=array("LXYY")
	value1=array(input_LXYY)
	
	sql="UPDATE " & table & " SET "
	for i=0 to ubound(field1)
		sql = sql & field1(i) & "='" & replace(value1(i),"'","''") & "'" 
		if i <> ubound(field1) then sql=sql & ","  else  sql=sql & " where id='" & pid & "'" 
	next
	oConn.Execute sql
end if

if request.form("subed")="删除" then 
'表单提交后
	'接受录入参数
	oConn.Execute "DELETE FROM " & table & " WHERE id='" & pid & "'" 
end if

set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from " & table & " where UserID="&LoginID
rs.open sql,oConn,1,1
'------------------------------------------------
%>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>自定义离线原因</title>
<script src="../js/Popup.js"></script>
<script src="../js/front_chec.js"></script>
<script src="../js/user_select.js"></script>
<script language="JavaScript">
<!--
 function require(form){
	return	checnull(form.input_LXYY,"请填写离线原因!")&&
	1==1;
 }
-->
</script>
</head>
<body topmargin="10" leftmargin="10">

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

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

<%=SearchScrip(Search)%>
<div align="center">
<table width="300" cellspacing="1" cellpadding="4" class="tab">
  <tr>
    <td width="100%" class="tdBottom" valign="top">
      <table width="100%" cellspacing="1" cellpadding="2" class="tab">
        <tr> 
          <td width="100%" class="tdTop">
	    <table border="0" width="100%" cellspacing="0" cellpadding="0">
	      <tr>
	        <td class="tdTop2">
	          <img border="0" src="../images/icon_title.gif" align="left">自定义离线原因
	        </td>
	        <td width="60" class="tdTop2">
	        </td>
	      </tr>
	    </table>
          </td>
        </tr>
        <tr> 
          <td class="td1">
              <table border="0" width="100%" cellspacing="1" cellpadding="2" class="tab">
                <tr class="td1"> 
                <form name="eventfrm" method="POST" action="?id=<%=pid%>" onSubmit="return require(this)">
                <input type=hidden name="subed" value="add">
                <input type=hidden name="id" value="<%=nextnumber%>">
                  <td nowrap colspan="6">
                   离线原因:<INPUT type=text size=28 name=input_LXYY maxlength="100" class=input>
                   <input type="submit" value="增加" name="B1" class="button0" onmouseout=className="button0" onmouseover=className="button1">
                  </td>
                </form>
                </tr>
                <tr> 
                  <td class="tdtop" nowrap>离线原因</td>
                  <td class="tdtop" colspan="2" width=80 nowrap>操作</td>
                </tr>
                <%while not rs.eof%>
	        <tr> 
	        <form name="eventfrm" method="POST" action="?id=<%=rs("id")%>" onSubmit="return require(this)">
	          <td nowrap class="td2">
	            <input type="text" size=35 value="<%=htmlout(rs("LXYY"))%>" maxlength="100" name="input_LXYY" class="button0" onmouseout=className="button0" onmouseover=className="button1">
	          </td>
	          <td nowrap class="td2">
		      <input type="submit" value="修改" name="subed" class="button0" onmouseout=className="button0" onmouseover=className="button1">
		  </td>
		  <td nowrap class="td2">
		      <input type="submit" value="删除" name="subed" class="button0" onmouseout=className="button0" onmouseover=className="button1" onClick="return confirm('确定要删除吗?\n该操作不可恢复!')">
	          </td>
                </form>
	        </tr>
                <%
                  rs.movenext
                wend
                %>
              </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</div>
</body>

</html>

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

⌨️ 快捷键说明

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