<!--#include file=conn.asp-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="plus/xzplus/inc/DvADCharxz.asp" -->

<%
    Head()

	dim admin_flag
	dim nm
	'admin_flag="22"
	
	if dvbbs.UserGroupID>1 then
		Errmsg=ErrMsg + "<BR><li>本页面为管理员专用，请<a href=admin_login.asp target=_top>登录</a>后进入。<br><li>您没有管理本页面的权限。"
		dvbbs_error()
	else

	if request("action")="fix" Then
	Call Fixuser()
	End If

	
		if request("action")="save" then
		call savegrade()
		elseif request("action")="add" then
		call add()
		elseif request("action")="savenew" then
		call savenew()
		elseif request("action")="del" then
		call del()
		else
		call gradeinfo()
		end if
		conn.close
		set conn=nothing
	end if
sub gradeinfo()
%>
<form method="POST" action=z_xzmanager_admin.asp?action=save>
<table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder">
<tr> 
<th height="23" colspan="6" width="944" >奖项属性管理器&nbsp; [<a href="?action=add"><font color="#FFFFFF"><b>添加奖项</b></font></a>]</th> 
</tr>
<tr> 
<td width="70" class=forumHeaderBackgroundAlternate><b>编号</b></td>
<td width="131" class=forumHeaderBackgroundAlternate><b>奖项名称</b></td>
<td width="327" class=forumHeaderBackgroundAlternate><b>相关说明</b></td>
<td width="162" class=forumHeaderBackgroundAlternate><b>图片名</b></td>
<td width="112" class=forumHeaderBackgroundAlternate><b>图片演示</b></td>
<td width="107" class=forumHeaderBackgroundAlternate><B>操作</B></td>
</tr>
<%
set rs=conn.execute("select * from xzdata")
nm=1
do while not rs.eof
%>
<tr> 
<td width="70" class=Forumrow>
<input type=hidden value="<%=nm%>" name="xzcount">
<p align="center">
<input size=3 value="<%=rs("xzid")%>" name="xzid" type=text></td>
<td width="131" class=Forumrow>
<input size=17 value="<%=rs("xzname")%>" name="xzname" type=text></td>
<td width="327" class=Forumrow>
<input size=53 value="<%=rs("xzsm")%>" name="xzsm" type=text></td>
<td width="162" class=Forumrow>
<input size=21 value="<%=rs("xzpicurl")%>" name="xzpicurl" type=text></td>
<td width="112" class=Forumrow>
<img src=plus/xzplus/pic/<%=rs("xzpicurl")%>>　
</td>
<td width="107" class=Forumrow>
<a href="?action=del&xzid=<%=rs("xzid")%>">删除</a></td>
</tr>
<%
nm=nm+1
rs.movenext
loop
rs.close
set rs=nothing
%>
<tr> 
<td width="944" colspan=6 class=Forumrow> 
<input type="submit" name="Submit" value="提 交">
</td>
</tr>
</table>
</form>

<%
'###############<! --CopyRight By jkm -->####################
end sub
sub savegrade()
	Server.ScriptTimeout=99999999
	dim xzname,xzpicurl,xzsm,xzid
	
	for i=1 to request.form("xzcount").count
	xzname=request.form("xzname")(i)
	xzpicurl=request.form("xzpicurl")(i)
	xzsm=request.form("xzsm")(i)
	xzid=request.form("xzid")(i)
	if isnumeric(xzid) and xzname<>"" and xzpicurl<>"" and xzsm<>"" then
	conn.execute("update xzdata set xzname='"&xzname&"',xzpicurl='"&xzpicurl&"',xzsm='"&xzsm&"' where xzid="&xzid)
	end if
	next
	response.write "奖项设置修改成功，请返回。"
	set rs=nothing
end sub
'###############<! --CopyRight By jkm -->####################
sub add()
%>
<form method="POST" action=z_xzmanager_admin.asp?action=savenew>
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"  width="95%" id="AutoNumber2" height="46">
    <tr>
      <td width="100%" height="54">
    <p style="margin-top: 0; margin-bottom: 0"><b>注意</b>：<br>
    ①、点击左面导航[<b><font color="#FF0000">奖项管理</font></b>]切换到奖项添加页面。<br>
    ②、请完整填写所有数据，然后进行保存。</p>
      </td>
    </tr>
  </table>
  </center>
</div>
<table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder" height="93">
<tr> 
<th colspan="2" height="12">添加新的奖项</th>
</tr>
<tr> 
<td width="40%" class=forumrow height="20"><b>奖项名称</b></td>
<td width="60%" class=forumrow height="20">
<input size=30 name="xzname" type=text></td>
</tr>
<tr>
<td width="40%" class=forumrow height="19"><b>奖项说明</b></td>
<td width="60%" class=forumrow height="19">
<input size=30 name="xzsm" type=text></td>
</tr>
<tr>
<td width="40%" class=forumrow height="10"><b>奖项图片</b></td>
<td width="60%" class=forumrow height="10">
<input size=30 name="xzpicurl" type=text></td>
</tr>
<tr>
<td width="100%" class=forumrow height="10" colspan="2"> 
<input type="submit" name="Submit" value="提 交"> </td>
</tr>
</table>
</form>
<%
end sub
sub savenew()
if request.form("xzname")="" then
	Errmsg="<br><li>请输入奖项名称。"
	call dvbbs_error()
	exit sub
end if
if request.form("xzsm")="" then
	Errmsg="<br><li>请输入奖项描述。"
	call dvbbs_error()
	exit sub
end if
if request.form("xzpicurl")="" then
	Errmsg="<br><li>请输入图片名。"
	call dvbbs_error()
	exit sub
end if
set rs = server.CreateObject ("Adodb.recordset")
sql="select * from xzdata where xzname='"&request.form("xzname")&"'"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
rs.addnew
rs("xzname")=request.form("xzname")
rs("xzsm")=request.form("xzsm")
rs("xzpicurl")=request.form("xzpicurl")
rs.update
else
	Errmsg="<br><li>该奖项已存在！"
	call dvbbs_error()
	exit sub
end if
rs.close
set rs=nothing
response.write "该奖项已被成功添加！建议您到奖项管理器中进行属性操作！"
end sub
sub del()
Server.ScriptTimeout=99999999
dim xzid
if isnumeric(request("xzid")) then
conn.execute("delete from xzdata where xzid="&request("xzid"))
response.write "删除成功！建议您到奖项属性管理器中进行其他操作！"
set rs=nothing
end if
end sub
%>