<!-- #include file=conn.asp-->
<!-- #include file=inc/const.asp -->
<%'kyo21于20050712修正此文件，解决分页不正常的问题%>
<%
	dim rs,nm,i,sql,TotalRec,Pcount,Orders,Page,TempStr

If Dvbbs.userid=0 Then Dvbbs.AddErrCode(6):Dvbbs.Showerr() end if
Dvbbs.LoadTemplates("paper_even_toplist")
ConnectionDatabase()
dim themenu,menu(8)
	
	menu(0)="勋章介绍"
	menu(1)="获得勋章名单"
	menu(2)="颁发勋章"
	menu(3)="勋章管理"
	menu(4)="事件察看"

 if request.querystring("menu")="" then
		themenu=0
	else
		themenu=request.querystring("menu")
	end if	

  
  sub xztitle
	set rs=conn.execute("select xzdata from Dv_user where username='"&Dvbbs.Membername&"'")

	'response.write "<table  width='100%' cellpadding=2 cellspacing=1 align=center class=tableborder2 >"
	response.write "	<tr>"
	response.write "		<th align=center valign=middle >&nbsp;&nbsp;&nbsp;&nbsp;"
	response.write "		<a href=z_xzindex.asp><font color=navy>勋章介绍</font></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;"
	response.write "		<a href=z_xzindex.asp?menu=1><font color=navy>获得勋章名单</font></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;"
	If dvbbs.usergroupid<=2 Then
	response.write "		<a href=z_xzindex.asp?menu=2><font color=navy>颁发勋章</font></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;"
	response.write "		<a href=z_xzindex.asp?menu=3><font color=navy>勋章管理</font></a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;"
	end if
	response.write "		<a href=z_xzindex.asp?menu=4><font color=navy>事件察看</font></a> "
	response.write "		</th>"
	response.write "	</tr> "
	'response.write "</table>"
	response.write "<br>"
	'response.write "<table width='70%' align=center cellpadding=3 cellspacing=1 class=tableborder2>"
	
	response.write "<tr>"
    response.write "<td height=1 align=center class=tablebody2>您现在获得的勋章："
    
    '###########################
dim xzrs,xzid,xzname,xzsm,xzpicurl,xzdata,xzq

if rs("xzdata")<>"" then
	
	xzdata=split(rs("xzdata"),"|||")
	for i=0 to ubound(xzdata)
		xzq=xzdata(i)
                if xzq<>"0" then
		set xzrs=conn.execute("select * from xzdata where xzid="&xzq)
		xzid=xzrs("xzid")
		xzname=xzrs("xzname")
		xzsm=xzrs("xzsm")
		xzpicurl=xzrs("xzpicurl")
		response.write "&nbsp;&nbsp;<img src=plus/xzplus/pic/"&xzrs("xzpicurl")&" title="&xzsm&">"
		end if
	next
else
response.write "要努力哦！你暂时没有什么勋章！"

end if
'###########################
    
    
	response.write "</td></tr>"
	response.write "<tr>"
	response.write "	<th height=25>" & dvbbs.stats & "</td>"
	response.write "</tr>"
end sub

  

If Dvbbs.GroupSetting(1)="0" Then Dvbbs.AddErrCode(64)
Dvbbs.ShowErr()
Dvbbs.stats=menu(themenu)
Dvbbs.Nav()
Dvbbs.Head_var 0,0,"勋章介绍","z_xzindex.asp"

call main()


Dvbbs.ActiveOnline()
Dvbbs.footer()



sub main()

  

%>
<table border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder1>
  <tr> 
  
	<td>
<% Call xztitle()%>

    </td>
  </tr>
  <tr>
    <td class=tablebody1> <%select case themenu

	case 0
	Call menu0()
	case 1
	Call menu1()
	case 2
	Call menu2()
	case 3
	Call menu3()
	case 4
	Call menu4()
	case 5
	Call menu5()
	end select
%>
	  </td>
	</tr>
	</table>
<%
end sub

sub menu0()
%>
  

