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

家庭/个人应用

开发平台:

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. </head>
  58. <script language="JavaScript">
  59. <!--
  60. function checkinput()
  61. {
  62. if (document.form2.not.value=="")
  63.  {
  64. alert("请输入生成的数量!");
  65. document.form2.not.focus();
  66. return false;
  67.  }
  68.  
  69.  if (document.form2.not.value < 1)
  70.  {
  71. alert("最少输入1张!");
  72. document.form2.not.focus();
  73. return false;
  74.  }
  75.  return true;
  76. }
  77. -->
  78. </script>
  79. <style type="text/css">
  80. <!--
  81. .样式1 {
  82. color: #FFFFFF;
  83. font-weight: bold;
  84. }
  85. .样式3 {font-size: 9pt}
  86. -->
  87. </style>
  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="carsave.asp?type=jd" onsubmit="if (!checkinput()) return false;" name="form2">
  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="样式3"> 
  98.         <input type="text" name="dayer" size="4">
  99.         天
  100.         <select size="1" name="grad">
  101.           <option value="1" selected>普通会员卡</option>
  102.           <option value="2">白银会员卡</option>
  103.           <option value="3">黄金会员卡</option>
  104.         </select>
  105.         </span></td>
  106.         <td width="25%" class="tdbg 样式3"><input type="text" name="not" size="6">
  107.           张</td>
  108.         <td width="12%" class="tdbg 样式3"> <input type="text" name="paymoneyj" size="4">          元</td>
  109.         <td width="13%" class="tdbg"><input name="B1" type="submit" value="增加"></td>
  110.       </tr>
  111.     </table>
  112.     </form>
  113.   <%
  114.  sql="select * from car where ok=0 order by id desc"
  115.  Set rs= Server.CreateObject("ADODB.Recordset")
  116.  rs.open sql,conn,1,1
  117.   if rs.eof and rs.bof then
  118.        response.write "<p align='center'> 还 没 有 任 何 充 值 卡</p>"
  119.    else
  120.   totalPut=rs.recordcount
  121.       totalPut=rs.recordcount
  122.       if currentpage<1 then
  123.           currentpage=1
  124.       end if
  125.       if (currentpage-1)*MaxPerPage>totalput then
  126.    if (totalPut mod MaxPerPage)=0 then
  127.      currentpage= totalPut  MaxPerPage
  128.    else
  129.       currentpage= totalPut  MaxPerPage + 1
  130.    end if
  131.       end if
  132.        if currentPage=1 then
  133.            showpage totalput,MaxPerPage,"car.asp"
  134.             showContent
  135.             showpage totalput,MaxPerPage,"car.asp"
  136.        else
  137.           if (currentPage-1)*MaxPerPage<totalPut then
  138.             rs.move  (currentPage-1)*MaxPerPage
  139.             dim bookmark
  140.             bookmark=rs.bookmark
  141.            showpage totalput,MaxPerPage,"car.asp"
  142.             showContent
  143.              showpage totalput,MaxPerPage,"car.asp"
  144.         else
  145.         currentPage=1
  146.            showpage totalput,MaxPerPage,"car.asp"
  147.            showContent
  148.            showpage totalput,MaxPerPage,"car.asp"
  149.       end if
  150.    end if
  151.    end if
  152.    sub showContent
  153.        dim i
  154.    i=0
  155.   %>
  156. <div align="center">
  157.   <center>
  158.     <table border="0" cellspacing="1" width="100%" class="border"  bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="2" height="33" style="border-collapse: collapse" bordercolor="#111111">
  159.       <form action="car.asp" name="forms" method="post">
  160.         <tr bgcolor="#429AEF"> 
  161.           <td width="157" height="20" align="center"><b><font color="#FFFFFF">电影卡号</font></b></td>
  162.           <td width="177" height="20" align="center"><b><font color="#FFFFFF">电影卡密码</font></b></td>
  163.           <td width="113" height="20" align="center"><b><font color="#FFFFFF">可充天数</font></b></td>
  164.           <td width="101" height="20" align="center"><b><font color="#FFFFFF">面&nbsp;&nbsp; 
  165.             值</font></b></td>
  166.           <td width="112" height="20" align="center"><span class="样式1">电影卡类型</span></td>
  167.           <td width="58" height="20" align="center"><b><font color="#FFFFFF">删除</font></b></td>
  168.           <td width="237" height="20" align="center"> <font color="#FFFFFF"> 
  169.             <input name="chkall" onClick="CheckAll(document.forms.chkall.checked)" type="checkbox" value="on">
  170.             <strong>全 选/</strong> <a href="javascript:OnDelete()"><font color="#ffffff"><strong>删 
  171.             除</strong></font></a></font></td>
  172.         </tr>
  173.         <%do while not rs.eof%>
  174.         <tr bgcolor="#F3F5F5"> 
  175.           <td height="4" width="157"  class="tdbg"> <p align="center"><%=rs("carid")%></td>
  176.           <td width="177" height="4" align="center"  class="tdbg"><%=rs("carpws")%></td>
  177.           <td width="113" height="4" align="center"  class="tdbg"><%=rs("day")%> 
  178.             天</td>
  179.           <td width="101" height="4" align="center"  class="tdbg"><%=rs("paymoney")%> 
  180.             元</td>
  181.           <td width="112" height="4" align="center"  class="tdbg"> <%if rs("oklook")=1 then%> 普通会员卡 <%elseif rs("oklook")=2 then%> 白银会员卡 <%elseif rs("oklook")=3 then%> 黄金会员卡 <%end if%> </td>
  182.           <td width="58" height="4" align="center"  class="tdbg"> <a href="delcar.asp?id=<%=rs("id")%>"><font color="#000000">删除</font></a></td>
  183.           <td width="237" height="4" align="center"  class="tdbg">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  184.             <input type="checkbox" name="selAnnounce" value="<%=cstr(rs("ID"))%>"></td>
  185.         </tr>
  186.        <% i=i+1
  187.       if i>=MaxPerPage then exit do
  188.       rs.movenext
  189.    loop
  190.   %>
  191.       </form>
  192.     </table>
  193.   </center>
  194. </div>
  195. <%
  196.    end sub 
  197. function showpage(totalnumber,maxperpage,filename)
  198.   dim n
  199.   if totalnumber mod maxperpage=0 then
  200.      n= totalnumber  maxperpage
  201.   else
  202.      n= totalnumber  maxperpage+1
  203.   end if
  204.   response.write "<p align=""center""><form method=Post action="&filename&"?typeid="&typeid&">"
  205.     if CurrentPage<2 then
  206.     response.write "<font color='#000080'>首页 上一页</font>&nbsp;"
  207.   else
  208.     response.write "<a href="&filename&"?page=1&typeid="&typeid&">首页</a>&nbsp;"
  209.     response.write "<a href="&filename&"?page="&CurrentPage-1&"&typeid="&typeid&">上一页</a>&nbsp;"
  210.   end if
  211.   if n-currentpage<1 then
  212.     response.write "<font color='#000080'>下一页 尾页</font>"
  213.   else
  214.     response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&typeid="&typeid&">"
  215.     response.write "下一页</a> <a href="&filename&"?page="&n&"&typeid="&typeid&">尾页</a>"
  216.   end if
  217.    response.write "<font color='#000080'>&nbsp;页次:</font><strong><font color=red>"&CurrentPage&"</font><font color='#000080'>/"&n&"</strong>页</font> "
  218.     response.write "<font color='#000080'>&nbsp;共<b>"&totalnumber&"</b>张 <b>"&maxperpage&"</b>张/页</font> "
  219.    response.write " <font color='#000080'>转到:</font><input type='text' name='page' size=4 maxlength=10 class=smallInput value="&currentpage&">"
  220.    response.write " <input class=buttonface type='submit'  value='Goto'  name='cndok'></span></p></form></p>"
  221.        
  222. end function
  223.    rs.close
  224.    set rs=nothing  
  225.    conn.close
  226.    set conn=nothing
  227.   %>
  228. <p><br>
  229. </p>
  230. </body>
  231. </html>