<!-- #Include File="../Include/Cls_IpSys.asp" -->
<%
'=======================================================
' 欢迎使用《阿赛大型门户网站系统V3.0》，简称“AsaiMHV3”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

dim review_page_num
review_page_num=Format_Mid_Num(27)

function review_type(ChannelIDs,rtid,rturl,rtt,ruser,RScore)
  dim isadmin,rsr,sqlr,rusername,remail,rtype,rtim,retim,rword,reword,rrssum,tmp_review,reip,readonly
  isadmin=false
  if int(login_modep)=1 or int(login_modep)=2 then isadmin=true
  if rtt=0 and ruser=login_username then isadmin=true
  rrssum=0
  sqlr="select count(rid) from AsaiMHReview where ChannelIDs="&ChannelIDs&" and re_id="&rtid
  set rsr=Cls.exec(sqlr,1)
  if not rsr.eof then
    rrssum=rsr(0)
  End If
  '阿赛增加评分汇总开始 
  dim rRScore,rtscore
  sqlr="select sum(RScore) from AsaiMHReview where ChannelIDs="&ChannelIDs&" and re_id="&rtid 
  set rsr=Cls.exec(sqlr,1) 
	rRScore=rsr(0)
  if not rsr.eof then
    rtscore=rtscore+rRScore 
  End If
  rsr.close 
  If rRScore="" or isnumeric(rtscore)=false then rtscore=0
  '评分汇总结束
  tmp_review=tmp_review&"<table cellspacing=1 cellpadding=4 class=rv_table>" & _
	     vbcrlf&"<tr><td class=rv_trt height=20>" 
	     if rrssum=0 then
            tmp_review=tmp_review&"&nbsp;目前尚无评论，评价&nbsp;<font color=red>"&rtscore&"</font>&nbsp;分"
	     else
            tmp_review=tmp_review&"&nbsp;<a href='javascript:;' onclick=""javascript:open_win('"&Cls.Web_Dir&"Common/Review.asp?action=list&ChannelIDs="&ChannelIDs&" &re_id="&rtid&"&rtit="&server.urlencode(tit)&"&ruser="&server.urlencode(ruser)&"','review_list',500,400,'yes');"">有&nbsp;<font color=red>"&rrssum&"</font>&nbsp;位网友参加了评论和打分</a>" & _ 
	     vbcrlf&"&nbsp;共计&nbsp;<font color=red>"&rtscore&"</font>&nbsp;分"
	     end if
  if int(login_modep)=1 or int(login_modep)=2 then
  tmp_review=tmp_review&"&nbsp;<a href='"&Cls.Web_Dir&"Common/Review.asp?action=delete&ChannelIDs="&ChannelIDs&"&re_id="&rtid&"&rurl="&server.urlencode(rturl)&"' onclick=""javascript:return click_return('删除所有评论内容',0);"">删除所有评论</a>"
  End If
  tmp_review=tmp_review&"</td></tr>"
  sqlr="select top "&review_page_num&" rid,rusername,remail,rword,rtim,rtype,retim,reword,rip,RScore from AsaiMHReview where ChannelIDs="&ChannelIDs&" and re_id="&rtid&" order by rid desc"
  set rsr=Cls.exec(sqlr,1)
  do while not rsr.eof
    rusername=rsr("rusername")
    remail=rsr("remail")
    rtype=rsr("rtype")
    rtim=rsr("rtim")
    retim=rsr("retim")
    'rword=rsr("rword")
    rword=Ubb.Ubbcode(rsr("rword"))
    rword=Replace(rword,"<br />","")
    'reword=rsr("reword")
    reword=Ubb.Ubbcode(rsr("reword"))
    reword=Replace(reword,"<br />","")
	rRScore=rsr("RScore")
    reip=ip_types(rsr("rip"))
    if Cls.Is_Null(remail)<>"" then remail="<a href='mailto:"&remail&"'><img src='"&Cls.web_skindir&"sys/email.gif' border=0 align=absmiddle title='"&rusername&" 的电子邮件："&remail&"'></a>"
    if rtype=1 then rusername=format_user_name(rusername,0,"")
    rtim="<font class=tims>"&Cls.time_type(rtim,1)&"</font>"
    tmp_review=tmp_review&"<tr class=rv_tr><td>" & _
	     vbcrlf&"<table border=0 cellspacing=1 cellpadding=4 width='100%' class=tf>" & _
	     vbcrlf&"<tr><td>"&img_skin("h_review")&"&nbsp;网友&nbsp;"&rusername&"&nbsp;评[&nbsp;<font color=red>"&rRScore&"</font>&nbsp;分]&nbsp;<font class=Gys>["&reip&"] </font>"
    tmp_review=tmp_review&"</td><td align=right>"&remail
    if login_username=ruser and login_mode<>"" or isadmin then
    tmp_review=tmp_review&"&nbsp;&nbsp;"&review_page(Cls.Web_Dir&"Common/Review.asp?action=reply&ChannelIDs="&ChannelIDs&" &re_id="&rtid&"&rid="&rsr("rid")&"&rurl="&server.urlencode(rturl))
    End If
    if isadmin then
    tmp_review=tmp_review&"&nbsp;&nbsp;<a href='"&Cls.Web_Dir&"Common/Review.asp?action=del&ChannelIDs="&ChannelIDs&"&re_id="&rtid&"&rid="&rsr("rid")&"&rurl="&server.urlencode(rturl)&"' onclick=""javascript:return click_return('删除这条评论内容',0);""><img src='"&Cls.web_skindir&"sys/del.gif' border=0 align=absmiddle title='删除这条评论'></a>"
    End If
    tmp_review=tmp_review&"&nbsp;&nbsp;"&rtim&"</td></tr>" & _
	     vbcrlf&"<tr><td colspan=2><font class=blue><b>评：</b></font>"&Cls.code_html(rword,2,0)&"</td></tr>"
    if Cls.Is_Null(reword)<>"" then
    tmp_review=tmp_review&"<tr><td colspan=2><font class=red2><b>回：</b></font>"&Cls.code_html(reword,2,0)&"</td></tr>"
    End If
    tmp_review=tmp_review&"</table></td></tr>"
    tmp_review=tmp_review&"<tr class=rv_trline><td></td></tr>"
    rsr.movenext
  loop
  rsr.close
  set rsr=nothing
  readonly=""
  if login_mode<>"" then readonly="readonly"
