<%@ Page Language="C#" Inherits="Caicai.Jingpin.UI.Plugins.Faq" %>

<!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 runat="server">
<title><%= Caicai.Framework.Utils.CAppSettings.ConfigGet("Page.SiteCopyright") %>在线答疑系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="../style.css" rel="stylesheet" rev="stylesheet" media="all" />
<meta name="author" content="guqiu.com" />
<meta name="keywords" content="谷秋精品课程系统,精品课程,谷秋精品课程,精品课程软件,谷秋精品工具" />
<meta name="description" content="谷秋精品课程系统网站由《谷秋精品课程软件》生成，谷秋精品课程软件官方网站http://www.guqiu.com。" />
<script type="text/javascript">
function CheckInput() 
{
    //TB_Name验证
	if ($("TB_Name").value=='')
	{
		alert("请填写您的姓名！");
		$("TB_Name").focus(); 
		return false;
	} 
	if ($("TB_Name").value.length > 10)
	{
		alert("很抱歉，输入的姓名已经超出限制！");
		$("TB_Name").focus(); 
		return false;
	}
	
	//TB_Title验证
	if($("TB_Title").value=='')
	{
	    alert("请填写标题！");
	    $("TB_Title").focus(); 
		return false;
	}
	if ($("TB_Title").value.length > 30)
	{
		alert("很抱歉，输入的标题已经超出限制！");
		$("TB_Title").focus(); 
		return false;
	}
	
	//TB_TeaID验证
	if ($("TB_TeaID").value=='0')
	{
		alert("请选择期望答复人！");
		$("TB_TeaID").focus(); 
		return false;
	} 
	
	//TB_Content验证
	if ($("TB_Content").value=='')
	{
		alert("请填写问题详述！");
		$("TB_Content").focus(); 
		return false;
	} 
	if ($("TB_Content").value.length > 5024) 
	{
		alert("很抱歉，输入的问题详述已经超出限制！");
		$("TB_Content").focus(); 
		return false;
	} 
	
	//TB_Validate验证
	if ($("TB_Validate").value=='')
	{
		alert("请填写验证码！");
		$("TB_Validate").focus(); 
		return false;
	} 
	if ($("TB_Validate").value.length != 4)
	{
		alert("请认真填写验证码！");
		$("TB_Validate").focus(); 
		return false;
	}
	return true;
}
function $(id) 
{
	return document.getElementById(id);
}
</script>
</head>
<body id="faq">
<form id="form1" runat="server">
<table class="table menu">
  <tr>
    <td><a href="?">查看答疑列表</a><a href="?action=insert">提交问题</a><a href="../login.aspx?url=<%=Server.UrlEncode("faq/default.aspx")%>&table=C_Faq">管理登陆</a></td>
  </tr>
</table>
<asp:Panel ID="PanelInsert" runat="server">
<table class="table">
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">您的姓名</td>
    <td><Cai:CTextBox runat="server" ID="TB_Name" Style="width:30%;" /></td>
</tr>
<tr>
    <td style="background:#f1f1f1;text-align:right;">问题标题</td>
    <td><Cai:CTextBox runat="server" ID="TB_Title" Style="width:50%;" /></td>
</tr>
<tr>
    <td style="background:#f1f1f1;text-align:right;">期望答复人</td>
    <td><Cai:CDropDownList runat="server" ID="TB_TeaID" Name="C_User" ControlType="TableName"  Where="UserGroup=2" /></td>
</tr>
<tr>
    <td style="background:#f1f1f1;text-align:right;">问题详述</td>
    <td><Cai:CTextBox runat="server" ID="TB_Content" TextMode="MultiLine" Style="height:80px;width:90%;" /></td>
</tr>
<tr>
    <td style="background:#f1f1f1;text-align:right;">验证码</td>
    <td><asp:TextBox runat="server" ID="TB_Validate" style="width:50px" />&nbsp;<img src="Validate.aspx" alt="看不清？点击更换" onclick="this.src=this.src+'?'" style="cursor:pointer;border:1px solid #333; position:absolute" /></td>
