<!--#include virtual="/conn.asp"-->  
<!--#include virtual="/function/fd_function.asp"-->
<!--#include virtual="/db.asp"-->


<%
user_id=session("user_id")
pro_id=T(request.QueryString("pro_id"))

if T(request.QueryString("action"))="pl" then
mmc_name=T(request.Form("mmc_name"))
mmc_sex=T(request.Form("mmc_sex"))
mmc_phone=T(request.Form("mmc_phone"))
mmc_email=T(request.Form("mmc_email"))
mmc_qq=T(request.Form("mmc_qq"))
mmc_youbian=T(request.Form("mmc_youbian"))
mmc_address=T(request.Form("mmc_address"))
mmc_title=T(request.Form("mmc_title"))
mmc_content=T(request.Form("mmc_content"))

sql="select * from chinammc_message"
set rs=fd_rs(cn,sql)
rs.addnew
rs("mmc_show")=0
rs("mmc_proid")=pro_id
rs("mmc_name")=mmc_name
rs("mmc_sex")=mmc_sex
rs("mmc_email")=mmc_email
rs("mmc_phone")=mmc_phone
rs("mmc_address")=mmc_address
rs("mmc_qq")=mmc_qq
rs("mmc_title")=mmc_title
rs("mmc_content")=mmc_content
rs("mmc_adddate")=date()
'rs("mmc_addip")=
if user_id<>"" then
rs("mmc_userid")=user_id
rs("mmc_flag")=1
else
rs("mmc_flag")=0
end if
rs.update
'response.Write("111111111111111111111111111111111111111111111111111")
response.Redirect "pro_show.asp?pro_id="&pro_id&""
response.End()
fd_free(rs)
end if

'查找用户信息用于评论中
if user_id<>"" then
sql="select * from chinammc_user where mmc_id="&user_id&""
set rs=fd_rs(cn,sql)
mmc_name=rs("mmc_truename")
mmc_phone=rs("mmc_phone")
mmc_email=rs("mmc_email")
mmc_address=rs("mmc_address")
mmc_youbian=rs("mmc_youbian")
mmc_qq=rs("mmc_qq")
fd_free(rs)
end if

set cn=fd_cn(cn)
'提取商品详细信息
sql="select * from chinammc_product where pro_id="&pro_id&""
set rs=fd_rs(cn,sql)
pro_code=rs("pro_code")
pro_name=rs("pro_name")
pro_guige=rs("pro_guige")
pro_count=rs("pro_count")
pro_hit=rs("pro_hit")
pro_price=rs("pro_price")
pro_price_vip=rs("pro_price_vip")
pro_bigpic=rs("pro_bigpic")
pro_smallpic=rs("pro_smallpic")
pro_content=rs("pro_content")
pro_secid=rs("pro_secid")

rs("pro_hit")=rs("pro_hit")+1
rs.update
fd_free(rs)

if pro_bigpic<>"" then
pro_pic=pro_bigpic
elseif pro_smallpic<>"" then
pro_pic=pro_smallpic
else
pro_pic="/images/nopic.gif"
end if

'提取该产品的评论
sql="select top 3 * from chinammc_message where mmc_proid="&pro_id&" and mmc_show=1"
set rs=fd_rs(cn,sql)
pl=""
if not (rs.bof and rs.eof) then
do until rs.eof 
pl=pl&"      <table width=98% border=0 cellspacing=0 cellpadding=0 style='margin:5px;border-bottom:1px dotted #CCCCCC' align=center>"
pl=pl&"      <tr>"
pl=pl&"      <td width=57% height=24 style='font-size:13px;padding:0px 5px;color:#333333'><strong>标题:</strong>"&rs("mmc_title")&"</td>"
pl=pl&"      <td width=22%  style='font-size:13px;padding:0px 5px;color:#333333;'><strong>评论人:</strong>"&rs("mmc_name")&"</td>"
pl=pl&"      <td width=21% style='font-size:13px;padding:0px 5px;color:#333333;text-align:right;'><strong>评论时间:</strong>"&rs("mmc_adddate")&"</td>"
pl=pl&"      </tr>"
pl=pl&"      <tr>"
pl=pl&"      <td colspan=3 style='color:#333333;padding:0px 5px;line-height:20px;'><strong>内容:"&rs("mmc_content")&"</strong></td>"
pl=pl&"      </tr>"
if rs("mmc_huifu")=1 then
pl=pl&"      <tr>"
pl=pl&"      <td colspan=3 style='color:#333333;padding:0px 5px;line-height:20px;'><strong>回复:"&rs("mmc_replaycontent")&"</strong></td>"
pl=pl&"      </tr>"
end if
pl=pl&"      </table>"
rs.movenext
loop
else
pl="暂无任何评论!"[/color][/color]end if
fd_free(rs)
'提取同类产品
sql="select top 4 * from chinammc_product where pro_secid="&pro_secid&""
set rs=fd_rs(cn,sql)
tl=""
if not (rs.bof and rs.eof) then
do until rs.eof
tl=tl&"        <td height=14 width=25% >"
tl=tl&"        <table width=100% height=165 cellpadding=0 cellspacing=0   >"
tl=tl&"        <tr>"
if rs("pro_smallpic")<>"" then
tl=tl&"        <td widtd=286 ><div align=center><a href=pro_show.asp?pro_id="&rs("pro_id")&"><img src="&rs("pro_smallpic")&" width=120 height=120 border=0/></a></div></td>"
elseif rs("pro_bigpic")<>"" then
tl=tl&"        <td widtd=286 ><div align=center><a href=pro_show.asp?pro_id="&rs("pro_id")&"><img src="&rs("pro_bigpic")&" width=120 height=120 border=0 /></a></div></td>"
else
tl=tl&"        <td widtd=286 ><div align=center><a href=pro_show.asp?pro_id="&rs("pro_id")&"><img src=/images/nopic.gif width=120 height=120 border=0 /></a></div></td>"
end if
tl=tl&"        </tr>"
tl=tl&"        <tr>"
tl=tl&"        <td class=he ><div align=center><a href=pro_show.asp?pro_id="&rs("pro_id")&">"&rs("pro_name")&"</a></div></td>"
tl=tl&"        </tr>"
tl=tl&"        <tr>"
tl=tl&"        <td class=he ><div align=center>会员价:¥"&rs("pro_price_vip")&"</div></td>"
tl=tl&"        </tr>"
tl=tl&"        </table>"
tl=tl&"        </td>"

rs.movenext
loop
else
tl=""
end if

fd_free(rs)
fd_free(cn)
%>

<%
set cn=fd_cn(cn)
sql="select * from chinammc_webconfig"
set rs=fd_rs(cn,sql)
sc_name=rs("sc_name")
fd_free(rs)
fd_free(cn)
%>
<!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" />

<link href="../images/css.css" rel="stylesheet" type="text/css" />
<title><%= pro_name %>-<%=sc_name%></title>
</head>