?? usercar_add.asp
字號:
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<!--#include file="../inc/ronger.asp"-->
<%
'response.buffer=false
'------------------------------------------------設置參數
LoginID=trim(Session("LoginID")) : if LoginID="" then LoginID=0 '當前用戶ID
'------------------------------------------------
'------------------------------------------------添加/修改記錄
table="tbioaCarBase" '表名
if request.form("addedit_subed")="true" then
'表單提交后
User_ID = LoginID
GetFr_Date = Request.Form("GetFr_Date")
Use_Date = Request.Form("Use_Date")
Use_Depar_ID = ChkInt(Request.Form("Use_Depar_ID"))
Use_Man = Request.Form("Use_Man")
Use_Line = Request.Form("Use_Line")
User_What = Request.Form("User_What")
PartMan_ID = ChkInt(Request.Form("PartMan_ID"))
Stau_IsOK = 0
Response.Write ShowSubmit(Use_Date,"請選擇用車時間!",1,"")
Response.Write ShowSubmit(Use_Man,"請填寫用車聯系人!",1,"")
Field1 = Array("User_ID","GetFr_Date","Use_Date","Use_Depar_ID","Use_Man","Use_Line","User_What","PartMan_ID","Stau_IsOK")
Value1 = Array( User_ID , GetFr_Date , Use_Date , Use_Depar_ID , Use_Man , Use_Line , User_What , PartMan_ID , Stau_IsOK )
For d=0 To UBound(Field1)
Value1(d)=Replace(Value1(d),"'","''")
Next
Sql = "INSERT INTO tbioa_UserCar (" & Join(Field1, ",") & ") VALUES ('" & Join(Value1, "','") & "')"
oConn.Execute Sql
Response.Write ShowSubmit("","用車申請表提交成功!請等待部門審批人審批!",1,"UserCar_List.asp")
end if
Function ChkInt(Str)
If Not(IsNumeric(Str))Then
ChkInt = 0
Else
If Int(Str) < 0 Or Int(Str) > 999999999 Then
ChkInt = 0
Else
ChkInt = Int(Str)
End If
End If
End Function
Function ShowSubmit(VarContent,Msg,Close,Page)
If VarContent = "" Then
If Close = 1 Then
oConn.Close
Set oConn = NoThing
End If
Response.Write CHR(10) & "<SCRIPT LANGUAGE=""JavaScript"">" & CHR(10)
Response.Write "<!--" & CHR(10)
If Page = "" Then
Response.Write "alert('"&Msg&"');history.back();" & CHR(10)
Else
Response.Write "alert('"&Msg&"');location.href='"&Page&"';" & CHR(10)
End If
Response.Write "-->" & CHR(10)
Response.Write "</SCRIPT>" & CHR(10)
Response.End
End If
End Function
%>
<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>
<script src="../js/Popup.js"></script>
<script src="../js/front_chec.js"></script>
<SCRIPT LANGUAGE="JavaScript">
<!--
//function selectmanager(form)
//{
// form.manager.value = showModalDialog("job_selectmanager.asp", "", "dialogWidth:14em; dialogHeight:8em; center: Yes; scroll:No; resizable: No; status: No; help: No;")
//}
//-->
</SCRIPT>
</head>
<body topmargin="10" leftmargin="10">
<!--#include file="UserCar_menu.html"-->
<hr width="100%" size=1 color="#000000">
<br>
<div align="center">
<table width="710" 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="javascript:history.back()" class="linkTop">返回列表</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="25%" class="td1" align="center">
<br>
<strong>用車申請表</strong>
<br><br>
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="tab">
<form name="eventfrm" method="POST" action="?" onSubmit="return checknull(this)">
<input type=hidden name="addedit_subed" value="true">
<tr class="td1">
<td width="27%">申 請 人: <%=Session("RealName")%><INPUT TYPE="hidden" name="User_ID" value="<%=Session("RealName")%>"></td>
<td width="27%">申請時間:<%=Year(now()) & "年" & Right("0"&Month(now()),2) & "月" & Right("0"&Day(now()),2) & "日"%><INPUT TYPE="hidden" name="GetFr_Date" value="<%=Year(now()) & "-" & Right("0"&Month(now()),2) & "-" & Right("0"&Day(now()),2)%>"></td>
<td width="46%">用車部門:<%=GetTableValue("tbioaDepartment","Name","ID",Session("DepID"))%><INPUT TYPE="hidden" name="Use_Depar_ID" value="<%=Session("DepID")%>"></td>
</tr>
<tr class="td1">
<td width="50%" colspan="2">用車時間: <input TYPE="TEXT" SIZE="12" MAXLENGTH="12" NAME="Use_Date" class="input" readonly> <a href=# title="選擇日期" onClick="fPopUpDlg('../js/calendar.htm', document.eventfrm.Use_Date, 'winpop', 234, 261);return false"><img src="../images/datetime.gif" border=0></a></td>
<td width="50%" rowspan="4">事由:<br>
<Textarea Name="User_What" Rows="10" Cols="50"></Textarea>
</td>
</tr>
<tr class="td1">
<td width="50%" colspan="2">用車聯系人:<input TYPE="TEXT" SIZE="12" MAXLENGTH="12" NAME="Use_Man" class="input"></td>
</tr>
<tr class="td1">
<td width="50%" colspan="2">部門審批人:<SELECT NAME="PartMan_ID">
<%
set rs_a=Server.CreateObject("ADODB.RecordSet")
sql="SELECT Id,Name FROM tbioaUser where department="&Session("DepID")&" order by ID"
rs_a.open sql,oConn,1,1
For i = 1 To Rs_a.RecordCount
Response.Write "<option value="""&rs_a(0)&""">"&rs_a(1)&"</option>"
rs_a.MoveNext
Next
rs_a.Close
Set rs_a = NoThing
%>
</SELECT>
</td>
</tr>
<tr class="td1">
<td width="50%" colspan="2">使用線路:<br>
<Textarea Name="Use_Line" Rows="5" Cols="50"></Textarea>
</td>
</tr>
<tr class="td1">
<td width="50%" colspan="3"><CENTER>
<INPUT TYPE="submit" value="提交申請" class="button0" onmouseout=className="button0" onmouseover=className="button1">
<INPUT TYPE="button" value="取消申請" onclick="javascript:history.back();" class="button0" onmouseout=className="button0" onmouseover=className="button1">
</CENTER></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
<%'釋放對象變量
oConn.close
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -