<!--#include file="../setting/conn.asp"--><%:SoonBiz.chkadmin:cid=8:act=SoonBiz.ract():Select Case act:Case "" : mainpage:Case "creatnewclass" : classinfo(false):Case "SaveNewClass" : SaveClass (False):Case "editclass" : classinfo(True):Case "saveeditclass" : SaveClass (True):Case "delclass":SoonBiz.execute("delete from "& sheethead &"_class where id="&SoonBiz.rid("classid")):SoonBiz.Execute("delete from "& sheethead &"_article where classid="&SoonBiz.rid("classid")):SoonBiz.Execute("delete from "& sheethead &"_vote where classid="&SoonBiz.rid("classid")):SoonBiz.loadclass():SoonBiz.loadcachenum (cid):SoonBiz.ok:Case "list" : list :Case "savenew" : saveinfo(False):Case "delinfo":sql="delete from "& sheethead &"_article where id="&SoonBiz.rid("id"):SoonBiz.execute(sql):SoonBiz.loadcachenum (cid):SoonBiz.ok:Case "saveedit" : saveinfo(True):Case "edititem" : fileinfo(true):Case "postlist" : postlist :Case "removehis" :SoonBiz.execute("delete from "& sheethead &"_vote"):SoonBiz.ok:End Select:SoonBiz.AdFoot():Setallnothing:Sub mainpage():Dim tr:tr=" <tr onmouseover=""this.style.backgroundColor='#e2e8f4';"" onmouseout=""this.style.backgroundColor='';"" > <td align='center'>{$id}</td> <td>{$title}</td> <td align='center'><a href=""?act=editclass&id={$id}"" onclick=""return showinnew(this,420,280)"">修改项目</a>￤<a href='?act=list&cid="& cid &"&classid={$id}'>管理投票内容</a>￤<a href='?act=delclass&cid="& cid &"&classid={$id}' onClick=""return confirm('确定要删除{$title}吗!')"">删除</a</td></tr>":SoonBiz.title="投票管理":SoonBiz.adhead:SoonBiz.nstate("投票管理"):Response.write "<table class=tableborder1 cellspacing=1>":Response.write "<tr>":Response.write " <th width=30>ID</th>":Response.write " <th width=*>项目名称</th>":Response.write " <th width=200>操作</th>":Response.write "</tr>":Response.write SoonBiz.ReplaceClass("admin_vote",cid,0,tr,"class1"):Response.write "</table>":Response.write "<div class='navoperate'><h1>操作导航</h1><li><ul>[<a href=""?act=creatnewclass"" onclick=""return showinnew(this,420,280)"">添加新投票项目</a>]</li></ul></div>":End Sub:Sub classinfo(isedit):Dim hailin,action:Dim title,readme
If isedit Then
hailin="编辑投票项目":action="?act=saveeditclass&id="&SoonBiz.rid("id"):Dim tempxml:Set tempxml=application(CacheName & "_class").documentElement.selectSingleNode("class[@id='" & SoonBiz.rid("id") & "']"):title=tempxml.getAttribute("title"):readme=tempxml.getAttribute("readme"):Set tempxml=Nothing
Else:hailin="添加新投票项目":action="?act=SaveNewClass&cid="&cid
End If:SoonBiz.title=hailin:SoonBiz.adhead:SoonBiz.nstate(hailin):Response.Write "<form method=""post"" action="""& action &""">":Response.Write "<table class=""tableborder1"" cellspacing=""1"">":Response.Write " <tr><th colspan=2>"& hailin &"</th></tr> ":Response.Write " <tr>":Response.Write " <td width=120>项目名称:</td>":Response.Write " <td width=*>":Response.Write " <input type=""text"" name=""title"" maxlength=""255"" class=""inputtext"" Value="""& title &""">":Response.Write " </td>":Response.Write " </tr>":Response.Write " <tr>":Response.Write " <td width=120>说明:</td>":Response.Write " <td>":Response.Write " <input type=""text"" name=""readme"" maxlength=""100"" class=""inputtext"" Value="""& readme &""">":Response.Write " </td>":Response.Write "</tr>":Response.Write "</table>":Response.Write "<div class=""operate""><input type=""submit"" name=""Submit"" value=""保存""></div>":Response.Write "</form>":End Sub:Sub SaveClass(isedit):Dim title,readme:Dim sql:title=SoonBiz.RequestStr ("主题名称","title","post",1,2,255,30,1):readme=SoonBiz.RequestStr ("主题说明","readme","post",1,0,255,30,0):ShowErr("")
If isedit Then
id=SoonBiz.rid("id"):sql="update "& sheethead &"_class set title='"&SoonBiz.Checkstr(title)&"',readme='"&SoonBiz.Checkstr(readme)&"' where id="&id
Else:sql="insert into "& sheethead &"_class (cid,title,readme,isshow) values ("&cid&",'"&SoonBiz.Checkstr(title)&"','"&SoonBiz.Checkstr(readme)&"',1)"
End If:SoonBiz.execute sql:SoonBiz.loadclass():SoonBiz.loadcachenum (cid):SoonBiz.Nok:End Sub:Sub list():Dim sql:Dim tr,editform:classid=SoonBiz.rid("classid"):sql="select * from ["& sheethead &"_article] where classid="&classid&" order by cls asc,id asc ":tr="<tr align=center><td align=left>"& editform &"{$title}</td><td>{$cls}</td><td>{$hits}</td><td><a href=""?act=edititem&id={$id}"" onclick=""return showinnew(this,350,220)"">编辑</a> | <A HREF='?act=delinfo&cid="& cid &"&id={$id}' onClick=""return confirm('确定要删除么{$title}吗!')"">删除</a></td></tr>":SoonBiz.adhead:SoonBiz.nstate(jinlan & " - 投票内容管理 - " &SoonBiz.Getxmlvalue("class","class[@id="& classid &"]","title")):Response.Write "<table cellspacing=1 class=tableborder1>":Response.Write "<tr>":Response.Write "<th>投票内容</th>":Response.Write "<th>排序</th>":Response.Write "<th>票数</th>":Response.Write "<th>操作</th>":Response.Write "</tr>":Response.write SoonBiz.ReplaceMdb("admin_vote",sql,tr,"",1):Response.write "</table>":Response.Write "<p></p>":fileinfo(false):End Sub:Sub fileinfo(isedit):Dim hailin,action:Dim title,cls,hits
If isedit Then
Dim rs:id=SoonBiz.rid("id"):Set rs=SoonBiz.execute("select * from "& sheethead &"_article where id=" & id):title=rs("title"):cls=Rs("cls"):hits=Rs("hits"):rs.close:Set rs=Nothing:hailin="编辑投票内容":action="?act=saveedit&cid="& cid &"&id="&id:SoonBiz.title="编辑投票内容":SoonBiz.adhead:SoonBiz.nstate("编辑投票内容")
Else:cls=100:hits=0:hailin="添加新投票内容":action="?act=savenew&cid="& cid &"&classid="&classid
End If:Response.Write "<form method=post action="""& action &""" id=""myform"" name=""myform"">":Response.Write "<table cellspacing=1 class=tableborder1>":Response.Write "<tr>":Response.Write "<th colspan=2>"& hailin &"</th>":Response.Write "</tr>":Response.Write "<tr>":Response.Write "<td width=20%\>投票内容:</td>":Response.Write "<td><input type='text' name='title' class=""inputtext"" value="""& title &""" maxlength=""255"" /> </td>":Response.Write "</tr>":Response.Write "<tr>":Response.Write "<td>排序:</td>":Response.Write "<td><input type=""text"" name=""cls"" size=5 value="""& cls &""" />":Response.Write "</tr>":Response.Write "<tr>":Response.Write "<td>票数:</td>":Response.Write "<td><input type=""text"" name=""hits"" size=5 value="""& hits &""" />":Response.Write "</tr>":Response.Write "</table>":Response.Write "<div class=""operate""><input type='submit' value=""保存""></div>":Response.Write "</form>":End Sub:Sub saveinfo(isedit):Dim title,cls,hits:Dim sql:classid=SoonBiz.rid("classid"):title=SoonBiz.RequestStr("投票内容","title","post",1,2,255,30,1):cls=SoonBiz.rid("cls"):hits=SoonBiz.rid("hits"):ShowErr("")':some~|!::}*now:himselfbe|him:'inabout
If isedit Then
id=SoonBiz.rid("id"):sql="update "& sheethead &"_article set title='"&title&"',cls="&cls&",hits="&hits&" where id="&id
Else:sql="insert into "& sheethead &"_article (cid,classid,title,cls,hits,stime) values ("& cid &","&classid&",'"&title&"',"&cls&","&hits&","& soonbizcom &")"
End If:SoonBiz.execute(sql):SoonBiz.loadcachenum (cid)
If isedit Then
SoonBiz.nok'has::butdid"foritstillhim'?after.because%:"out
Else:SoonBiz.ok
End If:End Sub:Sub postlist():Dim sql,shujun:shujun="<tr align=center><td>{$id}</td><td align=left>{$classid}/{$fid}</td><td>{$ip}</td><td>{$stime_short}</td></tr>":sql="select * from ["& sheethead &"_vote] order by id desc":SoonBiz.title="投票历史记录":SoonBiz.adhead:SoonBiz.nstate("投票历史记录"):Response.Write "<form method=""post"" action="""" id=""myform"">":Response.Write "<table class=tableborder1 cellspacing='1' >":Response.Write "<tr>":Response.Write "<th width=40>ID</th>":Response.Write "<th>所属分类ID/项目ID</th>":Response.Write "<th width=120>IP</th>":Response.Write "<th width=80>时间</th>":Response.Write "</tr>":Response.Write SoonBiz.ReplaceMdb("",sql,shujun,"",0):Response.Write "</table>":Response.Write SoonBiz.pagelist(""):Response.Write "<div class=""operate""><input type=""button"" value=""清空历史记录"" onClick=""Csubmit('myform','?act=removehis&amp;cid="&cid&"','确定要清空投票历史记录吗?')"" /></div>":Response.Write "</form>":SoonBiz.ostate("投票历史记录为了管理重复投票问题,历史记录比较多时可以清空记录"):End Sub
%>
