<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Admin_LineList.aspx.vb" Inherits="TourEx.Web.Admin_LineList" %>
<%@ 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="27"><span><a href="Admin_Line.aspx">添加</a></span></li>
	<li class="save" p="28"><span><a href="javascript:void(0);" onclick="Save(0);return false;">保存</a></span></li>
	<li class="del" p="29"><span><a href="javascript:void(0);" onclick="Del(0);return false;">删除</a></span></li>
	<li class="search">主题：<span id="TopicsList"><asp:HiddenField ID="TopicsId" runat="server" /></span>
        目的地：<span id="CategoryList"><asp:HiddenField ID="CategoryId" runat="server" /></span>
        关键词：<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='?TID2='+$('#TopicsId').val()+'&TID1='+$('#CategoryId').val()+'&TJ='+$('#TJ:checked').length+'&Order='+$('#Order:checked').length+'&Key='+$('#Key').val();" /></li>
</ul>
</form>
    <form id="BatchSubmit" name="BatchSubmit" method="post" action="?act=edit" style="display: none">
    </form>
        <div class="mainBox">
<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=\'L_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="150">操作</td>
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr id="From_<%#Eval("L_ID")%>" class="tabTextMain" onmouseout="this.style.background='#FFFFFF';" onmouseover="this.style.background='#F4F7FA';">
            <td><input name="L_ID" id="L_ID_<%#Eval("L_ID")%>" type="checkbox" value="<%#Eval("L_ID")%>" /></td>
            <td><%#Eval("L_ID")%></td>
            <td><a href="../Line/Show.aspx?id=<%#Eval("L_ID")%>" target="_blank"><%#Eval("L_Name")%></a></td>
            <td>
                <input id="L_OrderID_<%#Eval("L_ID")%>" name="L_OrderID_<%#Eval("L_ID")%>" type="text" value="<%#Eval("L_OrderID")%>" ovalue="<%#Eval("L_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("L_ID")%>);return false;" p="28">保存</a>
                <a href="Admin_LineOrder.aspx?LId=<%#Eval("L_ID")%>" p="56,57">订单</a> 
                <a href="Admin_LinePicList.aspx?Lid=<%#Eval("L_ID")%>" p="58,59,60">图片</a> 
                <a href="Admin_Line.aspx?id=<%#Eval("L_ID")%>" p="28">编辑</a> 
                <a href="javascript:void(0);" onclick="Del(<%#Eval("L_ID")%>);return false;" p="29">删除</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>
		</div>
<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(',27,')==-1)$('*[p="27"]').remove();
    if(AP.indexOf(',28,')==-1)$('*[p="28"]').remove();
    if(AP.indexOf(',29,')==-1)$('*[p="29"]').remove();
    if(AP.indexOf(',56,')+AP.indexOf(',57,')==-2)$('*[p="56,57"]').remove();
    if(AP.indexOf(',58,')+AP.indexOf(',59,')+AP.indexOf(',60,')==-3)$('*[p="58,69,60"]').remove();
}
function Save(ID) {
    var L_IDs = ID == 0 ? $('input[name="L_ID"]') : $('#L_ID_' + ID);
    var L_O;
    $('#BatchSubmit').html('');
    for (var i = 0; i < L_IDs.length; i++) {
        L_O = $('#L_OrderID_' + L_IDs[i].value).val();
        if (L_O != $('#L_OrderID_' + L_IDs[i].value).attr('ovalue')) {
            L_IDs[i].checked = true;
            $('#From_' + L_IDs[i].value).clone().prependTo("#BatchSubmit");
            $('#L_OrderID_' + L_IDs[i].value, '#BatchSubmit').val(L_O);
        }
    }
    if ($('#BatchSubmit').html() == '') { alert('数据没有改动过，无需保存！'); return; }
    $('input[name="L_ID"]', '#BatchSubmit').attr('checked', true);
    $('#BatchSubmit').submit();
}
 function Del(ID)
 {
 	var Url='?Act=del&';
	var IDs;
	if(ID>0)
	{
	    Url += 'L_ID=' + ID;
	}else{
	    IDs = $("input[name='L_ID']").serialize().replace(/&L_ID=/g, ',');
		if(IDs==''){alert('请选择您要删除的线路！');return;}
		Url +=IDs;
	}
	if(confirm('您确定删除吗！')){location=Url;}
 }
 
CreateSelect("TopicsList","TopicsId",$('#TopicsId').val(),3,"选择主题","","LineTopics","../");
CreateSelect("CategoryList","CategoryId",$('#CategoryId').val() ,0,"选择分类","","LineCategory","../");
//-->
</script>
</body>
</html>