<table border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder1>
	<tr >
		<td colspan=2 align="center" class=tablebody1>勋章办法介绍</td>
	</tr>
	<tr > 
		<td class=tablebody1 width=30% valign=top>
		<TABLE border="0" align="center" cellpadding="3" cellspacing="1" width=80% >
		<TR>
			<TD valign=top><div align="center">勋章办法介绍</div></TD>
		</TR>
		</TABLE>
		</td>
		<td class=tablebody1>
			<TABLE border="0"  width="550" align="center" cellpadding="3" cellspacing="1" 

class=tableborder1>
				<TR>
					<td class=tablebody3><div align="center">勋章名称</div></td>
					<td class=tablebody3><div align="center">说明</div></td>
					<td class=tablebody3><div align="center">勋章图示</div></td>
				</TR>
	<%
		set rs=conn.execute("select * from xzdata")
nm=1
do while not rs.eof
	%>
				<TR>
					<TD class=tablebody1 

align="center"><%=rs("xzname")%></TD>
					<TD class=tablebody1 align="center"><%=rs("xzsm")%></TD>
					<TD class=tablebody1 align="center"><img 

src=plus/xzplus/pic/<%=rs("xzpicurl")%>></TD>
				</TR>
	<%
			nm=nm+1
rs.movenext
loop
rs.close
set rs=nothing
	%>
</TABLE>
		</td>
    </tr>
</table>
<%
end sub






sub menu1()
%>
<br>
<br>
<table border="0" align="center" valign="top" cellspacing="1" class=tableborder1>
<tr>
<th>
姓名
</th>
<th>
勋章一
</th>
<th>
勋章二
</th>
<th>
勋章三
</th>
<th>
勋章四
</th>
<th>
勋章五
</th>
</tr>
<tr>
<%
Set Rs=Server.CreateObject("ADODB.RecordSet")
			sql="select userid,username,xzdata from [dv_user] where xzdata<>'' "

	If Not IsObject(Conn) Then ConnectionDatabase
	Rs.Open SQL,Conn,1,1
	If Not Rs.Eof Then TotalRec=Rs.RecordCount

	Dvbbs.SqlQueryNum = Dvbbs.SqlQueryNum + 1
	If Rs.Eof And Rs.Bof Then
		response.write "<tr><td colspan=5 class=tablebody1>　　还没有任何用户数据。</font></td></tr>"
	Else
		If TotalRec Mod Dvbbs.Forum_Setting(11)=0 Then
			Pcount= TotalRec \ Dvbbs.Forum_Setting(11)
		Else
			Pcount= TotalRec \ Dvbbs.Forum_Setting(11)+1
		End If

		Page=Cint(Request("page"))'kyo21添加
		If Not (IsSqlDataBase=1 And Orders=7 And IsBuss=1) Then
			RS.MoveFirst
			if Page > Pcount then Page = Pcount
   			if Page < 1 then Page=1
			RS.Move (Page-1) * Dvbbs.Forum_Setting(11)
			SQL=Rs.GetRows(Dvbbs.Forum_Setting(11))
		Else
			SQL=Rs.GetRows(-1)
		End If
		Set Rs=Nothing
	'userid=0,username=1,rank_name=2,UserRank=3,Rank_url=4,JoinDate=5
		For i = 0 To Ubound(SQL,2)
%>
<td align=left class=tablebody1 width=15%>&nbsp;<a href=dispuser.asp?id=<%=SQL(0,i)%> target=_blank><%=SQL(1,i)%></a></td>
<td align=center class=tablebody2 width=15%>
<%
    '###########################
dim xzrs,xzid,xzname,xzsm,xzpicurl,xzdata,xzq

	xzdata=split(SQL(2,i),"|||")
		'第一枚
		
        response.write "<table><tr><td align=center>"
    
      
		xzq=xzdata(0)
                if xzq<>"0" then
		set xzrs=conn.execute("select * from xzdata where xzid="&xzq)
		xzid=xzrs("xzid")
		xzname=xzrs("xzname")
		xzsm=xzrs("xzsm")
		xzpicurl=xzrs("xzpicurl")
		response.write "<img src=plus/xzplus/pic/"&xzrs("xzpicurl")&" title="&xzsm&">"
		
		
      
      
      response.write "</td></tr><tr><td align=center>"
    
    
      
      
      response.write ""&xzname&""
      end if
       response.write "</td></tr></table>"
       response.write "</td>"

         response.write "<td align=center class=tablebody2 width='15%'>"
  
    response.write "<table><tr><td align=center>"


		


				'第二枚
				xzq=xzdata(1)
                if xzq<>"0" then
		set xzrs=conn.execute("select * from xzdata where xzid="&xzq)
		xzid=xzrs("xzid")
		xzname=xzrs("xzname")
		xzsm=xzrs("xzsm")
		xzpicurl=xzrs("xzpicurl")
		response.write "<img src=plus/xzplus/pic/"&xzrs("xzpicurl")&" title="&xzsm&">"
		

 response.write "</td></tr><tr><td align=center>"
    
    
      
      
      response.write ""&xzname&""
      end if
       response.write "</td></tr></table>"
       response.write "</td>"

          response.write "<td align=center class=tablebody2 width='15%'>"
 
    response.write "<table><tr><td align=center>"


		

		
       



