<!--#include file="inc/Conn.asp"-->
<!--#include file="inc/Function_PC.asp"-->
<%

Function RndNumber(MaxNum,MinNum)
 Randomize 
 RndNumber=int((MaxNum-MinNum+1)*rnd+MinNum)
 RndNumber=RndNumber
End Function

ID=int(request("id"))
from=request("from")

if id=0 then 
response.Redirect "index.asp"
response.End()
end if

action=request("action")
if action="ok" then
	Dream_Grade=request.Form("Dream_Grade")
	scontent=request.Form("scontent")
	stitle=request.Form("stitle")
	TID=request.Form("ID")
	Set rs=Server.CreateObject("Adodb.RecordSet")
	rs.open "Select * From Dream_Review",conn,1,3
	rs.addnew
	rs("Dream_Grade")=int(Dream_Grade)
	rs("Dream_Content")=scontent
	rs("Dream_ViewID")=TID
	if session("Dream_UserName")<>"" then
	rs("Dream_UserID")=session("Dream_UserName")
	else
	rs("Dream_UserID")="游客"
	end if
	rs("Dream_UpdateTime")=now()
	rs.update	 
	rs.close
	set rs=nothing
	Response.Redirect "view.asp?cid="&cid&"&id="&TID
end if

if id <> 0 then
set key=conn.execute("select * from Dream_Menpiao where Dream_IsOK=true and id="&id)
if not(key.eof and key.bof) then
	DreamTitles=key("Dream_Title")
	DreamKeys=key("Dream_Keyword")
	DreamDes=key("Dream_Description")
	Dream_Style=key("Dream_Style")
	Dream_Hits=key("Dream_Hits")
	Dream_UpdateTime=key("Dream_UpdateTime")
	Dream_Content=key("Dream_Content")
	Dream_Content2=key("Dream_Content2")
	Dream_Content3=key("Dream_Content3")
	Dream_Content4=key("Dream_Content4")
	Dream_UserID=key("Dream_UserID")
	Dream_Theme=key("Dream_Theme")
	Dream_Area=key("Dream_Area")
	Dream_Bus=key("Dream_Bus")
	Dream_QQ=key("Dream_QQ")
	Dream_MapUrl=key("Dream_MapUrl")

	if key("Dream_DefaultPicUrl")<>"" then
	Dream_DefaultPicUrl=key("Dream_DefaultPicUrl")
	else
	Dream_DefaultPicUrl=""
	end if
	Dream_Address=key("Dream_Address")

	if key("Dream_Phone")<>"" then
	Dream_Phones=key("Dream_Phone")
	else
	Dream_Phones=Dream_Phone
	end if
else
	response.Redirect "index.asp"
	response.End()
end if
set key=nothing
end if
conn.execute "update Dream_Menpiao set Dream_Hits=Dream_Hits+1 where id="&id

if Dream_Theme <> 0 then
set key=conn.execute("select * from Dream_Theme where ID="&Dream_Theme)
if not(key.eof and key.bof) then
	Dream_Namestr=""
	if key("Dream_ClassID")=0 then
		bid=key("id")
		Dream_Namestr=key("Dream_Names")
		bclassname=key("Dream_Names")
		sclassname=""
	else
		bid=key("Dream_ClassID")
		sid=key("id")
		bclassname=B_ClassName(bid)
		sclassname=key("Dream_Names")
		Dream_Namestr=bclassname&" - "&sclassname
	end if
end if
set key=nothing
end if

if Dream_Area <> 0 then
set key=conn.execute("select * from Dream_Area where ID="&Dream_Area)
if not(key.eof and key.bof) then
	Dream_Areastr=""
	if key("Dream_ClassID")=0 then
	Dream_Areastr=key("Dream_Names")
	else
	Dream_Areastr=City(key("Dream_ClassID"))&" - "&key("Dream_Names")
	end if
end if
set key=nothing
end if

isrz="no"
if Dream_UserID<>"" then
isrz=userrz(Dream_UserID)
end if

if bclassname<>"" then
localstr=" > <a href=""?cid="&bid&""">"&bclassname&"</a>"
end if

if sclassname<>"" then
localstr=localstr&" > <a href=""?cid="&sid&""">"&sclassname&"</a>"
end if

