<!--#include file="conn.asp"-->
<%
dim id
id = request.QueryString("carid")
if isnumeric(id) = false or id = "" then call wrong("参数传递发生错误！")


'检查是否登陆，只有会员才能操作
if session("userId23") = "" then
	response.write "<script>alert('对不起，此操作只有登陆会员才能进行，请先登陆。');window.open('Login_2.asp','_self');</script>"
	response.End()
end if


'收藏车辆代码
set rs_l = server.CreateObject("adodb.recordset")
rs_l.open "select * from user_shoucang where userId = "& session("userId23") &" and carId = "& id &"",conn,1,3
if not rs_l.eof or not rs_l.bof then
	response.write "<script>alert('您已经对此车辆进行了收藏，请务重复操作。');window.close();</script>"
	response.End()
else
	rs_l.addnew
	rs_l("userId") = session("userId23")
	rs_l("carId") = id
	rs_l("shijian") = now()
	rs_l.update
end if
rs_l.close
set rs_l = nothing


rs.open "select * from product where id="& id &"",conn,1,1
if rs.eof then call wrong("未找到相关数据！")

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>加入收藏</title>
<link href="css/comm.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/comm.js"></script>
<style type="text/css" >
#Layer1{position:absolute;width:109px;height:14px;z-index:1;}
#Layer1 img{position:absolute;top:-20px;}
.STYLE1 {color: #FF0000}
.STYLE2 {
	color: #FFFFFF;
	font-weight: bold;
	font-size: 14px;
}
/*更多类似车辆按钮*/
#apDiv1 {
	position:absolute;
	width:47px;
	height:21px;
	z-index:2;
	left:875px;
}
</style>
</head>

<body>
<div class="bodyDiv">
	<!--#include file="model_top.asp"-->
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="86" height="36" align="center" bgcolor="FF8601"><img src="images/2car_40.jpg" width="78" height="28" alt=""></td>
        <td width="162" bgcolor="FF8601" style="font-size:14px; color: #FFFFFF;	font-weight: bold;">登录莆田二手车网</td>
        <td width="43"><img src="images/2car_36.jpg" width="43" height="36" alt=""></td>
        <td valign="bottom" background="images/2car_38.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="4%" height="15"><img src="images/site.gif" width="14" height="13" /></td>
            <td width="96%" valign="bottom">当前位置：收藏车辆</td>
          </tr>
          <tr>
            <td height=8 colspan="2"></td>
          </tr>
        </table></td>
      </tr>
	<tr>
    <td height="4" colspan="4" bgcolor="F0F0F0"></td>
  </tr>
</table>
	
  <table width="100%" height="190" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="5%" valign="top">　</td>
        <td width="35%" valign="top"><table width="98%" height="252" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td colspan="2">　</td>
          </tr>
          <tr>
            <td width="95%" valign="top"><div style=" padding:3px; text-align:center; width:277px; border:solid 1px #8C857B;">
			<%
			dim imgtmp
			if rs("smallImg")="nothing" then
				imgtmp = "img/car1.gif"
			else
				imgtmp = rs("smallImg")
			end if
			%>
			<a href="viewCarImg.asp?id=<%=id%>&imgName=1" target="_blank"><img src="<%=imgtmp%>" width="275" height="199"  border="0" /></a></div>
			  <div style="margin-top:3px;" align="center"><a href="viewCarImg.asp?id=<%=id%>&imgName=1" onfocus="this.blur()" target="_blank"><img src="images/200801072244.jpg" width="77" height="26" border="0" /></a></div>
			  <div style="margin-top:3px;">
			    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><div style="width:56px; background-color:#F2F6F7; float:left; margin-right:3px; height:40px;"><a href="viewCarImg.asp?id=<%=id%>&imgName=1" onfocus="this.blur()" target="_blank"><img src="<%=getshitu("smallImg")%>" width="56" height="40" alt="车辆图片" border="0" /></a></div>
					<div style="width:56px; background-color:#F2F6F7; float:left; margin-right:3px; height:40px;"><a href="viewCarImg.asp?id=<%=id%>&imgName=2" onfocus="this.blur()" target="_blank"><img src="<%=getshitu("smallImg2")%>" width="56" height="40" alt="前方视图" border="0" /></a></div>
					<div style="width:56px; background-color:#F2F6F7; float:left; margin-right:3px; height:40px;"><a href="viewCarImg.asp?id=<%=id%>&imgName=3" onfocus="this.blur()" target="_blank"><img src="<%=getshitu("smallImg3")%>" width="56" height="40" alt="汽车横图" border="0" /></a></div>
					<div style="width:56px; background-color:#F2F6F7; float:left; margin-right:3px; height:40px;"><a href="viewCarImg.asp?id=<%=id%>&imgName=4" onfocus="this.blur()" target="_blank"><img src="<%=getshitu("smallImg4")%>" width="56" height="40" alt="车内视图" border="0" /></a></div>
					<div style="width:56px; background-color:#F2F6F7; float:left; margin-right:3px; height:40px;"><a href="viewCarImg.asp?id=<%=id%>&imgName=5" onfocus="this.blur()" target="_blank"><img src="<%=getshitu("smallImg5")%>" width="56" height="40" alt="车箱视图" border="0" /></a></div></td>
                  </tr>
                </table> 
		      </div></td>
            <td width="5%" valign="top">　</td>
          </tr>
        </table></td>
        <td colspan="2" valign="top"><div style="margin:10px; text-align:center; font-size:14px; font-weight:bold; padding:10px; border:solid 1px #FFCC00; background-color:#FCF9F1;">恭喜您，您对本车辆的收藏成功！</div>
        <div style="margin-top:40px; text-align:center;"><a href="view2Car.asp?id=<%=id%>">返回</a>&nbsp;&nbsp;<a href="userCang.asp">查看收藏夹</a></div></td>
      </tr>
      
      <tr>
        <td valign="top">　</td>
        <td colspan="2" valign="top">		</td>
        <td width="5%" valign="top">　</td>
      </tr>
  </table>
  <div style="height:20px;"></div>
  <!--#include file="model_bottom.asp"-->
</div>
</body>
</html>
<%
'===================
'输出各个视图的图片
function getshitu(ziduan)
	dim imgtmp
	if rs(ziduan)="nothing" then
		imgtmp = "img/car1.gif"
	else
		imgtmp = rs(ziduan)
	end if
	getshitu = imgtmp
end function
%>