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

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

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

if session("yhj")="yes" then
yhj=""
end if

if session("yhj")="yes" and request("yhj")="yes" then
response.Redirect "view.asp?id="&id&"&cid="&cid
end if

session("yhj")=yhj

if id=0 or cid=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")
	mk=key("Dream_ModularID")
	Dream_Hits=key("Dream_Hits")
	Dream_UpdateTime=key("Dream_UpdateTime")
	Dream_Time=key("Dream_Time")
	Dream_QQ=key("Dream_QQ")
	Dream_Content=key("Dream_Content")
	Dream_Content2=key("Dream_Content2")
	Dream_Content3=key("Dream_Content3")
	Dream_Content4=key("Dream_Content4")
	Dream_User=key("Dream_User")
	Dream_MapUrl=key("Dream_MapUrl")
	Dream_Make=key("Dream_Make")
	Dream_ProID=key("Dream_ProID")
	if key("Dream_DefaultPicUrl")<>"" then
	Dream_DefaultPicUrl=key("Dream_DefaultPicUrl")
	else
	Dream_DefaultPicUrl=""
	end if
	Dream_Bus=key("Dream_Bus")
	Dream_Address=key("Dream_Address")

	if key("Dream_Phone")<>"" then
	Dream_Phones=key("Dream_Phone")
	else
	Dream_Phones=Dream_Phone
	end if
	
	
	Dream_UrlStr=""

	if trim(key("Dream_Url1"))<>"" then
		Dream_UrlStr=Dream_UrlStr&"<a href="&key("Dream_Url1")&" target=_blank class=Url>官网</a>"
	end if
	
	if trim(key("Dream_Url2"))<>"" then
		Dream_UrlStr=Dream_UrlStr&"<a href="&key("Dream_Url2")&" target=_blank class=Url>微店</a>"
	end if
	
	if trim(key("Dream_Url3"))<>"" then
		Dream_UrlStr=Dream_UrlStr&"<a href="&key("Dream_Url3")&" target=_blank class=Url>团购</a>"
	end if
	
	if trim(key("Dream_Url4"))<>"" then
		Dream_UrlStr=Dream_UrlStr&"<a href="&key("Dream_Url4")&" target=_blank class=Url>关注</a>"
	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 cid <> 0 then
set key=conn.execute("select * from Dream_Theme where ID="&cid)
if not(key.eof and key.bof) then	
	Dream_ClassID=key("Dream_ClassID")
	ClassID=key("ID")
	Dream_Names=key("Dream_Names")
else
	response.Redirect "index.asp"
	response.End()
end if
set key=nothing
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%>">
<meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=no">
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="full-screen" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="address=no">
<link rel="stylesheet" href="../css/style_guolv.css" />
<script type="text/javascript" src="../js/zepto.min.js"></script>
<script type="text/javascript" src="../js/globe.js"></script>
<script type="text/javascript" src="../js/swiper.min.js"></script>
<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>
<section>
<!--#include file="search.asp"-->
<div id="doc">
  <!-- S: 头部 -->
  <header id="hd" bk="tuan_m_detail_top">
    <!-- 文本title -->
    <h1 class="txt-title">商家详情</h1>
    <a href="#" class="home-btn ret-btn" bk="tuan_m_detail_back">返回</a> <a href="index.asp" class="home-btns">首页</a></header>
  <script type="text/javascript">
    
    // History, by lww, 2013/09/02
    ;(function($){
        if(!$) { return; }
        if( history.length > 1){
            $("#hd .ret-btn").show();
        }
        else {
            $("#hd .ret-btn").hide();
        }

        $("#hd .ret-btn").click(function(e){
            e.preventDefault();
            if( history.length > 1 ) {
                history.back();
            }
        });
    })(Zepto);
    
</script>
  <!-- E: 头部 -->
  <div id="bd">
    <!-- S: 轮播 -->
	<div class="lv-project-detail">
    <%if Dream_Content2<>"" then%>
    <div class="swiper-main detail-banner">
      <div class="swiper-container swiper-banner">
        <div class="swiper-wrapper"> <%=GetAllImgSrc(Dream_Content2)%> </div>
      </div>
      <div class="pagination"></div>
    </div>
    <%else%>
    <div id="slidePic" class="slide"><img src="../<%=Dream_DefaultPicUrl%>" alt="" /></div>
    <%end if%>
    <!-- E: 轮播 -->
	</div>
  </div>
  <div class="view">
  	<%if Dream_UrlStr<>"" then%>
  	<div class="view_but"><%=Dream_UrlStr%></div>
	<%end if%>
    <div class="view_t"><%=DreamTitles%></div>	
    <div class="view_con_t">商家信息</div>
	<%if len(Dream_Address)>0 then%>
    <div class="view_canshu"> <h3 class="icon2"><%if Dream_MapUrl<>"" then%><a href="<%=Dream_MapUrl%>" target="_blank"><%=Dream_Address%></a><%else%><%=Dream_Address%><%end if%></h3>
	</div>
	<%end if%>
	<%if len(Dream_Phones)>0 then%>
    <div class="view_canshu"> <h3 class="icon3"><a href="tel:<%=Dream_Phones%>"><%=Dream_Phones%></a></h3></div>
	<%end if%>
	<%if len(Dream_QQ)>0 then%>
    <div class="view_canshu"> <h3 class="icon4"><%=Dream_QQ%></h3></div>
	<%end if%>
	<%if len(Dream_Content3)>0 then%>
	<div class="view_con_t">商家介绍</div>
    <div class="view_con"><%=Dream_Content3%></div>
	<%end if%>
	<%if len(Dream_Content4)>0 then%>
	<div class="view_con_t">优惠信息</div>
    <div class="view_con"><%=Dream_Content4%></div>
	<%end if%>
	<%if len(Dream_Content)>0 then%>
    <div class="view_con_t">
      <h2>温馨提示</h2>
    </div>
    <div class="view_con"><%=Dream_Content%></div>
	<%end if%>
	<%if Dream_Review=true then%>
	<div class="view_con_t2"><h3>评价</h3><span><%=Review(ID)%>分</span></div>
	<%end if%>
  </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></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"><button id="button" class="button">用户点评</button></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%>
  <!--#include file="footer.asp"-->
</div>
<!--#include file="navb.asp"--> 
  <script type="text/javascript">
    
    // History, by lww, 2013/09/02
    ;(function($){
        if(!$) { return; }
        if( history.length > 1){
            $("#fnav .ret-btn").show();
        }
        else {
            $("#fnav .ret-btn").hide();
        }

        $("#fnav .ret-btn").click(function(e){
            e.preventDefault();
            if( history.length > 1 ) {
                history.back();
            }
        });
    })(Zepto);
    
</script>
<script>
  $('#button').click(function () {
			var scontent = $('#scontent').val();						
            if (scontent.length == 0) {
                alert("请输入点评标题及内容");
                return false;
            }else {
			alert('点评成功!');
                return true;
				
            }
        });	
</script>
</section>
</body>
</html>