<%@ Page CodeBehind="admin_card.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Typhoto.admin_card" %>
<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
  <HEAD>
		<link href="img/main.css" rel="stylesheet" type="text/css">
		<style type="text/css">
.style1 { FONT-WEIGHT: bold; COLOR: #ffffff }
</style>
		<script language="JAVASCRIPT">
function checkAll()
{
	var objID=document.getElementsByTagName("input");
	for (var i=0 ;i<objID.length;i++)
	{
		if (objID[i].type=="checkbox")
		{
			if(objID[i].checked)
			{
				objID[i].checked=false;
				document.all.CheckBox2.checked=false;
				AddRemoveValues(objID[i]); 
				
			}
			else
			{
				objID[i].checked=true;
				document.all.CheckBox2.checked=true;
				AddRemoveValues(objID[i]);
			}
		}
	}
}
function AddRemoveValues(oChk) { 
if(oChk.checked)
Form1.HdnSelectedValues.value += "," + oChk.value; 
else
Form1.HdnSelectedValues.value = Form1.HdnSelectedValues.value.replace("," + oChk.value,""); 
}
		</script>
</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" id="brb"
				height="27">
				<tr>
					<td colSpan="3" class="td_title">充值卡管理（点击表头可升降排序）
					</td>
				</tr>
			</table>
			<div align="center">
					<asp:datagrid id="DataGrid" runat="server" CssClass="GridBody"
						AutoGenerateColumns="False" Width="100%" PageSize="20" AllowSorting="True" GridLines="None">
				<AlternatingItemStyle CssClass="GridLine"></AlternatingItemStyle>
				<ItemStyle CssClass="GridItem"></ItemStyle>
				<HeaderStyle CssClass="GridHead"></HeaderStyle>
						<Columns>
							<asp:TemplateColumn HeaderText="选择">
								<HeaderStyle HorizontalAlign="Center" Width="5%"></HeaderStyle>
								<ItemStyle HorizontalAlign="Center"></ItemStyle>
								<HeaderTemplate>
									<INPUT type="checkbox" id="CheckBox2" onClick="checkAll()">
								</HeaderTemplate>
								<ItemTemplate>
									<INPUT id=chkSelect onclick=AddRemoveValues(this) type=checkbox value='<%#DataBinder.Eval(Container.DataItem,"id")%>' name=chkSelect runat="server">
								</ItemTemplate>
							</asp:TemplateColumn>
							<asp:BoundColumn Visible="False" DataField="id"></asp:BoundColumn>
							<asp:BoundColumn DataField="cardcode" SortExpression="cardcode" HeaderText="卡号">
								<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								<ItemStyle HorizontalAlign="Center"></ItemStyle>
							</asp:BoundColumn>
							<asp:BoundColumn DataField="cardpass" SortExpression="cardpass" HeaderText="密码">
								<HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>
								<ItemStyle HorizontalAlign="Center"></ItemStyle>
							</asp:BoundColumn>
							<asp:BoundColumn DataField="money" SortExpression="money" HeaderText="金额">
								<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								<ItemStyle HorizontalAlign="Center"></ItemStyle>
							</asp:BoundColumn>
							<asp:BoundColumn DataField="username" SortExpression="username" HeaderText="使用用户名">
								<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								<ItemStyle HorizontalAlign="Center"></ItemStyle>
							</asp:BoundColumn>
							<asp:BoundColumn DataField="datetime" SortExpression="datetime" HeaderText="使用时间">
								<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
								<ItemStyle HorizontalAlign="Center"></ItemStyle>
							</asp:BoundColumn>
						</Columns>
						<PagerStyle PageButtonCount="20" Mode="NumericPages"></PagerStyle>
					</asp:datagrid>
					<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
                      <tr>
                        <td height="25"><webdiyer:AspNetPager id="Pager" runat="server" PageSize="20" AlwaysShow="True" ShowCustomInfoSection="Left"
					NumericButtonCount="15" HorizontalAlign="Right" ShowBoxThreshold="21" FirstPageText="<font face=webdings>9</font>"
					PrevPageText="<font face=webdings>3</font>" NextPageText="<font face=webdings>4</font>" LastPageText="<font face=webdings>:</font>"
					Height="20px" CssClass="page" onpagechanged="Pager_PageChanged"></webdiyer:AspNetPager></td>
                      </tr>
                      <tr>
                        <th height="25"> 操作区</th>
                      </tr>
                      <tr>
                        <td align="center"><strong>查找：</strong>
                          <asp:TextBox ID="key" runat="server" CssClass="tableTdtext"></asp:TextBox>
                          <select name="select" id="type" runat="server">
                            <option value="1" selected>用户名</option>
                            <option value="2">卡号</option>
                          </select>
                          <asp:Button ID="button2" runat="server" Width="50px" class="formbutton" Text="查找" onclick="Button2_Click"></asp:Button>
                          <input id="HdnSelectedValues" type="hidden" name="HdnSelectedValues" runat="server">
                          <br>
                          <br>
                          <asp:Button ID="btnlock" runat="server" Width="123px" class="formbutton" Text="删除选定的充值卡" onclick="btnlock_Click"></asp:Button>
                          <br>
                          <br>
                          批量添加充值卡：添加数量：
                          <asp:TextBox ID="txtcount" runat="server" CssClass="tableTdtext" Width="55px"></asp:TextBox>
&nbsp;&nbsp;每卡金额：
<asp:TextBox ID="txtmoney" runat="server" CssClass="tableTdtext" Width="55px"></asp:TextBox>
元 &nbsp;
<asp:Button ID="btnunlock" runat="server" Width="50px" class="formbutton" Text="添加" onclick="btnunlock_Click"></asp:Button>
<br>
手动添加充值卡：卡号：
<asp:TextBox ID="card1" runat="server" CssClass="tableTdtext" Width="55px"></asp:TextBox>
&nbsp;&nbsp;密码：
<asp:TextBox ID="card2" runat="server" CssClass="tableTdtext" Width="55px"></asp:TextBox>
金额：
<asp:TextBox ID="card3" runat="server" CssClass="tableTdtext" Width="55px"></asp:TextBox>
元 &nbsp;
<asp:Button ID="btnunlock2" runat="server" Width="50px" class="formbutton" Text="添加" onclick="btnunlock2_Click"></asp:Button></td>
                      </tr>
                    </table>
		  </div>
		</form></FONT>
	</body>
</HTML>
