<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Admin_SceneryList.aspx.vb" Inherits="TourEx.Web.Admin_SceneryList" %>
<%@ Import Namespace="TourEx.BLL" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!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 language="javascript" src="../Sys/Js/jquery.js"></script>
<script type="text/javascript" src="../Sys/Js/CreateSelect.js"></script>
</head>
<body>
<form runat="server" id="TourExForm">
<ul class="tools">
	<li class="add" p="21"><span><a href="Admin_Scenery.aspx">添加</a></span></li>
	<li class="save" p="22"><span><a href="javascript:void(0);" onclick="Save(0);return false;">保存</a></span></li>
	<li class="del" p="23"><span><a href="javascript:void(0);" onclick="Del(0);return false;" p="23">删除</a></span></li>
	<li class="search"><asp:DropDownList ID="SCity" runat="server">
        <asp:ListItem Text="全部地区" Value=" "></asp:ListItem>
        </asp:DropDownList>
        <asp:DropDownList ID="SCategory" runat="server">
        <asp:ListItem Text="全部分类" Value=" "></asp:ListItem>
        </asp:DropDownList>
        关键词：<asp:TextBox ID="Key" runat="server" CssClass="searchTitle"></asp:TextBox>
        推荐：<asp:CheckBox ID="TJ" runat="server" />
        最新排序：<asp:CheckBox ID="Order" runat="server" />
        <input type="button" value="" class="searchInput" onclick="location='?CID='+$('#SCity').val()+'&TID='+$('#SCategory').val()+'&TJ='+$('#TJ:checked').length+'&Order='+$('#Order:checked').length+'&Key='+$('#Key').val();" /></li>
</ul>
<div style="display:none"><asp:Label ID="navIgation" runat="server" Text=""></asp:Label></div>
</form>
    <form id="BatchSubmit" name="BatchSubmit" method="post" action="?act=edit" style="display: none">
    </form>
<asp:Repeater ID="Repeater" runat="server">
    <HeaderTemplate>
		<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=\'S_ID\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));">全选</a>
                </td>
                <td width="50">编号</td>
                <td>景区名称</td>
                <td width="80">排序</td>
                <td width="180">操作</td>
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr id="From_<%#Eval("S_ID")%>" class="tabTextMain" onmouseout="this.style.background='#FFFFFF';" onmouseover="this.style.background='#F4F7FA';">
            <td>
                <input name="S_ID" id="S_ID_<%#Eval("S_ID")%>" type="checkbox" value="<%#Eval("S_ID")%>" />
            </td>
            <td>
                <%#Eval("S_ID")%>
            </td>
            <td>
                <a href="../Scenery/Show.aspx?id=<%#Eval("S_ID")%>" target="_blank">
                    <%#Eval("S_Name")%></a>
            </td>
            <td>
                <input id="S_OrderID_<%#Eval("S_ID")%>" name="S_OrderID_<%#Eval("S_ID")%>" type="text" value="<%#Eval("S_OrderID")%>" ovalue="<%#Eval("S_OrderID")%>" onkeyup="this.value=this.value.replace(/\D/g,'');" size="6" maxlength="6" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))" class="formTitle"/>
            </td>
            <td>
                <a href="javascript:void(0);" onclick="Save(<%#Eval("S_ID")%>);return false;" p="22">保存</a>
                <a href="Admin_SceneryOrder.aspx?SId=<%#Eval("S_ID")%>" p="48,49">订单</a> 
                <a href="Admin_TicketsList.aspx?id=<%#Eval("S_ID")%>" p="24,25,26">门票</a> 
                <a href="Admin_SceneryPicList.aspx?SId=<%#Eval("S_ID")%>" p="50,51,52">图片</a> 
                <a href="Admin_Scenery.aspx?id=<%#Eval("S_ID")%>" p="22">编辑</a> 
                <a href="javascript:void(0);" onclick="Del(<%#Eval("S_ID")%>);return false;" p="23">删除</a>
            </td>
        </tr>
    </ItemTemplate>
    <FooterTemplate>
        </table>
        <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(',21,')==-1)$('*[p="21"]').remove();
    if(AP.indexOf(',22,')==-1)$('*[p="22"]').remove();
    if(AP.indexOf(',23,')==-1)$('*[p="23"]').remove();
    if(AP.indexOf(',50,')==-1)$('*[p="50"]').remove();
    if(AP.indexOf(',48,')+AP.indexOf(',49,')==-2)$('*[p="48,49"]').remove();
    if(AP.indexOf(',50,')+AP.indexOf(',51,')+AP.indexOf(',52,')==-3)$('*[p="50,51,52"]').remove();
    if(AP.indexOf(',24,')+AP.indexOf(',25,')+AP.indexOf(',26,')==-3)$('*[p="24,25,26"]').remove();
}
function Save(ID) {
    var S_IDs = ID == 0 ? $('input[name="S_ID"]') : $('#S_ID_' + ID);
    var S_O;
    $('#BatchSubmit').html('');
    for (var i = 0; i < S_IDs.length; i++) {
        S_O = $('#S_OrderID_' + S_IDs[i].value).val();
        if (S_O != $('#S_OrderID_' + S_IDs[i].value).attr('ovalue')) {
            S_IDs[i].checked = true;
            $('#From_' + S_IDs[i].value).clone().prependTo("#BatchSubmit");
            $('#S_OrderID_' + S_IDs[i].value, '#BatchSubmit').val(S_O);
        }
    }
    if ($('#BatchSubmit').html() == '') { alert('数据没有改动过，无需保存！'); return; }
    $('input[name="S_ID"]', '#BatchSubmit').attr('checked', true);
    $('#BatchSubmit').submit();
}
 function Del(ID)
 {
 	var Url='?Act=del&';
	var IDs;
	if(ID>0)
	{
	    Url += 'S_ID=' + ID;
	}else{
 		IDs = $("input[name='S_ID']").serialize().replace(/&S_ID=/g,',');
		if(IDs==''){alert('请选择您要删除的景区！');return;}
		Url +=IDs;
	}
	if(confirm('您确定删除吗！')){location=Url;}
 }
//-->
</script>

</body>
</html>
