<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="autocoursemain.aspx.cs" Inherits="School_Web.admin.autocourse.autocoursemain" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<!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 id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>自动排课</title>
<asp:Literal ID="litregscript" runat="server" Text=""></asp:Literal>
<link href="../style/green/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="/admin/js/System.js" type="text/javascript"></script>
<script src="../js/jquery/jquery.js" type="text/javascript"></script>
<style type="text/css">
#chkAll, #chkRoom {
	width:13px;
	height:13px;
	margin:2px;
	padding:2px;
	border: 0px none #009999;
}
</style>

<script type='text/javascript' type="text/javascript">
function setParentInfo(a1,a2,a3,a4,a5)
{
	var txt1 = document.getElementById("txtJ1");
	txt1.value=a1;
	txt1 = document.getElementById("txtJ2");
	txt1.value=a2;
	txt1 =document.getElementById("txtClassNumber");
	txt1.value=a3;
	txt1 = document.getElementById("txtTeacherNumber");
	txt1.value=a4;
	txt1 = document.getElementById("txtRoomNumber");
	txt1.value=a5;
}
function setOpAutoCourse(guid) {
    return UsSysOpen("autocoursemaindesign.aspx?guid=" + guid + "&skytid=" + $("#drpSkyTID").val());
}
function setParentState(state,enddate,info,guid)
{
	var txt1 =document.getElementById("txtEndDate");
	txt1.value=enddate;
	txt1 = document.getElementById("oprInfo");
	var sAdd="<a onclick=\"return setOpAutoCourse('"+guid+"');\" href=\"javascript:void(0);\">[查看排课结果]</a>";
	info += sAdd;
	if(state=="5")
	{
		
		txt1.innerHTML=info;
	}
	else
	{
	    txt1.innerHTML = "对不起，自动排课失败，您可以点击排课自动在重新排课！" + "";
	}
	//txt1 =document.getElementById("btnSubmit");
	//txt1.style.display="";
	SetButtonState(false);
	//txt1.innerHTML= state+info+guid;
}

function AutoStart()
{
	var info;
	info="您确实要开始自动排课吗？请注意在排课没有结束的时候，请不要关闭浏览器，否则系统将可能存在问题！";
	var bstate=confirm(info);
	if(bstate)
	{
		var txt1 =document.getElementById("btnSubmit");
		txt1.style.display="none";
		//alert("点击确定，系统开始自动排课！");
	}
	//return false;
	return bstate;
}

function SetButtonState(state)
{
	var btn =document.getElementById("btnSubmit");
	if(state)
	{
		btn.style.display="none";
	}
	else
	{
		btn.style.display="";
	}
}

</script>

