📄 edit.asp
字号:
<% option explicit%>
<!-- #include virtual="Include/DataEnvi.asp" -->
<!-- #include virtual="Include/Page.asp" -->
<!-- #include virtual="Include/SelectValue.asp" -->
<!-- #include virtual="Include/GetRoleIDs.asp" -->
<%
Dim ObjDB
Dim C,i,AccountID
Dim IntID,StrSelectRole
Dim ObjRS,StrSQL
Dim BegDate,FinDate
Dim BegHour,BegMinute
Dim FinHour,FinMinute
IntID = Request.QueryString("ID")
If IntID ="" Then IntID = 1
Set ObjDB = Server.CreateObject("ADODB.Connection")
OpenDB ObjDB
Set C = Server.CreateObject ("CMS2003.DBhandle")
C.Init(ObjDB)
If Request.Form.Count > 0 Then
Call C.Edit(IntID,"_","t_OA_Work_Source_Record")
Response.Redirect "List.asp?SourceID=" & Request.QueryString("SourceID")
End If
StrSQL="Select * From t_OA_Work_Source_Record Where ID = " & IntID
Set ObjRS = C.View(StrSQL)
BegDate = ObjRS("BegDate")
FinDate = ObjRS("FinDate")
BegHour = ObjRS("BegHour")
BegMinute = ObjRS("BegMinute")
FinHour = ObjRS("FinHour")
FinMinute = ObjRS("FinMinute")
AccountID = ObjRS("AccountID")
StrSelectRole = SelectValue(ObjDB,"Select AccountID,TrueName from t_OA_SYS_Account_Character")
ObjDB.Close
Set ObjDB = Nothing
if not CheckRole(1) AND not CheckRole(22) AND (AccountID <> Session("AccountID")) then
%>
<script language=javascript>
alert("您无此权限!");
window.close();
</script>
<%
end if
Sub Main
%>
<style>
select{font-size:12px}
</style>
<script language=javascript>
function CheckDate()
{
var theForm = document.forms[0]
theForm._BegDate.value = theForm.Y1.value + "-" + theForm.M1.value + "-" + theForm.D1.value
theForm._FinDate.value = theForm.Y2.value + "-" + theForm.M2.value + "-" + theForm.D2.value
}
</script>
<form action="" method="post" onsubmit="CheckDate();return(CheckForm(this))" id=form1 name=form1>
<table class=Ltable cellspacing=1 cellpadding=3>
<tr class=LHtr>
<td width="15%">预定资源</td>
<td width="85%"> </td>
</tr>
<tr class=Ltr>
<td>开始时间</td>
<td>
<select name=Y1>
<%For i = year(date) - 1 To year(date) + 1%>
<option <%If i=YEAR(BegDate) Then Response.Write "selected"%> value="<%=I%>"><%=I%></option>
<%
NEXT
%>
</select>年<select name=M1>
<%
For i = 1 To 12
%>
<option <%If i=Month(BegDate) Then Response.Write "selected"%> value="<%=i%>" ><%=i%></option>
<%
Next
%>
</select>月<select name=D1>
<%
For i = 1 To 31
%>
<option <%If i=Day(BegDate) Then Response.Write "selected"%> value="<%=i%>" ><%=i%></option>
<%
Next
%>
</select>日
<input type="hidden" class=Input3 name="_BegDate" value="<%=Date()%>">
<Select class=Select Check=1 Show="小时" Name=_BegHour>
<%
For i = 0 to 23
%>
<option <%If i=Hour(Now) Then Response.Write "selected"%> Value=<%=i%>><%If i<10 Then Response.Write "0"%><%=i%></option>
<%
Next
%></select>:<Select class=Select Check=1 Show="分钟" Name=_BegMinute>
<%For i = 0 to 59
%><option Value=<%=i%>><%If i<10 Then Response.Write "0"%><%=i%>
<%next%></select></td>
</tr>
<tr class=Ltr>
<td>结束时间</td>
<td>
<select name=Y2>
<%For i = year(date)-1 To year(date)+1%>
<option value="<%=i%>" <%If year(FinDate)=i Then Response.Write "Selected"%>><%=i%></option>
<%Next%>
</select>年<select name=M2>
<%
For i = 1 To 12
%>
<option <%If i=Month(FinDate) Then Response.Write "selected"%> value="<%=i%>" ><%=i%></option>
<%
Next
%>
</select>月<select name=D2>
<%
For i = 1 To 31
%>
<option <%If i=Day(FinDate) Then Response.Write "selected"%> value="<%=i%>" ><%=i%></option>
<%
Next
%>
</select>日
<input type="hidden" name="_FinDate" value="<%=Date()%>">
<Select class=Select Check=1 Show="小时" Name=_FinHour>
<%For i = 0 to 23
%><option <%If i=Hour(Now) Then Response.Write "selected"%> Value=<%=i%>><%If i<10 Then Response.Write "0"%><%=i%>
<%next%></select>:<Select class=Select Check=1 Show="分钟" Name=_FinMinute>
<%For i = 0 to 59
%><option Value=<%=i%>><%If i<10 Then Response.Write "0"%><%=i%>
<%next%></select></td>
</tr>
<tr class=Ltr>
<td valign=top>预定描述</td>
<td><textarea rows=6 cols=30 class=textarea Check=1 Show="预定描述" name="_Des" ><%=ObjRS("Des")%></textarea></td>
</tr>
<tr class=Ltr>
<td>预定时间</td>
<td><input type="text" class=Input Check=1 Show="预定时间" name="_CreateTime" value="<%=Now()%>"></td>
</tr>
<%
if CheckRole(1) OR CheckRole(22) then
%>
<tr class=Ltr>
<td>批准情况</td>
<td><Input Type=radio name="_IsValid" value="True" <%If ObjRS("IsValid") Then Response.Write "checked"%>>批准 <Input Type=radio name="_IsValid" value="False" <%If Not ObjRS("IsValid") Then Response.Write "checked"%>>未批准</td>
</tr>
<%
end if
%>
</table>
<table cellspacing=1 cellpadding=3>
<tr>
<td>
<input type="submit" name="Submit" class=Button value="提 交"><input type="button" class=Button value="取 消" onclick="doList()"id=button1 name=button1><input type=button class=Button value="关闭" onclick="top.close()" id=button2 name=button2></td>
<td></td>
</tr>
</table>
</form>
<%'------------------------------------------------------------------%>
<%End Sub%>
<%'==================================================================%>
<!-- #include file="Templet.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -