<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="autocoursemain.aspx.cs" Inherits="Us.Web.admin.autocourse.autocoursemain" %>

<!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>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8,chrome=1" />

    <%=ImportScriptStr %>
    <asp:Literal ID="litregscript" runat="server" Text=""></asp:Literal>
    <link href="../style/default/style.css" rel="stylesheet" type="text/css" />
<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) {
    var url = ("/admin/autocourse/autocoursemaindesign.aspx?guid=" + guid + "&skytid=" + $("#drpSkyTID").val());
    CareffArtOpenB3(url);
}
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="";
	}
}

function OpenLP(skycnumber) {
    skytid = $("#drpSkyTID").val();
    var url="/admin/autocourse/skyautocoursecontinuelist.aspx?skytid="+skytid+"&skycnumber="+skycnumber;
    CareffArtOpenB3(url);
}

</script>

</head>
<body>
<form id="form1" runat="server">
   
  <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" Selected="True">高速模式(服务器压力大)</asp:ListItem>
                      <asp:ListItem Value="100">中速模式(服务器压力中)</asp:ListItem>
                      <asp:ListItem Value="1000" >低速模式(服务器压力小)</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">4联排课程</td>
                  <td class="tabmanagertr"> <a class="rptlink" href="javascript:void(0);" onclick="OpenLP('4');">[4联排课程设置]</a></td>
                  <td class="tablisttitle">2联排课程</td>
                  <td class="tabmanagertr"><a class="rptlink" href="javascript:void(0);" onclick="OpenLP('2');">[2联排课程设置]</a></td>
              </tr>
              <tr class="tablisttr">
                  <td class="tablisttitle" width="100">清空手动数据</td>
                  <td class="tabmanagertr" colspan="3">
                      <asp:CheckBox ID="chkClearHand" runat="server" CssClass="chkAuto" Text="清空手动排课里面预设的排课信息，全部自动安排；请注意如果使用了本功能后，本学期的所有排课数据将直接清空；这是个非常危险的操作，请千万注意；" />
                  </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="javascript:CareffArtOpenB3('/admin/autocourse/viewteachercoursesum.aspx');">【点击按照教师查看课程汇总】</a>，
                         <a href="javascript:CareffArtOpenB3('/admin/autocourse/viewclasscoursesum.aspx');">【点击按照班级查看课程汇总】</a>，
                         
                         
                         <a href="javascript:CareffArtOpenB3('/admin/autocourse/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>

</form>
</body>
</html>
