?? outline_alert.asp
字號:
<%
'OA 表單生成器1.0
'功能:離線設(shè)置
%>
<%
If Session("LoginOk")<>true or Session("LoginID")="" then
response.write "<script>parent.window.close()</script>"
response.end
end if
%>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<%
'response.buffer=false
'------------------------------------------------設(shè)置參數(shù)
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '當(dāng)前用戶ID
'------------------------------------------------
'------------------------------------------------修改記錄
table="tbioaOutline" '表名
if request.form("addedit_subed")="true" then
'表單提交后
input_lxyy=Request.Form("input_lxyy")'離線原因
input_yjhlsj=Request.Form("input_yjhlsj")'預(yù)計回來時間
input_lxsm=Request.Form("input_lxsm")'離線說明
input_lxfs=Request.Form("input_lxfs")'聯(lián)系方式
input_alertmod=Request.Form("input_alertmod")'退出時提示我
'編輯時使用的字段
field1=array("lxyy","yjhlsj","lxsm","lxfs","alertmod")
value1=array(input_lxyy,input_yjhlsj,input_lxsm,input_lxfs,input_alertmod)
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 UserID=" & LoginID
next
oConn.Execute sql
response.write "<script>parent.window.close()</script>"
end if
'--------------------------------------------取記錄
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from " & table & " where UserID="&LoginID
rs.open sql,oConn,3,2
if rs.EOF then
rs.AddNew
rs("UserID")=LoginID
rs.Update
rs.close
rs.open sql,oConn,1,1
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>離線設(shè)置</title>
<script src="../js/Popup.js"></script>
<script src="../js/front_chec.js"></script>
<script language="JavaScript">
<!--
function require(form){
return checnull(form.input_yjhlsj,"請?zhí)顚戭A(yù)計回來時間!")&&
1==1;
}
-->
</script>
</head>
<body topmargin="0" leftmargin="0" class="tdbottom">
<div align="center">
<table width="400" cellspacing="1" cellpadding="2" class="tab">
<tr>
<form name="eventfrm" method="POST" action="" enctype="POST" onSubmit="return require(this)">
<td width="25%" class="td1">
<input type=hidden name="addedit_subed" value="true">
<table border="0" width="100%" cellspacing="2" cellpadding="0">
<tr>
<td width="100" align="right" valign="top" nowrap>離線原因:</td>
<td width="300" nowrap>
<select name=input_lxyy>
<option value='外出' <%if rs("lxyy")="外出" then response.write "selected"%>>外出</option>
<option value='出差' <%if rs("lxyy")="出差" then response.write "selected"%>>出差</option>
<option value='臨時有事' <%if rs("lxyy")="臨時有事" then response.write "selected"%>>臨時有事</option>
<option value='一會兒就回來' <%if rs("lxyy")="一會兒就回來" then response.write "selected"%>>一會兒就回來</option>
<option value='正在用餐' <%if rs("lxyy")="正在用餐" then response.write "selected"%>>正在用餐</option>
<%
set rs1=server.CreateObject("ADODB.recordset")
rs1.Open "Select * from tbioaLXYY Where UserID=" & LoginID,oConn,1,1
do while not rs1.EOF
%>
<option value='<%=HtmlOut(rs1("lxyy"))%>' <%if rs("lxyy")=rs1("lxyy") then response.write "selected"%>><%=HtmlOut(rs1("lxyy"))%></option>
<%
rs1.MoveNext
loop
rs1.Close
set rs1=nothing
%>
</select>
<font COLOR="RED">*</font>
</td>
</tr>
<tr>
<td width="100" align="right" valign="top" nowrap>預(yù)計回來時間:</td>
<td width="300" nowrap><input type='text' name=input_yjhlsj class=input value='<%=Server.HTMLEncode(rs("yjhlsj"))%>' maxlength="50"> <font COLOR="RED">*</font>
</td>
</tr>
<tr>
<td width="100" align="right" valign="top" nowrap>離線說明:</td>
<td width="300" nowrap><textarea name="input_lxsm" rows="3" cols="39" class="textarea"><%=Server.HTMLEncode(rs("lxsm"))%></textarea>
</td>
</tr>
<tr>
<td width="100" align="right" valign="top" nowrap>聯(lián)系方式:</td>
<td width="300" nowrap><textarea name="input_lxfs" rows="3" cols="39" class="textarea"><%=Server.HTMLEncode(rs("lxfs"))%></textarea>
</td>
</tr>
<tr>
<td width="100" align="right" valign="top" nowrap>退出時提示我:</td>
<td width="300" nowrap> <input type="checkbox" name="input_alertmod" value="1" <%if rs("alertmod")="1" then response.write "checked"%>>
</td>
</tr>
<tr>
<td width="100%" colspan="2" align="center">
<input type="submit" value="確定" name="B1" class="button0" onmouseout=className="button0" onmouseover=className="button1"> <input type="reset" value="關(guān)閉" onclick="parent.window.close()" name="B2" class="button0" onmouseout=className="button0" onmouseover=className="button1">
</td>
</tr>
</table>
</td>
</form>
</tr>
<tr>
<td width="25%" class="tdBottom">
</td>
</tr>
</table>
</div>
</body>
</html>
<%'釋放對象變量
rs.close
oConn.close
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -