📄 carsp.asp
字号:
<!--#include file="check.asp"-->
<!--#INCLUDE FILE="connect.asp" -->
<%if request.servervariables("Request_Method")="POST" then
'check car is used
set rs=server.createobject("adodb.recordset")
sql="select timestart,timeend from applycar where id="&Clng(request("flowid"))
rs.open sql,conn,1,1
if not rs.eof then
timestart=rs("timestart")
timeend=rs("timeend")
else
response.write "没有找到车辆申请记录!"
response.end
end if
rs.close
sql="select * from applycar where status=1 and carid='"&request("carid")&"'"
rs.open sql,conn,1,1
while not rs.eof
if rs("timeend")<timestart or rs("timestart")>timeend then
free=true
else
free=false
response.write("<script language=javascript>alert('此时间车辆已被派出,请选择其他车辆!')</script>")
response.write("<script language=javascript>history.go(-1)</script>")
response.end
end if
rs.movenext
wend
rs.close
ipaddress=request.servervariables("remote_addr")
applytime=CDate(now())
set rs=server.createobject("adodb.recordset")
sql="select * from newwork where id="&Clng(request("nwid"))
rs.open sql,conn,1,1
peoplelist=rs("userlist")
rs.close
if peoplelist<>"" then
postion=instr(peoplelist,";")
if postion=len(peoplelist) then
nextpeople=left(peoplelist,postion-1)
peoplelist=""
else
nextpeople=left(peoplelist,postion-1)
peoplelist=mid(peoplelist,postion+1)
end if
else
nextpeople=""
end if
sql="select * from applygz where id=1"
rs.open sql,conn,1,3
rs.addnew
rs("flowid")=Clng(request("flowid"))
rs("handlename")=session("username")
rs("handleid")=session("uid")
rs("nextid")=nextpeople
rs("handletime")=applytime
rs("ipaddress")=ipaddress
rs("handletype")="6"
rs("remark")=request("yijian")
rs.update
rs.close
if request("choose")="1" then '同意申请
sql="select * from applycar where id="&Clng(request("flowid"))
rs.open sql,conn,1,3
rs("carid")=request("carid")
rs("carname")=request("carname")
rs("yijian")="<font color='blue'>"&rs("yijian")&request("yijian")&session("username")&" "&date()&"</font>"&"<br>"
if nextpeople="" then
rs("donetime")=applytime
rs("status")="1"
end if
rs.update
title=rs("title")
applyname=rs("applyname")
applyid=rs("applyid")
rs.close
if nextpeople="" then
sql="select * from mail where id=1"
rs.open sql,conn,1,3
rs.addnew
rs("topeopleid")=applyid
rs("title")="("&title&")用车申请通过!"
rs("text")="您的用车申请已经批准通过,<a href='readcar.asp?flowid="&Clng(request("flowid"))&"' class='readsp'>查看详细内容</a>"
rs("mailtime")=applytime
rs("senderid")=session("uid")
rs("sendername")=session("username")
rs("ipaddress")=ipaddress
rs.update
rs.close
else
sql="select * from newwork where id=1"
rs.open sql,conn,1,3
rs.addnew
rs("userid")=nextpeople
rs("userlist")=peoplelist
rs("title")=title
rs("typed")="用车申请"
rs("url")="carsp.asp"
rs("baseid")=Clng(request("flowid"))
rs("applytime")=applytime
rs.update
rs.close
end if
else
sql="select * from applycar where id="&Clng(request("flowid"))
rs.open sql,conn,1,3
rs("yijian")="<font color='red'>"&rs("yijian")&request("yijian")&session("username")&" "&date()&"</font>"
rs("donetime")=applytime
rs("status")="2"
rs.update
title=rs("title")
applyid=rs("applyid")
rs.close
sql="select * from mail where id=1"
rs.open sql,conn,1,3
rs.addnew
rs("topeopleid")=applyid
rs("title")="("&title&")用车申请被拒绝!"
rs("text")="您的用车申请拒绝通过!<a href='readcar.asp?flowid="&Clng(request("flowid"))&"' class='readsp'>查看详细内容</a>"
rs("mailtime")=applytime
rs("senderid")=session("uid")
rs("sendername")=session("username")
rs("ipaddress")=ipaddress
rs.update
rs.close
end if
sql="select donetime,status from newwork where id="&Clng(request("nwid"))
rs.open sql,conn,1,3
rs("donetime")=applytime
rs("status")="1"
rs.update
rs.close
response.write("<script language=javascript>alert('提交审批意见成功!')</script>")
response.write("<script>document.location='right.asp'</script>")
response.end
end if
%>
<html>
<head>
<title>用车审批单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="apply.css" type="text/css">
</head>
<!--#include file="checkuser.asp"-->
<%set rs=server.createobject("adodb.recordset")
sql="select * from applycar where id="&Clng(request("flowid"))
rs.open sql,conn,1,1
if rs.eof then
response.redirect "error.htm"
response.end
end if
timestart=rs("timestart")
timeend=rs("timeend")
yearstart=left(timestart,4)
yearend=left(timeend,4)
monthstart=mid(timestart,5,2)
monthend=mid(timeend,5,2)
daystart=mid(timestart,7,2)
dayend=mid(timeend,7,2)
hourstart=mid(timestart,9,2)
minutestart=mid(timestart,11,2)
hourend=mid(timeend,9,2)
minuteend=mid(timeend,11,2)
%>
<script language="JavaScript" src="apply.js"></script>
<script language="javascript">
function FindCar(url) {
var win
win=window.open(url,"",'location=no,directories=no,status=no,toolbar=no,menubar=no,scrollbars=yes,height=500,width=700,left=250,top=100');
return false;
}
</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" oncontextmenu="return false">
<form name="form" method="POST" action="carsp.asp">
<table cellpadding="0" cellspacing="0" width="100%">
<tr >
<td valign="top" align="center" colspan="3">
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="50" class="title" align="center"> <img src="images/carsp.gif"></td>
</tr>
</table>
<table cellpadding="2" cellspacing="1" width="90%" height="250" bgcolor="#555555">
<tr valign="middle" bgcolor="#f0f0f0" >
<td width="15%" height="35" bgcolor="#f0f0f0">
<div align="center">申请名称:</div>
</td>
<td height="35" colspan="3" class="applygz"><%=rs("title")%> </td>
</tr>
<tr bgcolor="#f0f0f0">
<td height="35" width="15%" valign="middle" bgcolor="#f0f0f0">
<div align="center">申请车辆:</div>
</td>
<td height="35" valign="middle" class="applygz" width="33%">
<% set ptr=server.createobject("adodb.recordset")
sql="select * from car"
ptr.open sql,conn,1,1
%>
<select name="carid" size="1" onChange="choosecar();">
<option value="">请选择车辆</option>
<%while not ptr.eof %>
<option value="<%=ptr("id")%>"><%=ptr("carname")%></option>
<%ptr.movenext
wend
ptr.close
set ptr=nothing
%>
</select>
<a href="carplan.asp?applydate=<%=rs("timestart")%>" onClick="return FindCar(this.href)" class="aapply">车辆安排</a>
</td>
<td height="35" valign="middle" bgcolor="f0f0f0" width="15%">
<div align="center">使用天数:</div>
</td>
<td height="35" valign="middle" class="applygz" width="37%"> <%=rs("day")%></td>
</tr>
<tr bgcolor="#f0f0f0">
<td height="35" width="15%" valign="middle" bgcolor="#f0f0f0">
<div align="center">用车时间:</div>
</td>
<td height="35" valign="middle" class="applygz" width="33%">
<%response.write(yearstart&"-"&monthstart&"-"&daystart&" "&hourstart&":"&minutestart)%>
</td>
<td height="35" valign="middle" bgcolor="f0f0f0" width="15%">
<div align="center">还车时间:</div>
</td>
<td height="35" valign="middle" class="applygz" width="37%">
<%response.write(yearend&"-"&monthend&"-"&dayend&" "&hourend&":"&minuteend)%>
</td>
</tr>
<tr bgcolor="#f0f0f0">
<td height="35" width="15%" valign="middle" bgcolor="#f0f0f0">
<div align="center"> 用车事由: </div>
</td>
<td colspan="3" height="35" valign="middle" class="applygz"> <%=rs("reason")%>
</td>
</tr>
<tr bgcolor="#f0f0f0">
<td height="35" width="15%" bgcolor="#f0f0f0">
<div align="center">申 请 人:</div>
</td>
<td height="35" class="applygz" width="33%">
<div align="left"><font color="black"><%=rs("applyname")%></font></div>
</td>
<td height="35" width="15%">
<div align="center">所在部门:</div>
</td>
<td height="35" class="applygz" width="37%">
<div align="left"><font color="black"><%=rs("dep")%></font> </div>
</td>
</tr>
<tr bgcolor="#f0f0f0">
<td height="35" width="15%" bgcolor="#f0f0f0">
<div align="center">审批结果:</div>
</td>
<td height="35" colspan="3" class="applygz"><%=rs("yijian")%></td>
</tr>
<tr bgcolor="f0f0f0">
<td width="15%" height="100" bgcolor="f0f0f0"><div align="center">审批意见:</div></td>
<td width="84%" height="100" bgcolor="f0f0f0" colspan="4"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="31" bgcolor="f0f0f0" class="applygz">
<input type="radio" name="radio" value="yes" checked onClick="ycspwriteyes()">
批准用车申请
<input type="radio" name="radio" value="no" onClick="ycspwriteno()">
拒绝用车申请</td>
</tr>
<tr>
<td bgcolor="ffffff">
<textarea name="yijian" style="width:100%;height:100%;" class="14textarea">同意用车申请! </textarea>
</td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="46%" height="40" align="right">
<p>
<input type="image" name="send" value=" 提 交 " onClick="return checkycsp();return false;" src="images/okgif.gif" alt="确定">
</td>
<td width="9%" height="40"> </td>
<td width="45%" height="40">
<input type="image" name="send2" value=" 返 回 " onClick="history.go(-1);return false;" src="images/fanhuigif.gif" alt="返回">
<input type="hidden" name="choose" value="1">
<input type="hidden" name="flowid" value="<%=Clng(request("flowid"))%>">
<input type="hidden" name="nwid" value="<%=Clng(request("nwid"))%>">
<input type="hidden" name="carname">
</td>
</tr>
</table>
</form>
<!--#include file="close.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -