<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Admin_SceneryOrder.aspx.vb" Inherits="TourEx.Web.Admin_SceneryOrder" %>
<%@ Import Namespace="TourEx.BLL" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<script runat="server">
    Function SceneryOrderStatus(ByVal O_Mark As Integer, ByVal O_ID As Integer) As String
        Select Case O_Mark
            Case 0
                Return "<font color=""red"">处理中</font>"
            Case 1
                Return "<font color=""red"">已取消</font>"
            Case 2
                Return "<font color=""green"">已处理</font><font color=""red"">(待取票)</font>"
            Case 3
                Return "<font color=""green"">已取票</font><font color=""red"">(待点评)</font>"
            Case 4
                Return "<a href=""Admin_SceneryReviews.aspx?id=" & O_ID & """><font color=""green"">已点评<font color=""red"">(待审核)</font></font></a>"
            Case Else
                Return "<font color=""green"">已结束</font>"
        End Select
    End Function
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题页</title>
<link rel="stylesheet" type="text/css" href="Css/Style.css"/>
<script type="text/javascript" language="javascript" src="../Sys/Js/jquery.js"></script>
</head>
<body>
<form runat="server" id="TourExForm">
<ul class="tools">
	<li class="del" p="49"><span><a href="javascript:void(0);" onclick="Del(0);return false;">删除</a></span></li>
            	<li class="search">
            <asp:DropDownList ID="T" runat="server">
            <asp:ListItem Text="搜索类型" Value="0" Selected="True"></asp:ListItem>
            <asp:ListItem Text="编号" Value="1"></asp:ListItem>
            <asp:ListItem Text="用户名" Value="2"></asp:ListItem>
            </asp:DropDownList>
            <asp:TextBox ID="Key" runat="server" CssClass="searchTitle"></asp:TextBox>
            <input type="button" value="" onclick="location='?T='+$('#T').val()+'&Key='+$('#Key').val();" class="searchInput"/>
        </li>
</ul>
</form> 
<asp:Repeater ID="Repeater" runat="server">
    <HeaderTemplate>
        <div class="mainBox">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabBox">
            <tr class="tabTitleMain">
                <td width="35" class="selectAll">
                    <a href="javascript:void(0);" onclick="$('input[name=\'ID\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));">全选</a>
                </td>
                <td width="70">编号</td>
                <td>用户名</td>
                <td>景区名称 - 门票名称</td>
                <td width="60">游玩时间</td>
                <td width="40">数量</td>
                <td width="40">总金额</td>
                <td width="40"><% = WebSet.BonusName%></td>
                <td width="100">状态</td>
                <td width="80">操作</td>
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr class="tabTextMain" id="From_<%#Eval("O_ID")%>" onmouseout="this.style.background='#FFFFFF';" onmouseover="this.style.background='#F4F7FA';">
            <td><input name="ID" id="O_ID_<%#Eval("O_ID")%>" type="checkbox" value="<%#Eval("O_ID")%>" /></td>
            <td><%#Eval("O_Number")%></td>
            <td><a href="?UId=<%#Eval("U_ID")%>"><%# Eval("U_Name")%></a></td>
            <td><a href="?SId=<%#Eval("O_SceneryId")%>"><%#Eval("S_Name")%></a> - <a href="?TId=<%#Eval("O_TicketsId")%>"><%#Eval("T_Name")%></a></td>
            <td><%#CDate(Eval("O_PlayDate")).ToString("yyyy-MM-dd")%></td>
            <td><%#Eval("O_Quantity")%>张</td>
            <td><%#Eval("O_FeesCount")%>元</td>
            <td><%#Eval("O_BonusCount")%><%=WebSet.BonusUnits %></td>
            <td><%# SceneryOrderStatus(Eval("O_Mark"), Eval("O_id"))%></td>
            <td>
                <a href="Admin_SceneryOrderEdit.aspx?id=<%#Eval("O_ID")%>" p="48">编辑</a> 
                <a href="javascript:void(0);" onclick="Del(<%#Eval("O_ID")%>);return false;" p="49">删除</a>
            </td>
        </tr>
    </ItemTemplate>
    <FooterTemplate>
        </table>
		</div>
        <asp:Label ID="lblEmpty" Text="暂无" runat="server" Visible="<%#Boolean.Parse((Repeater.Items.Count = 0).ToString())%>"
            Width="100%" Style="text-align: center">     
        </asp:Label>
    </FooterTemplate>
</asp:Repeater>
<webdiyer:AspNetPager ID="TourExPage" runat="server" UrlPaging="true" ShowPageIndexBox="Never"
    PageIndexBoxType="DropDownList" TextBeforePageIndexBox=""
    PageSize="20" OnPageChanged="BindData" EnableTheming="true" FirstPageText="首页"
    LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" CssClass="page" 
        PagingButtonSpacing="" CurrentPageButtonClass="current" 
    CurrentPageButtonStyle="">
</webdiyer:AspNetPager>
<script type="text/javascript">
 <!--//
 var AP='<%=TourEx.BLL.GetSession("AdminPermissions") %>';
 if(AP!='')
 {
    if(AP.indexOf(',48,')==-1)$('*[p="48"]').remove();
    if(AP.indexOf(',49,')==-1)$('*[p="49"]').remove();
 }
 function Del(ID)
 {
 	var Url='?Act=del&';
	var IDs;
	if(ID>0)
	{
		Url +='ID='+ID;
	}else{
 		IDs = $("input[name='ID']").serialize().replace(/&ID=/g,',');
		if(IDs==''){alert('请选择您要删除的订单！');return;}
		Url +=IDs;
	}
	if(confirm('删除订单将订单下的点评。(未审核的点评将不发放<%=WebSet.BonusName %>)\n您确定删除吗?')){location=Url;}
 }
//-->
</script>

</body>
</html>
