jicar.ASP
上传用户:qyswxdl
上传日期:2013-06-01
资源大小:1373k
文件大小:9k
源码类别:

家庭/个人应用

开发平台:

ASP/ASPX

  1. <!--#include file="articleconn.asp"-->
  2. <!--#include file="../checkpost.asp"-->
  3. <!--#include file="home1.asp"-->
  4. <!--#include file="security.asp"-->
  5. <%if session("flag")>3 then
  6.     response.write "<br><p align=center>您的操作权限不够!</p>"
  7.     response.end
  8. end if
  9. %>
  10. <head>
  11. <meta http-equiv="Content-Language" content="zh-cn">
  12. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  13. <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  14. <meta name="ProgId" content="FrontPage.Editor.Document">
  15. <LINK href="inc/Admin_STYLE.CSS" rel="stylesheet" type="text/css">
  16. <title>影视卡管理</title>
  17. <script language="JavaScript">
  18. function CheckAll(v)
  19. {
  20. var i;
  21. for (i=0;i<document.forms.elements.length;i++)
  22. {
  23. var e = document.forms.elements[i];
  24.         e.checked = v;
  25. }
  26. }
  27. function OnDelete()
  28.  {
  29. var del, a, i;
  30. del = new String("");
  31. for(i = 0; i < document.forms.elements.length ; i ++)
  32. {
  33. var e = document.forms.elements[i];
  34. if(e.name == 'selAnnounce')
  35. {
  36.    if ( e.checked == true)
  37.    {
  38.     a = e.value;
  39. del = del + a + ";";
  40.    }
  41. };
  42. }
  43.  if(del == "")
  44. {
  45. alert("请选择要删除的充值卡")
  46. }
  47. else
  48. {
  49. if(confirm("确定要删除吗?")==true)
  50.  {
  51. document.forms.submit();
  52. }
  53. }
  54. }
  55. //-->
  56. </script>
  57. <style type="text/css">
  58. <!--
  59. .样式3 {
  60. color: #FFFFFF;
  61. font-weight: bold;
  62. }
  63. .样式5 {font-size: 9pt}
  64. -->
  65. </style>
  66. </head>
  67. <script language="JavaScript">
  68. <!--
  69. function checkinput()
  70. {
  71. if (document.form2.not.value=="")
  72.  {
  73. alert("请输入生成的数量!");
  74. document.form2.not.focus();
  75. return false;
  76.  }
  77.  
  78.  if (document.form2.not.value < 1)
  79.  {
  80. alert("最少输入1张!");
  81. document.form2.not.focus();
  82. return false;
  83.  }
  84.  return true;
  85. }
  86. -->
  87. </script>
  88. <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  89. <div align="center"> 
  90.   <center>
  91.     <!--#include file="top1.asp"-->
  92.    <form method="POST" action="jicarsave.asp">
  93.     <table cellpadding="2" cellspacing="1" border="0" width="100%" class="border" align=center>
  94.       <tr align="center"> 
  95.         <td height=25 colspan=4 bgcolor="#429AEF" > <div align="left"><b><font color="#FFFFFF">自动增加计点充值卡:</font></b></div> 
  96.       <tr> 
  97.         <td width="50%"  class="tdbg" height=23><span class="样式5"> 
  98.           <input type="text" name="dayer" size="4">
  99.           点 
  100.           <select size="1" name="grad">
  101.             <option value="1" selected>计点会员卡</option>
  102.           </select>
  103.           </span></td>
  104.         <td width="25%" class="tdbg 样式5"><input type="text" name="not" size="6">
  105.           张</td>
  106.         <td width="12%" class="tdbg 样式5"> <input type="text" name="paymoneyj" size="4">          元</td>
  107.         <td width="13%" class="tdbg"><input name="B1" type="submit" value="增加"></td>
  108.       </tr>
  109.     </table>
  110.    </form>
  111.    <%
  112.    MaxPerPage=20
  113.    dim totalPut   
  114.    dim CurrentPage
  115.    dim TotalPages
  116.    dim i,j
  117.    dim typename
  118.    
  119.    typename=""
  120.    if not isempty(request("page")) then
  121.       currentPage=cint(request("page"))
  122.    else
  123.       currentPage=1
  124.    end if
  125.    dim sql
  126.    dim rs
  127.    dim rstype
  128.    dim typesql
  129.    dim typeid,typename1
  130.    if not isEmpty(Replace(request("typeid"), "'", "''")) then
  131. typeid=Replace(request("typeid"), "'", "''")
  132.    else
  133. typeid=0
  134.    end if
  135. %>
  136. </div>
  137. <%
  138.  sql="select * from jicar where ok=0 order by id desc"
  139.  Set rs= Server.CreateObject("ADODB.Recordset")
  140.  rs.open sql,conn,1,1
  141.   if rs.eof and rs.bof then
  142.        response.write "<p align='center'> 还 没 有 任 何 充 值 卡</p>"
  143.    else
  144.   totalPut=rs.recordcount
  145.       totalPut=rs.recordcount
  146.       if currentpage<1 then
  147.           currentpage=1
  148.       end if
  149.       if (currentpage-1)*MaxPerPage>totalput then
  150.    if (totalPut mod MaxPerPage)=0 then
  151.      currentpage= totalPut  MaxPerPage
  152.    else
  153.       currentpage= totalPut  MaxPerPage + 1
  154.    end if
  155.       end if
  156.        if currentPage=1 then
  157.            showpage totalput,MaxPerPage,"jicar.asp"
  158.             showContent
  159.             showpage totalput,MaxPerPage,"jicar.asp"
  160.        else
  161.           if (currentPage-1)*MaxPerPage<totalPut then
  162.             rs.move  (currentPage-1)*MaxPerPage
  163.             dim bookmark
  164.             bookmark=rs.bookmark
  165.            showpage totalput,MaxPerPage,"jicar.asp"
  166.             showContent
  167.              showpage totalput,MaxPerPage,"jicar.asp"
  168.         else
  169.         currentPage=1
  170.            showpage totalput,MaxPerPage,"jicar.asp"
  171.            showContent
  172.            showpage totalput,MaxPerPage,"jicar.asp"
  173.       end if
  174.    end if
  175.    end if
  176.    sub showContent
  177.        dim i
  178.    i=0
  179.   %>
  180. <div align="center">
  181.   <center>
  182.     <table border="0" cellspacing="1" width="100%" class="border"  bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="2" height="33" style="border-collapse: collapse" bordercolor="#111111">
  183.       <form action="jicar.asp" name="forms" method="post">
  184.         <tr bgcolor="#429AEF"> 
  185.           <td width="157" height="20" align="center"><b><font color="#FFFFFF">电影卡号</font></b></td>
  186.           <td width="177" height="20" align="center"><b><font color="#FFFFFF">电影卡密码</font></b></td>
  187.           <td width="113" height="20" align="center"><span class="样式3">可充点数</span></td>
  188.           <td width="81" height="20" align="center"><b><font color="#FFFFFF">面&nbsp;&nbsp; 
  189.             值</font></b></td>
  190.           <td width="118" height="20" align="center"><span class="样式3">电影卡类型</span></td>
  191.           <td width="72" height="20" align="center"><b><font color="#FFFFFF">删除</font></b></td>
  192.           <td width="237" height="20" align="center"> <font color="#FFFFFF"> 
  193.             <input name="chkall" onClick="CheckAll(document.forms.chkall.checked)" type="checkbox" value="on">
  194.             <strong>全 选/</strong> <a href="javascript:OnDelete()"><font color="#ffffff"><strong>删 
  195.             除</strong></font></a></font></td>
  196.         </tr>
  197.       <%do while not rs.eof%>
  198.         <tr bgcolor="#F3F5F5"> 
  199.           <td height="4" width="157"  class="tdbg"> <p align="center"><%=rs("carid")%></td>
  200.           <td width="177" height="4" align="center"  class="tdbg"><%=rs("carpws")%></td>
  201.           <td width="113" height="4" align="center"  class="tdbg"><%=rs("day")%> 
  202.             点</td>
  203.           <td width="81" height="4" align="center"  class="tdbg"><%=rs("paymoney")%> 
  204.             元</td>
  205.           <td width="118" height="4" align="center"  class="tdbg"> <%if rs("oklook")=1 then%> 计点会员卡 <%elseif rs("oklook")=2 then%> 白银会员卡 <%elseif rs("oklook")=3 then%> 黄金会员卡 <%end if%> </td>
  206.           <td width="72" height="4" align="center"  class="tdbg"> <a href="deljicar.asp?id=<%=rs("id")%>"><font color="#000000">删除</font></a></td>
  207.           <td width="237" height="4" align="center"  class="tdbg">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  208.             <input type="checkbox" name="selAnnounce" value="<%=cstr(rs("ID"))%>"></td>
  209.         </tr>
  210.         <% i=i+1
  211.       if i>=MaxPerPage then exit do
  212.       rs.movenext
  213.    loop
  214.   %>
  215.       </form>
  216.     </table>
  217.   </center>
  218. </div>
  219. <%
  220.    end sub 
  221. function showpage(totalnumber,maxperpage,filename)
  222.   dim n
  223.   if totalnumber mod maxperpage=0 then
  224.      n= totalnumber  maxperpage
  225.   else
  226.      n= totalnumber  maxperpage+1
  227.   end if
  228.   response.write "<p align=""center""><form method=Post action="&filename&"?typeid="&typeid&">"
  229.     if CurrentPage<2 then
  230.     response.write "<font color='#000080'>首页 上一页</font>&nbsp;"
  231.   else
  232.     response.write "<a href="&filename&"?page=1&typeid="&typeid&">首页</a>&nbsp;"
  233.     response.write "<a href="&filename&"?page="&CurrentPage-1&"&typeid="&typeid&">上一页</a>&nbsp;"
  234.   end if
  235.   if n-currentpage<1 then
  236.     response.write "<font color='#000080'>下一页 尾页</font>"
  237.   else
  238.     response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&typeid="&typeid&">"
  239.     response.write "下一页</a> <a href="&filename&"?page="&n&"&typeid="&typeid&">尾页</a>"
  240.   end if
  241.    response.write "<font color='#000080'>&nbsp;页次:</font><strong><font color=red>"&CurrentPage&"</font><font color='#000080'>/"&n&"</strong>页</font> "
  242.     response.write "<font color='#000080'>&nbsp;共<b>"&totalnumber&"</b>张 <b>"&maxperpage&"</b>张/页</font> "
  243.    response.write " <font color='#000080'>转到:</font><input type='text' name='page' size=4 maxlength=10 class=smallInput value="&currentpage&">"
  244.    response.write " <input class=buttonface type='submit'  value='Goto'  name='cndok'></span></p></form></p>"
  245.        
  246. end function
  247.    rs.close
  248.    set rs=nothing  
  249.    conn.close
  250.    set conn=nothing
  251.   %>
  252. <p><br>
  253. </p>
  254. </body>
  255. </html>