<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
ColumnName="":Tablename="HX_CarMain":Orderby="":action=request("action")
if action="del" then
 if WS_S.MemberPriv("WS_PublicAffairsCarModify")<>1 then HX_GoBack "对不起,您的权限不够!",""
 WS_MAID=request("WS_MAID")
 if WS_MAID="" or isnull(WS_MAID) or (WS_MAID<>"" and not isnumeric(WS_MAID)) then	HX_GoBack "非法操作",""  
 conn.execute("delete from HX_CarReturn where WS_CMID="&WS_MAID)
 conn.execute("delete from HX_CarApply where WS_MAID="&WS_MAID)
 conn.execute("delete from HX_CarMain where WS_MAID="&WS_MAID)
 WS_S.HX_Redirect "carlist.asp"
end if
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
response.Write "<head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title></title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'><script src='../HXinclude/HX_Function.js'></script></head><body topmargin='20' leftmargin='0' bottommargin='0'><table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>查看车辆</font></td></tr></table><table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor=FFFBE8><tr bgcolor='#BF9B73' class='td4'><td height='23' width='15%'><div align='center'>车牌号</div></td><td height='23' width='28%'><div align='center'>简要描述</div></td><td height='23' width='19%'><div align='center'>状 态</div></td><td height='23' width='19%'><div align='center'>预定情况</div></td><td height='23' width='9%'><div align='center'>修 改</div></td><td height='23' width='10%'><div align='center'>删 除</div></td></tr>"
   if rs.recordcount<=0 then
      response.Write "<tr><td colspan=6 bgcolor=FFFBE8 height=25 align=center>暂无记录！</td></tr>"
	else
    rs.PageSize =15 '每页记录条数
	iCount=rs.RecordCount '记录总数
	iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    
    rs.AbsolutePage=Page

	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	ii=0
	do while not rs.EOF 
	response.Write "<tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td width='15%' height='23'>"&rs("WS_CarName")&"</td><td width='28%' height='23'><font title='简要描述："&rs("WS_CarDescribe")&"'>"&rs("WS_CarDescribe")&"</font></td><td width='19%' height='23' align='center'>"
	       select case rs("WS_CarState")
			 case 0 response.Write "<font color='008000'>空闲</font>"
			 case 1 response.Write "<font color='red'>使用中</font>"
			 case 2 response.Write "<font color='red'>维修</font>"   
			 case 3 response.Write "<font color='red'>年检</font>"
			 case else response.Write "<font color='008000'>空闲</font>"
		 end select
		 response.Write "</td><td width='19%' height='23'><div align='center'><a href='orderlist.asp?WS_MAID="&rs("WS_MAID")&"'>查看</a></div></td><td width='9%' height='23'><div align='center'><a href='#' onClick=""openwin(430,253,'carmodify.asp?WS_MAID="&rs("WS_MAID")&"')"">修改</a></div></td><td width='10%' height='23'><div align='center'>"
		 if rs("WS_CarState")<>1 then response.Write "<a href='carlist.asp?action=del&WS_MAID="&rs("WS_MAID")&"'>"  else response.write "<a href='javascript:' onclick=""alert('此车辆正使用中，不能删除！\n请在归还后删除！');"">" 
		 response.Write "删除</a></div></td></tr>"
		 ii=ii+1
	  if ii>=rs.PageSize then Exit Do
	  rs.movenext
      loop
      call WS_S.PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>",6)
end if
call WS_S.HX_RSClose(rs) 
response.Write "</table></td></tr></table>"
%>