⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 car_index.asp

📁 办公自动化系统 适用于办公室的各种几本功能的操作 功能比较简单
💻 ASP
字号:
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/connection.asp"-->
<%response.expires=-1%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
</HEAD>
<%
selectdate=trim(request("SelectDate"))
if selectdate="" then selectdate=date()
%>
<BODY BGCOLOR="#FFFFFF">
<div align=center>
<table border=0 width="70%">
<tr>
<td><a href="car_admin.asp">车辆维护</a></td>
<td><a href="car_search.asp">车辆状态查询</a></td>
<td><a href="car_cancel.asp">取消车辆预定</a></td>
</tr>
</table></div>
<div align=center>
<table border=1 cellpadding=3 cellspacing=1 width="95%" bgcolor=#EEEEEE bordercolordark="#FFFFFF" bordercolorlight="#999999">
<tr>
	<td width="15%" nowrap><font color=red><b>车辆预约一揽</b></font></td>
	<td align=center><font color=red><%=year(selectdate)&"年"&month(selectdate)&"月"&day(selectdate)&"日"%></font></td>
	<td align=right width="20%">
	<a href="car_index.asp?selectdate=<%=(cdate(selectdate)-1)%>" title="昨日"><img src="../images/arrow_left.gif" border=0></a>
	<a href="car_index.asp" title="今日"><img src="../images/today.gif" border=0></a>
	<a href="car_index.asp?selectdate=<%=cdate(selectdate)+1%>" title="明日"><img src="../images/arrow_right.gif" border=0></a>
	</td>
</tr>
</table>

<table border=1 cellpadding=3 cellspacing=0 width="95%" bgcolor=#EEEEEE bordercolordark="#FFFFFF" bordercolorlight="#999999">
<tr>
<td width="15%">车辆列表/时间</td>
<td>8:00</td>
<td>9:00</td>
<td>10:00</td>
<td>11:00</td>
<td>12:00</td>
<td>13:00</td>
<td>14:00</td>
<td>15:00</td>
<td>16:00</td>
<td>17:00</td>
<td>18:00</td>
<td>&nbsp;</td>
</tr>
<%
set rs=server.createobject("Adodb.recordset")
sql="select * from tblCar where ID>0 Order by name"
rs.open sql,Conn
while not rs.eof
carID=trim(rs("ID"))%>
<tr>
<td><a href="car_Detail.asp?carID=<%=carID%>&selectdate=<%=selectdate%>"><%=trim(rs("name"))%></a></td>
<td>
	<%if haveused(carid,selectdate&" 8:00") then%>
	<a href="car_Detail.asp?carID=<%=carid%>&selectdate=<%=selectdate%>"><img src="../images/carused.gif" width=30 height=3 border=0 alt="有车辆安排"></a>
	<%else
	response.write "&nbsp;"
	end if%>
</td>
<td>
	<%if haveused(carid,selectdate&" 9:00") then%>
	<a href="car_Detail.asp?carID=<%=carid%>&selectdate=<%=selectdate%>"><img src="../images/carused.gif" width=30 height=3 border=0 alt="有车辆安排"></a>
	<%else
	response.write "&nbsp;"
	end if%>
</td>
<td>
	<%if haveused(carid,selectdate&" 10:00") then%>
	<a href="car_Detail.asp?carID=<%=carid%>&selectdate=<%=selectdate%>"><img src="../images/carused.gif" width=30 height=3 border=0 alt="有车辆安排"></a>
	<%else
	response.write "&nbsp;"
	end if%>
</td>
<td>
	<%if haveused(carid,selectdate&" 11:00") then%>
	<a href="car_Detail.asp?carID=<%=carid%>&selectdate=<%=selectdate%>"><img src="../images/carused.gif" width=30 height=3 border=0 alt="有车辆安排"></a>
	<%else
	response.write "&nbsp;"
	end if%>
</td>
<td>
	<%if haveused(carid,selectdate&" 12:00") then%>
	<a href="car_Detail.asp?carID=<%=carid%>&selectdate=<%=selectdate%>"><img src="../images/carused.gif" width=30 height=3 border=0 alt="有车辆安排"></a>
	<%else
	response.write "&nbsp;"
	end if%>
</td>
<td>
	<%if haveused(carid,selectdate&" 13:00") then%>
	<a href="car_Detail.asp?carID=<%=carID%>&selectdate=<%=selectdate%>"><img src="../images/carused.gif" width=30 height=3 border=0 alt="有车辆安排"></a>
	<%else
	response.write "&nbsp;"
	end if%>
</td>
<td>
	<%if haveused(carid,selectdate&" 14:00") then%>
	<a href="car_Detail.asp?carID=<%=carID%>&selectdate=<%=selectdate%>"><img src="../images/carused.gif" width=30 height=3 border=0 alt="有车辆安排"></a>
	<%else
	response.write "&nbsp;"
	end if%>