%>
<!doctype html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=DreamTitles%>-<%=Dream_SiteName%></title>
<meta name=Keywords content="<%=DreamKeys%>">
<meta name=Description content="<%=DreamDes%>">
<!--#include file="jscss.asp"-->
<!--#include file="inc/zdsbphone.asp"-->
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.more.js"></script>
<script type="text/javascript">
$(function(){
	$('#more').more({'address': 'reviewlist.asp?TID=<%=ID%>'})
});
</script>
</head>
<body>
<!--#include file="nheader.asp"-->
<div class="conment">
	<div class="local">当前位置：<a href="index.asp">首页</a><%=localstr%></div>
	<div class="viewcontent">
		<div class="share"><h3>分享到：</h3>
		<div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到：","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
		</div>
		<div class="view">
			<div class="view_img"><img src="<%=Dream_DefaultPicUrl%>" alt="" /></div>			
			<div class="view_canshu">
				<ul>
					<h3><%=DreamTitles%></h3><span><%=ReviewNum(id)%>条评论<i>|</i>浏览<%=Dream_Hits%>次<i>|</i>发布时间：<%=Dream_UpdateTime%></span>				
					<li>分类：<%=Dream_Namestr%></li>
					<li>地区：<%=Dream_Areastr%></li>
					<li>电话：<i class="tel"><%=Dream_Phones%></i></li>
					<li>扣扣：<%=Dream_QQ%></li>
					<li>地址：<%if Dream_MapUrl<>"" then%><a href="<%=Dream_MapUrl%>" target="_blank"><%=Dream_Address%></a><%else%><%=Dream_Address%><%end if%></li>
					<li>认证：<%if isrz="yes" then%><i class="green">实名验证会员发布</i><%else%><i>没有通过实名验证</i><%end if%></li>
				</ul>
				<%if len(Dream_Content4)>0 then%>
				<div class="wxts">优惠信息：<%=Dream_Content4%></div>
				<%end if%>
			</div>
		</div>
		<div class="img"><img src="images/pc_img_22.jpg" /></div>
		<div class="view_bdxq">
			<div class="img"><img src="images/pc_img_27.jpg" /></div>
			<%if len(Dream_Content3)>0 then%>
			<div class="view_bdxq_t"><h3>【商家介绍】</h3></div>
			<div class="view_bdxq_con"><%=Dream_Content3%></div>
			<%end if%>		
			<%if len(Dream_Content)>0 then%>
			<div class="view_bdxq_t"><h3>【温馨提示】</h3></div>
			<div class="view_bdxq_con"><%=Dream_Content%></div>
			<%end if%>
			<div class="view_bdxq_t"><h3>【访客评价】</h3></div>
			<%if Dream_Review=true then%>
			<div id="more" class="view_ReviewList">
				<div class="single_item">
					<ul><li class="new_review_name"></li><li class="new_review_grade"></li><li class="new_review_con"></li><li class="new_review_reply"></li></ul>
				</div>        
			  <div class="new_more"><a href="javascript:void(0)">查看更多</a></div>
			</div>
			<%end if%>
			<%if session("Dream_UserName")<>"" and session("Dream_Rok")=true and Dream_Review=true then%>
			<div class="view_ReviewAdd">
				<form action="view.asp?action=ok" method="post">
				<input name="id" type="hidden" value="<%=id%>" />
				<input name="cid" type="hidden" value="<%=cid%>" />
				<ul>
					<li><span>评分：</span>
						<label><input type="radio" name="Dream_Grade" value="1"><i>1分</i><input type="radio" name="Dream_Grade" value="2"><i>2分</i><input name="Dream_Grade" type="radio" value="3"><i>3分</i><input type="radio" name="Dream_Grade" value="4"><i>4分</i><input type="radio" name="Dream_Grade" value="5" checked><i>5分</i></label>
					</li>
					<li class="nop"><span>评价：</span><textarea name="scontent" id="scontent"  cols="" rows="5"></textarea></li>
					<li class="an"><input name="" type="submit" id="button" value=" 用户点评 "></li>
				</ul>
				</form>		
		  	</div>
			<%end if%>
			<%if session("Dream_UserName")="" and Dream_Review=true then%>
			<div class="nologin">会员登录后才能点评<br>请您先<a href="login.asp">登录</a>，未注册的<a href="reg.asp">点击注册</a></div>
			<%end if%>
			<%if session("Dream_UserName")<>"" and Dream_Review=true and session("Dream_Rok")=false then%>
			<div class="nologin">您帐号的评论权限已关闭，请联系管理员！</div>
			<%end if%>
			<div class="img"><img src="images/pc_img_29.jpg" /></div>
		</div>		
	</div>
	<!--#include file="right.asp"-->	
</div>
<!--#include file="footer.asp"-->
<script>
  $('#button').click(function () {
			var scontent = $('#scontent').val();						
            if (scontent.length == 0) {
                alert("请输入点评标题及内容");
                return false;
            }else {
			alert('点评成功!');
                return true;
				
            }
        });	
</script>
</body>
</html>