<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Admin_TicketsList.aspx.vb" Inherits="TourEx.Web.Admin_TicketsList" %>
<%@ 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>
</head>
<body>
<form runat="server" id="TourExForm">
<ul class="tools">
	<li class="add" p="24"><span><asp:HyperLink ID="AddTickets" runat="server">添加</asp:HyperLink></span></li>
	<li class="save" p="25"><span><a href="javascript:void(0);" onclick="Save(0);return false;">保存</a></span></li>
	<li class="del" p="26"><span><a href="javascript:void(0);" onclick="Del(0);return false;">删除</a></span></li>
	<li class="search"><asp:TextBox ID="Key" runat="server" CssClass="searchTitle"></asp:TextBox>
		<input type="button" value="" onclick="location='?Key='+$('#Key').val();" class="searchInput"/></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=\'T_ID\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));">全选</a>
                </td>
                <td width="50">编号</td>
                <td>门票名称</td>
                <td width="100">排序</td>
                <td width="100">操作</td>
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
         <tr class="tabTextMain" id="From_<%#Eval("T_ID")%>" onmouseout="this.style.background='#FFFFFF';" onmouseover="this.style.background='#F4F7FA';">
            <td>
                <input name="T_ID" id="T_ID_<%#Eval("T_ID")%>" type="checkbox" value="<%#Eval("T_ID")%>" />
            </td>
            <td>
                <%#Eval("T_ID")%>
            </td>
            <td>
                <input id="T_Name_<%#Eval("T_ID")%>" name="T_Name_<%#Eval("T_ID")%>" type="text" value="<%#Eval("T_Name")%>" ovalue="<%#Eval("T_Name")%>" class="formTitle"/>
            </td>
            <td>
                <input id="T_OrderID_<%#Eval("T_ID")%>" name="T_OrderID_<%#Eval("T_ID")%>" type="text" value="<%#Eval("T_OrderId")%>" ovalue="<%#Eval("T_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("T_ID")%>);return false;" p="25">保存</a>
                <a href="Admin_Tickets.aspx?id=<%#Eval("T_ID")%>" p="25">编辑</a> 
                <a href="javascript:void(0);" onclick="Del(<%#Eval("T_ID")%>);return false;" p="26">删除</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>
<script type="text/javascript">
 <!--//
 var AP='<%=TourEx.BLL.GetSession("AdminPermissions") %>';
 if(AP!='')
 {
    if(AP.indexOf(',24,')==-1)$('*[p="24"]').remove();
    if(AP.indexOf(',25,')==-1)$('*[p="25"]').remove();
    if(AP.indexOf(',26,')==-1)$('*[p="26"]').remove();
 }
 function Save(ID)
 {
 	var T_IDs=ID==0?$('input[name="T_ID"]'):$('#T_ID_'+ID);
	var T_Name,T_O;
	$('#BatchSubmit').html('');
	for(var i=0;i<T_IDs.length;i++)
	{
		T_Name = $.trim($('#T_Name_'+T_IDs[i].value).val());
		$('#T_Name_'+T_IDs[i].value).val(T_Name);
		if(T_Name==''){alert('请填写门票名称！');return;}
		T_O=$('#T_OrderID_'+T_IDs[i].value).val();
		if(T_Name!=$('#T_Name_'+T_IDs[i].value).attr('ovalue') || T_O!=$('#T_OrderID_'+T_IDs[i].value).attr('ovalue'))
		{
			T_IDs[i].checked=true;
			$('#From_'+T_IDs[i].value).clone().prependTo("#BatchSubmit");
			$('#T_Name_'+T_IDs[i].value,'#BatchSubmit').val(T_Name);
			$('#T_OrderID_'+T_IDs[i].value,'#BatchSubmit').val(T_O);
		}
	}
 	if($('#BatchSubmit').html()==''){alert('数据没有改动过，无需保存！');return;}
	$('input[name="T_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>
