<%data_path="../"%>

<!--#include file="../conn/conn.asp"-->
<!--#include file="../inc/safe.asp"-->

<%

	if issession=0 then
 	yxflag=Replace_Text(request.Cookies("yxflag"))
	gsid=Replace_Text(request.Cookies("Yxmemberid"))
	gradeid=Replace_Text(request.Cookies("gradeid"))
	else
 	yxflag=session("yxflag")
	gsid=session("id")
	gradeid=session("gradeid")
	end if 
  Response.Buffer = true
  Response.ExpiresAbsolute=now()-1
  Response.Expires=0
  Response.CacheControl="no-cache"
 
if Chkrequest(request("id")) then
id=Replace_Text(request("id"))
else
Response.Redirect (HOPE_InstallDir&"login/chklogin.asp?login=4")
end if
%>
<HTML><HEAD>
<title><%=webname%></title>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="<%=HOPE_InstallDir%>member/images/css.css" rel="stylesheet" type="text/css">
<SCRIPT language=javascript>
function setSubjectText(){
    
	if(trim(document.form.role.value) == "") {
		    alert("请先选择评价身份");
			document.form.role.focus();
		    return false;
	} 
	if(trim(document.form.type.value) == "") {
		    alert("请先选择评价类型");
			document.form.type.focus();
		    return false;
	} 
	if(trim(document.form.content.value) == "") {
		    alert("请先填写评价内容");
			document.form.content.focus();
		    return false;
	} 
	

  //  return true;
	document.form.submit()
    }
function trim(inputString) {
	   
              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;
           } 

</SCRIPT>
</HEAD>
<BODY style="BACKGROUND-REPEAT: no-repeat" text=#000000  ><BR><BR>
<TABLE cellSpacing=1 cellPadding=0 width=520 align=center bgColor=#ff9900 border=0>
  <TBODY>
  <TR>
    <TD align=middle>
      <TABLE cellSpacing=0 cellPadding=10 width="100%" bgColor=#ffffff 
        border=0><TBODY>
        <TR>
          <TD align=middle>
            <TABLE cellSpacing=0 cellPadding=5 width="100%" align=center 
            border=0>
              <TBODY>
			  <%if gsid=""  and  yxflag<>"1"  then%>

			  <TR>
                      <TD class=L vAlign=bottom align=middle colSpan=2 
                  height=26>您还不是会员，不能发表评价！</TD>
                    </TR>
              <TR>
                <TD class=lh13 align=middle colSpan=2 height=21><div align="center"><SPAN 
                  class=S align="center">·您可以<A           href="<%=HOPE_InstallDir%>login/register.asp"      target=_blank>成为会员，认证身份</A></SPAN> <br>
                      <br>
                </div></TD></TR>
				
<%
else
 set rspd=server.CreateObject("adodb.recordset")
 sqlpd="select rolelist from Websen_vipgrade where roleid="&gradeid
 rspd.open sqlpd,conn,1,1
if not rspd.eof then
if instr(rspd("rolelist"),"ypj")>0 then 
   %>
 			  <tr><TD class=lh13 colSpan=2><SPAN 
                  class=M>请认真填写以下表单：</FONT></SPAN><BR>
			<form method="POST" action="<%=HOPE_InstallDir%>trustadv/rempost_save.asp?id=<%=id%>" name="form">
                  <TABLE style="WORD-BREAK: break-all" cellSpacing=3 
                  cellPadding=0 width="100%" bgColor=#ffffff border=0>
                    <TBODY>
                    <TR>
                      <TD>
                        <TABLE style="WORD-BREAK: break-all" cellSpacing=3 
                        cellPadding=0 width="100%" bgColor=#f1f7fa border=0>
                          <TBODY>
                          <TR>
                            <TD>
                              <TABLE cellSpacing=1 cellPadding=5 width="100%" 
                              align=center bgColor=#cae0eb border=0>
                                <TBODY>
                                <TR>
                                <TD class=C align=middle 
                                bgColor=#ffffe1><SELECT name=role> 
								<OPTION value="" selected>请选择评价身份</OPTION> <OPTION 
                          value="买家">买家</OPTION> <OPTION 
                          value="卖家">卖家</OPTION> <OPTION 
                          value="其他">其他</OPTION></SELECT></TD>
                                <TD class=c align=middle 
                                bgColor=#ffffe1><SELECT name=type> 
                          <OPTION value="" selected>请选择评价类型<OPTION 
                          value="好评">好评</OPTION> <OPTION value="建议">建议</OPTION> 
                          <OPTION value="批评">批评</OPTION></SELECT></TD>
                                </TR>
                                </TBODY></TABLE></TD></TR>
                          <TR>
                            <TD>
                              <TABLE cellSpacing=0 cellPadding=5 width="100%" 
                              align=center border=0>
                                <TBODY>
                                <TR vAlign=top>
                                <TD class=c 
                                width="27%">&nbsp;&nbsp;<B>评价内容：</B></TD>
                                <TD 
                                class=sg><TEXTAREA name="content" rows=10 cols=45></TEXTAREA>
                                <FONT 
                  color=red>注意：内容尽可能详细，以提高评价的可信度。</FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
                    <TR>
                      <TD align=middle height=20><div align="center">
                        <INPUT class=subbutton style="WIDTH: 160px" onclick=javascript:setSubjectText() type=button value=一切完成，我要评价！ name=Post>
                                  </div></TD>
                            </TR>
                    <TR>
                      <TD colSpan=2>
                        <DIV 
              align=center></DIV></TD></TR></TBODY></TABLE></form></TD></tr>
 			
 <%
