<%@ Page Language="C#" Inherits="Caicai.Jingpin.UI.Plugins.Task" %>
<!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">
<link href="css.css" rel="stylesheet" type="text/css" />
<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" src="../../files/common/jquery.js"></script>
<script type="text/javascript">
$(function()
{
	$("#ButtonInsert").click(function()
	{
		//TB_Content验证
		if($("#DDL_ClassID").val()=='0' || $("#DDL_ClassID").val()==null)
		{
			alert("请选择作业！");
			$("#DDL_ClassID").get(0).focus(); 
			return false;
		}

		//TB_Content验证
		if($("#TB_Content").val()=='')
		{
			alert("请上传作业！");
			$("#TB_Content").get(0).focus(); 
			return false;
		}

		//TB_Intro验证
		if ($("#TB_Intro").val()=='')
		{
			alert("请填写作业详述！");
			$("#TB_Intro").get(0).focus(); 
			return false;
		} 
		return true;
	})

	$("#ButtonUpdate").click(function()
	{
		//TB_Result验证
		if ($("#TB_Result").val()=='')
		{
			alert("很抱歉，输入的成绩必须为数字！");
			$("#TB_Result").get(0).focus(); 
			return false;
		}
		return true;
	})

	$(".upload").click(function()
	{
		window.open($(this).attr("href"),"newWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=400,left=400,width=320,height=110");
		return false;
	})
	
	$("#DDL_ClassID").change(function()
	{
		//alert($(this).val());
		$(".taskclass").hide();
		$("div[name=class_"+ $(this).val() +"]").show();
	})

	//删除数据的提示
	$("a[title=delete]").click(function()
    {
        return confirm("你确定要删除这一项吗？");
    })

})
</script>
</head>
<body>
<form id="form1" runat="server">
<table class="table menu">
  <tr>
    <td width="130">
	<a href="default.aspx">查看全部作业列表</a>
	</td>
	<td align="right">
	<asp:placeholder runat="server" Visible='<%# IsLogin %>'><a href="../user.aspx?action=show&id=<%= LoginKey("UserID") %>"><%= LoginKey("Name") %>的用户中心</a><a href="default.aspx?action=user&id=<%= LoginKey("UserID") %>">我的作业列表</a><a href="default.aspx?action=insert">提交作业</a><asp:LinkButton ID="LinkButton1" runat="server" onclick="Loginout_Click"  Text="退出系统" /></asp:placeholder>
	<asp:placeholder runat="server" Visible='<%# !IsLogin %>'><a href="../login.aspx?url=<%=Server.UrlEncode("task/default.aspx")%>&table=C_Task&islog=yes">用户登陆</a></asp:placeholder>
	</td>	
  </tr>
</table>
<!-- 显示页面 -->
<asp:Panel ID="PanelDefault" runat="server">
<table class="table">
<thead>
<tr>
    <td style="width:16px;"></td>
    <td style="width:60px;">姓名</td>
    <td>作业名称</td>
    <td style="width:70px;">未批改内容</td>
    <td style="width:70px;">已批改内容</td>
    <td style="width:30px;">成绩</td>
    <td style="width:110px;">提交时间</td>
</tr>
</thead>
<asp:Repeater ID="RepeaterDefault" runat="server">
<ItemTemplate>
<tr>
    <td><img src="images/ico_task.gif" /></td>
    <td><a href="../user.aspx?action=show&id=<%# Eval("UserID")%>"><%# UserName(Eval("UserID").ToString())%></a></td>
    <td><a href="default.aspx?action=show&id=<%# Eval("ID")%>"><%# Caicai.Framework.UI.Admin.Manage.GetTableName("C_TaskClass", "Name", Eval("ClassID").ToString())%></a></td>
    <td><a href="../../<%# Eval("Content")%>" title="<%# Eval("Intro")%>" target="_blank">点这里下载</a></td>
    <td><a href="../../<%# Eval("ReContent")%>" title="<%# Eval("ReIntro")%>" target="_blank">点这里下载</a></td>
    <td style="color:Red"><%# Eval("Result")%></td>
    <td class="time"><%# Eval("InputDate") %></td>
</tr>
<asp:Panel ID="Panel2" runat="server" CssClass="inline" Visible="<%# IsAdmin %>">
<tr>
    <td></td>
    <td colspan="6" 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>
    </td>
</tr>
</asp:Panel>
</ItemTemplate>
</asp:Repeater>
<tr>
    <td style="border:0px; height:14px;" colspan="2"></td>
