<%@ Page CodeBehind="admin_ord.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Typhoto.admin_ord" %>
<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<script type="text/javascript" src="../js/calendar.js"></script>
		<script language="javascript">
   var CalendarWebControl = new atCalendarControl();
		</script>
		<link href="img/main.css" rel="stylesheet" type="text/css">
			<style type="text/css">
		.style1 { FONT-WEIGHT: bold; COLOR: #ffffff }
		.style2 { 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>
				<tr class="tableTd">
					<td>&nbsp;&nbsp;用户名或定单号：<input name="username" type="text" size="10" id="key" class="tableTdtext" runat="server"
							style="WIDTH: 96px; HEIGHT: 20px">&nbsp;从
						<asp:TextBox id="date1" runat="server" CssClass="tableTdtext" Columns="17"></asp:TextBox>至
						<asp:TextBox id="date2" runat="server" CssClass="tableTdtext" Columns="17"></asp:TextBox>&nbsp;
						<asp:DropDownList id="state" runat="server">
							<asp:ListItem Value="0" Selected="True">全部</asp:ListItem>
							<asp:ListItem Value="1">有效</asp:ListItem>
							<asp:ListItem Value="2">无效</asp:ListItem>
						</asp:DropDownList>&nbsp;&nbsp;<asp:button CssClass="formbutton" id="Button2" runat="server" Width="50px" Text="查找" onclick="Button2_Click"></asp:button></td>
				</tr>
			</table>
			<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" id="brb"
				height="27">
				<tr>
					<td colSpan="3" class="td_title">定单查看（点击表头可升降排序）
					</td>
					<td class="td_title1">合计：<asp:Label id="sum" runat="server">Label</asp:Label>元&nbsp;&nbsp;</td>
				</tr>
			</table>
			<div align="center"><asp:datagrid id="DataGrid" runat="server" AllowSorting="True" PageSize="20" Width="100%" AutoGenerateColumns="False"
					CssClass="GridBody" 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:HyperLinkColumn Text="用户名" DataNavigateUrlField="username" DataNavigateUrlFormatString="admin_edituser.aspx?username={0}"
							DataTextField="username" SortExpression="username" HeaderText="用户名">
							<HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>
							<ItemStyle HorizontalAlign="Center"></ItemStyle>
						</asp:HyperLinkColumn>
						<asp:HyperLinkColumn Text="支付人" DataNavigateUrlField="fromusername" DataNavigateUrlFormatString="admin_edituser.aspx?username={0}"
							DataTextField="fromusername" SortExpression="fromusername" HeaderText="支付人">
							<HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>
							<ItemStyle HorizontalAlign="Center"></ItemStyle>
						</asp:HyperLinkColumn>
						<asp:BoundColumn DataField="ord" SortExpression="ord" HeaderText="定单号">
							<HeaderStyle HorizontalAlign="Center" Width="20%"></HeaderStyle>
							<ItemStyle HorizontalAlign="Center"></ItemStyle>
						</asp:BoundColumn>
						<asp:TemplateColumn SortExpression="lx" HeaderText="空间类型">
							<HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>
							<ItemStyle HorizontalAlign="Center"></ItemStyle>
							<ItemTemplate>
								<asp:Label runat="server" Text='<%# showtype(DataBinder.Eval(Container, "DataItem.lx").ToString()) %>'>
								</asp:Label>
							</ItemTemplate>
						</asp:TemplateColumn>
						<asp:BoundColumn DataField="buycount" SortExpression="buycount" HeaderText="购买数量">
							<HeaderStyle HorizontalAlign="Center"></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:TemplateColumn HeaderText="是否有效">
							<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
							<ItemStyle HorizontalAlign="Center"></ItemStyle>
							<ItemTemplate>
								<asp:Label runat="server" Text='<%# showyx(DataBinder.Eval(Container, "DataItem.done").ToString()) %>'>
								</asp:Label>
							</ItemTemplate>
						</asp:TemplateColumn>
						<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">勾选定单：
							<asp:Button CssClass="formbutton" ID="btnlock" runat="server" Width="50px" Text="删除" onclick="btnlock_Click"></asp:Button>
							&nbsp;&nbsp;
							<asp:Button CssClass="formbutton" ID="btnunlock" runat="server" Width="50px" Text="有效" onclick="btnunlock_Click"></asp:Button>
							&nbsp;&nbsp;
							<asp:Button CssClass="formbutton" ID="btnmark" runat="server" Width="50px" Text="无效" onclick="btnmark_Click"></asp:Button>
							&nbsp;&nbsp;&nbsp;
							<asp:Button CssClass="formbutton" ID="clear" runat="server" Width="122px" Text="清除所有无效定单" onclick="clear_Click"></asp:Button>
							<input id="HdnSelectedValues" type="hidden" name="HdnSelectedValues" runat="server"></td>
					</tr>
				</table>
				<fieldset style="MARGIN-LEFT: 100px; MARGIN-RIGHT: 100px">
					<DIV align="center"></DIV>
				</fieldset>
			</div>
		</form>
	</body>
</HTML>