if int(format_mid_num(40))=1 and login_mode="" then
  tmp_review=tmp_review& vbcrlf&"<tr class=rv_trb><td align=center height=20>发表评论请先 <a href='"&Cls.Web_Dir&"User/Register.asp'>注册</a> 或 <a href='"&Cls.Web_Dir&"User/Login.asp?old_url=back'>登陆</a> 本站！</td></tr></table>" 
else
   tmp_review=tmp_review&"<tr class=rv_trb><td align=center><table border=0 cellspacing=1 cellpadding=4 width='100%'><tr align=left><td width='100%'><table border=0 cellspacing=0 cellpadding=2><form name=review_frm action='"&Cls.Web_Dir&"Common/Review.asp?ChannelIDs="&ChannelIDs&"&re_id="&rtid&"&ruser="&ruser&"&rurl="&server.urlencode(rturl)&"' method=post onsubmit=""javascript:frm_submitonce(this);""><tr height=30><td>我来评分：<td><input type=radio name=RScore checked value='1'>&nbsp;1分&nbsp;<input type=radio name=RScore value='2'>&nbsp;2分&nbsp;<input type=radio name=RScore value='3'>&nbsp;3分&nbsp;<input type=radio name=RScore  value='4'>&nbsp;4分&nbsp;<input type=radio name=RScore value='5'>&nbsp;5分</td></tr><tr><td>您的姓名：</td><td><input type=text class=txt name=rusername value='"&login_username&"' size=25 maxlength=20 "&readonly&"> "&redx&"</td></tr><tr><td>电子邮箱：</td><td><input type=text class=txt name=remail value='"&login_email&"' size=25 id=0 maxlength=50 > "&redx&"</td></tr><tr valign=top><td class=htd>评论内容：<br />250字内</td><td><textarea class=txtarea rows=8 cols=55 name=rword></textarea></td></tr><tr><td>发表评论：</td><td><input type=submit class=btn value='发表评论'>　　<input type=reset class=btn value='重新填写'></td></tr></form></table></td>" & _
	     vbcrlf&"</tr>" & _
	     vbcrlf&"</table>" & _
	     vbcrlf&"</td></tr></table>"
end if
review_type=tmp_review
End Function

function review_page(t1)
	dim a
	a="<a href='javascript:;' onclick=""javascript:open_win('"&t1&"','review_page',500,305,'no');""><img src='"&Cls.web_skindir&"sys/reply.gif' border=0 align=absmiddle title='回复这条评论'></a>"
	review_page=a
End Function
%>
