<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Admin_AboutList.aspx.vb" Inherits="TourEx.Web.Admin_AboutList" %>
<%@ 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 language="javascript" src="../Sys/Js/CreateSelect.js"></script>
</head>
<body>
<form runat="server" id="TourExForm">
<ul class="tools">
	<li class="add" p="30"><span><a href="Admin_About.aspx?pid=<%=ThisId %>" >添加</a></span></li>
	<li class="save" p="31"><span><a href="javascript:void(0);" onclick="Save(0);return false;">保存</a></span></li>
	<li class="del" p="32"><span><a href="javascript:void(0);" onclick="Del(0);return false;">删除</a></span></li>
</ul>
</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=\'A_ID\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));">全选</a></td>
                <td>标题</td>
                <td width="100">排序</td>
                <td width="120">操作</td>
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
         <tr class="tabTextMain" id="From_<%#Eval("A_ID")%>" onmouseout="this.style.background='#FFFFFF';" onmouseover="this.style.background='#F4F7FA';">
            <td><input name="A_ID" id="A_ID_<%#Eval("A_ID")%>" type="checkbox" value="<%#Eval("A_ID")%>" /></td>
            <td><input id="A_Title_<%#Eval("A_ID")%>" name="A_Title_<%#Eval("A_ID")%>" type="text" value="<%#Eval("A_Title")%>" ovalue="<%#Eval("A_Title")%>" class="formTitle" size="40"/></td>
            <td><input id="A_OrderID_<%#Eval("A_ID")%>" name="A_OrderID_<%#Eval("A_ID")%>" type="text" value="<%#Eval("A_OrderID")%>" ovalue="<%#Eval("A_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 width="120"><a href="?id=<%#Eval("A_ID")%>">下级</a>
                <a href="javascript:void(0);" onclick="Save(<%#Eval("A_ID")%>);return false;" p="31">保存</a>
                <a href="Admin_About.aspx?id=<%#Eval("A_ID")%>" p="31">编辑</a> 
                <a href="javascript:void(0);" onclick="Del(<%#Eval("A_ID")%>);return false;" p="32">删除</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 language="javascript" type="text/javascript">
 <!--//
 var AP='<%=TourEx.BLL.GetSession("AdminPermissions") %>';
 if(AP!='')
 {
    if(AP.indexOf(',30,')==-1)$('*[p="30"]').remove();
    if(AP.indexOf(',31,')==-1)$('*[p="31"]').remove();
    if(AP.indexOf(',32,')==-1)$('*[p="32"]').remove();
 }
 function Save(ID)
 {
 	var A_IDs=ID==0?$('input[name="A_ID"]'):$('#A_ID_'+ID);
	var A_Title,A_O;
	$('#BatchSubmit').html('');
	for(var i=0;i<A_IDs.length;i++)
	{
		A_Title = $.trim($('#A_Title_'+A_IDs[i].value).val());
		$('#A_Title_'+A_IDs[i].value).val(A_Title);
		if(A_Title==''){alert('请填写标题！');return;}
		A_O=$('#A_OrderID_'+A_IDs[i].value).val();
		if(A_Title!=$('#A_Title_'+A_IDs[i].value).attr('ovalue') || A_O!=$('#A_OrderID_'+A_IDs[i].value).attr('ovalue'))
		{
			A_IDs[i].checked=true;
			$('#From_'+A_IDs[i].value).clone().prependTo("#BatchSubmit");
			$('#A_Title_'+A_IDs[i].value,'#BatchSubmit').val(A_Title);
			$('#A_OrderID_'+A_IDs[i].value,'#BatchSubmit').val(A_O);
		}
	}
 	if($('#BatchSubmit').html()==''){alert('数据没有改动过，无需保存！');return;}
	$('input[name="A_ID"]','#BatchSubmit').attr('checked',true);
	$('#BatchSubmit').submit();
 }
 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('您确定删除吗！')){location=Url;}
 }
//-->
</script>

</body>
</html>
