AnswerForPoint.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:7k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_Inc/Function.asp" -->
  5. <%
  6. 'on error resume next
  7. Dim Conn,User_Conn,AnswerForPoint,listnum,page,j,i,nn,n,pagename,EndDate
  8. MF_Default_Conn
  9. MF_User_Conn
  10. MF_Session_TF
  11. if not MF_Check_Pop_TF("ME_award") then Err_Show 
  12. Set AnswerForPoint=Server.CreateObject(G_FS_RS)
  13. AnswerForPoint.open "select AID,ATopic,NeedPoint,PrizePoint,ADesc,AStartDate,AEndDate from FS_ME_AnswerForPoint order by AendDate asc",User_Conn,1,1
  14. pagename="AnswerForPoint.asp?"
  15. if AnswerForPoint.eof and AnswerForPoint.bof Then
  16. else
  17. listnum=10
  18. AnswerForPoint.pagesize=listnum
  19. page=Request.QueryString("page")
  20. if (page-AnswerForPoint.pagecount) > 0 then
  21. page=AnswerForPoint.pagecount
  22. elseif page = "" or page < 1 then
  23. page = 1
  24. end if
  25. AnswerForPoint.absolutepage=page
  26. '编号的实现
  27. j=AnswerForPoint.recordcount
  28. j=j-(page-1)*listnum
  29. i=0
  30. nn=Request.QueryString("page")
  31. if nn="" then
  32. n=0
  33. else
  34. nn=nn-1
  35. n=listnum*nn
  36. end if
  37. end if
  38. %>
  39. <html xmlns="http://www.w3.org/1999/xhtml">
  40. <HEAD>
  41. <TITLE>FoosunCMS</TITLE>
  42. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  43. </HEAD>
  44. <script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
  45. <script language="JavaScript" src="lib/UserJS.js" type="text/JavaScript"></script>
  46. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  47. <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> 
  48. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> 
  49. <form action="awardAction.asp?act=deleteAFPointaction" method="post" name="PrizeForm" id="PrizeForm">  
  50.   <tr>
  51.   <td colspan="6" class="xingmu">抽奖管理</td>
  52.   </tr>
  53.   <tr class="hback"> 
  54. <td width="30%" height="20" colspan="6" align="center"><div align="left"><a href="award.asp" target="_self">&nbsp;积分抽奖</a>&nbsp;|&nbsp;<a href="changePrize.asp">积分兑换</a> | 积分竞答<a href="AnswerForPoint.asp"> |</a> <a href="#" onClick="history.back()">后退</a></div></td> 
  55. </tr>
  56.         <tr class="xingmu"> 
  57.           <td width="40%" align="center">竟答项目</td> 
  58.           <td width="12%" align="center">需要积分</td>
  59.           <td width="12%" align="center">奖励积分</td>
  60.           <td width="15%" align="center">状态</td>
  61.   <td width="15%" align="center">截止时间</td>
  62.   <td width="10%" align="center"><input type="checkbox" name="Delete_CheckAll" value="all" onClick="CheckAll(this,'DeleteAFPoint')"></td> 
  63.         </tr>
  64. <%    
  65. do while not AnswerForPoint.eof and i<listnum
  66. Response.Write("<tr class='hback'>"&chr(10)&chr(13)) 
  67. Response.Write("<td align='center'><a href='AFPoint_AddEdit.asp?act=editAFPoint&AID="&AnswerForPoint("AID")&"'>"&AnswerForPoint("ATopic")&"</a></td>"&chr(10)&chr(13))
  68. Response.Write("<td align='center' width='20%'>"&AnswerForPoint("NeedPoint")&"</td>")
  69. Response.Write("<td align='center'>"&AnswerForPoint("PrizePoint")&"</td>")
  70. EndDate=AnswerForPoint("AEndDate")
  71. if EndDate<Now() then
  72. Response.Write("<td align='center'>已过期</td>")
  73. else
  74. Response.Write("<td align='center'>未过期</td>")
  75. end if
  76. Response.Write("<td align='center'>"&EndDate&"</td>")
  77. Response.Write("<td align='center'><input type='checkbox' name='DeleteAFPoint' value='"&AnswerForPoint("AID")&"'></td>")
  78. Response.Write("</tr>")
  79. AnswerForPoint.movenext
  80. i=i+1 
  81. j=j-1
  82. Loop
  83. %>
  84.     </form>
  85. <tr class="hback" height="10"> 
  86. <td align="right" colspan="5"><input name="AddAward" type="button" value="添 加" onClick="location='AFPoint_AddEdit.asp?act=addQuestion'"></td> 
  87. <td width="30%" align="center"><input type="Button" name="deleteAwards" onClick="AlertBeforeSubmite()" value="删 除"> 
  88.     </td> 
  89. </tr>
  90. <tr>
  91. <td align="right" colspan="6">
  92. <%=AnswerForPoint.recordcount%> 条消息&nbsp;&nbsp;<%=listnum%> 条消息/页&nbsp;&nbsp;共 <%=AnswerForPoint.pagecount%> 页 
  93. <% if page=1 then %>
  94. <%else%>
  95. <a href=<%=pagename%>><strong>|<<</strong></a>&nbsp; 
  96. <a href=<%=pagename%>page=<%=page-1%>><strong><<</strong></a>&nbsp; 
  97. <a href=<%=pagename%>page=<%=page-1%>><b>[<%=page-1%>]</b></a>&nbsp; 
  98. <%end if%>
  99. <% if AnswerForPoint.pagecount=1 then %>
  100. <%else%>
  101. <b>[<%=page%>]</b>
  102. <%end if%>
  103. <% if AnswerForPoint.pagecount-page <> 0 then %>
  104. <a href=<%=pagename%>page=<%=page+1%>><b>[<%=page+1%>]</b></a>&nbsp; 
  105. <a href=<%=pagename%>page=<%=page+1%>><strong>>></strong></a>&nbsp; 
  106. <a href=<%=pagename%>page=<%=AnswerForPoint.pagecount%>><strong>>>|</strong></a>&nbsp; 
  107. <%end if%> 
  108. </td>
  109. </tr> 
  110. </table> 
  111. </body>
  112. <%
  113. if Request.QueryString("Act")="addGroup" then
  114. AddGroupRs.close
  115. set AddGroupRs=nothing
  116. Conn.close
  117. Set Conn=nothing
  118. User_Conn.close
  119. Set User_Conn=nothing
  120. end if
  121. %>
  122. <script language="JavaScript" type="text/JavaScript">
  123. <!--
  124. function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  125.   if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
  126.     document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  127.   else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
  128. }
  129. MM_reloadPage(true);
  130. //-->
  131. var request=true;
  132. var result;
  133. try
  134. {
  135. request=new XMLHttpRequest();
  136. }catch(trymicrosoft)
  137. {
  138. try
  139. {
  140. request=new ActiveXObject("Msxml2.XMLHTTP")
  141. }catch(othermicrosoft)
  142. {
  143. try
  144. {
  145. request=new ActiveXObject("Microsoft.XMLHTTP")
  146. }catch(filed)
  147. {
  148. request=false;
  149. }
  150. }
  151. }
  152. if(!request) alert("Error initializing XMLHttpRequest!");
  153. function getAwardUser(Obj1,Obj2)
  154. {
  155. var url="getAwardUser.asp?AwardId="+Obj1+"&PrizeID="+Obj2+"&r="+Math.random();//构造url
  156. request.open("GET",url,true);//建立连接
  157. request.onreadystatechange = getResult;
  158. request.send(null);//传送数据,因为数据通过url传递了,所以这里传递的是null
  159. }
  160. function getResult(Obj)//当服务器响应的时候就使用这个方法
  161. {
  162. if(request.readyState ==4)//根据HTTP 就绪状态判断响应是否完成
  163. {
  164. if(request.status == 200)//判断请求是否成功
  165. {
  166. result=request.responseText;//获得响应的结果,也就是新的<select>
  167. var contaner=result.substring(0,result.indexOf("*"));
  168. var selectContent=result.substring(result.indexOf("*")+1,result.length);
  169. document.getElementById(contaner).innerHTML=selectContent;
  170. }
  171. }
  172. }
  173. function CheckAll(Obj,TargetName)
  174. {
  175. var CheckBoxArray;
  176. CheckBoxArray=document.getElementsByName(TargetName);
  177. for(var i=0;i<CheckBoxArray.length;i++)
  178. {
  179. if(Obj.checked)
  180. {
  181. CheckBoxArray[i].checked=true;
  182. }
  183. else
  184. {
  185. CheckBoxArray[i].checked=false;
  186. }
  187. }
  188. }
  189. function AlertBeforeSubmite()
  190. {
  191. if(confirm("确认要删除该记录?"))
  192. {
  193. document.PrizeForm.submit();
  194. }
  195. }
  196. </script>
  197. </html>