</head>
<body>
<form id="form1" runat="server">
  <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
  <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>   
  <div id="tbMain">
    <div class="divTbg">
      <div class="divTbgL"> </div>
      <div class="divTbgInfo">
        <div class="divTbgTitle"> 自动排课</div>
      </div>
    </div>
    <div class="divTbgF"> </div>
    <div class="divTNavBG" id="topURL">
      <ul id="topURLul">
        <li class="divURLed" id="div1">
          <div> <img src="../style/default/images/mini_icons_046.gif" width="10" height="10" /> 
              自动排课</div>
        </li>
      </ul>
    </div>
    <div id="mypanel">
      <div class="divInfoContext">
        <div class="divInfo">
          <div class="divInfoblack">
            <div class="divInfoTopList">
              <div class="listLeft">
                <div class="navtitle"> 自动排课</div>
              </div>
            </div>
          </div>
        </div>
        <div class="divInfo">
          <table width="100%" border="0" cellpadding="0" cellspacing="1" class="tablist" id="mainlist">
            <tr class="tablisttr">
              <td width="100" class="tablisttitle"> 启动时间</td>
              <td class="tabmanagertr">
                  <asp:TextBox ID="txtStartDate" runat="server"  
                                    Width="200px" Enabled="False" ReadOnly="True"></asp:TextBox></td>
              <td width="100" class="tablisttitle">结束时间</td>
              <td class="tabmanagertr">
                  <asp:TextBox ID="txtEndDate" runat="server"  
                                  Width="200px" Enabled="False" ReadOnly="True"></asp:TextBox></td>
            </tr>
            <tr class="tablisttr">
              <td width="100" class="tablisttitle"> 排课要求</td>
              <td class="tabmanagertr"><asp:CheckBox ID="chkAll" runat="server" Text="主课排上午" CssClass="chkAuto" />              
                  <asp:CheckBox ID="chkRoom" runat="server" CssClass="chkAuto" Text="教室参加排课" 
                      Enabled="False" />
                </td>
              <td class="tablisttitle">排课速度</td>
              <td class="tabmanagertr">
                  <asp:DropDownList ID="drpSkySpeed" runat="server">
                      <asp:ListItem Value="10">高速模式(服务器压力大)</asp:ListItem>
                      <asp:ListItem Value="100">中速模式(服务器压力中)</asp:ListItem>
                      <asp:ListItem Value="1000" Selected="True">低速模式(服务器压力小)</asp:ListItem>
                  </asp:DropDownList>
                </td>
            </tr>
            <tr class="tablisttr">
              <td width="100" class="tablisttitle"> 周课时数</td>
              <td class="tabmanagertr">
                  <asp:TextBox ID="txtJ1" runat="server"  
                                    Width="200px" Enabled="False" ReadOnly="True"></asp:TextBox>              </td>
              <td class="tablisttitle">教学计划</td>
              <td class="tabmanagertr">
                  <asp:TextBox ID="txtJ2" runat="server"  
                                  Width="200px" Enabled="False" ReadOnly="True"></asp:TextBox></td>
            </tr>
            <tr class="tablisttr">
              <td width="100" class="tablisttitle"> 班级数量</td>
              <td class="tabmanagertr">
                  <asp:TextBox ID="txtClassNumber" runat="server"  
                                    Width="200px" Enabled="False" ReadOnly="True"></asp:TextBox>              </td>
              <td class="tablisttitle">教师数量</td>
              <td class="tabmanagertr">
                  <asp:TextBox ID="txtTeacherNumber" runat="server"  
                                  Width="200px" Enabled="False" ReadOnly="True"></asp:TextBox></td>
            </tr>
            <tr class="tablisttr">
              <td width="100" class="tablisttitle"> 教室数量</td>
              <td class="tabmanagertr">
                  <asp:TextBox ID="txtRoomNumber" runat="server"  
                                    Width="200px" Enabled="False" ReadOnly="True"></asp:TextBox>              </td>
              <td class="tablisttitle">排课学期</td>
              <td class="tabmanagertr"><asp:DropDownList ID="drpSkyTID" runat="server" Enabled="true">
                                </asp:DropDownList></td>
            </tr>
            <tr class="tablisttr">
                  <td class="tablisttitle" width="100">
                      排课说明</td>
                  <td class="tabmanagertr" colspan="3">
                     <div style="line-height:15px">
                         1、设置您需要排课的状态，包括排课要求；<br />
                         2、点击下面的开始排课按钮，进行自动排课；<br />
                         3、如果排课成功，请点击排课状态的[查看排课结果]页面，打开排课效果；<br />
                         4、如果不满意，您可以返回重新开始排课，也可以在打开页面点击修改到您满意的状态；<br />
                         5、点击打开页面的【正式发布】按钮，将已经排好的课程发布，排课功能完成；<br />
                         6、当课程比较多的时候，请使用低速模式，否则服务器压力过大；<br />
                         7、<a href="viewteachercoursesum.aspx">【点击按照教师查看课程汇总】</a>，<a href="viewclasscoursesum.aspx">【点击按照班级查看课程汇总】</a>，<a href="autocoursemaindesign.aspx">【点击查看临时排课数据】</a><br />
                     </div>                  </td>
              </tr>
            <tr class="tablisttr">
              <td width="100" class="tablisttitle">排课状态 </td>
              <td colspan="3" class="tabmanagertr"><div id="oprInfo"></div></td>
            </tr>
            <tr class="tablisttr">
              <td width="100" class="tablisttitle">排课日志 </td>
              <td colspan="3" class="tabmanagertr">
              <div style="height:150px; overflow:auto" id="logInfo"><iframe src="autocoursemainserver.aspx" id="OutputFrame" 
              allowtransparency="true" frameborder="0"
                width="100%" height="100%" scrolling="auto" marginheight="0"></iframe></div></td>
            </tr>
              
          </table>
        </div>
      </div>
    </div>
  </div>
  <div class="divSave">
    <asp:Button ID="btnSubmit" runat="server" Text="开始排课(S)" CssClass="SkyButtonFocus"
                        OnClick="btnSubmit_Click" AccessKey="S" CommandName="save"></asp:Button>
  </div>
  </div>
  <asp:Literal ID="litJavaScript" runat="server"></asp:Literal>
</ContentTemplate>
  </asp:UpdatePanel>
  <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
    <ProgressTemplate>
      <div id="divLoading"> <img src="/admin/style/default/images/loading.gif" /> </div>
    </ProgressTemplate>
  </asp:UpdateProgress>
</form>
</body>
</html>