</tr>
<tr>
    <td colspan="7"><Caicai:CPageSql ID="PageDefault" runat="server" PageSize="10" /></td>
</tr>
</table>
</asp:Panel>
<!-- 提交页面 -->
<asp:Panel ID="PanelInsert" runat="server">
<table class="table">
<tr>
    <td style="background:#f1f1f1;text-align:right; width:100px;">作业名称</td>
    <td>
	<Cai:CDropDownList runat="server" ID="DDL_ClassID" />
	<asp:Repeater ID="RepeaterTaskClass" runat="server">
		<ItemTemplate>
			<div class="taskclass" name="class_<%# Eval("id") %>"><strong>作业说明：</strong><%# Eval("Intro") %></div>
		</ItemTemplate>
	</asp:Repeater>
	</td>
</tr>
<tr>
    <td style="background:#f1f1f1;text-align:right;">上传作业</td>
    <td><Cai:CTextBox runat="server" ID="TB_Content" Style="width:30%;" /><a href="../../files/common/upload.aspx?id=TB_Content&uploadname=task/" class="upload">点这里上传</a></td>
</tr>
<tr>
    <td style="background:#f1f1f1;text-align:right;">作业详述</td>
    <td><Cai:CTextBox runat="server" ID="TB_Intro" TextMode="MultiLine" Style="height:80px;width:90%;" /></td>
</tr>
<tr>
    <td colspan="2" align="center"><asp:Button ID="ButtonInsert" runat="server" Text=" 提 交 " onclick="Insert_Click" />&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; width:100px; text-align:right;">姓名</td>
    <td><a href="../user.aspx?action=show&id=<%# Eval("UserID")%>"><%# UserName(Eval("UserID").ToString())%></a></td>
</tr>
<tr>
    <td style="background:#f1f1f1; text-align:right;">作业名称</td>
    <td><%# Caicai.Framework.UI.Admin.Manage.GetTableName("C_TaskClass", "Name", Eval("ClassID").ToString())%></td>
</tr>
<tr>
    <td style="background:#f1f1f1; text-align:right;">作业详述</td>
    <td><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("Intro").ToString()) %></td>
</tr>
<tr>
    <td style="background:#f1f1f1; text-align:right;">未批改内容</td>
    <td><a href="../../<%# Eval("Content")%>" title="<%# Eval("Intro")%>" target="_blank">点这里下载</a></td>
</tr>
<tr>
    <td style="background:#f1f1f1; text-align:right;">已批改作业详述</td>
    <td><%# Caicai.Framework.Utils.CText.HtmlEncode(Eval("ReIntro").ToString()) %></td>
</tr>
<tr>
    <td style="background:#f1f1f1; text-align:right;">已批改内容</td>
    <td><a href="../../<%# Eval("ReContent")%>" title="<%# Eval("ReIntro")%>" target="_blank">点这里下载</a></td>
</tr>
<tr>
    <td style="background:#f1f1f1; text-align:right;">成绩</td>
    <td style="color:Red"><%# Eval("Result")%></td>
</tr>
<tr>
    <td style="background:#f1f1f1; text-align:right;">提交时间</td>
    <td class="time"><%# Eval("InputDate") %></td>
</tr>
<tr>
	<td style="background:#f1f1f1; text-align:right;"></td>
    <td><a href="javascript:history.back()" class="button">返回上一页</a></td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
</asp:Panel>
<asp:Panel ID="PanelUpdate" runat="server">
<table class="table">
<tr>
    <td style="background:#f1f1f1; width:100px; text-align:right;">成绩</td>
    <td><Cai:CTextBox runat="server" ID="TB_Result" Style="width:30%;" /></td>
</tr>
<tr>
    <td style="background:#f1f1f1;text-align:right;">上传批改作业</td>
    <td><Cai:CTextBox runat="server" ID="TB_ReContent" Style="width:30%;" /><a href="../../files/common/upload.aspx?id=TB_ReContent&uploadname=task/" class="upload" onclick="PageOpen(this); return false;">点这里上传</a></td>
</tr>
<tr>
    <td style="background:#f1f1f1;text-align:right;">作业详述</td>
    <td><Cai:CTextBox runat="server" ID="TB_ReIntro" TextMode="MultiLine" Style="height:80px;width:90%;" /></td>
</tr>
<tr>
    <td colspan="2" align="center"><asp:Button ID="ButtonUpdate" runat="server" Text=" 回 复 " onclick="Update_Click" />&nbsp;&nbsp;<input type="reset" value=" 重 置 " /></td>
</tr>
</table>
</asp:Panel>
</form>
</body>
</html>
