<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Admin_HelpList.aspx.vb" Inherits="TourEx.Web.Admin_HelpList" %>
<%@ 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="33"><span><a href="Admin_Help.aspx">添加</a></span></li>
	<li class="save" p="34"><span><a href="javascript:void(0);" onclick="Save(0);return false;">保存</a></span></li>
	<li class="del" p="35"><span><a href="javascript:void(0);" onclick="Del(0);return false;">删除</a></span></li>
	<li class="search">分类：<span id="CategoryList"><asp:HiddenField ID="CategoryId" runat="server" /></span>
        关键词：<asp:TextBox ID="Key" runat="server" cssclass="searchTitle"></asp:TextBox>
        <input type="button" value="" class="searchInput" onclick="location='?TID='+$('#CategoryId').val()+'&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=\'ID\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));">全选</a>
                </td>
                <td>帮助名称</td>
                <td width="100">排序</td>
                <td width="100">操作</td>
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr class="tabTextMain" id="From_<%#Eval("H_ID")%>" onmouseout="this.style.background='#FFFFFF';" onmouseover="this.style.background='#F4F7FA';">
            <td><input name="H_ID" id="H_ID_<%#Eval("H_ID")%>" type="checkbox" value="<%#Eval("H_ID")%>" /></td>
            <td>[<a href="?Tid=<%#Eval("H_CategoryId")%>"><%#Eval("T_Name")%></a>] <input id="H_Title_<%#Eval("H_ID")%>" name="H_Title_<%#Eval("H_ID")%>" type="text" value="<%#Eval("H_Title")%>" ovalue="<%#Eval("H_Title")%>" class="formTitle" style="width:300px;"/></td>
            <td>
                <input id="H_OrderID_<%#Eval("H_ID")%>" name="H_OrderID_<%#Eval("H_ID")%>" type="text" value="<%#Eval("H_OrderId")%>" ovalue="<%#Eval("H_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="100">
                <a href="javascript:void(0);" onclick="Save(<%#Eval("H_ID")%>);return false;" p="34">保存</a>
                <a href="Admin_Help.aspx?id=<%#Eval("H_ID")%>" p="34">编辑</a> 
                <a href="javascript:void(0);" onclick="Del(<%#Eval("H_ID")%>);return false;" p="35">删除</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(',33,')==-1)$('*[p="33"]').remove();
    if(AP.indexOf(',34,')==-1)$('*[p="34"]').remove();
    if(AP.indexOf(',35,')==-1)$('*[p="35"]').remove();
 }
 function Save(ID)
 {
 	var H_IDs=ID==0?$('input[name="H_ID"]'):$('#H_ID_'+ID);
	var H_Title,H_O;
	$('#BatchSubmit').html('');
	for(var i=0;i<H_IDs.length;i++)
	{
		H_Title = $.trim($('#H_Title_'+H_IDs[i].value).val());
		$('#H_Title_'+H_IDs[i].value).val(H_Title);
		if(H_Title==''){alert('请填写标题！');return;}
		H_O=$('#H_OrderID_'+H_IDs[i].value).val();
		if(H_Title!=$('#H_Title_'+H_IDs[i].value).attr('ovalue') || H_O!=$('#H_OrderID_'+H_IDs[i].value).attr('ovalue'))
		{
			H_IDs[i].checked=true;
			$('#From_'+H_IDs[i].value).clone().prependTo("#BatchSubmit");
			$('#H_Title_'+H_IDs[i].value,'#BatchSubmit').val(H_Title);
			$('#H_OrderID_'+H_IDs[i].value,'#BatchSubmit').val(H_O);
		}
	}
 	if($('#BatchSubmit').html()==''){alert('数据没有改动过，无需保存！');return;}
	$('input[name="H_ID"]','#BatchSubmit').attr('checked',true);
	$('#BatchSubmit').submit();
 }
 function Del(ID)
 {
 	var Url='?Act=del&';
	var IDs;
	if(ID>0)
	{
		Url +='H_ID='+ID;
	}else{
 		IDs = $("input[name='H_ID']").serialize().replace(/&H_ID=/g,',');
		if(IDs==''){alert('请选择您要删除的帮助！');return;}
		Url +=IDs;
	}
	if(confirm('您确定删除吗！')){location=Url;}
 }
 
$(function(){
CreateSelect("CategoryList","CategoryId",$('#CategoryId').val() ,3,"选择分类","","HelpCategory","../");
});
//-->
</script>

</body>
</html>
