<!--#include file=connn.asp-->
<!--#include file=cookies.asp-->
<!--#include file=../config.asp-->
<%
dim flag
flag=request.cookies("foxwww")("fox")
if flag<9 then
response.Write "<script LANGUAGE='javascript'>alert('你目前的级别不允许此操作！');history.go(-1);</script>"
response.end
end if
%>
<meta http-equiv="Content-Language" content="zh-cn">
<link rel="stylesheet" type="text/css" href="images/fox.css">
<style type=text/css>
BODY{
	margin:0px;
	FONT-SIZE: 12px;
	FONT-FAMILY: "宋体", "Verdana", "Arial", "Helvetica", "sans-serif";
	background-color: #CCCC99; 
	scrollbar-highlight-color: #CC9933; 
	scrollbar-arrow-color: #FFFFFF; 
	scrollbar-base-color: #CC9933
}
table { border:0px; }
td { font:normal 12px 宋体; }
img { vertical-align:bottom; border:0px; }
a { font:normal 12px 宋体; color:#111111; text-decoration:none; }
a:hover { color:#384780;text-decoration:underline; }
.sec_menu { border-left:2px solid #CC3300; border-right:2px solid #CC3300; border-bottom:2px solid #CC3300; overflow:hidden; background:#ffffff; }
.menu_title {background-color: #335EA8;color: white;font-size: 12px;font-weight:bold;height: 25; }
.menu_title span { position:relative; top:2px; left:8px; color:#FFFF00; font-weight:bold; }
.menu_title2 {background-color: #335EA8;color: white;font-size: 12px;font-weight:bold;height: 25; }
.menu_title2 span { position:relative; top:2px; left:8px; color:#FEFEFE; font-weight:bold; }
input,select,Textarea{
font-family:宋体,Verdana, Arial, Helvetica, sans-serif; font-size: 12px;}
</style><body leftmargin="0">
<%
   MaxPerPage=20
   dim totalPut   
   dim CurrentPage
   dim TotalPages
   dim i,j

   dim typename
   
   typename=""
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
   dim sql
   dim rs
   dim rstype
   dim typesql
   dim typeid,typename1
   if not isEmpty(request("typeid")) then
	typeid=request("typeid")
   else
	typeid=0
   end if
%>
<div align="center">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="439" height=50 bgcolor="#CC3300"></td>
  </tr>
</table>
</div>
<%
 sql="select * from FOX_car order by id desc"
 Set rs= Server.CreateObject("ADODB.Recordset")
 rs.open sql,conn,1,1
  if rs.eof and rs.bof then
       response.write "<p align='center'> <font color=ffffff><b>还 没 有 任 何 充 值 卡</b></p>"
   else
	  totalPut=rs.recordcount
      totalPut=rs.recordcount
      if currentpage<1 then
          currentpage=1
      end if
      if (currentpage-1)*MaxPerPage>totalput then
	   if (totalPut mod MaxPerPage)=0 then
	     currentpage= totalPut \ MaxPerPage
	   else
	      currentpage= totalPut \ MaxPerPage + 1
	   end if

      end if
       if currentPage=1 then
           showpage totalput,MaxPerPage,"car.asp"
            showContent
            showpage totalput,MaxPerPage,"car.asp"
       else
          if (currentPage-1)*MaxPerPage<totalPut then
            rs.move  (currentPage-1)*MaxPerPage
            dim bookmark
            bookmark=rs.bookmark
           showpage totalput,MaxPerPage,"car.asp"
            showContent
             showpage totalput,MaxPerPage,"car.asp"
        else
	        currentPage=1
           showpage totalput,MaxPerPage,"car.asp"
           showContent
           showpage totalput,MaxPerPage,"car.asp"
	      end if
	   end if
   end if
   sub showContent
       dim i
	   i=0

  %>
<div align="center">
  <center>
    <table border="0" cellspacing="1" width="100%" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="2" height="33" style="border-collapse: collapse" bordercolor="#111111">
      <tr height="25" bgcolor="#f3f3f3"> 
        <td width="84" align="center"><b>充值卡号</b></td>
        <td width="78" align="center"><b>充值卡密码</b></td>
        <td width="70" align="center"><b>可充<%=bname%></b></td>
        <td width="42" align="center"><b>面&nbsp;值</b></td>
        <td width="33" align="center"><b>删除</b></td>
      </tr>
      <%do while not rs.eof%>
      <tr> 
        <td height="25" width="84" bgcolor="#FFFFFF"> <p align="center"><%=rs("carid")%></td>
        <td width="78" height="25" bgcolor="#FFFFFF" align="center"><%=rs("carpws")%></td>
        <td width="70" height="25" bgcolor="#FFFFFF" align="center"><%=rs("day")%> 
          <%=bname%></td>
        <td width="42" height="25" bgcolor="#FFFFFF" align="center"><%=rs("paymoney")%> 
          元</td>
        <td width="33" height="25" bgcolor="#FFFFFF" align="center"> <a href="delcar.asp?id=<%=rs("id")%>"><font color="#000000">删除</font></a></td>
      </tr>
      <% i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	   loop
		  %>
    </table>
  </center>
</div>
<%
end sub 

function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
	n= totalnumber \ maxperpage
else
	n= totalnumber \ maxperpage+1
end if
%>

<div align="center">

<table border="0" bgcolor="FFF772" cellspacing="0" height="25" width="100%">
<form method=Post action="<%=filename%>?typeid=<%=typeid%>">
<tr><td>
<center>共有<font color="#ff0000"><b><%=totalnumber%></b></font>部&nbsp;&nbsp;&nbsp;当前:第<strong><font color="#ff0000"><%=CurrentPage%></font></strong>页/共<strong><font color="#ff0000"><%=n%></font></strong>页</center>                                                     
<td><div align="right">
<%if CurrentPage<2 then%>
<font color='888888'>首页&nbsp;上一页</font>&nbsp;&nbsp;&nbsp;                                                     
<%else%>
<a class=left href="<%=filename%>?typeid=<%=typeid%>&page=1&">首页</a>&nbsp;                                                     
<a class=left href="<%=filename%>?typeid=<%=typeid%>&page=<%=CurrentPage-1%>">上一页</a>&nbsp;&nbsp;&nbsp;                                                     
<%
end if
if n-currentpage<1 then
%>
<font color='888888'>下一页&nbsp;尾页</font>&nbsp;&nbsp;&nbsp;                                                     
<%else%>
<a class=left href="<%=filename%>?typeid=<%=typeid%>&page=<%=(CurrentPage+1)%>">下一页</a>&nbsp;                                                     
<a class=left href="<%=filename%>?typeid=<%=typeid%>&page=<%=n%>">尾页</a>&nbsp;                                                     
<%end if%>
<td align="center"><select name="page" onchange="javascript:submit()">
<%for i = 1 to n%>                                                                
<option value="<%=i%>" <%if cint(CurrentPage)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
<%next%></select></td></div></td></td>
</tr></form></table>      
</div>
<% 
end function
%>
<%
sub gotopage
end sub
%>
<SCRIPT>
function MM_openBrWindow(theURL,winName,features) { //v2.0
  mediaWindow = window.open(theURL,winName,features);
  mediaWindow.focus();
}
function formcheck()
{
 if (loginform.not.value=="")
 {
   alert('请问你要添加几张？');
   loginform.not.focus();
   return false;
 }
 if (loginform.paymoneyj.value=="")
 {
   alert('这张卡要多少钱？!');
   loginform.paymoneyj.focus();
   return false;
 }
if (loginform.paymoneyj.value.length < 2)
 {
   alert('这张卡也太便宜了吧!');
   loginform.paymoneyj.focus();
   return false;
 }
 return true;
}

</SCRIPT>
<div align="center">
  <center>
  <table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="25">
    <form method="POST" action="carsave.asp" name="loginform" onsubmit="if (!formcheck()) return false;">
      <tr align="center">
        <td width="112" height="25" bgcolor="#FFFFFF"><font size="2">
        <select size="1" name="day">
        <option value="50">50<%=bname%></option>
        <option value="100">100<%=bname%></option>
        <option value="200">200<%=bname%></option>      
        <option value="300">300<%=bname%></option>
        </select></font></td>
        <td align="center" width="106" height="25" bgcolor="#FFFFFF">
        <input type="text" name="not" size="10"> 张</td>
        <td align="center" width="100" height="25" bgcolor="#FFFFFF">
        <input type="text" name="paymoneyj" size="6"><span lang="en-us"> </span>
        元</td>
        <td align="center" width="100" height="25" bgcolor="#FFFFFF">
        <input type="submit" value="点击增加" name="B1"></td>
      </tr>
    </form>
  </table>
  </center>
</div></body></html>