<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Admin_LineQuestions.aspx.vb" Inherits="TourEx.Web.Admin_LineQuestions" %>
<%@ 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>
<title>无标题页</title>
<script type="text/javascript" src="../Sys/Js/jquery.js"></script>
<script type="text/javascript" src="../Sys/Js/jquery.validate.js"></script>
<script type="text/javascript" src="../Sys/Js/jquery.validate.check.js"></script>
<script type="text/javascript" src="../Sys/Js/AlertWindow.js"></script>
<link rel="stylesheet" type="text/css" href="Css/Style.css"/>
</head>
<body>
<div id="messWindow" class="messWindow">
</div>
<div id="promptWindow" class="promptWindow" align="center">
	<div class="titleBar">
		<span>编辑度假咨询</span><span onclick="HideWindow()" style="float:right;"><img src="Images/popclose.gif" /></span></div>
	<div class="mainContent">
		<form method="post" id="TourExForm">
		<input name="CountRows" id="CountRows" type="hidden" value="0" />
		<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D6DFF7">
			<tr>
				<td class="subMainLeft" width="50">问题：</td>
				<td class="subMainRight"><textarea name="Q_Questions" id="Q_Questions" cols="58" rows="10" class="formTextarea"></textarea></td>
			</tr>
			<tr>
				<td class="subMainLeft">回答：</td>
				<td class="subMainRight"><textarea name="Q_Answers" id="Q_Answers" cols="58" rows="10" class="formTextarea"></textarea></td>
			</tr>
		</table>
		<div class="subMainFoot" style="text-align:center; padding-left:0;"><input name="submit1" type="submit" class="formInput01" value="确定" /></div>
		</form>
	</div>
</div>
<ul class="tools">
	<li class="del" p="61"><span><a href="javascript:void(0);" onclick="Del(0);return false;">删除</a></span></li>
</ul>
<asp:Repeater ID="Repeater" runat="server">
    <HeaderTemplate>
		<table width="100%" border="0" cellpadding="0" cellspacing="1" class="tabBox">
            <tr class="tabTitleMain">
                <td width="35" class="selectAll"><a href="javascript:void(0);" onclick="$('input[name=\'Q_ID\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));">全选</a></td>
                <td>度假名称</td>
                <td width="120">日期</td>
                <td width="60">状态</td>
                <td width="80">操作</td>
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr class="tabTextMain" onmouseout="this.style.background='#FFFFFF';" onmouseover="this.style.background='#F4F7FA';">
            <td><input name="Q_ID" type="checkbox" id="Q_ID_<%#Eval("Q_ID")%>" value="<%#Eval("Q_ID")%>" /></td>
            <td><%#Eval("U_Name")%> 对 <a href="../Line/Show.aspx?id=<%#Eval("L_ID")%>" target="_blank"><%#Eval("L_Name")%></a><div style="border:1px #ddd dotted;padding:6px 10px;line-height:20px;background:#fff;margin-top:6px;">问：<%#bSubstring(Eval("Q_Questions"), 60)%><input type="hidden" id="Q_Questions_<%#Eval("Q_ID")%>" value="<%#Eval("Q_Questions")%>" /></div></td>
            <td><%#Eval("Q_QDate")%></td>
            <td><%#IIf(Eval("Q_Answers") = "", "<font color=""red"">未回答</font>", "<font color=""#0D7200"">已回答</font>")%><textarea id="Q_Answers_<%#Eval("Q_ID")%>" style="display:none"><%#Eval("Q_Answers")%></textarea></td>
            <td><a href="javascript:void(0);" onclick="Edit(<%#Eval("Q_ID")%>);" p="61">编辑</a> <a href="javascript:void(0);" onclick="Del(<%#Eval("Q_ID")%>);return false;" p="62">删除</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="10" 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(',61,')==-1)$('*[p="61"]').remove();
    if(AP.indexOf(',62,')==-1)$('*[p="62"]').remove();
 }
 function Del(ID)
 {
 	var Url='?Act=del&';
	var IDs;
	if(ID>0)
	{
		Url +='ID='+ID;
	}else{
 		IDs = $("input[name='Q_ID']").serialize().replace(/&Q_ID=/g,',');
		if(IDs==''){alert('请选择您要删除的度假问答！');return;}
		Url +=IDs;
	}
	if(confirm('您确定删除吗！')){location=Url;}
 }
 var Alls=true;
 function All(){$('input[name="Q_ID"]').attr('checked',Alls);Alls=!Alls;}
 function Edit(ID)
 {
    $('#TourExForm').attr('action','?id='+ID+'&act=save');
    $('#Q_Questions').val($('#Q_Questions_' + ID).val());
    $('#Q_Answers').val($('#Q_Answers_' + ID).val());
    $("#TourExForm").validate({
	    rules:{
		    Q_Questions: {required: true},
		    Q_Answers: {required: true}
	    }
    });
    ShowWindow();
 }
 //-->
</script>
</body>
</html>