</td>
<td>
	<%if haveused(carid,selectdate&" 15:00") then%>
	<a href="car_Detail.asp?carID=<%=carID%>&selectdate=<%=selectdate%>"><img src="../images/carused.gif" width=30 height=3 border=0 alt="有车辆安排"></a>
	<%else
	response.write "&nbsp;"
	end if%>
</td>
<td>
	<%if haveused(carid,selectdate&" 16:00") then%>
	<a href="car_Detail.asp?carID=<%=carID%>&selectdate=<%=selectdate%>"><img src="../images/carused.gif" width=30 height=3 border=0 alt="有车辆安排"></a>
	<%else
	response.write "&nbsp;"
	end if%>
</td>
<td>
	<%if haveused(carid,selectdate&" 17:00") then%>
	<a href="car_Detail.asp?carID=<%=carID%>&selectdate=<%=selectdate%>"><img src="../images/carused.gif" width=30 height=3 border=0 alt="有车辆安排"></a>
	<%else
	response.write "&nbsp;"
	end if%>
</td>
<td>
	<%if haveused(carid,selectdate&" 18:00") then%>
	<a href="car_Detail.asp?carID=<%=carID%>&selectdate=<%=selectdate%>"><img src="../images/carused.gif" width=30 height=3 border=0 alt="有车辆安排"></a>
	<%else
	response.write "&nbsp;"
	end if%>
</td>
<td><a href="car_Order.asp?CarID=<%=CarID%>&SelectDate=<%=selectdate%>">我要预约>></a></td>
</tr>
<%rs.movenext
wend
rs.close
set rs=nothing
%>
</table></div>

</BODY>
</HTML>
<!--#include file="../inc/connclose.asp"-->
<%

private function haveused(byval carid,byval times)
set rstmp=server.createobject("Adodb.recordset")
sql="select * from tblCarOrder where Starttime<='"& times &"' and EndTime>='"& times &"' and CarID="& carid
rstmp.open sql,Conn
if not rstmp.eof then
	haveused=true
else
	haveused=false
end if
rstmp.close
end function


private function toyestoday (byval strtoday)
	today=cdate(strtoday)
	today_year=year(today)
	today_month=month(today)
	today_day=day(today)
	yestoday_year=year(today)
	yestoday_month=month(today)
	yestoday_day=day(today)
if today_day-1>0 then
	yestoday_day=yestoday_day-1
elseif today_month="1" then
	yestoday_day=getmaxday(today_year,today_month)
	yestoday_month="12"
else
	yestoday_day=getmaxday(today_year,today_month)
	yestoday_month=yestoday_month-1
end if
toyestoday=yestoday_year&"-"&yestoday_month&"-"&yestoday_day
end function

private function totomorrow (byval strtoday)
	today=cdate(strtoday)
	today_year=year(today)
	today_month=month(today)
	today_day=day(today)
	tomorrow_year=year(today)
	tomorrow_month=month(today)
	tomorrow_day=day(today)
	if ((today_year mod 4=0) and (today_year mod 100<>0)) or (today_year mod 400=0) then
		runnian=true
	else
		runnian=false
	end if
	
	select case today_month
	case "1","3","5","7","8","10"
		if today_day="31" then
		tomorrow_day="1"
		tomorrow_month=today_month+1
		else
		tomorrow_day=today_day+1
		end if
	case "4","6","9","11"
		if today_day="30" then
		tomorrow_day="1"
		tomorrow_month=today_month+1
		else
		tomorrow_day=today_day+1
		end if
	case "2"
		if runnian and today_day="29" then
			tomorrow_day="1"
			tomorrow_month=today_month+1
		elseif (not runnian) and today_day="28" then
			tomorrow_day="1"
			tomorrow_month=today_month+1
		else
			tomorrow_day=today_day+1	
		end if
	case "12"
		if today_day="31" then
		tomorrow_day="1"
		tomorrow_month=today_month+1
		tomorrow_year=today_year+1
		else
		tomorrow_day=today_day+1
		end if

end select

totomorrow =tomorrow_year&"-"&tomorrow_month&"-"&tomorrow_day
end function

private function getmaxday(byval stryear, byval strmonth)
	if ((stryear mod 4=0) and (stryear mod 100<>0)) or (stryear mod 400=0) then
		runnian=true
	else
		runnian=false
	end if
	strmonth=strmonth-1
	if strmonth="0" then strmonth="12"

	select case strmonth
	case "1","3","5","7","8","10","12"
	getmaxday="31"
	case "4","6","9","11"
	getmaxday="30"
	case "2"
		if runnian then
			getmaxday="29"
		else
			getmaxday="28"
		end if
	case else
	getmaxday="31"
	end select
end function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -