⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_index.asp

📁 修正的自由领域投票系统2.0 支持文件上传
💻 ASP
📖 第 1 页 / 共 2 页
字号:
  </div></td>
</tr>
<tr>
  <td>参选主题:</td>
  <td><input name="zhuti" type="text" id="zhuti" /></td>
</tr>
<tr>
  <td>照片上传:</td>
  <td><label><input type="file" name="filexx" /></label>(目前支持的格式:<%=const_PhotoFormat%>)</td>
</tr>
<TR>
  <TD valign="top"><p>事迹内容:</p>
    <p>(类似与WORD的编辑器)</p></TD>
	<TD>
		
	    <div align="left">
	      <INPUT type="hidden" name="content1" value="">
        </div>
      <IFRAME ID="eWebEditor1" src="bianji/ewebeditor.asp?id=content1&style=s_coolblue" frameborder="0" scrolling="no" width="550" height="350"></IFRAME></TD>
	</TR>
<TR>
  <TD colspan="2" align=right><div align="center">
    <INPUT type=submit name=b1 value="提交">&nbsp;&nbsp;&nbsp;&nbsp; 
    <INPUT type=reset name=b2 value="重填">
  </div></TD>
	</TR>
</TABLE>
</FORM>
<%end sub
sub hxrbj
id=request.QueryString("id")
id=replace(id,"'","")
id=replace(id,">","")
id=replace(id,"<","")
id=replace(id,"?","")
set rs=conn.execute("select * from stu where id="&id)
%>
<FORM method="POST" name="myform" action="hxrtj.asp?action=bj&id=<%=id%>" enctype="multipart/form-data">
<TABLE width="100%" border="0" cellpadding="2" cellspacing="1">
<TR>
  <TD colspan="2"><div align="center">编辑候选人</div></TD>
  </TR>
<tr>
  <td width="13%">候选人姓名:</td>
  <td width="87%"><div align="left">
    <label>
    <input name="stuname" type="text" id="stuname" value="<%=rs("stuname")%>" readonly="true"/>
    </label>
    <span class="STYLE2">(提交后不可修改!)</span></div></td>
</tr>
<tr>
  <td>所属院系:</td>
  <td><div align="left">
    <input name="yuanxi" type="text" id="yuanxi" value="<%=rs("yuanxi")%>"/></div></td>
</tr>
<tr>
  <td>所属专业:</td>
  <td><div align="left"><input name="zhuanye" type="text" id="zhuanye" value="<%=rs("zhuanye")%>"/></div></td>
</tr>
<tr>
  <td>所属班级:</td>
  <td><div align="left"><input name="banji" type="text" id="banji" value="<%=rs("banji")%>"/></div></td>
</tr>
<tr>
  <td>参选主题:</td>
  <td><div align="left"><input name="zhuti" type="text" id="zhuti" value="<%=rs("zhuti")%>"/></div></td>
</tr>
<tr>
  <td>照片上传:</td>
  <td><label>
      <input name="images" type="text" id="images" value="<%=rs("images")%>" readonly="true"/>
      (若不更改相片请不要填写此处两栏)
      <br />
  <input type="file" name="filexx" /></label>(目前支持的格式:<%=const_PhotoFormat%>)</td>
</tr>
<TR>
  <TD valign="top"><p>事迹内容:</p>
    <p>(类似与WORD的编辑器)</p></TD>
	<TD>
		
	    <div align="left">
	      <INPUT type="hidden" name="content1" value="<%=rs("content")%>">
        </div>
      <IFRAME ID="eWebEditor1" src="bianji/ewebeditor.asp?id=content1&style=s_coolblue" frameborder="0" scrolling="no" width="550" height="350"></IFRAME></TD>
	</TR>
<TR>
  <TD colspan="2" align=right><div align="center">
    <INPUT type=submit name=b1 value="提交"> &nbsp;&nbsp;&nbsp;&nbsp;
    <INPUT type=reset name=b2 value="重填">
  </div></TD>
	</TR>
</TABLE>
</FORM>
<% end sub 
sub usermanage%>
用户管理||<a href="?action=adduser">添加用户</a>
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DCE5" width="73%">
  <tbody>    <tr>
      <td bgcolor="#f7f7f7"><div align="center">序号</div></td>
      <td bgcolor="#f7f7f7"><div align="center">姓名</div></td>
      <td width="22%" bgcolor="#f7f7f7"><div align="center">学号</div></td>
      <td width="24%" bgcolor="#f7f7f7"><div align="center">投票信息</div></td>
      <td width="28%" bgcolor="#f7f7f7"><div align="center">操作</div></td>
    </tr>
    <%
dim sql,page
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "Select * FROM ec Order By id Desc"
rs.open sql,conn,1,3

IF not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Then
page=1
Else
Page=Int(Abs(Request("page")))
End if

If not rs.eof then 
rs.pagesize =pagegl
total  = rs.RecordCount
mypagesize=rs.pagesize
rs.absolutepage = page
end if

