Hacked By AnonymousFox

Current Path : C:/AppServ/www/mfu/webengine/home/
Upload File :
Current File : C:/AppServ/www/mfu/webengine/home/indexadmin.php

<? 
include("../lib/session.php"); 
include("../lib/config.php");
include("../lib/connect.php");
include("../lib/function.php");
include("../lib/register_global.php");

$subject=$_GET["subject"];
$studentyear=$_GET["studentyear"];
$listid=$_GET["listid"];
$groupid=$_GET["groupid"];


$Eduyear=$_GET["Eduyear"];
if($Eduyear==""){ $Eduyear=date(" Y ")+543; }

$sqlsj="select cm_listsubject_Faculty from cm_listsubject where cm_listsubject_ID='$listid'";
$querysj=mysql_query($sqlsj);
$rowsj=mysql_fetch_array($querysj);
?>
<html>
<head>

<title><?=$System_Variable_Title?>
</title>
 
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
 
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<link href="../css/mystyle.css" rel="stylesheet" type="text/css">  
<style type="text/css">
<!--
.style1 {color: #000000}
.style3 {font-size: 16px}
.style4 {color: #FFFFFF}
.style13 {color: #030260}
-->
</style>
</head> 
<body bgcolor="#E9E6DF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../../images/thai.gif','../../images/eng.gif','../../images/chaina.gif','../../images/object/topbar-thai-over.gif','../../images/object/topbar-english-over.gif','../images/bullet/lang_over_02_1.gif','../images/bullet/lang_over_01_1.gif')">

<table width="95%" height="26" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td background="../../images/main/main-t-bg.gif" bgcolor="#162C41"><img src="../../webengine/bar.jpg" width="567" height="70" alt="&#3585;&#3619;&#3632;&#3607;&#3619;&#3623;&#3591;&#3624;&#3638;&#3585;&#3625;&#3634;&#3608;&#3636;&#3585;&#3634;&#3619;" /><br></td>
  </tr>
</table>
<table width="95%" height="6" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="1" bgcolor="#10202F">&nbsp;</td>
  </tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="1" bgcolor="#10202F"><img src="../../images/blank.gif" width="1" height="1"></td>
    <td align="center" valign="top"><table width="100%" height="480" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="215" align="center" valign="top" bgcolor="#9C9994" style="background-repeat:repeat-x; "><br>
            <!--Start Menu ----------------------------------------------------------------------------------->
        	<? if(strlen($System_Session_User_ID)==0) { ?>
            <? if($alert=="yes") { ?>
            <table width="90%" border="0" cellpadding="1" cellspacing="0" class="messagebox_alert">
              <form name="myLoginForm" method="post" action="../../system/login.php" onSubmit="
with(document.myLoginForm) {
	if(inputUserName.value=='') {
		inputUserName.focus();
		return false;
	}
	if(inputPassword.value=='') {
		inputPassword.focus();
		return false;
	}
}">
                <tr align="center"> 
                  <td height="40" colspan="2">Incorrect your<br>
                    UserName or Password.</td>
                </tr>
              </form>
            </table>
            <br>
            <? } ?>            
            <table width="97%" height="18" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td width="8"><img src="../../images/blank.gif" width="1" height="1"></td>
                <td ><strong><font color="#FFFFFF">&nbsp;<img src="../../images/object/bar-icon.gif" width="9" height="5" align="absmiddle">&nbsp;&#3648;&#3586;&#3657;&#3634;&#3626;&#3641;&#3656;&#3619;&#3632;&#3610;&#3610;</font></strong></td>
              </tr>
            </table> 
            <table width="100%" height="3" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td><img src="../../images/blank.gif" width="1" height="1"></td>
              </tr>
            </table>
            <table width="97%" border="0" cellpadding="0" cellspacing="0" bgcolor="#DFDFDF">
              <tr> 
                <td width="6" height="6"><img src="../../images/object/dot-border-1.gif" width="6" height="6"></td>
                <td height="6" background="../../images/object/dot-border-2.gif"><img src="../../images/blank.gif" width="1" height="1"></td>
                <td width="6" height="6"><img src="../../images/object/dot-border-3.gif" width="6" height="6"></td>
              </tr>
              <tr> 
                <td width="6" background="../../images/object/dot-border-4.gif"><img src="../../images/blank.gif" width="1" height="1"></td>
                <td align="center" valign="top">
<table width="100%" height="120" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td height="80" align="center" valign="middle"> 
                        <form name="myLoginForm" method="post" action="../system/login.php" onSubmit=" 
with(document.myLoginForm) {
	if(inputUserName.value=='') {
		inputUserName.focus();
		return false;
	}
	if(inputPassword.value=='') {
		inputPassword.focus();
		return false;
	}
}
				">
                          <table border="0" cellspacing="0" cellpadding="1">
                            <tr> 
                              <td height="18" colspan="2" valign="bottom"><font color="#990000"><strong>Username</strong></font><font color="#990000">&nbsp;</font></td>
                            </tr>
                            <tr> 
                              <td width="10">&nbsp;</td>
                              <td> <input name="inputUserName" type="text" class="input_left" id="inputUserName" size="20" maxlength="50"></td>
                            </tr>
                            <tr> 
                              <td height="18" colspan="2" valign="bottom"><font color="#990000"><strong>Password</strong></font><font color="#990000">&nbsp;</font></td>
                            </tr>
                            <tr> 
                              <td width="10">&nbsp;</td>
                              <td><input name="inputPassword" type="password" class="input_left" id="inputPassword" size="20" maxlength="50"></td>
                            </tr>
                            <tr> 
                              <td width="10">&nbsp;</td>
                              <td align="right"><input name="Submit" type="submit" class="button_60" value="LogIn"></td>
                            </tr>
                          </table>
                        </form></td>
                    </tr>
                  </table></td>
                <td width="6" background="../../images/object/dot-border-5.gif"><img src="../../images/blank.gif" width="1" height="1"></td>
              </tr>
              <tr> 
                <td width="6" height="6"><img src="../../images/object/dot-border-6.gif" width="6" height="6"></td>
                <td height="6" background="../../images/object/dot-border-7.gif"><img src="../../images/blank.gif" width="1" height="1"></td>
                <td width="6" height="6"><img src="../../images/object/dot-border-8.gif" width="6" height="6"></td>
              </tr>
            </table>
            <br>
            <? } else { ?>
            <? if($SystemMenuID=="") { $SystemMenuID=-1; } ?>
            <table width="205" height="21" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/bg-search.gif" style="background-repeat:repeat-x; ">
              <tr>
                <td width="5%" >&nbsp;</td> 
                <td width="95%" height="43" ><strong><font color="#FFFFFF">&nbsp;<img src="../../images/object/bar-icon.gif" width="9" height="5" align="absmiddle">&nbsp;&#3648;&#3617;&#3609;&#3641;&#3627;&#3621;&#3633;&#3585;</font></strong></td>
              </tr>
            </table> 
            <table width="205" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td bgcolor="#F3F3F3"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <form action="../../Templates/" method="get" name="myMenuForm" id="myMenuForm">
                      <input type="hidden" name="SystemMenuID">
                      <input type="hidden" name="SystemModuleKey">
                      <input type="hidden" name="System_EXID" value="<?=$System_EXID?>">
                    </form>
                    <? if($System_Session_User_ID>0) { ?> 
                    <tr> 
                      <td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
                    </tr>
                    <tr>
                      <td height="1" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="document.myMenuForm.action='../home/index.php'; document.myMenuForm.submit();">
					  <table width="100%" height="24" border="0" cellpadding="2" cellspacing="0" class="menu_table_text">
        <tr>
          <td width="22" align="center"><img src="../images/icon/ico516.gif" width="16" height="14"></td>
          <td>Home</td>
        </tr>
    </table></td>
                    </tr>
                    <tr> 
                      <td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
                    </tr>
                    <tr> 
                      <td height="22" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="
document.myMenuForm.action='../system/user_information.php'; 
document.myMenuForm.SystemMenuID.value=-3;
document.myMenuForm.submit();
"><table width="100%" height="25" border="0" cellpadding="2" cellspacing="0">
                          <tr> 
                            <td width="22" align="center"><img src="../images/icon/ico559.gif" width="15" height="16"></td>
                            <td> 
                              <? if($SystemMenuID==-3) { ?>
                              <b><font color="#990000">User Information</font></b> 
                              <? } else { ?>
                              User Information 
                              <? } ?>                            </td>
                          </tr>
                        </table></td>
                    </tr>
                    <? } ?>
                    <!---------------------------------------------------------------------------->
                    <? if($System_Session_Level=="Admin") { ?>
                    <tr> 
                      <td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
                    </tr>
                    <tr> 
                      <td height="22" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="
document.myMenuForm.action='../system/user_management.php'; 
document.myMenuForm.SystemMenuID.value=-4;
document.myMenuForm.submit();
"><table width="100%" height="25" border="0" cellpadding="2" cellspacing="0">
                          <tr> 
                            <td width="22" align="center"><img src="../images/icon/ico051.gif" width="13" height="19"></td>
                            <td> 
                              <? if($SystemMenuID==-4) { ?>
                              <b><font color="#990000">Manage User Admin</font></b> 
                              <? } else { ?>
                              Manage User Admin 
                              <? } ?>                            </td>
                          </tr>
                        </table></td>
                    </tr>
                    <? } ?>
                    <!---------------------------------------------------------------------------->
                    <? if($System_Session_User_ID==0) { ?>
                    <tr> 
                      <td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
                    </tr>
                    <tr> 
                      <td height="22" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="
document.myMenuForm.action='../mod_dmenu/index.php'; 
document.myMenuForm.SystemMenuID.value=-2;
document.myMenuForm.submit();
"><table width="100%" height="25" border="0" cellpadding="2" cellspacing="0">
                          <tr> 
                            <td width="22" align="center"><img src="../images/icon/ico509.gif" width="16" height="13"></td>
                            <td> 
                              <? if($SystemMenuID==-2) { ?>
                              <b><font color="#990000">Menu Bulider</font></b> 
                              <? } else { ?>
                              Menu Bulider 
                              <? } ?>                            </td>
                          </tr>
                        </table></td>
                    </tr>
                    <? } ?>
                    <? if($System_Session_User_ID>0) { ?>
                    <?
$sql = "SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_ParentID=0 AND ".$System_TableName_Menu."_Language = '$System_Session_Language' ORDER BY ".$System_TableName_Menu."_Order ASC ";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");
$MenuRecordCount=MYSQL_NUMROWS($Query);

$index=1;
if($MenuRecordCount>0) {
	while($index<$MenuRecordCount+1) {
		$Row=MYSQL_FETCH_ARRAY($Query);
		
		// checking for User Permission
		
		$myUserID = $System_Session_User_ID;
		$myMenuID = $Row[$System_TableName_Menu."_ID"];
		$myMenuPermission = getUserPermissionOnMenu($myUserID,$myMenuID);

		if($Row[$System_TableName_Menu."_Type"]=="Group") {
			$isUserOnGroup=isUserOnGroup($myUserID,$myMenuID);
		} else {
			$isUserOnGroup=1;
		}
		if( strlen($myMenuPermission)>0 && $myMenuPermission!="NA" && $isUserOnGroup>0) {
		?>
                    <tr> 
                      <td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
                    </tr>
                    <tr> 
                      <td height="22" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="
<? if($Row[$System_TableName_Menu."_ModuleType"]=="Group") { ?>
	menuHideSubShow('idMenuSub<?=$Row[$System_TableName_Menu."_ID"]?>');
<? } else { ?>
with(document.myMenuForm) {
	SystemMenuID.value=<?=$Row[$System_TableName_Menu."_ID"]?>; 
	SystemModuleKey.value='<?=$Row[$System_TableName_Menu."_ModuleKey"]?>'; 
	action='<?=$Row[$System_TableName_Menu."_LinkPath"]?>'; 
	submit();
}
<? } ?>
"><table width="100%" height="25" border="0" cellpadding="2" cellspacing="0">
                          <tr> 
                            <td width="22" align="center"><? if($Row[$System_TableName_Menu."_Icon"]==""){ ?>
                              <img src="../images/icon/145.gif">							<? }else{ ?>
							<img src="<?=$Row[$System_TableName_Menu."_Icon"]?>"><? } ?></td>
                            <td> 
                              <? if($SystemMenuID==$Row[$System_TableName_Menu."_ID"]) { ?>
                              <b><font color="#990000"> 
                              <?=$Row[$System_TableName_Menu."_Name".$System_Session_Language]?>
                              </font></b> 
                              <? } else { ?>
                              <?=$Row[$System_TableName_Menu."_Name".$System_Session_Language]?>
                              <? } ?>                            </td>
                            <? if($Row[$System_TableName_Menu."_ModuleType"]=="Group") { ?>
                            <td width="14" align="left"><img src="../images/arrow1.gif" width="13" height="10"></td>
                            <? } ?>
                          </tr>
                        </table></td>
                    </tr>
                    <?
		$ParentID=$Row[$System_TableName_Menu."_ID"];
		
		$sql1 = "SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_ParentID='$ParentID' ORDER BY ".$System_TableName_Menu."_Order ASC ";
		$Query1=MYSQL_DB_QUERY($System_DataBase_Name,$sql1) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql1<br>\n");
		$RecordCount1=MYSQL_NUMROWS($Query1);
	
		// checking for this sub menu active
		$sql2 = "SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_ID='$SystemMenuID' AND ".$System_TableName_Menu."_ParentID='$ParentID' ";
		
		$Query2=MYSQL_DB_QUERY($System_DataBase_Name,$sql2) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql2<br>\n");
		$isActiveMenu=MYSQL_NUMROWS($Query2);

		if($RecordCount1>0) {
		?>
                    <tr id="idMenuSub<?=$ParentID?>" <? if($isActiveMenu==0) { ?> style="display:none" <? } ?>> 
                      <td height="22" align="left" class="menu_table_bg_sub" > 
                        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
<tr height="8" >
                            <td height="8" background="../images/rare1.gif" bgcolor="#EACFD3" style="background-position:top; background-repeat:repeat-x; "><img src="../images/spacer.gif" width="24" height="8" /></td>
</tr>
</table><?
		$index1=1;
		
		while($index1<$RecordCount1+1) {
			$Row1=MYSQL_FETCH_ARRAY($Query1);
			$myID=$Row1[$System_TableName_Menu."_ID"];

			// checking for User Permission
			$myUserID = $System_Session_User_ID;
			$myMenuID = $myID;
			$myMenuPermission = getUserPermissionOnMenu($myUserID,$myMenuID);
			if( strlen($myMenuPermission)>0 && $myMenuPermission!="NA") {

				?>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="menu_table_bg_sub" onMouseOver="this.className='menu_table_bg_oversub'; " onMouseOut="this.className='menu_table_bg_sub'; " >
                          <tr> 
                            <td width="4">&nbsp;</td>
                            <td width="171" align="left"><table width="100%" height="25" border="0" cellpadding="1" cellspacing="0"  
 onClick="
with(document.myMenuForm) {
	SystemMenuID.value=<?=$Row1[$System_TableName_Menu."_ID"]?>; 
	SystemModuleKey.value='<?=$Row1[$System_TableName_Menu."_ModuleKey"]?>'; 
	action='<?=$Row1[$System_TableName_Menu."_LinkPath"]?>'; 
	submit();
}
">
                                <tr> 
                                  <td width="22" align="left"><? if($Row1[$System_TableName_Menu."_Icon"]==""){ ?>-<? }else{ ?><img src="<?=$Row1[$System_TableName_Menu."_Icon"]?>"><? }?></td>
                                  <td align="left"> 
                                    <? if($SystemMenuID==$Row1[$System_TableName_Menu."_ID"]) { ?>
                                    <b><font color="#990000"> 
                                    <?=$Row1[$System_TableName_Menu."_Name".$System_Session_Language]?>
                                    </font></b> 
                                    <? } else { ?>
							  <font color="#6666AA"><?=$Row1[$System_TableName_Menu."_Name".$System_Session_Language]?></font>
                                    <? } ?>                                  </td>
                                </tr>
                            </table></td>
                          </tr>
                          <tr align="left">
                            <td colspan="2"><img src="../images/line3.gif" width="195"></td>
                          </tr>
                        </table>
                      <? 
					} // if Permission
					$index1++;
				} // while
			 } // if RecordCount1
			 ?>                      </td>
                    </tr>
                    <?
		} // if myMenuPermission
		$index++;
	} // while
} // if RecordCount
?>
                    <? } ?>
                    <tr> 
                      <td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
                    </tr>
                    <tr> 
                      <td height="22" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="document.myMenuForm.action='../system/logout.php'; document.myMenuForm.submit();"><table width="100%" height="25" border="0" cellpadding="2" cellspacing="0">
                          <tr> 
                            <td width="22" align="center"><img src="../images/icon/ico569.gif" width="13" height="13"></td>
                            <td>Logout</td>
                          </tr>
                        </table>                      </td>
                    </tr>
            </table></td>
              </tr>
            </table>
            
            <table width="205" height="30" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/bg-search2.gif">
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table>
            <? } ?>
            <script language="JavaScript" type="text/JavaScript">
function menuHideSubShow(myIdName) {
	if(document.getElementById(myIdName).style.display=='none') { 
		document.getElementById(myIdName).style.display=''
	} else {
		document.getElementById(myIdName).style.display='none';
	}
}
			  </script>
          <!--End Menu ----------------------------------------------------------------------------------->          </td>
          <td align="center" valign="top" bgcolor="#E9E6DF"> 
            <table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="16" valign="top" bgcolor="#C4BDB1">&nbsp;</td>
        <td align="center" valign="top" bgcolor="#C4BDB1">&nbsp;</td>
        <td valign="top" bgcolor="#C4BDB1">&nbsp;</td>
      </tr>
      <tr>
        <td width="20" valign="top" background="../images/object/border_03.gif"><img src="../images/object/border_16.gif" width="20" height="83"></td>
        <td align="center" valign="top" bgcolor="#FFFFFF">
		   <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="15" height="300">&nbsp;</td>
                  <td align="left" valign="top">
                  <div class="title1"> <br>
                    <br>
</div>
                    
                    <br>
	                <script language="JavaScript" src="../lib/popup.js" type="text/javascript"></script>
	                <? 
## Load Module Configuration Variable ############################################
include("config.php");
## Default Value ############################################
$SystemModule_defaultPageSize = 15;
$SystemModule_defaultPageShow = 1;
$SystemModule_MaxPage = 20;
$SystemModule_ReduceRange = 15; 		// +,- from current page show
$SystemModule_ASCDESC = "DESC";
$SystemModule_OrderBy = $myModule_Table."_ID";

#########################################################
?>
  <? if($action=="add") { 
 $CheckBoxID1=$_GET["CheckBoxID1"];
$subject=$_GET["subject"];
$studentyear=$_GET["studentyear"];
	$myCheckBoxID1=0;
	for($i=1;$i<=$TotalCheckBoxID1;$i++) {
		$myVar="CheckBoxID1".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID1=$$myVar;
		}
	}
?>
	                
	                <!-- import the calendar script -->
	                <link rel="stylesheet" type="text/css" href="../../css/myCalendarStyle.css">
	                <script type="text/javascript" src="../mod_calendar/lib/calendar.js"></script>
	                <script type="text/javascript" src="../mod_calendar/lib/lang/calendar-th.js"></script>
	                <script type="text/javascript" src="../mod_calendar/lib/loadcalendar.js"></script>
	                
	                <!-- end the calendar script -->
	                <table style="border-collapse: collapse" border="1" width="98%" align="center" cellpadding="0" cellspacing="1" class="table_border" bordercolor="#E8E7E1">
	                  <script src="FormManager.js">
					  </script>	
	                  <script type="text/javascript">
window.onload = function() {
    setupDependencies('myForm'); //name of form(s). Seperate each with a comma (ie: 'weboptions', 'myotherform' )
  };
</script>
	                  <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="myReturnForm" id="myReturnForm">
	                    <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
	                    <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
	                    <input name="admin" type="hidden" id="admin" value="<?=$admin?>">
	                    <input name="action" type="hidden" id="action" value="">
	                    <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
	                    <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
	                    <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
	                    <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
	                    <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
	                    <input name="subject" type="hidden" id="subject" value="<?=$subject?>">
	                    <input name="studentyear" type="hidden" id="PageSearch" value="<?=$studentyear?>">
	                    </form>
                        
                      <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="myForm" id="myForm" onSubmit=" if(!verifySubmit()) { return false; } ">
                        <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
                        <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
                        <input name="admin" type="hidden" id="admin" value="<?=$admin?>">
                        <input name="action" type="hidden" id="action" value="addnew">
                        <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
                        <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
                        <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
                        <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
                        <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
                        <input name="myCheckBoxID1" type="hidden" id="PageSearch" value="<?=$myCheckBoxID1?>">
                        <tr> 
                          <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="mytable_inner">
                            <tr align="center">
                              <td height="24" colspan="2" align="center" bgcolor="#F7F6F0" class="table_title1" style="font-weight: bold"><div align="center"><b>&#3648;&#3614;&#3636;&#3656;&#3617;&#3586;&#3657;&#3629;&#3617;&#3641;&#3621;</b></div></td>
                                </tr>
                            
                            <tr>
                              <td height="22" align="right" bgcolor="#F7F6F0" class="style3">ปีการศึกษา</td>
                              <td height="22" class="style3"><select name="Eduyear1" id="select">
                                  <option value="2559">2559</option>
                                  <option value="2560" selected>2560</option>
                                  <option value="2561">2561</option>
                                  <option value="2562">2562</option>
                                  <option value="2563">2563</option>
                                  <option value="2564">2564</option>
                                  <option value="2565">2565</option>
								    <option value="2566" selected="selected">2566</option>
									<option value="2567">2567</option>
                              </select></td>
                            </tr>
                            <tr>
                              <td width="138" height="22" align="right" bgcolor="#F7F6F0" class="style3">&#3619;&#3634;&#3618;&#3623;&#3636;&#3594;&#3634;</td>
                                  <td width="548" height="22" class="style3"><span class="style13"><b><?=$subject?></b></span>
                                    <input type="hidden" name="Subject" value="<?=$subject?>" />                                </td>
                                </tr>
                            <tr>
                              <td height="22" align="right" bgcolor="#F7F6F0" class="style3">&#3609;&#3633;&#3585;&#3624;&#3638;&#3585;&#3625;&#3634;&#3594;&#3633;&#3657;&#3609;&#3611;&#3637;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609;</td>
                                  <td height="22" class="style3"><span class="style13"><b><?=$studentyear?></b></span><input type="hidden" name="Studentyear" value="<?=$studentyear?>" /> </td>
                                </tr>
                            <tr>
                              <td height="22" align="right" bgcolor="#F7F6F0" class="style3">&#3648;&#3619;&#3639;&#3656;&#3629;&#3591;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609;</td>
                                  <td height="22" class="style3"><input name="Course" type="text" id="textfield" size="60" /></td>
                                </tr>
                            <tr>
                              <td height="22" align="right" bgcolor="#F7F6F0" class="style3" valign="top">&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;</td>
                                  <td height="22" class="style3"><table width="398" border="0">
                                    <tr>
                                      <td width="18">1. </td>
                                    <td colspan="2"><div class="style4" id="divDocumentSubject">&nbsp;</div></td>
                                    </tr>
                                    <tr>
                                      <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument" type="button" class="" id="btDocument" onClick="
Popup('popupDocumentWindow','popup_document_selecter.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="inputDocumentID" type="hidden" id="inputDocumentID" value="$inputDocumentID" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                    </table><br>
<table width="398" border="0">
                                    <tr>
                                      <td width="18">2. </td>
                                      <td colspan="2"><div class="style4" id="divDocumentSubject2">&nbsp;</div></td>
                                    </tr>
                                    <tr>
                                      <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument2" type="button" class="" id="btDocument2" onClick="
Popup('popupDocumentWindow','ppts.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="valueform2" type="hidden" id="valueform2" value="$valueform2" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                    </table><br>
<table width="398" border="0">
                                    <tr>
                                      <td width="18">3. </td>
                                      <td colspan="2"><div class="style4" id="divDocumentSubject3">&nbsp;</div></td>
                                    </tr>
                                    <tr>
                                      <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument3" type="button" class="" id="btDocument3" onClick="
Popup('popupDocumentWindow','ppts3.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="valueform3" type="hidden" id="valueform3" value="$valueform3" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                    </table><br>
<table width="398" border="0">
                                    <tr>
                                      <td width="18">4. </td>
                                      <td colspan="2"><div class="style4" id="divDocumentSubject4">&nbsp;</div></td>
                                    </tr>
                                    <tr>
                                      <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument2" type="button" class="" id="btDocument2" onClick="
Popup('popupDocumentWindow','ppts4.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="valueform4" type="hidden" id="valueform4" value="$valueform4" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                    </table>
                                    <br>
                                    <br>
                                    <select name="Statuspay" id="Statuspay">
                                      <option value="เบิกเงิน" selected>เบิกเงิน</option>
                                      <option value="ไม่เบิกเงิน">ไม่เบิกเงิน</option>
                                    </select>
                                    <table width="398" border="0" style="display:none">
                                      <tr>
                                        <td width="18">2. </td>
                                    <td colspan="2"><div class="style4" id="divDocumentSubject2">&nbsp;</div></td>
                                  </tr>
                                      <tr>
                                        <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument" type="button" class="" id="btDocument" onClick="
Popup('popupDocumentWindow','popup_document_selecter2.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="inputDocumentID2" type="hidden" id="inputDocumentID2" value="$inputDocumentID2" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                      </table>
                                    <table width="398" border="0"  style="display:none">
                                      <tr>
                                        <td width="18">3. </td>
                                    <td colspan="2"><div class="style4" id="divDocumentSubject3">&nbsp;</div></td>
                                  </tr>
                                      <tr>
                                        <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument2" type="button" class="" id="btDocument2" onClick="
Popup('popupDocumentWindow','popup_document_selecter3.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="inputDocumentID3" type="hidden" id="inputDocumentID3" value="$inputDocumentID3" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                      </table>
                                    <table width="398" border="0"  style="display:none">
                                      <tr>
                                        <td width="18">4. </td>
                                    <td colspan="2"><div class="style4" id="divDocumentSubject4">&nbsp;</div></td>
                                  </tr>
                                      <tr>
                                        <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument3" type="button" class="" id="btDocument3" onClick="
Popup('popupDocumentWindow','popup_document_selecter4.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="inputDocumentID4" type="hidden" id="inputDocumentID4" value="$inputDocumentID4" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                      </table>
                                    <table width="398" border="0"  style="display:none">
                                      <tr>
                                        <td width="18">5. </td>
                                  <td colspan="2"><div class="style4" id="divDocumentSubject5">&nbsp;</div></td>
                                </tr>
                                      <tr>
                                        <td>&nbsp;</td>
                                  <td width="160"><input name="btDocument4" type="button" class="" id="btDocument4" onClick="
Popup('popupDocumentWindow','popup_document_selecter5.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                    <input name="inputDocumentID5" type="hidden" id="inputDocumentID5" value="$inputDocumentID5" /></td>
                                  <td width="206">&nbsp;</td>
                                </tr>
                                      </table>                            
                                    <br>
                                    <br></td>
                                </tr>
                            <tr>
                              <td height="22" align="right" bgcolor="#F7F6F0" class="style3"><div align="right">&#3623;&#3633;&#3609;&#3607;&#3637;&#3656;&nbsp;</div></td>
                                  <td height="22" class="style3">
                                    <table border="0" cellspacing="0" cellpadding="1">
                                      <tr>
                                        <td><input name="inputMod_Calendar_DateFrom" type="text" class="input_center" id="inputMod_Calendar_DateFrom" value="<?=$myDate?>" size="10" maxlength="10" /></td>
                                        <td><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateFrom', 'y-mm-dd');" value=" ... " />                                      </td>
                                        </tr>
                                      </table>                                    </td>
                                </tr>
                            <tr>
                              <td height="22" align="right" bgcolor="#F7F6F0" class="style3"><div align="right">&#3648;&#3623;&#3621;&#3634;&nbsp;</div></td>
                                  <td height="22" class="style3"><table border="0" cellspacing="0" cellpadding="1">
                                    <tr>
                                      <td width="30">&#3592;&#3634;&#3585;</td>
                                        <td><select name="inputTimeFromHH" class="select" id="inputTimeFromHH">
                                          <? for($i=0;$i<=24;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                          <option value="<?=$myi?>"<? if($myTimeHH==$i) { echo " selected"; } ?>>
                                            <?=$myi?>
                                            </option>
                                          <? } ?>
                                          </select></td>
                                        <td><b>:</b></td>
                                        <td><select name="inputTimeFromMM" class="select" id="inputTimeFromMM">
                                          <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                          <option value="<?=$myi?>"<? if($myTimeMM==$i) { echo " selected"; } ?>>
                                            <?=$myi?>
                                            </option>
                                          <? } ?>
                                          </select></td>
                                        <td width="37" align="right"><input name="inputIsTimeTo" type="checkbox" id="inputIsTimeTo" value="Yes" onClick="if(document.getElementById('idTimeTo1').style.display=='') { document.getElementById('idTimeTo1').style.display='none'; document.getElementById('idTimeTo2').style.display='none';  document.getElementById('idTimeTo3').style.display='none'; } else { document.getElementById('idTimeTo1').style.display=''; document.getElementById('idTimeTo2').style.display=''; document.getElementById('idTimeTo3').style.display=''; } " /></td>
                                        <td nowrap="nowrap">&#3606;&#3638;&#3591;&nbsp;</td>
                                        <td  id="idTimeTo1" style="display:none"><select name="inputTimeToHH" class="select" id="inputTimeToHH">
                                          <? for($i=0;$i<=24;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                          <option value="<?=$myi?>"<? if($myTimeHH==$i) { echo " selected"; } ?>>
                                            <?=$myi?>
                                            </option>
                                          <? } ?>
                                          </select></td>
                                        <td  id="idTimeTo2" style="display:none"><b>:</b></td>
                                        <td  id="idTimeTo3" style="display:none"><select name="inputTimeToMM" class="select" id="inputTimeToMM">
                                          <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                          <option value="<?=$myi?>"<? if($myTimeMM==$i) { echo " selected"; } ?>>
                                            <?=$myi?>
                                            </option>
                                          <? } ?>
                                          </select></td>
                                      </tr>
                                    </table></td>
                                </tr>
                            <tr>
                              <td height="22" align="right" bgcolor="#F7F6F0" class="style3">&#3619;&#3641;&#3611;&#3649;&#3610;&#3610;</td>
                                  <td height="22" class="style3">
                                    <select name="Type" id="Type">
									 <?
									 $sqlt="select * from mfu_type where mfu_type_Group='1' and mfu_type_ID>72 order by mfu_type_Id desc";
									$queryt=mysql_query($sqlt);
									while($rowt=mysql_fetch_array($queryt)) { 
									?>
                                      <option value="<?=$rowt[mfu_type_ID]?>" <? if($rowt[mfu_type_Name]=="Lecture (กข)"){?>selected<? } ?>><?=$rowt[mfu_type_Name]?></option>
									  <? } ?>
                                      </select>                                   </td>
                                </tr>
                            <tr>
                              <td height="22" align="right" bgcolor="#F7F6F0" class="style3">&#3626;&#3606;&#3634;&#3609;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609;</td>
                                  <td height="22" class="style3">
								     <select name="Place" id="Place">
									 <?
									 $sqlp="select * from mfu_place order by mfu_place_Name asc";
									$queryp=mysql_query($sqlp);
									while($rowp=mysql_fetch_array($queryp)) { 
									?>
									<?
									if($rowp[mfu_place_Hospital]==1){$h="&#3619;&#3614;.&#3585;&#3621;&#3634;&#3591;";}
									if($rowp[mfu_place_Hospital]==2){$h="&#3619;&#3614;.&#3648;&#3592;&#3619;&#3636;&#3597;&#3585;&#3619;&#3640;&#3591;";}
									?>
                                      <option value="<?=$rowp[mfu_place_ID]?>"><?=$rowp[mfu_place_Name]?> <?=$h?></option>
									  <? } ?>
                                      </select>								  </td>
                                </tr>
                            <tr>
                              <td height="22" align="right" bgcolor="#F7F6F0" class="style3">&#3585;&#3621;&#3640;&#3656;&#3617;&#3609;&#3633;&#3585;&#3624;&#3638;&#3585;&#3625;&#3634;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609;</td>
                                  <td height="22" class="style3">
								 <!--  '<select name="Student" id="Student" onChange="location.href='indexadmin.php?action=add&listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>&groupid='+this.value;">-->
								 <select name="Student" id="Student">
                                    <option value="4" selected="selected">&#3607;&#3640;&#3585;&#3588;&#3609;</option>
									<?
									$sqlgroup="select * from group_student order by ID asc";
									$querygroup=mysql_query($sqlgroup);
									while($rowgroup=mysql_fetch_array($querygroup))	{
									?>
                                    <option value="<?=$rowgroup[ID]?>"><?=$rowgroup[Name]?> <? if($rowgroup[Faculty]=="1"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3629;&#3634;&#3618;&#3640;&#3619;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; }
			    if($rowgroup[Faculty]=="2"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3585;&#3640;&#3617;&#3634;&#3619;&#3648;&#3623;&#3594;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; }
			    if($rowgroup[Faculty]=="3"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3624;&#3633;&#3621;&#3618;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; }
			    if($rowgroup[Faculty]=="4"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3626;&#3641;&#3605;&#3636;-&#3609;&#3619;&#3637;&#3648;&#3623;&#3594;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; }
                if($rowgroup[Faculty]=="5"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3624;&#3633;&#3621;&#3618;&#3585;&#3619;&#3619;&#3617;&#3585;&#3619;&#3632;&#3604;&#3641;&#3585;"; }
			   if($rowgroup[Faculty]=="6"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3648;&#3623;&#3594;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;&#3593;&#3640;&#3585;&#3648;&#3593;&#3636;&#3609;&#3649;&#3621;&#3632;&#3609;&#3636;&#3605;&#3636;&#3648;&#3623;&#3594;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; }
              if($rowgroup[Faculty]=="7"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3592;&#3633;&#3585;&#3625;&#3640;&#3623;&#3636;&#3607;&#3618;&#3634;"; }
			    if($rowgroup[Faculty]=="8"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3650;&#3626;&#3605; &#3624;&#3629; &#3609;&#3634;&#3626;&#3636;&#3585;"; }
                if($rowgroup[Faculty]=="9"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3623;&#3636;&#3626;&#3633;&#3597;&#3597;&#3637;&#3623;&#3636;&#3607;&#3618;&#3634;"; }
			    if($rowgroup[Faculty]=="10"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3648;&#3623;&#3594;&#3585;&#3619;&#3619;&#3617;&#3615;&#3639;&#3657;&#3609;&#3615;&#3641;"; }
               if($rowgroup[Faculty]=="11"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3619;&#3633;&#3591;&#3626;&#3637;&#3623;&#3636;&#3607;&#3618;&#3634;"; }
			    if($rowgroup[Faculty]=="12"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3614;&#3618;&#3634;&#3608;&#3636;&#3623;&#3636;&#3607;&#3618;&#3634;"; }
             if($rowgroup[Faculty]=="13"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3629;&#3609;&#3634;&#3617;&#3633;&#3618;&#3594;&#3640;&#3617;&#3594;&#3609;"; }
			if($rowgroup[Faculty]=="14"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3592;&#3636;&#3605;&#3648;&#3623;&#3594;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; } ?></option>
									<? } ?>
                                    </select>
								   &nbsp;&nbsp;&nbsp;
								   <input name="btDocument" type="button" class="" id="btDocument" onClick="
Popup('popupDocumentWindow','popup_group.php',550,430,1)
								" value="&#3604;&#3641;&#3619;&#3634;&#3618;&#3621;&#3632;&#3648;&#3629;&#3637;&#3618;&#3604;&#3585;&#3621;&#3640;&#3656;&#3617;&#3609;&#3633;&#3585;&#3624;&#3638;&#3585;&#3625;&#3634;" />                                    </td>
                                </tr>
                            <tr>
                              <td height="22" align="right" bgcolor="#F7F6F0" class="style3">&nbsp;</td>
                                  <td height="22" class="style3"><input type="hidden" name="Listid" value="<?=$listid?>" />&nbsp;</td>
                                </tr>
                            
                            
                            </table>
							  
                            <table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
                              <tr align="right"> 
                                <td height="30" colspan="4" align="center" class="table_row2"> 
                                  <table width="300" border="0" cellspacing="0" cellpadding="2">
                                    <tr align="center"> 
                                      <td> 
  <script language="JavaScript" type="text/JavaScript">
function isBlank(myObj) { if(myObj.value=='') { return true; } return false; }
function verifySubmit() {
 	with(document.myForm) {
				if(Course.value=='') {
				alert('&#3585;&#3619;&#3640;&#3603;&#3634;&#3585;&#3619;&#3629;&#3585;&#3648;&#3619;&#3639;&#3656;&#3629;&#3591;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609;');
					Course.focus();
					return false;
				}
				if(inputMod_Calendar_DateFrom.value=='') {
				alert('&#3585;&#3619;&#3640;&#3603;&#3634;&#3648;&#3621;&#3639;&#3629;&#3585;&#3623;&#3633;&#3609;&#3607;&#3637;&#3656;&#3626;&#3629;&#3609;');
					inputMod_Calendar_DateFrom.focus();
					return false;
				}
				
				
				//if(inputDocumentID.value=='$inputDocumentID') {
			//	alert('&#3585;&#3619;&#3640;&#3603;&#3634;&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;');
					//inputDocumentID.focus();
			//		return false;
			//	}
				
				
				
				
/*				if(Fill1.value=='') {
				alert('&#3585;&#3619;&#3640;&#3603;&#3634;&#3648;&#3621;&#3639;&#3629;&#3585;&#3617;&#3634;&#3605;&#3619;&#3600;&#3634;&#3609;&#3585;&#3634;&#3619;&#3648;&#3619;&#3637;&#3618;&#3609;&#3619;&#3641;&#3657;');
					Fill1.focus();
					return false;
				}
*/				if(Fill2.value=='') {
				alert('&#3585;&#3619;&#3640;&#3603;&#3634;&#3648;&#3621;&#3639;&#3629;&#3585;&#3649;&#3614;&#3607;&#3618;&#3626;&#3616;&#3634;');
					Fill2.focus();
					return false;
				}
				if(Type.value=='other' && otherdetail.value=='') {
				alert('&#3585;&#3619;&#3640;&#3603;&#3634;&#3585;&#3619;&#3629;&#3585;&#3619;&#3634;&#3618;&#3621;&#3632;&#3648;&#3629;&#3637;&#3618;&#3604;&#3619;&#3641;&#3611;&#3649;&#3610;&#3610;&#3629;&#3639;&#3656;&#3609;&#3654;');
					otherdetail.focus();
					return false;
				}
	}
	return true;
}
						</script> <input name="btAdd" type="submit" class="" id="btAdd" value="&#3610;&#3633;&#3609;&#3607;&#3638;&#3585;"> 
                                        &nbsp;&nbsp;&nbsp;<input name="btCalcel" type="button" class="" id="btCalcel" onClick="
if(confirm('Are you sure to return to list?')) {
	document.myReturnForm.submit();
}
						" value="&#3618;&#3657;&#3629;&#3609;&#3585;&#3621;&#3633;&#3610;"> </td>
                                      </tr>
                                    </table></td>
                                </tr>
                              </table></td>
                          </tr>
                        </form>
                      </table>
                      <? 
//########################################################
} else if ($action=="addnew") { 

if(strlen($inputMod_Calendar_DateFrom)!=10) { $inputMod_Calendar_DateFrom="0000-00-00"; }
	if(strlen($inputMod_Calendar_DateTo)!=10) { $inputMod_Calendar_DateTo="0000-00-00"; }
	if($inputIsDateTo=="") { $inputMod_Calendar_DateTo="0000-00-00"; }
	if($inputIsTimeTo=="") { $inputMod_Calendar_TimeTo="00:00:00"; }
	if( strlen($inputMod_Calendar_DateFrom)>0 && strlen($inputMod_Calendar_DateTo)>0 && $inputMod_Calendar_DateFrom!="0000-00-00"  && $inputMod_Calendar_DateTo!="0000-00-00" ) {
		if(strcmp($inputMod_Calendar_DateFrom,$inputMod_Calendar_DateTo)<1) { 
			// Do nothing.
		} else { 
			// Switch Date
			$myTmp = $inputMod_Calendar_DateFrom;
			$inputMod_Calendar_DateFrom = $inputMod_Calendar_DateTo;
			$inputMod_Calendar_DateTo = $myTmp;
		}
	}
	if($inputMod_Calendar_DateTo=="0000-00-00") { $inputMod_Calendar_DateTo=$inputMod_Calendar_DateFrom; }
	$doublezero="00";
	$inputMod_Calendar_TimeFrom=$inputTimeFromHH.":".$inputTimeFromMM.":".$doublezero;
	$inputMod_Calendar_TimeTo=$inputTimeToHH.":".$inputTimeToMM.":".$doublezero;
?>
	                <!--<form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="myForm" id="myForm">
                      <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
                      <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
                      <input name="admin" type="hidden" id="admin" value="<?=$admin?>">
                      <input name="action" type="hidden" id="action">
                      <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
                      <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
                      <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
                      <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
                      <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
              </form>
                    <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>-->
	                <?
					$year=substr($inputMod_Calendar_DateFrom,0,4);
$sql = "select  WEEK('$inputMod_Calendar_DateFrom')";
$exc = mysql_query($sql);
$row = mysql_fetch_array($exc);
$dw=$year.$row[0];
	
	$minus=(($inputTimeToMM*1/60)-($inputTimeFromMM*1/60));
	$plus=($inputTimeToHH-$inputTimeFromHH);
	$Totaltime=$plus+$minus;

	$sqlid="select crm_system_staff_FName,crm_system_staff_LName,crm_system_staff_Faculty from crm_system_staff where crm_system_staff_ID='$inputDocumentID'";
	$queryid=mysql_query($sqlid);
	$Rowid = mysql_fetch_array($queryid);
	 $sql = "INSERT INTO ".$myModule_Table1."(".$myModule_Table1."_Eduyear,".$myModule_Table1."_Subject, ".$myModule_Table1."_Faculty, ".$myModule_Table1."_Studentyear,".$myModule_Table1."_Course,".$myModule_Table1."_Teacher,".$myModule_Table1."_DateFrom,".$myModule_Table1."_DateTo,".$myModule_Table1."_TimeFrom,".$myModule_Table1."_TimeTo,".$myModule_Table1."_Alltime,".$myModule_Table1."_Type,".$myModule_Table1."_Place,".$myModule_Table1."_Student,".$myModule_Table1."_Createbyid,".$myModule_Table1."_Createby,".$myModule_Table1."_Createdate,".$myModule_Table1."_ListsubjectID,".$myModule_Table1."_Groupweek,".$myModule_Table1."_Statuspay) VALUES('$Eduyear1','$Subject','$Rowid[2]','$Studentyear','$Course','$rowsj[0]','$inputMod_Calendar_DateFrom','$inputMod_Calendar_DateTo','$inputMod_Calendar_TimeFrom','$inputMod_Calendar_TimeTo','$Totaltime','$Type','$Place','$Student','$inputDocumentID','$System_Session_UserName',Now(),'$Listid','$dw','$Statuspay')";
	//die();
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");
	


$sql="select max(cm_mod_detailoverall_ID) from cm_mod_detailoverall";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");
$Row=mysql_fetch_row($Query);
$MaxID=$Row[0];

$sqlt1="select hptnm from mfu_mod_teacher where Id='$inputDocumentID'";
$queryt1=mysql_query($sqlt1);
$rowt1=mysql_fetch_array($queryt1);
if($rowt1[0]=="โรงพยาบาลกลาง"){ $ending="1";   }
if($rowt1[0]=="โรงพยาบาลเจริญกรุงประชารักษ์"){ $ending="3";    }

$sqlt2="select hptnm from mfu_mod_teacher where Id='$valueform2'";
$queryt2=mysql_query($sqlt2);
$rowt2=mysql_fetch_array($queryt2);
if($rowt2[0]=="โรงพยาบาลกลาง"){ $ending2="1";   }
if($rowt2[0]=="โรงพยาบาลเจริญกรุงประชารักษ์"){ $ending2="3";    }

$sqlt3="select hptnm from mfu_mod_teacher where Id='$valueform3'";
$queryt3=mysql_query($sqlt3);
$rowt3=mysql_fetch_array($queryt3);
if($rowt3[0]=="โรงพยาบาลกลาง"){ $ending3="1";   }
if($rowt3[0]=="โรงพยาบาลเจริญกรุงประชารักษ์"){ $ending3="3";    }

$sqlt4="select hptnm from mfu_mod_teacher where Id='$valueform4'";
$queryt4=mysql_query($sqlt4);
$rowt4=mysql_fetch_array($queryt4);
if($rowt4[0]=="โรงพยาบาลกลาง"){ $ending4="1";   }
if($rowt4[0]=="โรงพยาบาลเจริญกรุงประชารักษ์"){ $ending4="3";    }

$sqlt5="select hptnm from mfu_mod_teacher where Id='$valueform5'";
$queryt5=mysql_query($sqlt5);
$rowt5=mysql_fetch_array($queryt5);
if($rowt5[0]=="โรงพยาบาลกลาง"){ $ending5="1";   }
if($rowt5[0]=="โรงพยาบาลเจริญกรุงประชารักษ์"){ $ending5="3";    }
	
	$sqlteacher1 = "insert into cmteacher 
(cmteacher_TeacherID,cmteacher_DetailoverallID,cmteacher_Hos) values ('$inputDocumentID','$MaxID','$ending')";
	$query=mysql_query($sqlteacher1);
	
	if($valueform2>0)
	{
	 $sqlteacher2 = "insert into cmteacher 
(cmteacher_TeacherID,cmteacher_DetailoverallID,cmteacher_Hos) values ('$valueform2','$MaxID','$ending2')";
$query=mysql_query($sqlteacher2);
	}
	if($valueform3>0)
	{
	$sqlteacher3 = "insert into cmteacher 
(cmteacher_TeacherID,cmteacher_DetailoverallID,cmteacher_Hos) values ('$valueform3','$MaxID','$ending3')";
$query=mysql_query($sqlteacher3);
	}
	if($valueform4>0)
	{
	$sqlteacher4 = "insert into cmteacher 
(cmteacher_TeacherID,cmteacher_DetailoverallID,cmteacher_Hos) values ('$valueform4','$MaxID','$ending4')";
$query=mysql_query($sqlteacher4);
	}
	if($valueform5>0)
	{
	$sqlteacher5 = "insert into cmteacher 
(cmteacher_TeacherID,cmteacher_DetailoverallID,cmteacher_Hos) values ('$valueform5','$MaxID','$ending5')";
$query=mysql_query($sqlteacher5);
	}

	
	$sqlFill1 = "insert into cm_relate2(cm_relate2_No1,cm_relate2_No2,cm_relate2_No3,cm_relate2_No4,cm_relate2_No5,cm_relate2_No6,cm_relate2_No7,cm_relate2_No8,cm_relate2_No9,cm_relate2_No10,cm_relate2_No11,cm_relate2_No12,cm_relate2_No13,cm_relate2_No14,cm_relate2_No15,cm_relate2_No16,cm_mod_detailoverallID,cm_relate2_Alltime,cm_relate2_SubjectID) values ('$inputCouncilID','$inputCouncilID2','$inputCouncilID3','$inputCouncilID4','$inputCouncilID5','$inputCouncilID6','$inputCouncilID7','$inputCouncilID8','$inputCouncilID9','','$Fill12','$Fill13','$Fill14','$Fill15','$Fill16','$Fill17','$MaxID','$Totaltime','$Listid')";
		$query=mysql_query($sqlFill1);
	
	if(($Fill1)<>""){
		for($i=0;$i<count($Fill1);$i++){
		$sqlFill1 = "insert into cm_relate1
 (cm_relate1_No,cm_mod_detailoverall_ID,cm_relate1_Alltime,cm_relate1_SubjectID) values ('$Fill1[$i]','$MaxID','$Totaltime','$Listid')";
	//	echo $sqlmaterialSelect ;
		$query=mysql_query($sqlFill1);
						}	
		}
		
		$sql="select max(cm_listsubject_Amountadd) from cm_listsubject where cm_listsubject_ID='$Listid'";
		$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");
		$Row=mysql_fetch_row($Query);
		$MaxID=$Row[0]+1;
		$sql="update cm_listsubject set cm_listsubject_Amountadd='$MaxID' where cm_listsubject_ID='$Listid'";
		$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");

?>                    
	                <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="myForm" id="myForm">
	                  <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
	                  <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
	                  <input name="admin" type="hidden" id="admin" value="<?=$admin?>">
	                  <input name="action" type="hidden" id="action">
	                  <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
	                  <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
	                  <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
	                  <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
	                  <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
	                  </form>
                      <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
	                
	                
	                
  <? } else if($action=="addproject") { 
?>
	                
	                <!-- import the calendar script -->
	                <link rel="stylesheet" type="text/css" href="../../css/myCalendarStyle.css">
	                <script type="text/javascript" src="../mod_calendar/lib/calendar.js"></script>
	                <script type="text/javascript" src="../mod_calendar/lib/lang/calendar-en.js"></script>
	                <script type="text/javascript" src="../mod_calendar/lib/loadcalendar.js"></script>
	                <!-- end the calendar script -->
	                <? 
//########################################################
} elseif($action=="edit") { 
	$myCheckBoxID=0;
	for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID=$$myVar;
		}
	}
	$sql="SELECT * FROM ".$myModule_Table1." WHERE ".$myModule_Table1."_ID=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");
	$Row=MYSQL_FETCH_ARRAY($Query);
?>
	                <link rel="stylesheet" type="text/css" href="../../css/myCalendarStyle.css">
	                <script type="text/javascript" src="../mod_calendar/lib/calendar.js"></script>
	                <script type="text/javascript" src="../mod_calendar/lib/lang/calendar-en.js"></script>
	                <script type="text/javascript" src="../mod_calendar/lib/loadcalendar.js"></script>
	                <table style="border-collapse: collapse" border="1" width="98%" align="center" cellpadding="0" cellspacing="1" class="table_border" bordercolor="#E8E7E1">
	                  <script src="FormManager.js">
					  </script>	
	                  <script type="text/javascript">
window.onload = function() {
    setupDependencies('myForm'); //name of form(s). Seperate each with a comma (ie: 'weboptions', 'myotherform' )
  };
</script>
	                  <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="myReturnForm" id="myReturnForm">
	                    <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
	                    <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
	                    <input name="admin" type="hidden" id="admin" value="<?=$admin?>">
	                    <input name="action" type="hidden" id="action" value="">
	                    <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
	                    <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
	                    <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
	                    <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
	                    <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
	                    </form>
                        <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="myForm" id="myForm" enctype="multipart/form-data"  onSubmit=" if(!verifySubmit()) { return false; } ">
                          <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
                          <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
                          <input name="admin" type="hidden" id="admin" value="<?=$admin?>">
                          <input name="action" type="hidden" id="action" value="update">
                          <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
                          <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
                          <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
                          <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
                          <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
                          <input name="CheckBoxID1" type="hidden" id="CheckBoxID1" value="<?=$myCheckBoxID?>">
                          <input name="TotalCheckBoxID" type="hidden" id="TotalCheckBoxID" value="1">						
                          <tr> 
                            <td bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="2" cellspacing="1" class="mytable_inner">
                              <tr align="center">
                                <td height="24" colspan="2" align="center" class="table_title1" style="font-weight: bold"><div align="center">&#3649;&#3585;&#3657;&#3652;&#3586;&#3586;&#3657;&#3629;&#3617;&#3641;&#3621;</div></td>
                                </tr>
                              
                              
                              <tr>
                                <td height="22" align="right" bgcolor="#F7F6F0" class="style3">ปีการศึกษา</td>
                                <td height="22" class="style3"><select name="Eduyear1" id="select">
                                    <option value="2559" <? if($Row[cm_mod_detailoverall_Eduyear]=="2559"){?> selected<? } ?>>2559</option>
                                    <option value="2560" <? if($Row[cm_mod_detailoverall_Eduyear]=="2560"){?> selected<? } ?>>2560</option>
                                    <option value="2561"<? if($Row[cm_mod_detailoverall_Eduyear]=="2561"){?> selected<? } ?>>2561</option>
                                    <option value="2562"<? if($Row[cm_mod_detailoverall_Eduyear]=="2562"){?> selected<? } ?>>2562</option>
                                    <option value="2563"<? if($Row[cm_mod_detailoverall_Eduyear]=="2563"){?> selected<? } ?>>2563</option>
                                    <option value="2564"<? if($Row[cm_mod_detailoverall_Eduyear]=="2564"){?> selected<? } ?>>2564</option>
                                    <option value="2565"<? if($Row[cm_mod_detailoverall_Eduyear]=="2565"){?> selected<? } ?>>2565</option>
									<option value="2566"<? if($Row[cm_mod_detailoverall_Eduyear]=="2566"){?> selected<? } ?>>2566</option>
									<option value="2567"<? if($Row[cm_mod_detailoverall_Eduyear]=="2567"){?> selected<? } ?>>2567</option>
                                </select></td>
                              </tr>
                              <tr>
                                <td width="254" align="right" bgcolor="#F7F6F0" class="style3">&#3619;&#3634;&#3618;&#3623;&#3636;&#3594;&#3634;</td>
                                  <td width="982" class="style3"><span class="style13"><b>
                                    <?=$subject?>
                                    </b></span>
                                    <input type="hidden" name="Subject" value="<?=$subject?>" /></td>
                                </tr>
                              <tr>
                                <td align="right" bgcolor="#F7F6F0" class="style3">&#3609;&#3633;&#3585;&#3624;&#3638;&#3585;&#3625;&#3634;&#3594;&#3633;&#3657;&#3609;&#3611;&#3637;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609;</td>
                                  <td class="style3"><span class="style13"><b><?=$studentyear?></b></span><input type="hidden" name="Studentyear" value="<?=$studentyear?>" /> </td>
                                </tr>
                              <tr>
                                <td align="right" bgcolor="#F7F6F0" class="style3">&#3648;&#3619;&#3639;&#3656;&#3629;&#3591;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609;</td>
                                  <td class="style3"><input name="Course" type="text" id="textfield" value="<?=$Row[cm_mod_detailoverall_Course]?>" size="60" /></td>
                                </tr>
                              <tr>
                                <td align="right" bgcolor="#F7F6F0" class="style3" valign="top">&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;</td>
                                  <td class="style3">
                                    <span class="style13"><b><?
							   $sqlteach="select * from cmteacher a,mfu_mod_teacher b where a.cmteacher_TeacherID=b.Id and a.cmteacher_DetailoverallID='$Row[cm_mod_detailoverall_ID]' order by a.cmteacher_ID asc";
                             $Queryteach=mysql_query($sqlteach);
							 $num=1;
                             while ($Rowteach = mysql_fetch_array($Queryteach)) { 
							 	echo $num++;echo".";
								echo $Rowteach[name]; echo"&nbsp;";echo $Rowteach[lname];
								echo "</br>";
							 }
							 ?></b></span><br />
                                    <table width="398" border="0">
                                      <tr>
                                        <td width="18">1. </td>
                                    <td colspan="2"><div class="style4" id="divDocumentSubject">&nbsp;</div></td>
                                    </tr>
                                      <tr>
                                        <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument" type="button" class="" id="btDocument" onClick="
Popup('popupDocumentWindow','popup_document_selecter.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="inputDocumentID" type="hidden" id="inputDocumentID" value="$inputDocumentID" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                      </table> 
                                      <br><br>
<table width="398" border="0">
                                    <tr>
                                      <td width="18">2. </td>
                                      <td colspan="2"><div class="style4" id="divDocumentSubject2">&nbsp;</div></td>
                                    </tr>
                                    <tr>
                                      <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument2" type="button" class="" id="btDocument2" onClick="
Popup('popupDocumentWindow','ppts.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="valueform2" type="hidden" id="valueform2" value="$valueform2" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                    </table><br>
<table width="398" border="0">
                                    <tr>
                                      <td width="18">3. </td>
                                      <td colspan="2"><div class="style4" id="divDocumentSubject3">&nbsp;</div></td>
                                    </tr>
                                    <tr>
                                      <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument3" type="button" class="" id="btDocument3" onClick="
Popup('popupDocumentWindow','ppts3.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="valueform3" type="hidden" id="valueform3" value="$valueform3" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                    </table><br>
<table width="398" border="0">
                                    <tr>
                                      <td width="18">4. </td>
                                      <td colspan="2"><div class="style4" id="divDocumentSubject4">&nbsp;</div></td>
                                    </tr>
                                    <tr>
                                      <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument2" type="button" class="" id="btDocument2" onClick="
Popup('popupDocumentWindow','ppts4.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="valueform4" type="hidden" id="valueform4" value="$valueform4" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                    </table>
                                      <br>
                                      <select name="Statuspay" id="Statuspay">
                                      <option value="เบิกเงิน" <? if($Row[cm_mod_detailoverall_Statuspay]=="เบิกเงิน"){?> selected<? } ?>>เบิกเงิน</option>
                                      <option value="ไม่เบิกเงิน" <? if($Row[cm_mod_detailoverall_Statuspay]=="ไม่เบิกเงิน"){?> selected<? } ?>>ไม่เบิกเงิน</option>
                                    </select>

                                    <table width="398" border="0" style="display:none">
                                      <tr>
                                        <td width="18">2. </td>
                                    <td colspan="2"><div class="style4" id="divDocumentSubject2">&nbsp;</div></td>
                                  </tr>
                                      <tr>
                                        <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument" type="button" class="" id="btDocument" onClick="
Popup('popupDocumentWindow','popup_document_selecter2.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="inputDocumentID2" type="hidden" id="inputDocumentID2" value="$inputDocumentID2" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                      </table>
                                    <table width="398" border="0" style="display:none">
                                      <tr>
                                        <td width="18">3. </td>
                                    <td colspan="2"><div class="style4" id="divDocumentSubject3">&nbsp;</div></td>
                                  </tr>
                                      <tr>
                                        <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument2" type="button" class="" id="btDocument2" onClick="
Popup('popupDocumentWindow','popup_document_selecter3.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="inputDocumentID3" type="hidden" id="inputDocumentID3" value="$inputDocumentID3" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                      </table>
                                    <table width="398" border="0" style="display:none">
                                      <tr>
                                        <td width="18">4. </td>
                                    <td colspan="2"><div class="style4" id="divDocumentSubject4">&nbsp;</div></td>
                                  </tr>
                                      <tr>
                                        <td>&nbsp;</td>
                                    <td width="160"><input name="btDocument3" type="button" class="" id="btDocument3" onClick="
Popup('popupDocumentWindow','popup_document_selecter4.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                      <input name="inputDocumentID4" type="hidden" id="inputDocumentID4" value="$inputDocumentID4" /></td>
                                    <td width="206">&nbsp;</td>
                                  </tr>
                                      </table>
                                    <table width="398" border="0" style="display:none">
                                      <tr>
                                        <td width="18">5. </td>
                                  <td colspan="2"><div class="style4" id="divDocumentSubject5">&nbsp;</div></td>
                                </tr>
                                      <tr>
                                        <td>&nbsp;</td>
                                  <td width="160"><input name="btDocument4" type="button" class="" id="btDocument4" onClick="
Popup('popupDocumentWindow','popup_document_selecter5.php',550,430,1)
								" value="&#3648;&#3621;&#3639;&#3629;&#3585;&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;" />
                                    <input name="inputDocumentID5" type="hidden" id="inputDocumentID5" value="$inputDocumentID5" /></td>
                                  <td width="206">&nbsp;</td>
                                </tr>
                                      </table>
                                    <br>
                                    <br></td>
                                </tr>
                              <tr>
                                <td height="22" align="right" bgcolor="#F7F6F0" class="style3"><div align="right">&#3623;&#3633;&#3609;&#3607;&#3637;&#3656;&nbsp;</div></td>
                                <td height="22" class="style3"><table border="0" cellspacing="0" cellpadding="1">
                                    <tr>
                                      <td><input name="inputMod_Calendar_DateFrom" type="text" class="input_center" id="inputMod_Calendar_DateFrom" value="<?=$Row[cm_mod_detailoverall_DateFrom]?>" size="10" maxlength="10" /></td>
                                      <td><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateFrom', 'y-mm-dd');" value=" ... " />                                      </td>
                                    </tr>
                                </table></td>
                              </tr>
                              
                              <tr> 
                                <td height="22" align="right" bgcolor="#F7F6F0"> <?
$myTime = explode(":",$Row[cm_mod_detailoverall_TimeFrom]);
$myTimeHH = $myTime[0]*1;
$myTimeMM = $myTime[1]*1;
?>
                                  &#3648;&#3623;&#3621;&#3634;&nbsp;</td>
                                  <td height="22" class="style3"><table border="0" align="left" cellpadding="1" cellspacing="0">
                                    <tr> 
                                      <td width="30">&#3592;&#3634;&#3585;</td>
                                        <td><select name="inputTimeFromHH" class="select" id="inputTimeFromHH">
                                          <? for($i=0;$i<=24;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                          <option value="<?=$myi?>"<? if($myTimeHH==$i) { echo " selected"; } ?>> 
                                            <?=$myi?>
                                            </option>
                                          <? } ?>
                                          </select></td>
                                        <td><b>:</b></td>
                                        <td><select name="inputTimeFromMM" class="select" id="inputTimeFromMM">
                                          <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                          <option value="<?=$myi?>"<? if($myTimeMM==$i) { echo " selected"; } ?>> 
                                            <?=$myi?>
                                            </option>
                                          <? } ?>
                                          </select></td>
                                        <td width="37" align="right"> 
                                          <?
$myTime = explode(":",$Row[cm_mod_detailoverall_TimeTo]);
$myTimeHH = $myTime[0]*1;
$myTimeMM = $myTime[1]*1;
?>
                                          <input name="inputIsTimeTo" type="checkbox" id="inputIsTimeTo" value="Yes" onClick="if(document.getElementById('idTimeTo1').style.display=='') { document.getElementById('idTimeTo1').style.display='none'; document.getElementById('idTimeTo2').style.display='none';  document.getElementById('idTimeTo3').style.display='none'; } else { document.getElementById('idTimeTo1').style.display=''; document.getElementById('idTimeTo2').style.display=''; document.getElementById('idTimeTo3').style.display=''; } " <? if($Row[cm_mod_detailoverall_TimeTo]!="00:00:00") { echo " checked"; } ?>></td>
                                        <td nowrap>&#3606;&#3638;&#3591;&nbsp;</td>
                                        <td  id="idTimeTo1" <? if($Row[cm_mod_detailoverall_TimeTo]=="00:00:00") { ?>style="display:none"<? } ?>><select name="inputTimeToHH" class="select" id="inputTimeToHH">
                                          <? for($i=0;$i<=24;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                          <option value="<?=$myi?>"<? if($myTimeHH==$i) { echo " selected"; } ?>> 
                                            <?=$myi?>
                                            </option>
                                          <? } ?>
                                          </select></td>
                                        <td  id="idTimeTo2" <? if($Row[cm_mod_detailoverall_TimeTo]=="00:00:00") { ?>style="display:none"<? } ?>><b>:</b></td>
                                        <td  id="idTimeTo3" <? if($Row[cm_mod_detailoverall_TimeTo]=="00:00:00") { ?>style="display:none"<? } ?>><select name="inputTimeToMM" class="select" id="inputTimeToMM">
                                          <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                          <option value="<?=$myi?>"<? if($myTimeMM==$i) { echo " selected"; } ?>> 
                                            <?=$myi?>
                                            </option>
                                          <? } ?>
                                          </select></td>
                                      </tr>
                                    </table></td>
                                </tr>
                              
                              <tr>
                                <td height="22" align="right" bgcolor="#F7F6F0" class="style3">&#3619;&#3641;&#3611;&#3649;&#3610;&#3610;</td>
                                <td height="22" class="style3"><select name="Type" id="Type">
                                    <?
									 $sqlt="select * from mfu_type where mfu_type_Group='1' order by mfu_type_Id desc";
									$queryt=mysql_query($sqlt);
									while($rowt=mysql_fetch_array($queryt)) { 
									?>
                                    <option value="<?=$rowt[mfu_type_ID]?>" <? if($rowt[mfu_type_ID]==$Row[cm_mod_detailoverall_Type]) { ?> selected="selected" <? } ?>>
                                      <?=$rowt[mfu_type_Name]?>
                                      </option>
                                    <? } ?>
                                  </select>                                </td>
                              </tr>
                              <tr>
                                <td height="22" align="right" bgcolor="#F7F6F0" class="style3">&#3626;&#3606;&#3634;&#3609;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609;</td>
                                <td height="22" class="style3"><select name="Place" id="Place">
                                    <?
									 $sqlp="select * from mfu_place order by mfu_place_Name asc";
									$queryp=mysql_query($sqlp);
									while($rowp=mysql_fetch_array($queryp)) { 
									?>
                                    <?
									if($rowp[mfu_place_Hospital]==1){$h="&#3619;&#3614;.&#3585;&#3621;&#3634;&#3591;";}
									if($rowp[mfu_place_Hospital]==2){$h="&#3619;&#3614;.&#3648;&#3592;&#3619;&#3636;&#3597;&#3585;&#3619;&#3640;&#3591;";}
									?>
                                    <option value="<?=$rowp[mfu_place_ID]?>" <? if($rowp[mfu_place_ID]==$Row[cm_mod_detailoverall_Place]) { ?> selected="selected" <? } ?>>
                                      <?=$rowp[mfu_place_Name]?>
                                    <?=$h?>
                                      </option>
                                    <? } ?>
                                  </select>                                </td>
                              </tr>
                              <tr>
                                <td height="22" align="right" bgcolor="#F7F6F0" class="style3">&#3585;&#3621;&#3640;&#3656;&#3617;&#3609;&#3633;&#3585;&#3624;&#3638;&#3585;&#3625;&#3634;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609;</td>
                                <td height="22" class="style3"><!--  '<select name="Student" id="Student" onChange="location.href='indexadmin.php?action=add&listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>&groupid='+this.value;">-->
                                    <select name="Student" id="Student">
                                      <?
									$sqlgroup="select * from group_student order by ID asc";
									$querygroup=mysql_query($sqlgroup);
									while($rowgroup=mysql_fetch_array($querygroup))	{
									?>
									
                                      <option value="<?=$rowgroup[ID]?>" <? if($rowgroup[ID]==$Row[cm_mod_detailoverall_Student]) { ?> selected="selected" <? } ?>>
                                        <?=$rowgroup[Name]?> <? if($rowgroup[Faculty]=="1"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3629;&#3634;&#3618;&#3640;&#3619;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; }
			    if($rowgroup[Faculty]=="2"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3585;&#3640;&#3617;&#3634;&#3619;&#3648;&#3623;&#3594;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; }
			    if($rowgroup[Faculty]=="3"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3624;&#3633;&#3621;&#3618;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; }
			    if($rowgroup[Faculty]=="4"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3626;&#3641;&#3605;&#3636;-&#3609;&#3619;&#3637;&#3648;&#3623;&#3594;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; }
                if($rowgroup[Faculty]=="5"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3624;&#3633;&#3621;&#3618;&#3585;&#3619;&#3619;&#3617;&#3585;&#3619;&#3632;&#3604;&#3641;&#3585;"; }
			   if($rowgroup[Faculty]=="6"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3648;&#3623;&#3594;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;&#3593;&#3640;&#3585;&#3648;&#3593;&#3636;&#3609;&#3649;&#3621;&#3632;&#3609;&#3636;&#3605;&#3636;&#3648;&#3623;&#3594;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; }
              if($rowgroup[Faculty]=="7"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3592;&#3633;&#3585;&#3625;&#3640;&#3623;&#3636;&#3607;&#3618;&#3634;"; }
			    if($rowgroup[Faculty]=="8"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3650;&#3626;&#3605; &#3624;&#3629; &#3609;&#3634;&#3626;&#3636;&#3585;"; }
                if($rowgroup[Faculty]=="9"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3623;&#3636;&#3626;&#3633;&#3597;&#3597;&#3637;&#3623;&#3636;&#3607;&#3618;&#3634;"; }
			    if($rowgroup[Faculty]=="10"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3648;&#3623;&#3594;&#3585;&#3619;&#3619;&#3617;&#3615;&#3639;&#3657;&#3609;&#3615;&#3641;"; }
               if($rowgroup[Faculty]=="11"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3619;&#3633;&#3591;&#3626;&#3637;&#3623;&#3636;&#3607;&#3618;&#3634;"; }
			    if($rowgroup[Faculty]=="12"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3614;&#3618;&#3634;&#3608;&#3636;&#3623;&#3636;&#3607;&#3618;&#3634;"; }
             if($rowgroup[Faculty]=="13"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3629;&#3609;&#3634;&#3617;&#3633;&#3618;&#3594;&#3640;&#3617;&#3594;&#3609;"; }
			if($rowgroup[Faculty]=="14"){ echo"&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634;&#3592;&#3636;&#3605;&#3648;&#3623;&#3594;&#3624;&#3634;&#3626;&#3605;&#3619;&#3660;"; } ?>
                                        </option>
                                      <? } ?>
                                    </select>
                                  &nbsp;&nbsp;&nbsp;
                                  <input name="btDocument" type="button" class="" id="btDocument" onClick="
Popup('popupDocumentWindow','popup_group.php',550,430,1)
								" value="&#3604;&#3641;&#3619;&#3634;&#3618;&#3621;&#3632;&#3648;&#3629;&#3637;&#3618;&#3604;&#3585;&#3621;&#3640;&#3656;&#3617;&#3609;&#3633;&#3585;&#3624;&#3638;&#3585;&#3625;&#3634;" />                                </td>
                              </tr>
                              
                              </table>
                              <table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
                                <tr align="right"> 
                                  <td height="30" colspan="4" align="center" class="table_row2"> 
                                    <table width="300" border="0" cellspacing="0" cellpadding="2">
                                      <tr align="center"> 
                                        <td width="148">
  <script language="JavaScript" type="text/JavaScript">
function isBlank(myObj) { if(myObj.value=='') { return true; } return false; }
function verifySubmit() {
 	with(document.myForm) {
				if(Course.value=='') {
				alert('&#3585;&#3619;&#3640;&#3603;&#3634;&#3585;&#3619;&#3629;&#3585;&#3648;&#3619;&#3639;&#3656;&#3629;&#3591;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609;');
					Course.focus();
					return false;
				}
				if(inputMod_Calendar_DateFrom.value=='') {
				alert('&#3585;&#3619;&#3640;&#3603;&#3634;&#3648;&#3621;&#3639;&#3629;&#3585;&#3623;&#3633;&#3609;&#3607;&#3637;&#3656;&#3626;&#3629;&#3609;');
					inputMod_Calendar_DateFrom.focus();
					return false;
				}
				if(inputTime.value=='') {
				alert('&#3585;&#3619;&#3640;&#3603;&#3634;&#3648;&#3621;&#3639;&#3629;&#3585;&#3592;&#3635;&#3609;&#3623;&#3609;&#3594;&#3633;&#3656;&#3623;&#3650;&#3617;&#3591;&#3607;&#3637;&#3656;&#3626;&#3629;&#3609;');
					inputTime.focus();
					return false;
				}
				if(Fill2.value=='') {
				alert('&#3585;&#3619;&#3640;&#3603;&#3634;&#3648;&#3621;&#3639;&#3629;&#3585;&#3649;&#3614;&#3607;&#3618;&#3626;&#3616;&#3634;');
					Fill2.focus();
					return false;
				}
				if(Type.value=='other' && otherdetail.value=='') {
				alert('&#3585;&#3619;&#3640;&#3603;&#3634;&#3585;&#3619;&#3629;&#3585;&#3619;&#3634;&#3618;&#3621;&#3632;&#3648;&#3629;&#3637;&#3618;&#3604;&#3619;&#3641;&#3611;&#3649;&#3610;&#3610;&#3629;&#3639;&#3656;&#3609;&#3654;');
					otherdetail.focus();
					return false;
				}
	}
	return true;
}
						</script> <input name="btSave" type="submit" class="" id="btSave" value="&#3610;&#3633;&#3609;&#3607;&#3638;&#3585;">                                      
                                          <script type="text/javascript">
<!--
function confirmation() {
	var answer = confirm("&#3588;&#3640;&#3603;&#3605;&#3657;&#3629;&#3591;&#3585;&#3634;&#3619;&#3618;&#3639;&#3609;&#3618;&#3633;&#3609;&#3592;&#3619;&#3636;&#3591;&#3627;&#3619;&#3639;&#3629;&#3652;&#3617;&#3656;?")
	if (answer){
		document.myForm.action.value='setstatus';
		document.myForm.submit();
	}
	else{
	}
}
//-->
                                      </script></td>
                                        <td width="144"> <input name="btCalcel" type="button" class="" id="btCalcel" onClick="
if(confirm('Are you sure to return to list?')) {
	document.myReturnForm.submit();
}
						" value="&#3618;&#3657;&#3629;&#3609;&#3585;&#3621;&#3633;&#3610;"> </td>
                                      </tr>
                                      </table></td>
                                </tr>
                                </table></td>
                          </tr>
                          </form>
                      </table>
  <? 
##############################################
 }elseif($action=="view") { 
 $CheckBoxID=$_GET["CheckBoxID"];
 
	$myCheckBoxID=0;
	for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID=$$myVar;
		}
	}
	$sql="SELECT * FROM cm_mod_detailoverall WHERE cm_mod_detailoverall_ID=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");
	$Row=MYSQL_FETCH_ARRAY($Query);
?>
	                <br>
	                <br>
	                <br />
	                <table style="border-collapse: collapse" border="1" bordercolor="#E8E7E1" width="95%" align="center" cellpadding="0" cellspacing="1" class="table_border">
	                  <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="myReturnForm" id="myReturnForm">
	                    <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
	                    <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
	                    <input name="admin" type="hidden" id="admin" value="<?=$admin?>">
	                    
	                    <input name="action" type="hidden" id="action" value="">
	                    <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
	                    <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
	                    <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
	                    <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
	                    <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
	                    </form>
                        <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="myForm" id="myForm" >
                          <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
                          <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
                          <input name="admin" type="hidden" id="admin" value="<?=$admin?>">
                          <input name="action" type="hidden" id="action" value="update">
                          <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
                          <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
                          <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
                          <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
                          <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
                          <input name="CheckBoxID1" type="hidden" id="CheckBoxID1" value="<?=$myCheckBoxID?>">
                          <input name="TotalCheckBoxID" type="hidden" id="TotalCheckBoxID" value="1">						
                          <tr> 
                            <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="mytable_inner">
                              <tr align="center">
                                <td height="24" colspan="3" align="center" class="table_title1" style="font-weight: bold"><div align="left">&#3586;&#3657;&#3629;&#3617;&#3641;&#3621;&#3585;&#3634;&#3619;&#3626;&#3629;&#3609;</div></td>
                                </tr>
                              <tr align="center"> 
                                <td height="24" colspan="3" align="center" class="table_title2" style="font-weight: bold">&#3604;&#3641;&#3586;&#3657;&#3629;&#3617;&#3641;&#3621;</td>
                                </tr>
                              <tr>
                                <td width="228" height="31" align="right" class="table_row2">&#3619;&#3634;&#3618;&#3623;&#3636;&#3594;&#3634; : </td> 
                                  <td width="460" colspan="2" class="table_row2"><?=$Row[cm_mod_detailoverall_Subject]?></td>
                                </tr>
                              <tr>
                                <td width="228" align="right" class="table_row2">&#3616;&#3634;&#3588;&#3623;&#3636;&#3594;&#3634; : </td> 
                                  <td height="22" colspan="2" class="table_row2">
                                    <?=$Row[cm_mod_detailoverall_Faculty]?></td>
							    </tr>
                              <tr>
                                <td width="228" align="right" class="table_row2">&#3609;&#3633;&#3585;&#3624;&#3638;&#3585;&#3625;&#3634;&#3611;&#3637;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609;  : </td> 
									  <td height="22" colspan="2" class="table_row2"><?=$Row[cm_mod_detailoverall_Studentyear]?></td>
							      </tr>							
                              <tr>
                                <td width="228" align="right" class="table_row2">&#3648;&#3619;&#3639;&#3656;&#3629;&#3591;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609; :</td> 
                                  <td height="22" colspan="2" valign="top" class="table_row2"><?=$Row[cm_mod_detailoverall_Course]?></td>
							    </tr>
                              <tr>
                                <td width="228" align="right" class="table_row2">&#3612;&#3641;&#3657;&#3626;&#3629;&#3609; : </td> 
                                  <td height="22" colspan="2" class="table_row2"> <?
							$sqlteach="select * from cmteacher a,crm_system_staff b where a.cmteacher_TeacherID=b.crm_system_staff_ID and a.cmteacher_DetailoverallID='$Row[cm_mod_detailoverall_ID]' order by a.cmteacher_ID asc";
                             $Queryteach=mysql_query($sqlteach);
                             while ($Rowteach = mysql_fetch_array($Queryteach)) { 
								echo substr($Rowteach[crm_system_staff_FName],0,40);
								echo "</br>";
							 }
							 ?></td>
                                </tr>
                              <tr>
                                <td align="right" class="table_row2">ประเภทการเบิก : </td>
                                <td height="22" colspan="2" class="table_row2"><?=$Row[cm_mod_detailoverall_Statuspay]?></td>
                              </tr>
                              <tr>
                                <td width="228" align="right" class="table_row2">&#3623;&#3633;&#3609;&#3607;&#3637;&#3656;&#3626;&#3629;&#3609; : </td>
                                  <td height="22" colspan="2" class="table_row2"><?=ShowDateShort($Row[cm_mod_detailoverall_DateFrom])?></td>
                                </tr>
                              <tr>
                                <td align="right" class="table_row2">&#3648;&#3623;&#3621;&#3634;&#3607;&#3637;&#3656;&#3626;&#3629;&#3609; : </td>
                                  <td height="22" colspan="2" class="table_row2"><?=$Row[cm_mod_detailoverall_TimeFrom]?>-<?=$Row[cm_mod_detailoverall_TimeTo]?></td>
                                </tr>
                              <tr>
                                <td width="228" align="right" class="table_row2">&#3619;&#3641;&#3611;&#3649;&#3610;&#3610; :  </td>
                                  <td height="22" colspan="2" class="table_row2">
								  <?
								   $sqlt="select mfu_type_Name  from mfu_type where mfu_type_Group='1' and mfu_type_ID='$Row[cm_mod_detailoverall_Type]'";
									$queryt=mysql_query($sqlt);
									$rowt=mysql_fetch_array($queryt);
								  echo $rowt[0];
								  ?></td>
                                </tr>
                              <tr>
                                <td align="right" class="table_row2" valign="top">&#3626;&#3606;&#3634;&#3609;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609; : </td>
                                  <td height="22" colspan="2" class="table_row2">
                                    <?
								   $sqlp="select mfu_place_Name,mfu_place_Hospital  from mfu_place where mfu_place_ID='$Row[cm_mod_detailoverall_Place]'";
									$queryp=mysql_query($sqlp);
									$rowp=mysql_fetch_array($queryp);
									if($rowp[mfu_place_Hospital]==1){$h="&#3619;&#3614;.&#3585;&#3621;&#3634;&#3591;";}
									if($rowp[mfu_place_Hospital]==2){$h="&#3619;&#3614;.&#3648;&#3592;&#3619;&#3636;&#3597;&#3585;&#3619;&#3640;&#3591;";}
								  echo $rowp[0]; echo "&nbsp;"; echo $h;
								  ?>                                </td>
                                </tr>
                              <tr>
                                <td align="right" class="table_row2" valign="top">&#3609;&#3633;&#3585;&#3624;&#3638;&#3585;&#3625;&#3634;&#3607;&#3637;&#3656;&#3648;&#3619;&#3637;&#3618;&#3609; : </td>
                                  <td height="22" colspan="2" class="table_row2"> &#3585;&#3621;&#3640;&#3656;&#3617;
                                    <?
									$sqls="select *  from group_student where ID='$Row[cm_mod_detailoverall_Student]'";
									$querys=mysql_query($sqls);
									$rows=mysql_fetch_array($querys);
									echo "$rows[Name]";
									?><br>
									<?
									$sqls="select *  from group_student_list a,evaluateicm_system_student b where a.ID_Student=b.evaluateicm_system_student_ID and a.ID_Group='$Row[cm_mod_detailoverall_Student]' order by a.ID_Student asc";
									$querys=mysql_query($sqls);
									while($rows=mysql_fetch_array($querys)){
									echo $rows[2];echo "$rows[evaluateicm_system_student_FName]"; echo"&nbsp;"; echo "$rows[evaluateicm_system_student_LName]"; echo"<br>";
									}
									?>								    </td>
                                </tr>
                              
                              </table>
                              <table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
                                <tr align="right"> 
                                  <td height="30" colspan="4" align="center" class="table_row2"> 
                                    <table width="370" border="0" cellspacing="0" cellpadding="2">
                                      <tr align="center"> 
                                        <td>
                                          <input name="btEdit" type="submit" class="" id="btEdit" value="&#3649;&#3585;&#3657;&#3652;&#3586;&#3586;&#3657;&#3629;&#3617;&#3641;&#3621;" onClick="
document.myForm.action.value='edit';
document.myForm.submit();
						">                                      </td>
                                        <td> <input name="btCalcel" type="button" class="" id="btCalcel" onClick="
if(confirm('Are you sure to return to list?')) {
	document.myReturnForm.submit();
}
						" value="&#3618;&#3657;&#3629;&#3609;&#3585;&#3621;&#3633;&#3610;"> </td>
                                        <td>&nbsp;</td>
                                      </tr>
                                      </table></td>
                                </tr>
                                </table></td>
                          </tr>
                          </form>
                      </table>
                      <br />
	                
  <? } else if ($action=="viewpro") { 				 
 $CheckBoxID1=$_GET["CheckBoxID1"];
 
	$myCheckBoxID1=0;
	for($i=1;$i<=$TotalCheckBoxID1;$i++) {
		$myVar="CheckBoxID1".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID1=$$myVar;
		}
	}
	$sql="SELECT * FROM roadpump_mod_request a,roadpump_mod_booking b  WHERE a.roadpump_mod_request_ID=b.roadpump_mod_booking_IDRequest and a.roadpump_mod_request_ID='$myCheckBoxID1'";
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");
	$Row=MYSQL_FETCH_ARRAY($Query);
	$record=mysql_num_rows($Query);
?>
	                <br>
	                <br>
	                <br /><? if($record>0){?>
	                <? } else { echo"<div align=center>&#3607;&#3656;&#3634;&#3609;&#3618;&#3633;&#3591;&#3652;&#3617;&#3656;&#3617;&#3637;&#3586;&#3657;&#3629;&#3617;&#3641;&#3621;&#3585;&#3634;&#3619;&#3592;&#3629;&#3591;&#3619;&#3606;</div>";  } ?>
	                <br />
	                <? 

//########################################################
} else if ($action=="update") { 
	$MaxID = $CheckBoxID1;

	if(strlen($inputMod_Calendar_DateFrom)!=10) { $inputMod_Calendar_DateFrom="0000-00-00"; }
	if(strlen($inputMod_Calendar_DateTo)!=10) { $inputMod_Calendar_DateTo="0000-00-00"; }
	if($inputIsDateTo=="") { $inputMod_Calendar_DateTo="0000-00-00"; }
	if($inputIsTimeTo=="") { $inputMod_Calendar_TimeTo="00:00:00"; }
	if( strlen($inputMod_Calendar_DateFrom)>0 && strlen($inputMod_Calendar_DateTo)>0 && $inputMod_Calendar_DateFrom!="0000-00-00"  && $inputMod_Calendar_DateTo!="0000-00-00" ) {
		if(strcmp($inputMod_Calendar_DateFrom,$inputMod_Calendar_DateTo)<1) { 
			// Do nothing.
		} else { 
			// Switch Date
			$myTmp = $inputMod_Calendar_DateFrom;
			$inputMod_Calendar_DateFrom = $inputMod_Calendar_DateTo;
			$inputMod_Calendar_DateTo = $myTmp;
		}
	}
	if($inputMod_Calendar_DateTo=="0000-00-00") { $inputMod_Calendar_DateTo=$inputMod_Calendar_DateFrom; }
	$doublezero="00";
	$inputMod_Calendar_TimeFrom=$inputTimeFromHH.":".$inputTimeFromMM.":".$doublezero;
	$inputMod_Calendar_TimeTo=$inputTimeToHH.":".$inputTimeToMM.":".$doublezero;
	
	$minus=(($inputTimeToMM*1/60)-($inputTimeFromMM*1/60));
	$plus=($inputTimeToHH-$inputTimeFromHH);
	$Totaltime=$plus+$minus;	
	
$year=substr($inputMod_Calendar_DateFrom,0,4);
$sql = "select  WEEK('$inputMod_Calendar_DateFrom')";
$exc = mysql_query($sql);
$row = mysql_fetch_array($exc);
$dw=$year.$row[0];

	$sql = "UPDATE ".$myModule_Table1." SET ".
	$myModule_Table1."_Eduyear='$Eduyear1' ,".
	$myModule_Table1."_Course='$Course' ,".
	$myModule_Table1."_DateFrom='$inputMod_Calendar_DateFrom' ,".
	$myModule_Table1."_TimeFrom='$inputMod_Calendar_TimeFrom' ,".
	$myModule_Table1."_Timeto='$inputMod_Calendar_TimeTo' ,".
	$myModule_Table1."_Alltime='$Totaltime' ,".

	$myModule_Table1."_Type='$Type' ,".
	$myModule_Table1."_Place='$Place' ,".
	$myModule_Table1."_Student='$Student' ,".


	$myModule_Table1."_Createbyid='$inputDocumentID' ,".
	$myModule_Table1."_Createby='$System_Session_UserName' ,".
	$myModule_Table1."_Groupweek='$dw' ,".
	$myModule_Table1."_Statuspay='$Statuspay' ,".
	$myModule_Table1."_Lastupdate=Now() ".
	" WHERE ".$myModule_Table1."_ID=".$CheckBoxID1;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");


$sqlt1="select hptnm from mfu_mod_teacher where Id='$inputDocumentID'";
$queryt1=mysql_query($sqlt1);
$rowt1=mysql_fetch_array($queryt1);
if($rowt1[0]=="โรงพยาบาลกลาง"){ $ending="1";   }
if($rowt1[0]=="โรงพยาบาลเจริญกรุงประชารักษ์"){ $ending="3";    }

$sqlt2="select hptnm from mfu_mod_teacher where Id='$valueform2'";
$queryt2=mysql_query($sqlt2);
$rowt2=mysql_fetch_array($queryt2);
if($rowt2[0]=="โรงพยาบาลกลาง"){ $ending2="1";   }
if($rowt2[0]=="โรงพยาบาลเจริญกรุงประชารักษ์"){ $ending2="3";    }

$sqlt3="select hptnm from mfu_mod_teacher where Id='$valueform3'";
$queryt3=mysql_query($sqlt3);
$rowt3=mysql_fetch_array($queryt3);
if($rowt3[0]=="โรงพยาบาลกลาง"){ $ending3="1";   }
if($rowt3[0]=="โรงพยาบาลเจริญกรุงประชารักษ์"){ $ending3="3";    }

$sqlt4="select hptnm from mfu_mod_teacher where Id='$valueform4'";
$queryt4=mysql_query($sqlt4);
$rowt4=mysql_fetch_array($queryt4);
if($rowt4[0]=="โรงพยาบาลกลาง"){ $ending4="1";   }
if($rowt4[0]=="โรงพยาบาลเจริญกรุงประชารักษ์"){ $ending4="3";    }

$sqlt5="select hptnm from mfu_mod_teacher where Id='$valueform5'";
$queryt5=mysql_query($sqlt5);
$rowt5=mysql_fetch_array($queryt5);
if($rowt5[0]=="โรงพยาบาลกลาง"){ $ending5="1";   }
if($rowt5[0]=="โรงพยาบาลเจริญกรุงประชารักษ์"){ $ending5="3";    }
	
		if($inputDocumentID>0)
	{
		$sql = "DELETE FROM cmteacher WHERE cmteacher_DetailoverallID='$CheckBoxID1'";
	$query=mysql_query($sql);
	$sqlteacher1 = "insert into cmteacher 
(cmteacher_TeacherID,cmteacher_DetailoverallID,cmteacher_Hos) values ('$inputDocumentID','$MaxID','$ending')";
	$query=mysql_query($sqlteacher1);
	if($valueform2>0)
	{
	$sqlteacher2 = "insert into cmteacher 
(cmteacher_TeacherID,cmteacher_DetailoverallID,cmteacher_Hos) values ('$valueform2','$MaxID','$ending2')";
$query=mysql_query($sqlteacher2);
	}
	if($valueform3>0)
	{
	$sqlteacher3 = "insert into cmteacher 
(cmteacher_TeacherID,cmteacher_DetailoverallID,cmteacher_Hos) values ('$valueform3','$MaxID','$ending3')";
$query=mysql_query($sqlteacher3);
	}
	if($valueform4>0)
	{
	
	$sqlteacher4 = "insert into cmteacher 
(cmteacher_TeacherID,cmteacher_DetailoverallID,cmteacher_Hos) values ('$valueform4','$MaxID','$ending4')";
$query=mysql_query($sqlteacher4);
	}
	if($valueform5>0)
	{
	$sqlteacher5 = "insert into cmteacher 
(cmteacher_TeacherID,cmteacher_DetailoverallID,cmteacher_Hos) values ('$valueform5','$MaxID','$ending5')";
$query=mysql_query($sqlteacher5);
	}


}
?>
	                
	                <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>&Eduyear=<?=$Eduyear1?>" method="post" name="myForm" id="myForm">
	                  <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
	                  <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
	                  <input name="admin" type="hidden" id="admin" value="<?=$admin?>">
	                  <input name="action" type="hidden" id="action">
	                  <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
	                  <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
	                  <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
	                  <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
	                  <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
	                  </form>
                      <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
	                <? 
#########################################################
}elseif ($action=="cancel") { 
	$myCheckBoxID=0;
	for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID=$$myVar;
		}
	}
	$sql="SELECT * FROM ".$myModule_Table." WHERE ".$myModule_Table."_ID=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");
	$Row=MYSQL_FETCH_ARRAY($Query);

?>
	                <? 
#########################################################
}elseif ($action=="delete") { 
		for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			 $sql = "DELETE FROM cm_mod_detailoverall  WHERE cm_mod_detailoverall_ID=".$$myVar;
			$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");
		}
	}
?>
					  <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>&Eduyear=<?=$Eduyear?>" method="post" name="myForm" id="myForm">
	                  <input name="action" type="hidden" id="action">
	                  <input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
	                  <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
	                  <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
	                  <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
	                  <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
	                  <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
	                  <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
	                  <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
	                  </form>
                      <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
	                <? 
#########################################################
} else if ($action=="setstatus") { 
	$myCheckBoxID=0;
	for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID=$$myVar;
		}
	}
	 $sql="UPDATE ".$myModule_Table1." SET ".$myModule_Table1."_Status='1' WHERE ".$myModule_Table1."_ID=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: &#3648;&#3585;&#3636;&#3604;&#3588;&#3623;&#3634;&#3617;&#3612;&#3636;&#3604;&#3614;&#3621;&#3634;&#3604; <br>$sql<br>\n");
?>
	                <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="myForm" id="myForm">
	                  <input name="action" type="hidden" id="action">
	                  <input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
	                  <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
	                  <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
	                  <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
	                  <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
	                  <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
	                  <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
	                  <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
	                  </form>
                      <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
	                <?	
#########################################################
} else { ?>
  <?
# Check to set default value #########################
if($PageSize=="") { $PageSize = $SystemModule_defaultPageSize; }
if($PageShow=="") { $PageShow = $SystemModule_defaultPageShow; }
if($ASCDESC=="") { $ASCDESC = $SystemModule_ASCDESC; } 
if($OrderBy=="") { $OrderBy = $SystemModule_OrderBy; } 
if($action=="switchorder") { 
	if($ASCDESC=="ASC") { $ASCDESC = "DESC"; }  else { $ASCDESC="ASC"; } 
} 
if($PageSearch!="") { $PageSearch=trim($PageSearch); }
if($GroupID=="") { $GroupID=0; }

# Count total record size #########################
	//$sql="select * from cm_mod_detailoverall a,mfu_place b where a.cm_mod_detailoverall_Place=b.mfu_place_ID  and a.cm_mod_detailoverall_ListsubjectID='$listid'"
		$sql="select * from cm_mod_detailoverall a,mfu_place b where a.cm_mod_detailoverall_Place=b.mfu_place_ID  and a.cm_mod_detailoverall_ListsubjectID='$listid' and  a.cm_mod_detailoverall_Eduyear ='$Eduyear'";
;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE(mysql_error());
if($PageSearch=="") {
	//$sql="select * from cm_mod_detailoverall a,mfu_place b where a.cm_mod_detailoverall_Place=b.mfu_place_ID  and a.cm_mod_detailoverall_ListsubjectID='$listid'";
		$sql="select * from cm_mod_detailoverall a,mfu_place b where a.cm_mod_detailoverall_Place=b.mfu_place_ID  and a.cm_mod_detailoverall_ListsubjectID='$listid'  and  a.cm_mod_detailoverall_Eduyear ='$Eduyear'";
	} else {
		$sql = $sql."  AND  ( cm_mod_detailoverall_Course LIKE '%$PageSearch%' OR 
	cm_mod_detailoverall_Teacher LIKE '%$PageSearch%' OR 
	cm_mod_detailoverall_Type LIKE '%$PageSearch%' ) ";
}
//$sql.=" group by cm_mod_detailoverall_Connect";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE(mysql_error());
//echo $sql;
 $TotalRecordCount=MYSQL_NUMROWS($Query);

# Find max page size #########################
if($TotalRecordCount>$PageSize) {
	$NoOfPage= ceil($TotalRecordCount/$PageSize);
} else {
	$NoOfPage=1;
}
# Recover page show into range #########################
if($PageShow>$NoOfPage) { $PageShow=$NoOfPage; }

# Select only paging range #########################
$RecordStart = ($PageShow-1)*$PageSize;

$sql.=" ORDER BY b.mfu_place_Hospital ASC,a.cm_mod_detailoverall_DateFrom ASC,a.cm_mod_detailoverall_TimeFrom ASC LIMIT $RecordStart , $PageSize ";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE(mysql_error());
$RecordCount=MYSQL_NUMROWS($Query);
?>
	                <script language="JavaScript" type="text/JavaScript">
function Paging_CheckAll(objCheckHeader,txtCheckBoxFirstName,intTotalItems) {
	if(intTotalItems>0)
		for(i=1;i<=intTotalItems;i++)
			document.getElementById(txtCheckBoxFirstName+i).checked = objCheckHeader.checked;			
	return true;

}
function Paging_CheckAllHandle(objCheckHeader,txtCheckBoxFirstName,intTotalItems) {
	var isCheckedAll = true;
	if(intTotalItems>0)
		for(i=1;i<=intTotalItems;i++)
			if(!document.getElementById(txtCheckBoxFirstName+i).checked) 
			isCheckedAll = false;
	objCheckHeader.checked = isCheckedAll;
	return true;
}
function Paging_CountChecked(txtCheckBoxFirstName,intTotalItems) {
	var intChecked = 0;
	if(intTotalItems>0)
		for(i=1;i<=intTotalItems;i++)
			if(document.getElementById(txtCheckBoxFirstName+i).checked) 
			intChecked ++;
	return intChecked ;
}
function Paging_CheckedThisItem(objCheckHeader,indexing,txtCheckBoxFirstName,intTotalItems) {
	if(intTotalItems>0)
		for(i=1;i<=intTotalItems;i++)
			if(i==indexing) {
				document.getElementById(txtCheckBoxFirstName+i).checked = true;
			} else {
				document.getElementById(txtCheckBoxFirstName+i).checked = false;
			}
	objCheckHeader.checked = false;
	return true;
}
</script>
	                <div id="divDataPicker" style="display:none; position:absolute; top:-135px; left:81px; width: 200px; z-index: 1;Filter:Alpha(opacity=95)"> 
	                  <table width="100%" border="0" cellpadding="0" cellspacing="1" class="table_border">
	                    <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="myStatusForm" id="myStatusForm">
	                      <input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
	                      <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
	                      <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
	                      <tr> 
	                        <td height="22"><table width="100%" height="22" border="0" cellpadding="0" cellspacing="0" class="table_header">
	                          <tr> 
	                            <td width="28" align="center"><img src="../images/icon/ico439.gif" width="19" height="15"></td>
                                    <td align="center">Select Status</td>
                                    <td width="22" align="center"><img src="../images/icon/ico215.gif" width="16" height="16" onMouseOver="this.style.cursor='hand'" onClick="document.getElementById('divDataPicker').style.display='none'; "></td>
                                  </tr>
	                          </table></td>
                            </tr>
	                      <tr> 
	                        <td height="120" align="center" class="table_row1"><br> 
	                          <table width="120" border="0" cellpadding="2" cellspacing="0">
	                            <tr> 
	                              <td height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="Enable"></td>
                                    <td height="22" class="text_bold">Enable</td>
                                  </tr>
	                            <tr> 
	                              <td width="26" height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="Disable"></td>
                                    <td height="22" class="text_bold">Disable</td>
                                  </tr>
	                            </table>
                                <br> <table border="0" cellspacing="0" cellpadding="6">
                                  <tr> 
                                    <td><input name="btSave" type="button" class="button_th_60" id="btSave" value="Save" onClick="
if(document.myStatusForm.toolbarStatus[0].checked) {
	document.myForm.SelectStatus.value=document.myStatusForm.toolbarStatus[0].value;
}
if(document.myStatusForm.toolbarStatus[1].checked) {
	document.myForm.SelectStatus.value=document.myStatusForm.toolbarStatus[1].value;
}
document.myForm.action.value='setstatus';
Paging_CheckedThisItem(document.myForm.CheckBoxAll, StatusIndex ,'CheckBoxID', document.myForm.TotalCheckBoxID.value );
document.myForm.submit();
"></td>
                                    <td><input name="btClose" type="button" class="button_th_60" id="btClose" value="Close" onClick="document.getElementById('divDataPicker').style.display='none';"></td>
                                  </tr>
                                  </table></td>
                            </tr>
	                      <tr> 
	                        <td height="6" class="table_footer"><img src="../images/blank.gif" width="1" height="1"></td>
                            </tr>
	                      </form>
                        </table>
                      </div>
                      <script language="JavaScript" type="text/JavaScript">
var StatusIndex=0;
function ShowDataPicker(myDivName,RefX,RefY) {
	document.getElementById(myDivName).style.display=''; 
	document.getElementById(myDivName).style.left = document.body.scrollLeft + window.event.clientX + RefX;
	document.getElementById(myDivName).style.top= document.body.scrollTop+ window.event.clientY + RefY;
}
	  </script>
	                <table width="95%" border="0" align="center" cellpadding="2" cellspacing="0" >
	                  <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="mySearchForm1" id="mySearchForm1" onSubmit="return false;">
	                    <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>" />
	                    <input name="SystemMenuID2" type="hidden" id="SystemMenuID2" value="<?=$SystemMenuID?>" />
	                    <tr>
	                      <td>
	                        
	                        <div align="right">
	                          <input name="toolbarPageSearch1" type="text"  style="height:15px"class="input_left" id="toolbarPageSearch1" value="<?=$PageSearch?>" size="20" maxlength="50" />                        
	                          <input name="btPageSearch" type="button"  id="btPageSearch" value="&#3588;&#3657;&#3609;&#3627;&#3634;&#3586;&#3657;&#3629;&#3617;&#3641;&#3621;" onClick="
document.myForm.PageSearch.value=document.mySearchForm1.toolbarPageSearch1.value;
document.myForm.submit();
						" />
	                          <input name="btAdd2" type="button" id="btAdd2" value="&#3648;&#3614;&#3636;&#3656;&#3617;&#3586;&#3657;&#3629;&#3617;&#3641;&#3621;&#3651;&#3627;&#3617;&#3656;" onClick="
document.myForm.action.value='add';
document.myForm.submit();
				" />
	                          <input name="btAdd3" type="button" class="" id="btAdd3" value="&#3618;&#3657;&#3629;&#3609;&#3585;&#3621;&#3633;&#3610;" onClick="window.location='schedule.php'" />
	                          <input name="btAdd2" type="button" class="" id="btAdd2" value="Export to Word" onClick="window.location='exportword.php?ListID=<?=$listid?>'" style="display:none" />
	                          </div>                        </td></tr>
	                    </form>
                  </table>
                      <br />
	                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="table_border">
	                  <tr> 
	                    <td bgcolor="#FFFFFF"><table width="100%" border="1" align="center" cellpadding="2" cellspacing="1" bordercolor="#E8E7E1" class="table_border" style="border-collapse: collapse">
	                      <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>&Eduyear=<?=$Eduyear?>" method="post" name="myForm" id="myForm">
	                        <input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
	                        <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
	                        <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
	                        <input name="action" type="hidden" id="action">
	                        <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
	                        <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
	                        <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
	                        <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
	                        <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
	                        <input name="SelectStatus" type="hidden" id="SelectStatus">
	                        <tr align="center" class="menu_table_header">
	                          <td colspan="7" class=""><div align="center" class="table_header">&#3619;&#3634;&#3618;&#3623;&#3636;&#3594;&#3634; :
	                            <?=$subject?>
	                            <br />
	                            &#3609;&#3633;&#3585;&#3624;&#3638;&#3585;&#3625;&#3634;&#3594;&#3633;&#3657;&#3609; :
	                            <?=$studentyear?>
	                             <br>
	                             ปีการศึกษา : <a href="indexadmin.php?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>&Eduyear=<?=$Eduyear-1?>" class="style4" title="ปีการศึกษาก่อนหน้า">&lt;&lt;</a> <?=$Eduyear?> <a href="indexadmin.php?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>&Eduyear=<?=$Eduyear+1?>" class="style4"  title="ปีการศึกษาถัดไป">&gt;&gt;</a><br />
	                            </div></td>
                              </tr>
	                        
	                        <tr align="center" class="menu_table_header">
	                          <td width="7%" bgcolor="#F7F6F0" class="table_title2"><input name="CheckBoxAll" type="checkbox" class="form_checkbox style1" id="CheckBoxAll" onClick="Paging_CheckAll(this,'CheckBoxID',document.myForm.TotalCheckBoxID.value)" value="Yes" /></td>
                                <td width="18%" bgcolor="#F7F6F0" class="table_title2 style1">&#3585;&#3634;&#3619;&#3648;&#3619;&#3637;&#3618;&#3609;</td>
                                <td width="17%" bgcolor="#F7F6F0" class="table_title2 style1">&#3612;&#3641;&#3657;&#3626;&#3629;&#3609;</td>
                                <td width="15%" bgcolor="#F7F6F0" class="table_title2 style1">&#3623;&#3633;&#3609;&#3607;&#3637;&#3656;&#3626;&#3629;&#3609;</td>
                                <td width="18%" bgcolor="#F7F6F0" class="table_title2 style1">&#3626;&#3606;&#3634;&#3609;&#3607;&#3637;&#3656;</td>
                                <td width="16%" bgcolor="#F7F6F0" class="table_title2 style1">&#3619;&#3641;&#3611;&#3649;&#3610;&#3610;</td>
                                <td width="9%" bgcolor="#F7F6F0" class="table_title2 style1">Action</td>
                              </tr>
	                        <?
$index=1;
if($RecordCount>0) {
	while($index<$RecordCount+1) {
		if($myClassRow=="table_row1") { $myClassRow="table_row2"; } else { $myClassRow="table_row1";  }
		$Row=MYSQL_FETCH_ARRAY($Query);
	?>
	<?
							$sqlpl="select * from mfu_place where mfu_place_ID='$Row[cm_mod_detailoverall_Place]'";
							$querypl=mysql_query($sqlpl);
							$rowpl=mysql_fetch_array($querypl);
							?>
	                        <tr <? if($rowpl[mfu_place_Hospital]==1){ ?>class="table_row1"<? } if($rowpl[mfu_place_Hospital]==2){ ?>class="table_row3" <? } ?>>
	                          <td align="center"><input name="CheckBoxID<?=$index?>" type="checkbox" class="form_checkbox" id="CheckBoxID<?=$index?>" onClick="Paging_CheckAllHandle(document.myForm.CheckBoxAll,'CheckBoxID',document.myForm.TotalCheckBoxID.value)" value="<?=$Row[$myModule_Table1."_ID"]?>" /></td>
                                <td align="center"><div align="center">
                                  <span class="menu_one">
                                    <a href="#" onClick="
Paging_CheckedThisItem( document.myForm.CheckBoxAll, <?=$index?>, 'CheckBoxID', document.myForm.TotalCheckBoxID.value );
document.myForm.action.value='view';
document.myForm.submit();"><?=$Row[cm_mod_detailoverall_Course]?></a>                              </span>
                                  <br />
                                  </div></td>
                                <td align="center">
                                  <div align="left">
                                    <?
							 $sqlteach="select * from cmteacher a,mfu_mod_teacher b where a.cmteacher_TeacherID=b.Id and a.cmteacher_DetailoverallID='$Row[cm_mod_detailoverall_ID]' order by a.cmteacher_ID asc";
                             $Queryteach=mysql_query($sqlteach);
                             while ($Rowteach = mysql_fetch_array($Queryteach)) { 
							 //if($Rowteach[prefix]=="&#3609;&#3634;&#3618;"){  echo"&#3629;.&#3609;&#3614;.";  } else { echo "&#3629;.&#3614;&#3597;."; }
								echo $Rowteach[prefix];
								echo $Rowteach[name];   echo"&nbsp;&nbsp;"; echo $Rowteach[lname];
								echo "</br>";echo $Rowteach[posnmfull];
							 }
							 ?>
                                    </div>                              </td>
                                <td align="center"><br>
                                  <?=ShowDateShort($Row[cm_mod_detailoverall_DateFrom])?>
                                  <br>
                                  <br>
                                  <div align="center">
                                    <?=substr($Row[cm_mod_detailoverall_TimeFrom],0,5)?>
                                    -
  <?=substr($Row[cm_mod_detailoverall_TimeTo],0,5)?>
  <br />
                                  </div><br></td>
                                <td align="center">
							<?=$rowpl[mfu_place_Name]?> <br><b>
<? if($rowpl[mfu_place_Hospital]==1) { echo"&#3619;&#3614;.&#3585;&#3621;&#3634;&#3591;"; } if($rowpl[mfu_place_Hospital]==2) { echo"&#3619;&#3614;.&#3648;&#3592;&#3619;&#3636;&#3597;&#3585;&#3619;&#3640;&#3591;"; }?></b></td>
                                <td align="center"><?
								   $sqlt="select mfu_type_Name  from mfu_type where mfu_type_Group='1' and mfu_type_ID='$Row[cm_mod_detailoverall_Type]'";
									$queryt=mysql_query($sqlt);
									$rowt=mysql_fetch_array($queryt);
								  echo $rowt[0];
								  ?></td>
                                <td align="center" valign="middle"><div align="center">
                                  <table border="0" cellspacing="0" cellpadding="1">
                                    <tr align="center" valign="bottom">
                                      <td><img src="../img/icons/view.png" alt="View" width="16" height="16" border="0" onMouseOver="this.style.cursor='hand'" onClick="
Paging_CheckedThisItem( document.myForm.CheckBoxAll, <?=$index?>, 'CheckBoxID', document.myForm.TotalCheckBoxID.value );
document.myForm.action.value='view';
document.myForm.submit();
						" /></td>
                                        <td><img src="../img/icons/edit.png" alt="Edit" width="16" height="16" border="0" onMouseOver="this.style.cursor='hand'" onClick="
if(confirm('Are you sure to edit this record?')) {
	Paging_CheckedThisItem( document.myForm.CheckBoxAll, <?=$index?>, 'CheckBoxID', document.myForm.TotalCheckBoxID.value );
	document.myForm.action.value='edit';
	document.myForm.submit();
}
						" /></td>
                                        <td><img src="../img/icons/delete.png" alt="Delete" width="16" height="16" border="0" onMouseOver="this.style.cursor='hand'" onClick="
if(confirm('Are you sure to delete this record?')) {
	Paging_CheckedThisItem( document.myForm.CheckBoxAll, <?=$index?>, 'CheckBoxID', document.myForm.TotalCheckBoxID.value );
	document.myForm.action.value='delete';
	document.myForm.submit();
}
						" /></td>
                                      </tr>
                                    </table>
                                </div></td>
                              </tr>
	                        <?
		$index++;
	}
} else {  ?>
	                        <tr class="table_row1">
	                          <td colspan="9" align="center">&#3652;&#3617;&#3656;&#3614;&#3610;&#3586;&#3657;&#3629;&#3617;&#3641;&#3621;!</td>
                              </tr>
	                        <? } ?>
	                        <input name="TotalCheckBoxID" type="hidden" id="TotalCheckBoxID" value="<?=$index-1?>" />
	                        </form>
                          </table>
                          <table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
                            <form action="?listid=<?=$listid?>&subject=<?=$subject?>&studentyear=<?=$studentyear?>" method="post" name="mySearchForm" id="mySearchForm" onSubmit="return false;">
                              <input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                              <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
                              <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
                              <tr align="right"> 
                                <td colspan="4" align="right" class="table_footer"><div class="menu_one"> 
                                  <div align="right">&#3627;&#3609;&#3657;&#3634;
                                    <? 
				  if($NoOfPage>1) { 
				  ?>
                                    <select name="toolbarPageShow" class="select" onChange="document.myForm.PageShow.value=this.value; document.myForm.submit(); ">
                                      <? 
if($NoOfPage<$SystemModule_MaxPage) {
	// Show page list #########################
	for($i=1;$i<=$NoOfPage;$i++) { 
		echo "<option value=\"$i\"";
		if($i==$PageShow) { echo " selected"; }
		echo ">$i</option>";
	} 
}  else {
	// # If total page count greater than default max page  value then reduce page select size #########################
	$starti = $PageShow-$SystemModule_ReduceRange;
	if($starti<1) { $starti=1; }
	$endi = $PageShow+$SystemModule_ReduceRange;
	if($endi>$NoOfPage) { $endi=$NoOfPage; }
	//#####################
	for($i=$starti ;$i<=$endi;$i++) { 
		echo "<option value=\"$i\"";
		if($i==$PageShow) { echo " selected"; }
		echo ">$i</option>";
	} 
}
?>
                                      </select>
                                    <? 
 } else { 
	echo "1";
 }
 ?>
                                    &#3592;&#3634;&#3585;
  <?=$NoOfPage?>
                                    | &#3588;&#3657;&#3609;&#3614;&#3610;&#3607;&#3633;&#3657;&#3591;&#3627;&#3617;&#3604;
                                    <?=$TotalRecordCount?> &#3619;&#3634;&#3618;&#3585;&#3634;&#3619;</div>
                                  </div></td>
                                </tr>
                              </form>
                            </table></td>
                        </tr>
	                  </table>
                      <p>&nbsp;</p>
                      <p><br>
                        <? 
}
#########################################################
?>
                        </p>
                      <p>&nbsp; </p>
                      <br>
                      <p align="right">&nbsp;</p>
                    </div>
                     </td>
                  <td width="15">&nbsp;</td>
                </tr>
            </table>		</td>
        <td width="17" valign="top" background="../images/object/border_07.gif"><img src="../images/object/border_17.gif" width="17" height="119"></td>
      </tr>
      <tr>
        <td height="16"><img src="../images/object/border_09.gif" width="20" height="16"></td>
        <td height="16" background="../images/object/border_11.gif"><img src="../images/object/border_11.gif" width="1" height="16"></td>
        <td><img src="../images/object/border_13.gif" width="17" height="16"></td>
      </tr>
    </table></td>
        </tr>
      </table></td>
    <td width="1" bgcolor="#10202F"><img src="../../images/blank.gif" width="1" height="1"></td> 
  </tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="4" height="30" align="left" valign="bottom" background="../../images/main/main-t-bg.gif">&nbsp;</td>
    <td height="30" align="center" background="../../images/main/main-t-bg.gif">&nbsp;</td>
    <td width="4" height="30" align="right" valign="bottom" background="../../images/main/main-t-bg.gif">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<? 
include("../lib/disconnect.php");
?>

Hacked By AnonymousFox1.0, Coded By AnonymousFox