<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_PublicAffairsCarModify")<>1 then response.Write "<script>alert('对不起,您的权限不够!');window.close();</script>":response.end
ColumnName="":Tablename="HX_CarMain":WS_MAID=request("WS_MAID")
if WS_MAID="" or isnull(WS_MAID) or (WS_MAID<>"" and not isnumeric(WS_MAID)) then 	response.write "<script>alert('非法操作');window.close();</script>":response.end  
CarName=request("CarName"):CarDescribe=request("CarDescribe"):CarState=request("CarState"):Orderby=" where WS_MAID="&WS_MAID
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
action=request("action")
if action="saveinfo" then
  if rs("WS_CarState")=1 and CarState<>1 then
    if not conn.execute("select * from HX_CarApply where WS_CarSpsign=1 and WS_MAID="&WS_MAID).eof then
      HX_GoBack rs("WS_CarName")&"正在使用当中，不能更改成其它状态，请在归还后更改！",""
    end if
  end if
  rs("WS_CarName")=CarName:rs("WS_CarDescribe")=CarDescribe:rs("WS_CarState")=CarState:rs.update
  response.write "<script>if(confirm('修改成功!\n是否关闭此窗口？')) {window.close();window.opener.location.reload();}else {location.href='carmodify.asp?WS_MAID="&WS_MAID&"';}</script>"
  response.end
end if
if rs.recordcount<=0 then response.write "<script>alert('非法操作');window.close();</script>":response.end 
response.Write "<head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title>修改车辆信息</title><link rel=stylesheet type=text/css href='../HXinclude/HX_Css.css'><script src='../HXinclude/HX_Function.js'></script></head><body topmargin='8' leftmargin='0' bottommargin='8'><table width='400'  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><form name='form1' method='post' action='?action=saveinfo' onSubmit='return Carcheck(this);'><tr bgcolor='#FFFBE8'><td width='23%'>车牌号码</td><td width='77%'><input name='CarName' type='text' value='"&rs("WS_CarName")&"' maxlength='50'></td></tr><tr bgcolor='#FFFBE8'><td>汽车状态</td><td><select name='CarState'><option value='0' "
if rs("WS_CarState")=0 then response.write "selected"
response.write ">空闲</option><option value='1' "
if rs("WS_CarState")=1 then response.write "selected"
response.write ">使用中</option><option value='2' "
if rs("WS_CarState")=2 then response.write "selected"
response.write ">维修</option><option value='3' "
if rs("WS_CarState")=3 then response.write "selected"
response.write ">年检</option></select></td></tr><tr bgcolor='#FFFBE8'><td width='23%' valign='top'>简要描述</td><td width='77%'><textarea rows='8' name='CarDescribe' cols='50' class='bgline'>"&rs("WS_CarDescribe")&"</textarea></td></tr><tr bgcolor='#FFFBE8'><td>&nbsp;</td><td><input type='submit' name='Submit' value=' 修 改 '> <input type='reset' name='Submit' value=' 重 输 '> <input type='button' name='Submit' value=' 关 闭 ' onclick='javascript:window.close();'><input name='WS_MAID' type='hidden' value='"&WS_MAID&"'></td></tr></form></table></td></tr></table>" 
%>