</tr>
<tr>
    <td style="background:#f1f1f1;text-align:right;"></td>
    <td style="color:Red">提交问题后，只有被老师回复了才能在前台显示问题列表！</td>
</tr>
<tr>
    <td colspan="2" align="center"><asp:Button ID="ButtonInsert" runat="server" Text=" 提 交 " onclick="Insert_Click" OnClientClick="return CheckInput();" />&nbsp;&nbsp;<input type="reset" value=" 重 置 " /></td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="PanelDefault" runat="server">
<table class="table">
<thead>
<tr>
    <td style="width:20px;"></td>
    <td>标题</td>
    <td style="width:80px;">期望回复人</td>
    <td style="width:100px;">提问人</td>
    <td style="width:120px;">提问时间</td>
</tr>
</thead>
<asp:Repeater ID="RepeaterDefault" runat="server">
<ItemTemplate>
<tr class="<%# Eval("ReContent").ToString().Length > 0 ? "datayes" : "datano" %>">
    <td><img src="images/ico_help.gif" /></td>
    <td class="title"><a href="default.aspx?action=show&id=<%# Eval("ID") %>"><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Title").ToString()) %></a></td>
    <td><%# UserName(Eval("TeaID").ToString())%></td>
    <td><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Name").ToString()) %></td>
    <td class="time"><%# Eval("InputDate") %></td>
</tr>
<asp:Panel ID="Panel2" runat="server" CssClass="inline" Visible="<%# IsAdmin %>">
<tr>
    <td></td>
    <td  colspan="4" style="background:#f1f1f1;"><a href="?action=update&id=<%# Eval("ID") %>"  title="update" class="button">回复</a><a href="?action=delete&id=<%# Eval("ID") %>"  title="delete" class="button">删除</a><asp:LinkButton ID="LinkButton1" runat="server" onclick="Loginout_Click"  Text="注销" CssClass="button" />
    </td>
</tr>
</asp:Panel>
</ItemTemplate>
</asp:Repeater>
<tr>
    <td style="border:0px; height:14px;" colspan="2"></td>
</tr>
<tr>
    <td colspan="5"><Caicai:CPageSql ID="PageShow" runat="server" PageSize="10" /></td>
</tr>
</table>
</asp:Panel>
<!-- 更新页面 -->
<asp:Panel ID="PanelUpdate" runat="server">
<table class="table">
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">问题回复</td>
    <td><asp:TextBox runat="server" ID="TB_ReContent" TextMode="MultiLine"  Style="height:80px;width:90%;" /></td>
</tr>
<tr>
    <td colspan="2" align="center"><asp:Button ID="ButtonUpdate" runat="server" onclick="Update_Click"  Text=" 回 复 " />&nbsp;&nbsp;<input type="reset" value=" 重 置 " /></td>
</tr>
</table>
</asp:Panel>
<!-- 详细页面 -->
<asp:Panel ID="PanelShow" runat="server">
<asp:Repeater ID="RepeaterShow" runat="server">
<ItemTemplate>
<table class="table">
<tr>
    <td style="background:#f1f1f1;" colspan="2"><strong>问题详细描述</strong></td>
</tr>
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">姓名</td>
    <td><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Name").ToString()) %></td>
</tr>
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">标题</td>
    <td><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Title").ToString()) %></td>
</tr>
<tr>
    <td style="height:10px" colspan="2"></td>
</tr>
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">期望回复人</td>
    <td><%# UserName(Eval("TeaID").ToString())%></td>
</tr>
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">问题详述</td>
    <td><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Content").ToString()) %>&nbsp;&nbsp;<span class="time">Time:<%# Eval("InputDate") %></td>
</tr>
<tr>
    <td style="height:10px;background:#ccc;" colspan="2"></td>
</tr>
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">回复人</td>
    <td style="color:Blue"><%# UserName(Eval("ReUserID").ToString()) %>
	</td>
</tr>
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">问题回复</td>
    <td style="color:Blue"><%# Eval("ReContent") %>&nbsp;&nbsp;<span class="time">Time:<%# Eval("ReInputDate") %></td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
</asp:Panel>
</form>
</body>
</html>