'第三枚
				xzq=xzdata(2)
                if xzq<>"0" then
		set xzrs=conn.execute("select * from xzdata where xzid="&xzq)
		xzid=xzrs("xzid")
		xzname=xzrs("xzname")
		xzsm=xzrs("xzsm")
		xzpicurl=xzrs("xzpicurl")
		response.write "<img src=plus/xzplus/pic/"&xzrs("xzpicurl")&" title="&xzsm&">"
		
 response.write "</td></tr><tr><td align=center>"
    
    
      
      
      response.write ""&xzname&""
      end if
       response.write "</td></tr></table>"
         response.write "</td>"

       response.write "<td align=center class=tablebody2 width='15%'>"
    
    response.write "<table><tr><td align=center>"


		

		
     



'第四枚
				xzq=xzdata(3)
                if xzq<>"0" then
		set xzrs=conn.execute("select * from xzdata where xzid="&xzq)
		xzid=xzrs("xzid")
		xzname=xzrs("xzname")
		xzsm=xzrs("xzsm")
		xzpicurl=xzrs("xzpicurl")
		response.write "<img src=plus/xzplus/pic/"&xzrs("xzpicurl")&" title="&xzsm&">"
		

 response.write "</td></tr><tr><td align=center>"
    
    
      
      
      response.write ""&xzname&""
      end if
       response.write "</td></tr></table>"
         response.write "</td>"

        response.write "<td align=center class=tablebody2 width='15%'>"
   
    response.write "<table><tr><td align=center>"


		

		
     



'第五枚
				xzq=xzdata(4)
                if xzq<>"0" then
		set xzrs=conn.execute("select * from xzdata where xzid="&xzq)
		xzid=xzrs("xzid")
		xzname=xzrs("xzname")
		xzsm=xzrs("xzsm")
		xzpicurl=xzrs("xzpicurl")
		response.write "<img src=plus/xzplus/pic/"&xzrs("xzpicurl")&" title="&xzsm&">"
		
 response.write "</td></tr><tr><td align=center>"
    
    
      
      
      response.write ""&xzname&""
      end if
       response.write "</td></tr></table>"
    

		response.write "</td>"


		

	'response.write "<br>"
'###########################
    
%>



</tr>
<%
		Next
%>
</table>
<%
		TempStr = template.html(3)
		TempStr = Replace(TempStr,"{$action}","")'kyo21添加
		TempStr = Replace(TempStr,"{$keyword}","")'kyo21添加
		TempStr = Replace(TempStr,"{$page}",page)
		TempStr = Replace(TempStr,"{$Pcount}",Pcount)
		TempStr = Replace(TempStr,"{$width}",Dvbbs.mainsetting(0))
		TempStr = Replace(TempStr,"{$alertcolor}",Dvbbs.mainsetting(1))
		TempStr = Replace(TempStr,"{$pagelimited}",Dvbbs.Forum_Setting(11))
		TempStr = Replace(TempStr,"{$listnum}",totalrec)
		TempStr = Replace(TempStr,"{$boardid}","&menu=1&orders="&orders)'kyo21修正Menu=1

	response.write TempStr
	End If


%>
     
      
	 
<%
end sub

sub menu2()
%>
       <table width="50%" border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder1>
        <tr >
          <td align="center" height=500 class=TableBody1><IFRame marginwidth=0 marginheight=0  width=100% height=100% src=z_xzup_admin.asp frameborder=0 scrolling=no></iframe></td>
        </tr>
		<tr>
		  <td align="center" class=TableBody1><font color="#FF0000">注意</font>
		  </td>
		</tr>
      </table>
