ManageAward.asp
上传用户:btntkt
上传日期:2021-04-16
资源大小:5296k
文件大小:8k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

DOS

  1. <!--#include file="conn.asp"-->
  2. <%
  3. dim cls
  4. if session("admin")="" then
  5. Response.Redirect("admin.asp")
  6. else
  7. if session("flag")<>"0" then
  8. cls = Instr(session("flag"), "vipfig")
  9. if cls <= 0 then
  10. %>
  11. <script language="javascript">
  12. if (confirm("您的操作权限不够,系统拒绝你的访问,请点确定返回,或者点取消退出重新登录"))
  13.   location.href="login.asp";
  14. else
  15.   location.href="index.asp";
  16. </script>
  17. <%
  18. end if
  19. end if
  20. end if
  21. %>
  22. <html>
  23. <head>
  24. <title>Untitled Document</title>
  25. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  26. <link href="../images/css.css" rel="stylesheet" type="text/css">
  27. </head>
  28. <body>
  29.   <%dim selectm,selectkey,selectbookid
  30. selectkey=trim(request(trim("selectkey")))
  31. selectm=trim(request("selectm"))
  32. if selectkey="" then
  33. selectkey=request.QueryString("selectkey")
  34. end if
  35. '//删除奖品
  36. if selectm="" then
  37. selectm=request.QueryString("selectm")
  38. end if
  39. selectbookid=request("selectbookid")
  40. if selectbookid<>"" then
  41. conn.execute "delete from jiangpin where bookid in ("&selectbookid&")"
  42. response.Redirect "ManageAward.asp"
  43. response.End
  44. end if
  45. %>
  46. <form name="form1" method="post" action="">
  47.   <table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
  48.     <tr> 
  49.       <th  background="../images/admin_bg_1.gif" class="tableHeaderText" colspan=4>查看与修改奖品</th>
  50.     </tr>
  51. <div align="center">
  52.     <%'开始分页
  53. Const MaxPerPage=10
  54.     dim totalPut   
  55.     dim CurrentPage
  56.     dim TotalPages
  57.     dim j
  58.     dim sql
  59.      if Not isempty(request("page")) then
  60.        currentPage=Cint(request("page"))
  61.     else
  62.        currentPage=1
  63.     end if 
  64. set rs=server.CreateObject("adodb.recordset")
  65. select case selectm
  66. case ""
  67.             rs.open "select bookid,bookname,adddate from jiangpin",conn,1,1
  68.     case "all"
  69. rs.open "select bookid,bookname,adddate from jiangpin order by adddate desc",conn,1,1
  70.     case "bookid"
  71. rs.open "select bookid,bookname,adddate from jiangpin where bookid="&selectkey&"",conn,1,1
  72. case "bookname"
  73. rs.open "select bookid,bookname,adddate from jiangpin where bookname like '%"&selectkey&"%'",conn,1,1
  74. case "bookcontent"
  75. rs.open "select bookid,bookname,adddate from jiangpin where bookcontent like '%"&selectkey&"%'",conn,1,1
  76.   end select
  77.     if err.number<>0 then
  78. response.write "数据库中无数据"
  79. end if
  80.    if rs.eof And rs.bof then
  81.         Response.Write "<p align='center' class='contents'> 对不起,没有您查找的奖品!</p>"
  82.     else
  83.    totalPut=rs.recordcount
  84.        if currentpage<1 then
  85.            currentpage=1
  86.        end if
  87.        if (currentpage-1)*MaxPerPage>totalput then
  88.     if (totalPut mod MaxPerPage)=0 then
  89.       currentpage= totalPut  MaxPerPage
  90.     else
  91.        currentpage= totalPut  MaxPerPage + 1
  92.     end if
  93.        end if
  94.         if currentPage=1 then
  95.              showContent
  96.              showpage totalput,MaxPerPage,"ManageAward.asp"
  97.         else
  98.            if (currentPage-1)*MaxPerPage<totalPut then
  99.              rs.move  (currentPage-1)*MaxPerPage
  100.              dim bookmark
  101.              bookmark=rs.bookmark
  102.              showContent
  103.               showpage totalput,MaxPerPage,"ManageAward.asp"
  104.          else
  105.          currentPage=1
  106.             showContent
  107.             showpage totalput,MaxPerPage,"ManageAward.asp"
  108.        end if
  109.     end if
  110.         end if
  111.     sub showContent
  112.         dim i
  113.     i=0%>
  114. </div>
  115.     <tr bgcolor="#E8F1FF"> 
  116.       <td width="10%" class="forumRowHighlight"> <div align="center">序号</div></td>
  117.       <td width="50%" class="forumRowHighlight"> <div align="center">奖品名称</div></td>
  118.       <td width="30%" class="forumRowHighlight"> <div align="center">加入时间</div></td>
  119.       <td width="10%" class="forumRowHighlight"> <div align="center">选 择</div></td>
  120.     </tr>
  121.     <%
  122.   do while not rs.eof%>
  123.     <tr> 
  124.       <td class="forumRowHighlight"> <div align="center"><%=rs("bookid")%></div></td>
  125.       <td class="forumRowHighlight"> <a href=EditAward.asp?id=<%=rs("bookid")%>> 
  126.         <% if len(trim(rs("bookname")))>16 then
  127. response.write left(trim(rs("bookname")),14)&"..."
  128. else
  129. response.write trim(rs("bookname"))
  130. end if%>
  131.         </a></td>
  132.       <td class="forumRowHighlight"> <div align="center"><%=rs("adddate")%></div></td>
  133.       <td class="forumRowHighlight"> <div align="center"> 
  134.           <input name="selectbookid" type="checkbox" id="selectbookid" value="<%=rs("bookid")%>">
  135.         </div></td>
  136.     </tr>
  137.     <%i=i+1
  138. if i>=MaxPerPage then Exit Do
  139. rs.movenext
  140.   loop
  141.   rs.close
  142.   set rs=nothing%>
  143.     <tr> 
  144.       <td class="forumRowHighlight" colspan="4"> <div align="right"> 
  145.           <input class="button" type="submit" name="Submit" value="删 除" onClick="return test();">
  146.         </div></td>
  147.     </tr>
  148. </table>
  149. <br>
  150.   <table width="100%" border="0" cellpadding="0" cellspacing="0">
  151.     <tr align="center"> 
  152.       <td> 
  153.         <%  
  154. End Sub   
  155.   
  156. Function showpage(totalnumber,maxperpage,filename)  
  157.    Dim n
  158.   
  159. If totalnumber Mod maxperpage=0 Then  
  160. n= totalnumber  maxperpage  
  161. Else
  162. n= totalnumber  maxperpage+1  
  163. End If
  164. Response.Write "<form method=Post action="&filename&"?selectm="&selectm&"&selectkey="&selectkey&" >"  
  165. Response.Write "<p align='center' class='contents'> "  
  166. If CurrentPage<2 Then  
  167. Response.Write "<font class='contents'>首页 上一页</font> "  
  168. Else  
  169. Response.Write "<a href="&filename&"?page=1&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>首页</a> "  
  170. Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>上一页</a> "  
  171. End If
  172. If n-currentpage<1 Then  
  173. Response.Write "<font class='contents'>下一页 尾页</font>"  
  174. Else  
  175. Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>"  
  176. Response.Write "下一页</a> <a href="&filename&"?page="&n&"&selectm="&selectm&"&selectkey="&selectkey&" class='contents'>尾页</a>"  
  177. End If  
  178. Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "  
  179. Response.Write "<font class='contents'> 共有"&totalnumber&"种商品 " 
  180. Response.Write "<font class='contents'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="&currentpage&">"  
  181. Response.Write "&nbsp;<input type='submit'  class='button' value='GO' name='cndok' ></form>"  
  182. End Function  
  183. %> </td>
  184.     </tr>
  185.   </table>
  186. </form>
  187. <form name="form2" method="post" action="ManageAward.asp">
  188.   <table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
  189.     <tr> 
  190.       <th class="tableHeaderText" colspan=3>奖品查讯</th>
  191.     </tr>
  192.     <tr> 
  193.       <td width="30%" class="forumRowHighlight">
  194.   <div align="center"> <input name="selectkey" type="text" id="selectkey" onFocus="this.value=''" value="请输入关键字">
  195.         </div></td>
  196.       <td width="70%" class="forumRowHighlight"> <div align="center"> 
  197.           <select name="selectm" id="selectm">
  198.             <option value="all" selected>全部奖品</option>
  199.             <option value="bookid">按奖品序号</option>
  200.             <option value="bookname" >按奖品名称</option>
  201.             <option value="bookcontent">奖商品说明</option>
  202.           </select>
  203.         </div></td>
  204.       <td class="forumRowHighlight"> <div align="center"><input class=button type="submit" name="Submit2" value="查 讯"></div></td>
  205.     </tr>
  206.   </table>
  207. </form>
  208. </body>
  209. </html>
  210. <script>
  211. function test()
  212. {
  213.   if(!confirm('确认删除吗?')) return false;
  214. }
  215. </script>