📄 plan_edit.asp
字号:
<%
'功能:编辑日程安排
'参数: request.form("addedit_subed")="true"#表单提交; request("id")#要编辑日程的ID;
' request("page")=int #当前页码; 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
currentpage=request("page") : if currentpage="" then currentpage=1 '当前页码
selectdate=request("selectdate") '是否显示所有日程
pid=request("id") '日程ID
'------------------------------------------------
'------------------------------------------------修改记录
table="tbioaPlan" '表名
if request.form("addedit_subed")="true" then
'表单提交后
Title=Request.Form("Title")'标题
StartDate=Request.Form("StartDate")'开始日期
EndDate=Request.Form("EndDate"):if EndDate="" then EndDate=StartDate'结束日期
Importance=Request.Form("Importance")'重要程度
Body=Request.Form("Body")'内容
Remark=Request.Form("Remark")'备注
'编辑时使用的字段
field1=array("Title","StartDate","EndDate","Importance","Body","Remark")
value1=array(Title,StartDate,EndDate,Importance,Body,Remark)
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
word="<p>日程信息修改成功!</p><p><img border=0 src=../images/icon_show.gif align=left width=16 height=16><a href=plan_show.asp?id=" & pid & "&page=" & currentpage & "&selectdate=" & selectdate & ">查看该日程</a>"
else'--------------------------------------------取记录
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from " & table & " where ID="&pid
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>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.Title,"请填写日程标题!")&&
checnull(form.StartDate,"请确定日程起始日期!")&&
checnull(form.Body,"请填写日程内容!");
}
-->
</script>
</head>
<body topmargin="10" leftmargin="10">
<!--#include file="plan_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>
<td width="90" class="tdTop">
<p align="left"><img border="0" src="../images/icon_return.gif" align="left">
<a href="plan_list.asp?page=<%=currentpage%>&selectdate=<%=selectdate%>" class="linkTop">返回列表</a></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="?id=<%=pid%>&page=<%=currentpage%>&selectdate=<%=selectdate%>" 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" name="Title" size="40" value="<%=Server.HTMLEncode(rs("Title"))%>" maxlength="100" class="input"> <font COLOR="RED">*</font>
</td>
</tr>
<tr>
<td width="100%">
起始日期:
<input TYPE="TEXT" SIZE="20" MAXLENGTH="24" NAME="StartDate" value="<%=rs("StartDate")%>" class="input" readonly> <a href=# title="选择日期" onClick="fPopUpDlg('../js/datetime.htm', document.eventfrm.StartDate, 'winpop', 350, 250);return false"><img src="../images/datetime.gif" border=0></a> <font COLOR="RED">*</font>
<br>
结束日期:
<input TYPE="TEXT" SIZE="20" MAXLENGTH="24" NAME="EndDate" value="<%=rs("EndDate")%>" class="input" readonly>
<a href=# title="选择日期" onClick="fPopUpDlg('../js/datetime.htm', document.eventfrm.EndDate, 'winpop', 350, 250);return false"><img src="../images/datetime.gif" border=0></a> 如果不选择,则和"起始日期"一样
</td>
</tr>
<tr>
<td width="100%">重要程度:<input type="radio" value="0" name="Importance" <%if rs("Importance")=0 then response.write "checked"%>>未指定 <input type="radio" value="1" name="Importance" <%if rs("Importance")=1 then response.write "checked"%>>低 <input type="radio" value="2" name="Importance" <%if rs("Importance")=2 then response.write "checked"%>>中 <input type="radio" value="3" name="Importance" <%if rs("Importance")=3 then response.write "checked"%>>高 <font COLOR="RED">*</font>
</td>
</tr>
<tr>
<td width="100%">日程内容: <font COLOR="RED">*</font><br>
<textarea rows="5" name="Body" cols="50" class="textarea"><%=Server.HTMLEncode(rs("Body"))%></textarea><br>
</td>
</tr>
<tr>
<td width="100%">备注:<br>
<textarea rows="5" name="Remark" cols="50" class="textarea"><%=Server.HTMLEncode(rs("Remark"))%></textarea>
</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>
<%
rs.close
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 + -