<%
end sub

sub menu3()
%>
      <table width="50%" border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder1>
        <tr >
          <td align="center" height=600 class=TableBody1><IFRame marginwidth=0 marginheight=0  width=100% height=100% src=z_xzmanager_admin.asp frameborder=0 scrolling=yes></iframe></td>
        </tr>
		<tr>
		  <td align="center" class=TableBody1>

    <p style="margin-top: 0; margin-bottom: 0"><b>注意</b>：<br>
    ①、编号中必须添入数值，否则不能保存。<br>
    ②、请完整填写所有数据，然后进行保存。<br>
    ③、点击[<b><font color="#FF0000">添加奖项</font></b>]切换到奖项添加页面。</p>
    
		  </td>
		</tr>
      </table>
<%
    
end sub

sub menu4()
	Dim Page
	Dim select1,select2
	Dim TempStr
	Dim TotalRec,i,Pcount

	TotalRec=0
	Page=request("page")
	If Page="" Or Not IsNumerIc(Page) Then Page=1
	Page=Clng(Page)

	'sql="select * from xz_log "

	sql="select xz_date,xz_owner,xz_user,xz_pos,xz_level,xz_why from xz_log "

%>
<table cellpadding=6 cellspacing=1 align=center class=tableborder1>
<tr> 
<th>日期时间</th>
<th>颁发者</th>
<th>被颁发者</th>
<th>情况</th>
<th>对应勋章</th>
<th>颁发原因</th>
</tr>
<%

	Set Rs=Server.CreateObject("ADODB.RecordSet")
	If Not IsObject(Conn) Then ConnectionDatabase
	Rs.Open SQL,Conn,1,1
	If Not Rs.Eof Then TotalRec=Rs.RecordCount

	Dvbbs.SqlQueryNum = Dvbbs.SqlQueryNum + 1
	If Rs.Eof And Rs.Bof Then
		response.write "<tr><td colspan=6 class=tablebody1>　　还没有任何事件。</font></td></tr>"
	Else
		If TotalRec Mod Dvbbs.Forum_Setting(11)=0 Then
			Pcount= TotalRec \ Dvbbs.Forum_Setting(11)
		Else
			Pcount= TotalRec \ Dvbbs.Forum_Setting(11)+1
		End If
		RS.MoveFirst
		if Page > Pcount then Page = Pcount
		if Page < 1 then Page=1
		RS.Move (Page-1) * Dvbbs.Forum_Setting(11)
		SQL=Rs.GetRows(Dvbbs.Forum_Setting(11))
		Set Rs=Nothing
	        'rank_date=0,rank_owner=1,rank_user=2,rank_pos=3,rank_level=4,Rank_url=5,rank_why=6
		For i = 0 To Ubound(SQL,2)
	%>
<tr>
<td class=tablebody1 width=150><%=SQL(0,i)%></a></td>
<td align=center width=100 class=tablebody2><%=SQL(2,i)%></td>
<td align=center width=100 class=tablebody1><%=SQL(1,i)%></td>
<td align=center width=100 class=tablebody2><%=SQL(3,i)%></td>
<td align=center width=100 class=tablebody1><img border=0 src="plus/xzplus/pic/<%=SQL(4,i)%>.gif"></a></td>
<td align=left class=tablebody2><%=SQL(5,i)%></td>
</tr>
<%
		Next
%>
</table>
<%
		TempStr = template.html(3)
		TempStr = Replace(TempStr,"{$action}","")
		TempStr = Replace(TempStr,"{$keyword}","")
		TempStr = Replace(TempStr,"{$page}",page)
		TempStr = Replace(TempStr,"{$Pcount}",Pcount)
		TempStr = Replace(TempStr,"{$width}",Dvbbs.mainsetting(0))
		TempStr = Replace(TempStr,"{$alertcolor}",Dvbbs.mainsetting(1))
		TempStr = Replace(TempStr,"{$pagelimited}",Dvbbs.Forum_Setting(11))
		TempStr = Replace(TempStr,"{$listnum}",totalrec)
		TempStr = Replace(TempStr,"{$boardid}","0&menu=4&orders="&orders)
	response.write TempStr
	End If
end sub



%>