 <% 
	data_path="../../" 'ACC连接数据库路径，对SQL无效
	numid="15"
	dir="../err.asp" 
  %> 
  <!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
 <!--#include file="../rolecheck.asp"-->
 
<html>
<head><title></title>

<link rel="stylesheet" type="text/css" href="../css/style.css">
<style type="text/css">
<!--
.STYLE4 {color: #666666}
.STYLE5 {color: #0099CC}
-->
</style>
</head>

<%
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'处理更新商务指数：	
     	dim modi,id
		id=replace_text(request("id"))
		modi=replace_text(request("modi"))
		
		'^^^^^^^^^^^^^^^^^^^^^^^^^^^^
		
		
		if modi="modify" and id<>"" then
			userzhi=Result_Yst(id)
		   conn.execute "update Websen_corporation set trust_score="&userzhi&" where id="&id
		   response.Redirect(request.ServerVariables("HTTP_REFERER"))
		end if

'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 '修改商务指数表单:
		dim editmod,editname,edityi
		edityi=replace_text(request("edityi"))
		editname=replace_text(request("editname"))
		editgo=replace_text(request("editgo"))
		
		if editgo<>"" and editname<>"" and edityi<>"" then
		
		if not isnumeric(edityi) then
		 response.Write("<script>alert('请输入数字!');history.back(-1);</script>")
		 response.End()
		end if
		if edityi<=0 then
		 edityi=0
		end if
		
		 conn.execute "update Websen_corporation set trust_score="&edityi&" where id="&editname
		  response.Redirect(request.ServerVariables("HTTP_REFERER"))
		
		end if

'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'更新所有商务指数：
		dim editall
		editall=replace_text(request("editall"))
		if editall="editall" then
		set rsall=server.CreateObject("adodb.recordset")
		sqlall="select id,trust_score from Websen_corporation where flag=1   order by id desc "
		rsall.open sqlall,conn,1,3
		if not rsall.eof then
		do while not rsall.eof 
		
		yishu=Result_Yst(rsall("id"))
		rsall("trust_score")=yishu
		rsall.update()
		
		rsall.movenext
		loop
		set rsall=nothing
		end if
		
		end if




'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


%>


<body>
 <table width="98%" border="0" cellspacing="0" cellpadding="0"  align=center class="tableBorder">
<tr> 
<th class="tableHeaderText" colspan=2 height=25>商务指数管理&nbsp;&nbsp;<a href="swzhishu.asp?editall=editall"><font color="#333333">重新统计更新所有商务指数</font></a></th>
</tr></table>
 <table width="98%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#7698DD" >
   <tr>
     <td>
 
       <span class="STYLE4">&nbsp;<span class="STYLE5">1</span>、企业身份认证(通过第三方身份认证,加10分)  &nbsp;<span class="STYLE5">2</span>、会员年限（加入会员的时间,从第2年开始,加20分/年）&nbsp;<span class="STYLE5">3</span>、客户评价(好评加2分,中评不加分,批评减2分)--只有会员之间才可以相互评价、积分. <span class="STYLE5">4</span>、证书荣誉(将企业线下经营所积累的信用延伸到网上)（1）&quot;税务登记证&quot;5分/张,5分封顶;（2）经营许可类证书、产品类证书、其他证书：2分/张,10分封顶. <span class="STYLE5">5</span>.对会员的评论进行审核后对被评论的会员的商务指数进行加减分处理:+1分/好评,-1分/批评&nbsp;说明：以上五大因素,第1点是基础,如果没有通过身份认证,其他3点都无法生效.同时,企业身份认证周期是一年一次     </span></td>
</tr></table>


<%

'修改商务指数表单:
		
		dim editory,editid
		editid=replace_text(request("editid"))
		editory=replace_text(request("editory"))
		if editory="eidt" then
 %>
 
 <table border="1"  align="center" bordercolor="#7698DD" cellpadding="0"  cellspacing="0" width="98%" >
 <form name="editform" action="swzhishu.asp" method="post">
 <tr><td align="center" height="30">
 
 <%
 
 set rsedit=server.CreateObject("adodb.recordset")
 sqledit="select id,qymc,trust_score from Websen_corporation where id="&editid
 rsedit.open sqledit,conn,1,1
 if rsedit.eof then
  zhishu=0
  id=0
  qiname=""
 end if
 if not rsedit.eof then
 id=rsedit("id")
 zhishu=rsedit("trust_score")
 qiname=rsedit("qymc")
 set rsedit=nothing
 end if
 %>
 
 修改会员[&nbsp;<font color="red"><%=qiname%></font>&nbsp;]的商务指数:<input type="text" name="edityi" maxlength="8" value="<%=zhishu%>"><input name="editname" type="hidden" value="<%=editid%>"><input type="submit" value="修改" name="editgo">

</td></tr></form>
</table>
<%
 end if
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%>
   
<table width="98%"  border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#7698DD">
  <tr><td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr><td width="21%" height="25" align="center" class=bodytitle><font color="#CC3300"><b>商务会员名称</b></font></td>
  <td width="18%" height="25" align="center" class=bodytitle><font color="#CC3300"><b>商务服务状态</b></font></td>
  <td width="9%" height="25" align="center" class=bodytitle><font color="#CC3300"><b>商务指数</b></font></td>
  <td width="44%" height="25" align="center" class=bodytitle><font color="#CC3300"><b>指数详细</b></font></td>
  <td width="8%" height="25" align="center" class=bodytitle><font color="#CC3300"><b>操作</b></font></td>
</tr>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from Websen_corporation where flag=1   order by id desc "
rs.open sql,conn,1,1
msg_per_page=15 '定义每页显示记录条数
%>
<!--#include file="../../inc/headpage.asp"-->
<%
if rs.eof then
response.Write("<tr><td>暂无商务会员</td></tr>")
end if
if not rs.eof then
iy=1
do while not rs.eof and rowcount > 0

 
%>

<tr onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#BFDFFF'" bgcolor="<%if iy mod 2=0 then response.Write("#DDE2EC") else response.Write("#F1F3F5") end if%>"><td height="35" align="left"  >&nbsp;<a title="查看或修改企业资料" href="../vipgrade/useredit.asp?id=<%=rs("id")%>">
  <% Set re = New RegExp
re.Pattern ="("&keywords&")"
re.IgnoreCase = True
re.Global=True
result = re.Replace(rs("user"), "<font color=red>$1</font>")%><%=result%></a></td>
  <td height="25" align="center"  ><%
  if  rs("enddate")>=date() then
  response.Write("<font color=#778FA8>正常</font>")
  else
  response.Write("<font color=red>已过期<font color=blue>"&datediff("h",rs("enddate"),date())&"</font>小时=<font color=blue>"&datediff("d",rs("enddate"),date())&"</font>天</font>")
  end if
  
  
  %></td>
  <td height="25" align="center"  ><font color="#BE6D56"><b><%=rs("trust_score")%></b></font></td>
  <td height="25" align="center"  >
   
  企业身份认证:10分;商务使用年限:
  <%
  
	  '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^start ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  
	  if datediff("d",rs("BeginDate"),date())>365 then '从第 2 年开始，加 20 分 / 年
	   response.Write(cint(datediff("d",rs("BeginDate"),date())/365)*20)
	   else
	   response.Write("0")
	  end if
	  
	  %>分;
	  
	  <%
	  '对税务登记证或产品类证书或经营许可证类证书或其他证书
	  set rszz=server.CreateObject("adodb.recordset")
	  sqlzz="select * from Websen_bizre where sh=1 and typeid=3 and  gsid="&rs("id")
	  rszz.open sqlzz,conn,1,1
	  if rszz.eof then
	   response.Write("")
	  end if
	  if not rszz.eof then
	  response.Write("税务登记证:5分;")
	  set rszz=nothing
	  end if
	  '^^^^^^^^
	  '经营许可证类证书
	 set rsz2=server.CreateObject("adodb.recordset")
	 sqlz2="select count(*) as ztotal from  Websen_bizre where sh=1 and typeid =1 and gsid="&rs("id")
	 rsz2.open sqlz2,conn,1,1
	 if not rsz2.eof then
	   jinying=rsz2("ztotal")*2
	   if jinying>10 then
		jinying=10
	   end if
	   
	   set rsz2=nothing
	 end if
	  if jinying<>0 then
	   response.Write("经营许可证类证书:"&jinying&"分;")
	  end if
	  
	  '^^^^^^^^
	  '产品类证书
	  set rsz3=server.CreateObject("adodb.recordset")
	 sqlz3="select count(*) as ztotal from  Websen_bizre where sh=1 and typeid =2 and gsid="&rs("id")
	 rsz3.open sqlz3,conn,1,1
	 if not rsz3.eof then
	   chanpin=rsz3("ztotal")*2
	   
	   if chanpin>10 then
		chanpin=10
	   end if
	   if chanpin<>0 then
	   response.Write("产品类证书:"&chanpin&"分;")
	  end if
	   set rsz3=nothing
	 end if
	  '^^^^^^^^^^^^^
	  '其他证书
		set rsz4=server.CreateObject("adodb.recordset")
	 sqlz4="select count(*) as ztotal from  Websen_bizre where sh=1 and typeid =4 and gsid="&rs("id")
	 rsz4.open sqlz4,conn,1,1
	 if rsz4.eof then
	
	  qita=0
	 end if
	 if not rsz4.eof then
	   qita=rsz4("ztotal")*2
	   if qita>10 then
		qita=10
	   end if
	   if qita<>0 then
	   response.Write("其他证书:"&qita&"分;")
	   end if
	   
	   set rsz4=nothing
	 end if
	  '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  
	  
	  '执行加分的操作:
	  haopin=0
	  set rsjj=server.CreateObject("adodb.recordset")
	  sqljj="select * from Websen_trustadv where abs(pass)=1 and type='好评' and bprid="&rs("id")
	  rsjj.open sqljj,conn,1,1
	  if rsjj.eof then
       haopin=0
	  end if
	  if not rsjj.eof then
	  do while not rsjj.eof 
	      haopin=haopin+1
	   
	  rsjj.movenext
	    loop
		response.Write("好评:")
         response.Write(haopin)
		 response.Write("分;")
   	    set rsjj=nothing
	    end if
	  '^^^^^^^^^^^^^^^^^^^^^^^减分^^^^^^
	  pipin=0
	  set rspp=server.CreateObject("adodb.recordset")
	  sqlpp="select * from Websen_trustadv where abs(pass)=1 and type='批评' and bprid="&rs("id")
	  rspp.open sqlpp,conn,1,1
	  if rspp.eof then
       pipin=0
	  end if
	   if not rspp.eof then
	   do while not rspp.eof 
	      pipin=pipin-1
	   
	   rspp.movenext
	   loop
	   response.Write("批评:"&pipin&"分;")
	   set rspp=nothing
	  end if
   	  
	'^^^^^^^^^^^^^^^^^^^^^^^^^^^^end ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 	  %>
   
  </td>
  <td height="25" align="center" ><a href="swzhishu.asp?modi=modify&id=<%=rs("id")%>" title="重新统计该会员的指数值">更新</a>&nbsp;<a href="swzhishu.asp?editory=eidt&editid=<%=rs("id")%>&page=<%=currentpage%>" title="直接修改该会员的指数值">修改</a></td>
</tr>
  <%
  icolor=icolor+1
if icolor>1 then icolor=0
rowcount=rowcount-1
rs.movenext
iy=iy+1
loop
 
 %>

</table></td></tr></table>
<table border="0" align="center" cellpadding="0" cellspacing="0"  width="98%"><tr><td align="center"><%=listPages("swzhishu.asp")%></td></tr></table>
<%
set rs=nothing
end if
%>
</body>

</html>

<%
'统计计算商务指数：
	Function Result_Yst(idno)
	
	 
	 ' 企业身份认证:10分;
	   shenfen=10
	  	 
		 
	 '商务使用年限:
       set rsc=server.CreateObject("adodb.recordset")
	   sqlc="select  BeginDate from Websen_corporation where id="&idno
	   rsc.open sqlc,conn,1,1
	   if rsc.eof then
         nian=0
	   end if
	   if not rsc.eof then
       if datediff("d",rsc("BeginDate"),date())>365 then '从第 2 年开始，加 20 分 / 年
         nian=cint(datediff("d",rsc("BeginDate"),date())/365)*20
       else
         nian=0
       end if
	   set rsc=nothing
	   end if
	  
	  
	  '对税务登记证或产品类证书或经营许可证类证书或其他证书:
	  
	  set rszz=server.CreateObject("adodb.recordset")
	  sqlzz="select * from Websen_bizre where sh=1 and typeid=3 and  gsid="&idno
	  rszz.open sqlzz,conn,1,1
	  if rszz.eof then
	  shuiwu=0
	  end if
	  if not rszz.eof then
	  shuiwu=5
	  set rszz=nothing
	  end if
	  '^^^^^^^^
	  
	  '经营许可证类证书
	 set rsz2=server.CreateObject("adodb.recordset")
	 sqlz2="select count(*) as ztotal from  Websen_bizre where sh=1 and typeid =1 and gsid="&idno
	 rsz2.open sqlz2,conn,1,1
	 if rsz2.eof then
     jinying=0
	 end if
	 if not rsz2.eof then
	   jinying=rsz2("ztotal")*2
	   if jinying>10 then
		jinying=10
	   end if
	 set rsz2=nothing
	 end if
	 
	  '^^^^^^^^
	  
	  
	  '产品类证书
	  set rsz3=server.CreateObject("adodb.recordset")
	  sqlz3="select count(*) as ztotal from  Websen_bizre where sh=1 and typeid =2 and gsid="&idno
	  rsz3.open sqlz3,conn,1,1
	  if rsz3.eof then
       chanpin=0
	  end if
	  if not rsz3.eof then
	   chanpin=rsz3("ztotal")*2
	   
	   if chanpin>10 then
		chanpin=10
	   end if
	  set rsz3=nothing
	  end if
	  '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  
	  
	  '其他证书
	 set rsz4=server.CreateObject("adodb.recordset")
	 sqlz4="select count(*) as ztotal from  Websen_bizre where sh=1 and typeid =4 and gsid="&idno
	 rsz4.open sqlz4,conn,1,1
	 if rsz4.eof then
      qita=0
	 end if
	 if not rsz4.eof then
	   qita=rsz4("ztotal")*2
	   if qita>10 then
		qita=10
	   end if
	 set rsz4=nothing
	 end if
	 
	 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	   '执行加分的操作:
	  haopin=0
	  set rsjj=server.CreateObject("adodb.recordset")
	  sqljj="select * from Websen_trustadv where abs(pass)=1 and type='好评' and bprid="&idno
	  rsjj.open sqljj,conn,1,1
	  if rsjj.eof then
          haopin=0
	  end if
	  if not rsjj.eof then
	  do while not rsjj.eof 
	      haopin=haopin+1
	   
	  rsjj.movenext
	    loop
		response.Write("好评:")
         response.Write(haopin)
		 response.Write("分;")
   	    set rsjj=nothing
	    end if
	  '^^^^^^^^^^^^^^^^^^^^^^^^减分^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  pipin=0
	  set rspp=server.CreateObject("adodb.recordset")
	  sqlpp="select * from Websen_trustadv where abs(pass)=1 and type='批评' and bprid="&idno
	  rspp.open sqlpp,conn,1,1
	   if rspp.eof then
          pipin=0
	   end if
	   if not rspp.eof then
	   do while not rspp.eof 
	      pipin=pipin-1
	   
	   rspp.movenext
	   loop
	   response.Write("批评:"&pipin&"分;")
	   set rspp=nothing
	   end if
	  '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  
	  
	  Result_Yst=shenfen+nian+shuiwu+jinying+chanpin+qita+haopin+pipin
	
 End Function





'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
%>