else
 %>  
	 			  <TR>
                      <TD class=L vAlign=bottom align=middle colSpan=2 
                  height=26>对不起！您所在的等级无权限进行评价，不能发表评价！</TD>
                    </TR>
              <TR>
                <TD class=lh13 align=middle colSpan=2 height=21>  <br>
                      <br>
                </div></TD></TR>
				
			<%
  end if
rspd.close
end if
end if	
			%>
			  <TR>
                <TD class=lh13 colSpan=2>
                  <TABLE style="WORD-BREAK: break-all" cellSpacing=3 
                  cellPadding=0 width="100%" bgColor=#ffffff border=0>
                    <TBODY>
                    <TR>
                      <TD>
					  <%
			sql="select Websen_trustadv.*,Websen_corporation.name,Websen_corporation.trust_score from Websen_trustadv,Websen_corporation where Websen_trustadv.bprid="&id&" and Websen_corporation.id=Websen_trustadv.pjrid order by Websen_trustadv.id desc"
			Set rs= Server.CreateObject("ADODB.Recordset") 
            rs.open sql,conn,1,1
			if rs.eof then
			response.write"<tr><TD class=lh13 colSpan=2><div align='center'><SPAN class=M>该会员暂未获得任何的评价</FONT></SPAN></div></td></tr>"
			else
            response.write"<div align=""center"">  <SPAN class=M>以下是该会员获得的最新一条评价：</FONT></SPAN><BR></div><br>"
			%>
					  
                        <TABLE style="WORD-BREAK: break-all" cellSpacing=3 
                        cellPadding=0 width="100%" bgColor=#f1f7fa border=0>
                          <TBODY>
                          <TR>
                            <TD>
                              <TABLE cellSpacing=1 cellPadding=5 width="100%" 
                              align=center bgColor=#cae0eb border=0>
                                <TBODY>
                                <TR>
                                <TD class=C width=250 
                                bgColor=#ffffe1>&nbsp;&nbsp;评价人：<%=rs("name")%></TD>
                                <TD class=c align=middle 
                                bgColor=#ffffe1>指数：<FONT 
                                color=red><B><%=rs("trust_score")%></B></FONT></TD>
                                <TD class=c align=middle 
                                bgColor=#ffffe1>身份：<FONT 
                                color=red><B><%=rs("role")%></B></FONT></TD></TR>
                                <TR>
                                <TD class=c bgColor=#ffffe1>&nbsp;&nbsp;<B>评价性质：</B> <SPAN 
                                class=pj3><%=rs("type")%></SPAN> &nbsp; 
                              </TD>
                                <TD colspan="2" align=middle 
                                bgColor=#ffffe1 class=c> 评价时间：<span class="S S">（<%=FormatDate(rs("dateandtime"),1)%>）</span></TD>
								</TR></TBODY></TABLE></TD></TR>
                          <TR>
                            <TD>
                              <TABLE cellSpacing=0 cellPadding=5 width="100%" 
                              align=center border=0>
                                <TBODY>
                                <TR vAlign=top>
                                <TD class=c 
                                width="21%">&nbsp;&nbsp;<B>评价内容：</B></TD>
                                <TD width="79%" 
                                class=sg><%=rs("content")%> 
                                <BR><BR> 
                                </TD></TR>
                                <TR vAlign=top bgcolor="#FF0000">
                                  <TD colspan="2" class=c><div align="right"></div></TD>
                                  </TR>
                                </TBODY></TABLE></TD></TR></TBODY></TABLE>
<br><DIV align=right><a href="<%=HOPE_InstallDir%>trustadv/rem.asp?id=<%=id%>" target="_blank">查看更多评价信息</a></DIV>
<%
end if

rs.close
set rs=nothing
%></TD></TR>
</TBODY></TABLE></TD></TR>
			  </TBODY></TABLE></TD></TR></TBODY></TABLE></TR></TBODY></TABLE></BODY></HTML>