i=1
do while not rs.eof  and mypagesize>0
%>
    <tr>
      <td width="8%" bgcolor="#f7f7f7"><div align="center"><%=rs("id")%></div></td>
      <td width="18%" bgcolor="#f7f7f7"><div align="center"><%=rs("sname")%></a></div></td>
      <td bgcolor="#f7f7f7"><div align="center"><%=rs("sid")%></div></td>
      <td bgcolor="#f7f7f7"><div align="center"><% if rs("vote")<>"dxf," then%>
	  已投票<% else %> 尚未投票 <% end if %>
	  </div></td>
      <td bgcolor="#f7f7f7"><div align="center"><a href="?action=adduser">添加用户</a>/<a href="?action=useredit&id=<%=rs("id")%>">编辑</a>/<a href="?action=deluser&id=<%=rs("id")%>" onclick="return confirm('这个操作将删除这位用户及其相关的信息\n         你确定吗?');">删除</a></div></td>
    </tr>
    
    <%
mypagesize=mypagesize-1
i=i+1
rs.movenext
loop
%>
    <tr bgcolor="#CCCC00">
      <td height="18" colspan="6" valign="bottom"><div align="center">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <form action="?action=usermanage" method="post" name="form2" id="form2">
            <tr>
              <td align="right" height="22"><font color="#ffffff" class="td">共<b><%=rs.pagecount%></b>页<b><%=total%></b>条 当前第<b><%=page%></b>页 <a href="?page=1&action=usermanage" class="td">首页</a>
                      <%if page>1 then%>
                      <a href="?page=<%=page-1%>&action=usermanage" class="td">上一页</a>
                      <%else%>
                上一页
                <%end if%>
                <%if page<rs.pagecount   then%>
                <a href="?page=<%=page+1%>&action=usermanage" class="td">下一页</a>
                <%else%>
                下一页
                <%end if%>
                <a href="?page=<%=rs.pagecount%>&action=usermanage" class="td">尾页</a>
                <select name="page" class="td">
                  <%for i=1 to rs.pagecount%>
                  <option value="<%=i%>"
														  <%
					  if i=page then
					  response.write" selected"
					  end if
					  %>><%=i%></option>
                  <%next%>
                </select>
                <input type="submit" name="Submit22" value="转向" class="td" />
              </font></td>
            </tr>
          </form>
        </table>
      </div></td>
    </tr>
  </tbody>
</table>
<% end sub 
sub adduser%>
<form action="?action=addusername" method="post">
<table width="300">
  
<tr>
  <td width="90"><div align="right">用户名:</div></td>
  <td width="198"><label>
    <input name="sname" type="text" id="sname" />
  </label></td>
</tr>
<tr>
  <td height="15"><div align="right">
    <div align="right">学&nbsp;&nbsp;号:</div>
  </div></td>
  <td><input name="sid" type="text" id="sid" /></td>
</tr>
<tr>
  <td height="15" colspan="2"><div align="center">
    <label>
    <input type="submit" name="Submit" value="提交" />
    </label>
  </div></td>
</tr></table>
</form>
<%end sub
sub useredit
set rs=conn.execute("select * from ec where id="&request.QueryString("id")&"")%>
<form action="?action=addusername&dxf=wsj" method="post">
<table width="300">
  
<tr>
  <td width="90"><div align="right">用户名:</div></td>
  <td width="198"><label>
    <input name="sname" type="text" id="sname" value="<%=rs("sname")%>"/>
  </label></td>
</tr>
<tr>
  <td height="15"><div align="right">
    <div align="right">学&nbsp;&nbsp;号:</div>
  </div></td>
  <td><input name="sid" type="text" id="sid" value="<%=rs("sid")%>"></td>
</tr>
<tr>
  <td height="15" colspan="2"><div align="center">
    <label>
    <input type="submit" name="Submit" value="提交" />
    </label>
  </div></td>
</tr></table>
</form>
<%set rs=nothing
end sub
sub deluser
conn.execute("delete * from ec where id="&request.QueryString("id")&"")
set conn=nothing
response.Write("<script>window.alert('删除成功!');window.location.href='./admin_index.asp?action=usermanage'</script>")
response.end()
end sub
sub addusername
sname=request.Form("sname")
sid=request.Form("sid")
sname=replace(sname,"'","")
sid=replace(sid,"'","")
if request.QueryString("dxf")="wsj" then
    conn.execute("update ec set sid='"&sid&"' ")
	conn.execute("update ec set sname='"&sname&"' ")
	response.Write("<script>window.alert('更新成功!');window.location.href('./admin_index.asp?action=usermanage')</script>")
	set rs=nothing
	response.End()
else
set rs=conn.execute("select * from ec where sid='"&sid&"'")
   if rs.eof then
      conn.execute="insert into ec(sname,sid) values('"&sname&"','"&sid&"')"
   else
      response.Write("<script>window.alert('已经存在该学生编号!');history.go(-1)</script>")
	  response.End()
   end if
   response.Write("<script>window.alert('添加成功!');window.location.href('./admin_index.asp?action=adduser')</script>")
   response.End()

end if
end sub%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -