Hacked By AnonymousFox

Current Path : C:/AppServ/www/mfu/webengine/mod_member/
Upload File :
Current File : C:/AppServ/www/mfu/webengine/mod_member/list.php

<? 
include("../lib/session.php"); 
include("../lib/config.php");
include("../lib/connect.php");
include("../lib/function.php");
include("../lib/register_global.php");
?>
<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">
</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 width="1" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
    <td background="../../images/main/main-t-bg.gif" bgcolor="#831B0E"><table width="100%" height="26" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="867" valign="top"><img src="../../webengine/bar.jpg" width="567" height="70" alt="กระทรวงศึกษาธิการ" />&nbsp;</td>
        <td width="115" align="right" valign="top">&nbsp;</td>
      </tr>
    </table></td><td width="1" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
  </tr>
</table>
<table width="95%" height="6" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="1" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
    <td width="587" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
    <td width="1" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
  </tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="1" bgcolor="#A13626"><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;เข้าสู่ระบบ</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;เมนูหลัก</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: เกิดความผิดพลาด <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: เกิดความผิดพลาด <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: เกิดความผิดพลาด <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">
		   <? if(strlen($System_Session_User_ID)>0) { ?>

                  <br>
                  <script language="JavaScript" src="../lib/popup.js" type="text/JavaScript"></script>
                  <br>
                  <br>
                  <? 
## Load Module Configuration Variable ############################################

include("config.php");

## Default Value ############################################
$SystemModule_defaultPageSize = 400;
$SystemModule_defaultPageShow = 1;
$SystemModule_MaxPage = 20;
$SystemModule_ReduceRange = 10; 		// +,- from current page show
$SystemModule_ASCDESC = "DESC";
//$myModule_Table = $myModule_Table1;
$SystemModule_OrderBy = $myModule_Table."_CreateDate";
#########################################################
?>
                  <script language="JavaScript" src="../lib/popup.js" type="text/JavaScript"></script>
                  <!-- import the calendar script -->
                  <link rel="stylesheet" type="text/css" href="../css/myCalendarStyle.css">
                  <script type="text/javascript" src="lib/lang/calendar-th.js"></script>
                  <script type="text/javascript" src="lib/loadcalendar.js"></script>

<? if ($action=="addnew") { 

 if($inputhospital=="other") { $inputhospital=""; } 

	 $sql2 = "INSERT INTO mfu_mod_teacher (prefix,name,lname,posnmfull,exptnm,dspnm,dspnm2,dspnm3,dspnm4,email,hptnm,telephone,history,historytrain) values ('$inputprefix','$inputname','$inputlname','$inputposition','$inputexpert','$inputfaculty','$inputfaculty2','$inputfaculty3','$inputfaculty4','$inputemail','$inputhospital$otherdetail','$inputtel','$inputhistory','$inputhistorytrain')";
	$Query2 = mysql_query($sql2);
	 if($inputhospital=="other") { 
	$sqlho = "INSERT INTO hospital (Name) values ('$otherdetail')";
	$queryho = mysql_query($sqlho);
	}
		$sql="select MAX(Id) from mfu_mod_teacher";
	$query=mysql_query($sql);
	$row=mysql_fetch_array($query);
	$MAXID=$row[0];
	$myrand = rand(1111,9999);
	$exts = explode(".", $_FILES['inputMap']['name']);
	$ext = strtolower(($exts[count($exts) - 1]));	
	$ImageType = $ext;

	if(copy($_FILES["inputMap"]["tmp_name"],"../../upload/member/$MAXID-$myrand.$ImageType")) 
	{ 
	$inputmap=$_FILES["inputMap"]["name"];
	$picmap = "$MAXID-$myrand.$ImageType";
	
    	  $sql="update mfu_mod_teacher set picture='$picmap' where Id='$MAXID'";
		 
		$query=mysql_query($sql);
	}  
	
	
		?>
                    <form action="?" 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="action" type="hidden" id="action">
					  <input type="hidden" id="GroupID" name="GroupID" value="<?=$inputGroupID?>">
                      <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>
                    <? 
} 
?>
                    <? 
####################################################################
if($action=="add") { 
?>
<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>
                    <table width="90%" border="0" cellpadding="0" cellspacing="1" class="table_header">
                      <form action="?" 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="action" type="hidden" id="action" value="">
						 <input type="hidden" id="GroupID" name="GroupID" value="<?=$GroupID?>">
                        <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="?" method="post" enctype="multipart/form-data" name="myForm" id="myForm">
                        <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" value="addnew">
						 <input type="hidden" id="GroupID" name="GroupID" value="<?=$GroupID?>">
                        <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?>">
                        <tr> 
                          <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="2" cellspacing="1">
                              <tr> 
                                <td height="24" colspan="2" align="center" class="menu_table_header">Add New <?=getMenuName($SystemMenuID)?></td>
                              </tr>
                              <tr> 
                                <td height="26" colspan="2" class="table_col3">&nbsp;&nbsp;<img src="../images/bullet/box21.gif" width="11" height="11">&nbsp;Header Information </td>
                              </tr>
<?
if($GroupID>0){
?>
<script language="javascript" type="text/javascript">
if(<?=$GroupID?>==2){
	document.getElementById('RowhideMonth').style.display=''; 
	document.getElementById('RowhideYear').style.display='none'; 
}else if(<?=$GroupID?>==4){
	document.getElementById('RowhideMonth').style.display='none'; 
	document.getElementById('RowhideYear').style.display=''; 
}else{
	document.getElementById('RowhideMonth').style.display='none'; 
	document.getElementById('RowhideYear').style.display='none'; 
}
</script>
<?
}else{
?>
<script language="javascript" type="text/javascript">
	document.getElementById('RowhideMonth').style.display=''; 
	document.getElementById('RowhideYear').style.display='none'; 
</script>
<? }?>
                              <tr>
                                <td width="31%" align="right" class="table_col1">รูปภาพ</td> 
                                <td height="22" class="table_col2"><input type="file" name="inputMap" id="inputMap" /></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">&nbsp;</td>
                                <td height="22" class="table_col2"><span class="table_col1">
                                  <input name="inputchoose" type="radio" value="1">
                                หัวหน้าภาควิชา 
                                <input name="inputchoose" type="radio" value="2">
รองหัวหน้าภาควิชา <br>
<input name="inputchoose" type="radio" value="0" checked>
                                ไม่ได้เป็นหัวหน้าและรองหัวหน้าภาควิชา
</span></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1"> คำนำหน้าชื่อ</td> 
                                <td height="22" class="table_col2"> <input name="inputprefix" type="text" class="input_left" id="inputprefix" size="50" maxlength="255"></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">ชื่อ</td> 
                                <td height="22" class="table_col2"> <input name="inputname" type="text" class="input_left" id="inputname" size="50" maxlength="255"></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">นามสกุล</td>
                                <td height="22" class="table_col2"><input name="inputlname" type="text" class="input_left" id="inputlname" size="50" maxlength="255"></td>
                              </tr>
                              
                              <tr>
                                <td align="right" class="table_col1">ตำแหน่ง</td>
                                <td height="22" class="table_col2"><input name="inputposition" type="text" class="input_left" id="inputposition" size="50" maxlength="255"></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">ความเชี่ยวชาญเฉพาะด้าน</td>
                                <td height="22" class="table_col2"><input name="inputexpert" type="text" class="input_left" id="inputexpert" size="50" maxlength="255"></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">ภาควิชา</td>
                                <td height="22" class="table_col2"><select name="inputfaculty" class="">
                                  <?
									$sqlde="select distinct dspnm from mfu_mod_teacher";
									$queryde=mysql_query($sqlde);
									while($rowde=mysql_fetch_array($queryde)){
									?>
                                  <option value="<?=$rowde[dspnm]?>">
                                    <?=$rowde[dspnm]?>
                                  </option>
                                  <? } ?>
                                </select></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">ภาควิชา</td>
                                <td height="22" class="table_col2"><select name="inputfaculty2" class="">
								<option value="" selected="selected"></option>
                                  <?
									$sqlde="select distinct dspnm from mfu_mod_teacher";
									$queryde=mysql_query($sqlde);
									while($rowde=mysql_fetch_array($queryde)){
									?>
                                  <option value="<?=$rowde[dspnm]?>">
                                    <?=$rowde[dspnm]?>
                                  </option>
                                  <? } ?>
                                </select></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">ภาควิชา</td>
                                <td height="22" class="table_col2"><select name="inputfaculty3" class="">
									<option value="" selected="selected"></option>
                                  <?
									$sqlde="select distinct dspnm from mfu_mod_teacher";
									$queryde=mysql_query($sqlde);
									while($rowde=mysql_fetch_array($queryde)){
									?>
                                  <option value="<?=$rowde[dspnm]?>">
                                    <?=$rowde[dspnm]?>
                                  </option>
                                  <? } ?>
                                </select></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">ภาควิชา</td>
                                <td height="22" class="table_col2"><select name="inputfaculty4" class="">
									<option value="" selected="selected"></option>
                                  <?
									$sqlde="select distinct dspnm from mfu_mod_teacher";
									$queryde=mysql_query($sqlde);
									while($rowde=mysql_fetch_array($queryde)){
									?>
                                  <option value="<?=$rowde[dspnm]?>">
                                    <?=$rowde[dspnm]?>
                                  </option>
                                  <? } ?>
                                </select></td>
                              </tr>
                              
                              <tr>
                                <td align="right" class="table_col1">อีเมลล์</td>
                                <td height="22" class="table_col2"><input name="inputemail" type="text" class="input_left" id="inputemail" size="50" maxlength="255"></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">โรงพยาบาล</td>
                                <td height="22" class="table_col2">
								<select name="inputhospital" id="inputhospital">
								<?
								$sqlho="select * from hospital order by Id asc";
								$queryho=mysql_query($sqlho);
								while($rowho=mysql_fetch_array($queryho)){
								?>
                                  <option value="<?=$rowho[Name]?>"><?=$rowho[Name]?></option>
								  <? } ?>
										    <option value="other">อื่น ๆ</option>
                                </select><input type="text" name="otherdetail" id="otherdetail" style="border:1px; padding:1px;border-style: solid ; border-color: #dbdee1;" class="DEPENDS ON inputhospital BEING other" />								</td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">เบอร์โทรศัพท์</td>
                                <td height="22" class="table_col2"><input name="inputtel" type="text" class="input_left" id="inputtel" size="50" maxlength="255"></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">ประวัติการศึกษา</td>
                                <td height="22" class="table_col2"><textarea name="inputhistory" cols="50" rows="6" class="input_textarea" id="inputhistory"></textarea></td>
                              </tr>
                              <tr>
                                <td height="22" colspan="2" align="right" class="table_col1"><div align="center">ประวัติการอบรม</div></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">ประวัติชื่อโครงการอบรม</td>
                                <td height="22" class="table_col2"><input type="text" name="textfield" id="textfield"></td>
                            </tr>
                              <tr>
                                <td align="right" class="table_col1">วันที่</td>
                                <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                  <tr>
                                    <td nowrap>From&nbsp;</td>
                                    <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>
                                    <td width="25" align="right"><input name="inputIsDateTo" type="checkbox" id="inputIsDateTo" value="Yes" onClick="if(document.getElementById('idDateTo1').style.display=='') { document.getElementById('idDateTo1').style.display='none'; document.getElementById('idDateTo2').style.display='none'; } else { document.getElementById('idDateTo1').style.display=''; document.getElementById('idDateTo2').style.display=''; } "></td>
                                    <td nowrap>To&nbsp;</td>
                                    <td id="idDateTo1" style="display:none"><input name="inputMod_Calendar_DateTo" type="text" class="input_center" id="inputMod_Calendar_DateTo" value="<?=$myDate?>" size="10" maxlength="10"></td>
                                    <td id="idDateTo2" style="display:none"><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateTo', 'y-mm-dd');" value=" ... "></td>
                                  </tr>
                                </table></td>
                              </tr>
                              <tr><td align="right" class="table_col1">เวลา</td>
                                <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                  <tr>
                                    <td width="30">From</td>
                                    <td><select name="inputTimeFromHH" class="select" id="inputTimeFromHH">
                                        <? for($i=0;$i<=23;$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>To&nbsp;</td>
                                    <td  id="idTimeTo1" style="display:none"><select name="inputTimeToHH" class="select" id="inputTimeToHH">
                                        <? for($i=0;$i<=23;$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 align="right" class="table_col1">สถานที่</td>
                                <td height="22" class="table_col2"><input type="text" name="textfield2" id="textfield2"></td>
                              </tr>
                              <tr>
                                <td align="right" class="table_col1">หน่วยงานผู้จัด</td>
                                <td height="22" class="table_col2"><input type="text" name="textfield3" id="textfield3"></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_footer"> 
                                  <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(isBlank(inputprefix)) {	inputprefix.focus(); return false; }
		if(isBlank(inputname)) {	inputname.focus(); return false; }
		if(isBlank(inputlname)) {	inputlname.focus(); return false; }

	}
	//fnSave();
	document.myForm.submit();
}
						</script> <input name="btAdd" type="button" class="button_80" id="btAdd" value="Add" onClick="verifySubmit();">                                      </td>
                                      <td> <input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="
if(confirm('Are you sure to return to list?')) {
	document.myReturnForm.submit();
}
						" value="Cancel"> </td>
                                    </tr>
                                  </table></td>
                              </tr>
                            </table></td>
                        </tr>
                      </form>
                  </table>
                    <br>
                    <br>
                    <br>
                    <? 
#########################################################
} else if($action=="view") { 
	$myCheckBoxID=0;
	for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID=$$myVar;
		}
	}
	$sql="SELECT * FROM ".$myModule_Table." WHERE Id='$myCheckBoxID'";
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	$Row=MYSQL_FETCH_ARRAY($Query);
	$inputPass = $Row[$myModule_Table."_Pass"];
	$inputID = $Row[$myModule_Table."_member_ID"];
	$inputUser = $Row[$myModule_Table."_User"];
	$inputFName = $Row[$myModule_Table."_FName"];
	$inputLName = $Row[$myModule_Table."_LName"];
	$inputGender = $Row[$myModule_Table."_Gender"];
	$inputGroup = $Row[$myModule_Table."_Group"];
	$inputAddress = $Row[$myModule_Table."_HomeTown"];
	$inputCityID = $Row[$myModule_Table."_CityID"];
	$inputPostalCode = $Row[$myModule_Table."_PostalCode"];
	$inputPhone = $Row[$myModule_Table."_Phone"];
	$BirthArr=explode('-',$Row[$myModule_Table."_BirthDate"]);
	$inputDate=$BirthArr[2];
	$inputMonth=$BirthArr[1];
	$inputYear=$BirthArr[0];
	
	$inputBirthDate = $Row[$myModule_Table."_BirthDate"];
	?>
                  <br>
                  <table width="90%" border="0" cellpadding="0" cellspacing="0">
                    <form action="?" 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="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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
					  <input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
                    </form>
                    <form action="?" 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="action" type="hidden" id="action" value="edit">
                      <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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
                      <input name="CheckBoxID1" type="hidden" id="CheckBoxID1" value="<?=$myCheckBoxID?>">
                      <input name="TotalCheckBoxID" type="hidden" id="TotalCheckBoxID" value="1">
					  <input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
                      <tr> 
                        <td  bgcolor="#FFFFFF" class="table_col2"> <table width="100%" border="0" cellpadding="2" cellspacing="1">
                            <tr> 
                              <td height="24" colspan="2" align="center" class="menu_table_header">View 
                                <?=getMenuName($SystemMenuID)?>                              </td>
                            </tr>
                          </table>
						<table width="100%" border="0"  cellpadding="0" cellspacing="1">
                              <tr> 
                                <td> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="table_border">
                                  <tr>
                                    <td height="22" colspan="2" class="table_col3">&nbsp;&nbsp;<img src="../../webengine/images/bullet/box21.gif" width="11" height="11">&nbsp;&nbsp;ข้อมูลระบบ</td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1"> ชื่อผู้ใช้ &nbsp;</td>
                                    <td height="22" class="table_col2"><?=$Row[Username]?></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1"> รหัสผ่าน&nbsp;</td>
                                    <td height="22" class="table_col2"><?=$Row[Password]?></td>
                                  </tr>
                                  <tr>
                                    <td height="22" colspan="2" class="table_col3">&nbsp;&nbsp;<img src="../../webengine/images/bullet/box21.gif" width="11" height="11">&nbsp;&nbsp;ข้อมูลส่วนตัว</td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">Picture&nbsp;&nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"> <? if($Row[picture]!=""){?>
							  <img src="../../upload/member/<?=$Row[picture]?>">
							  <? } ?>&nbsp;<br>
							  <? if($Row[Choose]=="1"){ echo"หัวหน้าภาควิชา";}if($Row[Choose]=="2"){ echo"รองหัวหน้าภาควิชา";}?></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_2">pertypenm</LABEL>                                      &nbsp;&nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"><?=$Row[pertypenm]?></td>
                                  </tr>
                                  <tr>
                                    <td width="22%" height="22" align="right" class="table_col1"> <LABEL for="checkbox_row_3">posno</LABEL>
                                      &nbsp; 
                                      &nbsp;</td>
                                    <td width="78%" height="22" class="table_col2"><?=$Row[posno]?></td>
                                  </tr>
                                  <tr>
                                    <td width="22%" height="22" align="right" class="table_col1">name&nbsp;&nbsp;&nbsp; </td>
                                    <td width="78%" height="22" class="table_col2"><?=$Row[name]?></td>
                                  </tr>
                                 <tr>
                                    <td height="22" align="right" class="table_col1">lname&nbsp;&nbsp;&nbsp; </td>
                                    <td height="22" class="table_col2"><?=$Row[lname]?></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">pos&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"><?=$Row[pos]?></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_7">exptnm</LABEL>                                      &nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"><?=$Row[exptnm]?></td>
                                  </tr>
								  <tr>
                                    <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_8">exctnm</LABEL>                                      &nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"><?=$Row[exctnm]?></td>
                                  </tr>
								   <tr>
                                    <td height="22" align="right" class="table_col1">posnm &nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"><?=$Row[posnm]?></td>
                                  </tr>
								  <tr>
                                    <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_11">lvl</LABEL>                                      &nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"><?=$Row[lvl]?>                                    </tr>
								   <tr>
                                    <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_11">lvlnm</LABEL>                                      &nbsp;</td>
                                    <td height="22" class="table_col2"><?=$Row[lvlnm]?></td>
                                  </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_11">sex</LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[sex]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_11">age</LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[age]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_11">appage</LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[appage]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_15">dspnm</LABEL>
								       <LABEL for="checkbox_row_11"></LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[dspnm]?></td>
							      </tr>
								   <tr>
                                     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_15">dspnm</LABEL>
                                       2
                                         <LABEL for="checkbox_row_11"></LABEL>
                                       &nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[dspnm2]?></td>
							      </tr>
								   <tr>
                                     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_15">dspnm3</LABEL>
                                         <LABEL for="checkbox_row_11"></LABEL>
                                       &nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[dspnm3]?></td>
							      </tr>
								   <tr>
                                     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_15">dspnm4</LABEL>
                                         <LABEL for="checkbox_row_11"></LABEL>
                                       &nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[dspnm4]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_16">appdate</LABEL>
								       <LABEL for="checkbox_row_11"></LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[appdate]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_17">birthdate</LABEL>
								       <LABEL for="checkbox_row_16"></LABEL>
                                       <LABEL for="checkbox_row_11"></LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[birthdate]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_18">salamt</LABEL>
								       <LABEL for="checkbox_row_16"></LABEL>
                                       <LABEL for="checkbox_row_11"></LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[salamt]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_19">pertype</LABEL>
								       <LABEL for="checkbox_row_16"></LABEL>
                                       <LABEL for="checkbox_row_11"></LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[pertype]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_20">poscd</LABEL>
								       <LABEL for="checkbox_row_16"></LABEL>
                                       <LABEL for="checkbox_row_11"></LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[poscd]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_21">divcd</LABEL>
								       <LABEL for="checkbox_row_16"></LABEL>
                                       <LABEL for="checkbox_row_11"></LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[divcd]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_22">lctno</LABEL>
								       <LABEL for="checkbox_row_16"></LABEL>
                                       <LABEL for="checkbox_row_11"></LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[lctno]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_22">datediff</LABEL>
                                       <LABEL for="checkbox_row_16"></LABEL>
                                       <LABEL for="checkbox_row_11"></LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[datediff]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_24">hptnm</LABEL>
								       <LABEL for="checkbox_row_22"></LABEL>
                                       <LABEL for="checkbox_row_16"></LABEL>
                                       <LABEL for="checkbox_row_11"></LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[hptnm]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1"><LABEL for="checkbox_row_25">posnmfull</LABEL>
								       <LABEL for="checkbox_row_22"></LABEL>
                                       <LABEL for="checkbox_row_16"></LABEL>
                                       <LABEL for="checkbox_row_11"></LABEL>
&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[posnmfull]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1">Telphone&nbsp;&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[telephone]?></td>
							      </tr>
								   <tr>
								     <td height="22" align="right" class="table_col1">History&nbsp;&nbsp;</td>
								     <td height="22" class="table_col2"><?=$Row[history]?></td>
							      </tr>
								   <tr>
                                     <td height="22" align="right" class="table_col1" valign="top">Historytrain&nbsp;&nbsp;</td>
								     <td height="22" class="table_col2">
									 <table width="100%" border="1" style="border-collapse:collapse" bordercolor="#999999">
                                       <tr>
                                         <td width="8%"><div align="center">ลำดับ</div></td>
                                         <td width="23%"><div align="center">ชื่อโครงการอบรม</div></td>
                                         <td width="15%"><div align="center">วัน / เดือน / ปี</div></td>
                                         <td width="21%"><div align="center">เวลา</div></td>
                                         <td width="17%"><div align="center">สถานที่</div></td>
                                         <td width="16%"><div align="center">ผู้จัด</div></td>
                                       </tr>
                                       <?
									 $sql="select * from history where idteacher='$myCheckBoxID' order by datefrom asc";
									 $query=mysql_query($sql);
									 $num=mysql_num_rows($query);
									  $i=$num;
									 while($row=mysql_fetch_array($query)){
									
									 ?>
                                       <tr>
                                         <td><div align="center">
                                           <?=$i?>
                                         </div>                                          </td>
                                         <td><?=$row[name]?></td>
                                         <td><div align="center">
                                           <br>
                                           <?=ShowDateLongTh($row[datefrom])?>
                                           <br>
                                           -
                                           <br>
                                           <?=ShowDateLongTh($row[dateto])?>
                                           <br>
                                           <br>
                                         </div></td>
                                         <td><div align="center">
                                           <?=$row[timefrom]?>
                                           -
                                           <?=$row[timeto]?>
                                         </div></td>
                                         <td><?=$row[place]?></td>
                                         <td><?=$row[organize]?></td>
                                       </tr>
                                       <?  $i--; } ?>
                                     </table>
									 <?
									 $sql="select * from history where idteacher='$myCheckBoxID' order by datefrom asc";
									 $query=mysql_query($sql);
									 while($row=mysql_fetch_array($query)){
									 ?>
									 ประวัติชื่อโครงการอบรม : <?=$row[name]?><br>
 วันที่  :<?=ShowDateLongTh($row[datefrom])?> - <?=ShowDateLongTh($row[dateto])?><br>
เวลา : <?=$row[timefrom]?> - <?=$row[timeto]?><br>
 สถานที่ : <?=$row[place]?><br>
 หน่วยงานผู้จัด : <?=$row[organize]?>
                                     <br><br>
                                  <?
									 }
									 ?>
									 <?=$Row[historytrain]?></td>
							      </tr>
								   
								
							    </table></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_footer"> 
                                <table width="300" border="0" cellspacing="0" cellpadding="2">
                                  <tr align="center"> 
								  <? if($System_Session_Permission[$SystemMenuID]=="RW" ){ ?>
                                  <td><input name="btEdit" type="submit" class="button_80" id="btEdit" value="Edit" onClick="
document.myForm.action.value='edit';
document.myForm.submit();
						"></td>
						<? }?>
                                  <td><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="

	document.myReturnForm.submit();

						" value="Back"></td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table></td>
                      </tr>
                    </form>
                  </table>
                  <br>
              
                  <br>
                  <script language="JavaScript">
HideCheckBox();
function HideCheckBox() {
	for( i =0; i < document.myForm.elements.length; i++ ) {
			//  hide check box
			if( document.myForm.elements[ i ].type.toLowerCase( ) == "checkbox" ) {
				document.myForm.elements[ i ].disabled=true;
			}
	}
}
                  </script>				  
                  <? 
####################################################################
} else if($action=="edit") { 
	$myCheckBoxID=0;
	for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID=$$myVar;
		}
	}
	 $sql="SELECT * FROM ".$myModule_Table." WHERE Id=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	$Row=MYSQL_FETCH_ARRAY($Query);
	$inputPass = $Row[$myModule_Table."_Pass"];
	$inputID = $Row[$myModule_Table."_member_ID"];
	$inputUser = $Row[$myModule_Table."_User"];
	$inputFName = $Row[$myModule_Table."_FName"];
	$inputLName = $Row[$myModule_Table."_LName"];
	$inputGender = $Row[$myModule_Table."_Gender"];
	$inputGroup = $Row[$myModule_Table."_Group"];
	$inputAddress = $Row[$myModule_Table."_HomeTown"];
	$inputCityID = $Row[$myModule_Table."_CityID"];
	$inputPostalCode = $Row[$myModule_Table."_PostalCode"];
	$inputPhone = $Row[$myModule_Table."_Phone"];
	$inputDate=$BirthArr[2];
	$inputMonth=$BirthArr[1];
	$inputYear=$BirthArr[0];
	?>
	                  <br><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>
  <link rel="stylesheet" type="text/css" href="../css/myCalendarStyle.css">
                    <script type="text/javascript" src="lib/calendar.js"></script>
                    <script type="text/javascript" src="lib/lang/calendar-th.js"></script>
                    <script type="text/javascript" src="lib/loadcalendar.js"></script>
                  <table width="90%" border="0" cellpadding="0" cellspacing="0" >
                    <form action="?" 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="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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
						<input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
                    </form>
                    <form action="?" method="post" enctype="multipart/form-data" name="myForm" id="myForm">
                        <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" 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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
                        <input name="CheckBoxID1" type="hidden" id="CheckBoxID1" value="<?=$myCheckBoxID?>">
						<input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
                      <tr> 
                        <td bgcolor="#FFFFFF" class="table_col2"> <table width="100%" border="0"  cellpadding="0" cellspacing="1">
                            <tr> 
                              <td height="24" colspan="2" align="center" class="menu_table_header">Edit <?=getMenuName($SystemMenuID)?></td>
                            </tr>
                          </table>
                          <table width="100%" border="0"  cellpadding="0" cellspacing="1">
                              <tr> 
                                <td> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="table_border">
                              <tr><td height="22" colspan="2" class="table_col3">&nbsp;&nbsp;<img src="../../webengine/images/bullet/box21.gif" width="11" height="11">&nbsp;&nbsp;ข้อมูลระบบ</td>
                                  </tr>
                                  <tr>
                                    <td width="31%" height="22" align="right" class="table_col1">รูปภาพ</td>
                                    <td width="72%" height="22" class="table_col2"><img src="../../upload/member/<?=$Row[picture]?>"><br>
                                    <input type="file" name="inputMap" id="inputMap" />
                                    &nbsp;(<strong>ขนาดรูปกว้าง 87 pixel</strong>)</td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">&nbsp;</td>
                                    <td height="22" class="table_col2"><span class="table_col1">
                                      <input name="inputchoose" type="radio" value="1" <? if($Row[Choose]=="1"){ ?> checked="checked" <? } ?>>
หัวหน้าภาควิชา
<input name="inputchoose" type="radio" value="2" <? if($Row[Choose]=="2"){ ?> checked="checked" <? } ?>>
รองหัวหน้าภาควิชา <br>
<input name="inputchoose" type="radio" value="0" <? if($Row[Choose]=="0"){ ?> checked="checked" <? } ?>>
                                ไม่ได้เป็นหัวหน้าและรองหัวหน้าภาควิชา</span></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1"> คำนำหน้าชื่อ</td>
                                    <td height="22" class="table_col2">
                                      <input type="text" name="inputprefix" value="<?=$Row[prefix]?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">ชื่อ</td>
                                    <td height="22" class="table_col2"><input type="text" name="inputname"  value="<?=$Row[name]?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">นามสกุล</td>
                                    <td height="22" class="table_col2"><input type="text" name="inputlname"  value="<?=$Row[lname]?>"></td>
                                  </tr>
                                  
                                  <tr>
                                    <td height="22" align="right" class="table_col1">ตำแหน่ง</td>
                                    <td height="22" class="table_col2"><input type="text" name="inputposition" value="<?=$Row[posnmfull]?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">ความเชี่ยวชาญเฉพาะด้าน</td>
                                    <td height="22" class="table_col2"><input type="text" name="inputexpert" value="<?=$Row[exptnm]?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">ภาควิชา</td>
                                    <td height="22" class="table_col2">
									<select name="inputfaculty">
									<?
									$sqlde="select distinct dspnm from mfu_mod_teacher";
									$queryde=mysql_query($sqlde);
									while($rowde=mysql_fetch_array($queryde)){
									?>
                                      <option value="<?=$rowde[dspnm]?>" <? if($rowde[dspnm]==$Row[dspnm])  {  echo"selected"; }?>><?=$rowde[dspnm]?></option>
									  <? } ?>
                                    </select>                                   </td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ภาควิชา</td>
                                    <td height="22" class="table_col2">
                                       <select name="inputfaculty2">
									<?
									$sqlde="select distinct dspnm from mfu_mod_teacher";
									$queryde=mysql_query($sqlde);
									while($rowde=mysql_fetch_array($queryde)){
									?>
                                      <option value="<?=$rowde[dspnm]?>" <? if($rowde[dspnm]==$Row[dspnm2])  {  echo"selected"; }?>><?=$rowde[dspnm]?></option>
									  <? } ?>
                                    </select>  </td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ภาควิชา</td>
                                    <td height="22" class="table_col2"><select name="inputfaculty3">
									<?
									$sqlde="select distinct dspnm from mfu_mod_teacher";
									$queryde=mysql_query($sqlde);
									while($rowde=mysql_fetch_array($queryde)){
									?>
                                      <option value="<?=$rowde[dspnm]?>" <? if($rowde[dspnm]==$Row[dspnm3])  {  echo"selected"; }?>><?=$rowde[dspnm]?></option>
									  <? } ?>
                                    </select>  </td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ภาควิชา</td>
                                    <td height="22" class="table_col2"><select name="inputfaculty4">
									<?
									$sqlde="select distinct dspnm from mfu_mod_teacher";
									$queryde=mysql_query($sqlde);
									while($rowde=mysql_fetch_array($queryde)){
									?>
                                      <option value="<?=$rowde[dspnm]?>" <? if($rowde[dspnm]==$Row[dspnm4])  {  echo"selected"; }?>><?=$rowde[dspnm]?></option>
									  <? } ?>
                                    </select>  </td>
                                  </tr>
                                  
                                  <tr>
                                    <td height="22" align="right" class="table_col1">อีเมลล์</td>
                                    <td height="22" class="table_col2"><input type="text" name="inputemail"  value="<?=$Row[email]?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">โรงพยาบาล</td>
                                    <td height="22" class="table_col2">
									<select name="inputhospital" id="inputhospital">
								<?
								$sqlho="select * from hospital order by Id asc";
								$queryho=mysql_query($sqlho);
								while($rowho=mysql_fetch_array($queryho)){
								?>
								<option value="<?=$rowho[Name]?>"  <? if($Row[hptnm ]==$rowho[Name])  {  echo"selected"; }?>><?=$rowho[Name]?></option>
								<? } ?>
								<option value="other">อื่น ๆ</option>
                                </select><input type="text" name="otherdetail" id="otherdetail" style="border:1px; padding:1px;border-style: solid ; border-color: #dbdee1;" class="DEPENDS ON inputhospital BEING other" />														</td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">เบอร์โทรศัพท์</td>
                                    <td height="22" class="table_col2"><input type="text" name="inputtel"  value="<?=$Row[telephone]?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">ประวัติการศึกษา</td>
                                    <td height="22" class="table_col2"><textarea name="inputhistory" cols="40" rows="5"><?=$Row[history]?></textarea></td>
                                  </tr>
                                  <tr>
                                    <td height="22" colspan="2" align="right" class="table_col1"><div align="center">ประวัติการอบรม</div></td>
                                  </tr>
               				<?
							 $sqlh1="select * from history where orderi='1' and idteacher='$myCheckBoxID'";
							$queryh1=mysql_query($sqlh1);
							$rowh1=mysql_fetch_array($queryh1);
			                      
							$sqlh2="select * from history where orderi='2' and idteacher='$myCheckBoxID'";
							$queryh2=mysql_query($sqlh2);
							$rowh2=mysql_fetch_array($queryh2);
							
							$sqlh3="select * from history where orderi='3' and idteacher='$myCheckBoxID'";
							$queryh3=mysql_query($sqlh3);
							$rowh3=mysql_fetch_array($queryh3);
							
							$sqlh4="select * from history where orderi='4' and idteacher='$myCheckBoxID'";
							$queryh4=mysql_query($sqlh4);
							$rowh4=mysql_fetch_array($queryh4);
							
							$sqlh5="select * from history where orderi='5' and idteacher='$myCheckBoxID'";
							$queryh5=mysql_query($sqlh5);
							$rowh5=mysql_fetch_array($queryh5);
								  
								  ?>
                                  <tr>
                                    <td align="right" class="table_col1">ประวัติชื่อโครงการอบรม</td>
                                    <td height="22" class="table_col2"><input type="text" name="nameh1" id="textfield6" value="<?=$rowh1[name]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">วันที่</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td nowrap>จาก&nbsp;</td>
                                          <td><input name="inputMod_Calendar_DateFrom" type="text" class="input_center" id="inputMod_Calendar_DateFrom" value="<?=$rowh1[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>
                                          <td width="25" align="right"><input name="inputIsDateTo" type="checkbox" id="inputIsDateTo" onClick="if(document.getElementById('idDateTo1').style.display=='') { document.getElementById('idDateTo1').style.display='none'; document.getElementById('idDateTo2').style.display='none'; } else { document.getElementById('idDateTo1').style.display=''; document.getElementById('idDateTo2').style.display=''; } " value="Yes"></td>
                                      <td nowrap>To&nbsp;</td>
                                      <td id="idDateTo1" style="display:none"> 
                                        <input name="inputMod_Calendar_DateTo" type="text" class="input_center" id="inputMod_Calendar_DateTo" value="<?=$rowh1[dateto]?>" size="10" maxlength="10"></td>
                                      <td id="idDateTo2" style="display:none"> 
                                        <input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateTo', 'y-mm-dd');" value=" ... "></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr><td align="right" class="table_col1">เวลา</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td width="30">จาก</td>
                                           <td>
                                           <?
										    $myTimeHH=substr($rowh1[timefrom],0,2);
										    $myTimeMM=substr($rowh1[timefrom],3,2);
										    $myTimeHH2=substr($rowh1[timeto],0,2);
										   $myTimeMM2=substr($rowh1[timeto],3,2);
										   ?>
                                           <select name="inputTimeFromHH" class="select" id="inputTimeFromHH">
                                          <? for($i=0;$i<=23;$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" 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=''; } " value="Yes"></td>
                                      <td nowrap>To&nbsp;</td>
                                      <td  id="idTimeTo1" style="display:none"><select name="inputTimeToHH" class="select" id="inputTimeToHH">
                                          <? for($i=0;$i<=23;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                          <option value="<?=$myi?>"<? if($myTimeHH2==$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($myTimeMM2==$i) { echo " selected"; } ?>> 
                                          <?=$myi?>
                                          </option>
                                          <? } ?>
                                        </select></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">สถานที่</td>
                                    <td height="22" class="table_col2"><input type="text" name="placeh1" id="textfield5"  value="<?=$rowh1[place]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">หน่วยงานผู้จัด</td>
                                    <td height="22" class="table_col2"><input type="text" name="orgh1" id="textfield4"  value="<?=$rowh1[organize]?>">
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input name="delhis1" type="checkbox" id="checkbox" value="1">
                                    ลบข้อมูลออก</td>
                                  </tr>
                                  <tr>
                                    <td height="22" colspan="2" align="right" class="table_col1">&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ประวัติชื่อโครงการอบรม</td>
                                    <td height="22" class="table_col2"><input type="text" name="nameh2" id="textfield9" value="<?=$rowh2[name]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">วันที่</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td nowrap>จาก&nbsp;</td>
                                          <td><input name="inputMod_Calendar_DateFrom2" type="text" class="input_center" id="inputMod_Calendar_DateFrom2" value="<?=$rowh2[datefrom]?>" size="10" maxlength="10" ></td>
                                          <td><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateFrom2', 'y-mm-dd');" value=" ... ">                                          </td>
                                          <td width="25" align="right"><input name="inputIsDateTo2" type="checkbox" id="inputIsDateTo2" value="Yes" onClick="if(document.getElementById('idDateTo3').style.display=='') { document.getElementById('idDateTo3').style.display='none'; document.getElementById('idDateTo4').style.display='none'; } else { document.getElementById('idDateTo3').style.display=''; document.getElementById('idDateTo4').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td id="idDateTo3" style="display:none"><input name="inputMod_Calendar_DateTo2" type="text" class="input_center" id="inputMod_Calendar_DateTo2" value="<?=$rowh2[dateto]?>" size="10" maxlength="10"></td>
                                          <td id="idDateTo4" style="display:none"><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateTo2', 'y-mm-dd');" value=" ... "></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr><td align="right" class="table_col1">เวลา</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td width="30">จาก</td>
                                          <?
										    $myTimeHH=substr($rowh2[timefrom],0,2);
										    $myTimeMM=substr($rowh2[timefrom],3,2);
										    $myTimeHH2=substr($rowh2[timeto],0,2);
										   $myTimeMM2=substr($rowh2[timeto],3,2);
										   ?>
                                          <td><select name="inputTimeFromHH2" class="select" id="inputTimeFromHH2">
                                              <? for($i=0;$i<=23;$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="inputTimeFromMM2" class="select" id="inputTimeFromMM2">
                                              <? 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="inputIsTimeTo2" type="checkbox" id="inputIsTimeTo2" value="Yes" onClick="if(document.getElementById('idTimeTo4').style.display=='') { document.getElementById('idTimeTo4').style.display='none'; document.getElementById('idTimeTo5').style.display='none';  document.getElementById('idTimeTo6').style.display='none'; } else { document.getElementById('idTimeTo4').style.display=''; document.getElementById('idTimeTo5').style.display=''; document.getElementById('idTimeTo6').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td  id="idTimeTo4" style="display:none"><select name="inputTimeToHH2" class="select" id="inputTimeToHH2">
                                              <? for($i=0;$i<=23;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeHH2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                          <td  id="idTimeTo5" style="display:none"><b>:</b></td>
                                          <td  id="idTimeTo6" style="display:none"><select name="inputTimeToMM2" class="select" id="inputTimeToMM2">
                                              <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeMM2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">สถานที่</td>
                                    <td height="22" class="table_col2"><input type="text" name="placeh2" id="textfield8"   value="<?=$rowh2[place]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">หน่วยงานผู้จัด</td>
                                    <td height="22" class="table_col2"><input type="text" name="orgh2" id="textfield7"  value="<?=$rowh2[organize]?>">
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input type="checkbox" name="delhis2" id="checkbox2" value="1">
ลบข้อมูลออก</td>
                                  </tr>
                                  <tr>
                                    <td height="22" colspan="2" align="right" class="table_col1">&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ประวัติชื่อโครงการอบรม</td>
                                    <td height="22" class="table_col2"><input type="text" name="nameh3" id="textfield12" value="<?=$rowh3[name]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">วันที่</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td nowrap>จาก&nbsp;</td>
                                          <td><input name="inputMod_Calendar_DateFrom3" type="text" class="input_center" id="inputMod_Calendar_DateFrom3" value="<?=$rowh3[datefrom]?>" size="10" maxlength="10"></td>
                                          <td><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateFrom3', 'y-mm-dd');" value=" ... ">                                          </td>
                                          <td width="25" align="right"><input name="inputIsDateTo3" type="checkbox" id="inputIsDateTo6" value="Yes" onClick="if(document.getElementById('idDateTo11').style.display=='') { document.getElementById('idDateTo11').style.display='none'; document.getElementById('idDateTo12').style.display='none'; } else { document.getElementById('idDateTo11').style.display=''; document.getElementById('idDateTo12').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td id="idDateTo11" style="display:none"><input name="inputMod_Calendar_DateTo3" type="text" class="input_center" id="inputMod_Calendar_DateTo3" value="<?=$rowh3[dateto]?>" size="10" maxlength="10"></td>
                                          <td id="idDateTo12" style="display:none"><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateTo3', 'y-mm-dd');" value=" ... "></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr><td align="right" class="table_col1">เวลา</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td width="30">จาก</td>
                                            <?
										    $myTimeHH=substr($rowh3[timefrom],0,2);
										    $myTimeMM=substr($rowh3[timefrom],3,2);
										    $myTimeHH2=substr($rowh3[timeto],0,2);
										   $myTimeMM2=substr($rowh3[timeto],3,2);
										   ?>
                                          <td><select name="inputTimeFromHH3" class="select" id="inputTimeFromHH6">
                                              <? for($i=0;$i<=23;$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="inputTimeFromMM3" class="select" id="inputTimeFromMM6">
                                              <? 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="inputIsTimeTo3" type="checkbox" id="inputIsTimeTo6" value="Yes" onClick="if(document.getElementById('idTimeTo16').style.display=='') { document.getElementById('idTimeTo16').style.display='none'; document.getElementById('idTimeTo17').style.display='none';  document.getElementById('idTimeTo18').style.display='none'; } else { document.getElementById('idTimeTo16').style.display=''; document.getElementById('idTimeTo17').style.display=''; document.getElementById('idTimeTo18').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td  id="idTimeTo16" style="display:none"><select name="inputTimeToHH3" class="select" id="inputTimeToHH6">
                                              <? for($i=0;$i<=23;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeHH2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                          <td  id="idTimeTo17" style="display:none"><b>:</b></td>
                                          <td  id="idTimeTo18" style="display:none"><select name="inputTimeToMM3" class="select" id="inputTimeToMM6">
                                              <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeMM2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  
                                  <tr>
                                    <td align="right" class="table_col1">สถานที่</td>
                                    <td height="22" class="table_col2"><input type="text" name="placeh3" id="textfield11"   value="<?=$rowh3[place]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">หน่วยงานผู้จัด</td>
                                    <td height="22" class="table_col2"><input type="text" name="orgh3" id="textfield10"  value="<?=$rowh3[organize]?>">
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input type="checkbox" name="delhis3" id="checkbox3" value="1">
ลบข้อมูลออก</td>
                                  </tr>
                                  <tr>
                                    <td height="22" colspan="2" align="right" class="table_col1">&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ประวัติชื่อโครงการอบรม</td>
                                    <td height="22" class="table_col2"><input type="text" name="nameh4" id="textfield15" value="<?=$rowh4[name]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">วันที่</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td nowrap>จาก&nbsp;</td>
                                          <td><input name="inputMod_Calendar_DateFrom4" type="text" class="input_center" id="inputMod_Calendar_DateFrom4" value="<?=$rowh4[datefrom]?>" size="10" maxlength="10"></td>
                                          <td><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateFrom4', 'y-mm-dd');" value=" ... ">                                          </td>
                                          <td width="25" align="right"><input name="inputIsDateTo4" type="checkbox" id="inputIsDateTo4" value="Yes" onClick="if(document.getElementById('idDateTo7').style.display=='') { document.getElementById('idDateTo7').style.display='none'; document.getElementById('idDateTo8').style.display='none'; } else { document.getElementById('idDateTo7').style.display=''; document.getElementById('idDateTo8').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td id="idDateTo7" style="display:none"><input name="inputMod_Calendar_DateTo4" type="text" class="input_center" id="inputMod_Calendar_DateTo4" value="<?=$rowh4[dateto]?>" size="10" maxlength="10"></td>
                                          <td id="idDateTo8" style="display:none"><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateTo4', 'y-mm-dd');" value=" ... "></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr><td align="right" class="table_col1">เวลา</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td width="30">จาก</td>
                                            <?
										    $myTimeHH=substr($rowh4[timefrom],0,2);
										    $myTimeMM=substr($rowh4[timefrom],3,2);
										    $myTimeHH2=substr($rowh4[timeto],0,2);
										   $myTimeMM2=substr($rowh4[timeto],3,2);
										   ?>
                                          <td><select name="inputTimeFromHH4" class="select" id="inputTimeFromHH4">
                                              <? for($i=0;$i<=23;$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="inputTimeFromMM4" class="select" id="inputTimeFromMM4">
                                              <? 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="inputIsTimeTo4" type="checkbox" id="inputIsTimeTo4" value="Yes" onClick="if(document.getElementById('idTimeTo10').style.display=='') { document.getElementById('idTimeTo10').style.display='none'; document.getElementById('idTimeTo11').style.display='none';  document.getElementById('idTimeTo12').style.display='none'; } else { document.getElementById('idTimeTo10').style.display=''; document.getElementById('idTimeTo11').style.display=''; document.getElementById('idTimeTo12').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td  id="idTimeTo10" style="display:none"><select name="inputTimeToHH4" class="select" id="inputTimeToHH4">
                                              <? for($i=0;$i<=23;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeHH2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                          <td  id="idTimeTo11" style="display:none"><b>:</b></td>
                                          <td  id="idTimeTo12" style="display:none"><select name="inputTimeToMM4" class="select" id="inputTimeToMM4">
                                              <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeMM2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">สถานที่</td>
                                    <td height="22" class="table_col2"><input type="text" name="placeh4" id="textfield14"   value="<?=$rowh4[place]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">หน่วยงานผู้จัด</td>
                                    <td height="22" class="table_col2"><input type="text" name="orgh4" id="textfield13"  value="<?=$rowh4[organize]?>">
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input type="checkbox" name="delhis4" id="checkbox4" value="1">
ลบข้อมูลออก</td>
                                  </tr>
                                  <tr>
                                    <td height="22" colspan="2" align="right" class="table_col1">&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ประวัติชื่อโครงการอบรม</td>
                                    <td height="22" class="table_col2"><input type="text" name="nameh5" id="textfield18" value="<?=$rowh5[name]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">วันที่</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td nowrap>จาก&nbsp;</td>
                                          <td><input name="inputMod_Calendar_DateFrom5" type="text" class="input_center" id="inputMod_Calendar_DateFrom5" value="<?=$rowh5[datefrom]?>" size="10" maxlength="10"></td>
                                          <td><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateFrom5', 'y-mm-dd');" value=" ... ">                                          </td>
                                          <td width="25" align="right"><input name="inputIsDateTo5" type="checkbox" id="inputIsDateTo5" value="Yes" onClick="if(document.getElementById('idDateTo9').style.display=='') { document.getElementById('idDateTo9').style.display='none'; document.getElementById('idDateTo10').style.display='none'; } else { document.getElementById('idDateTo9').style.display=''; document.getElementById('idDateTo10').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td id="idDateTo9" style="display:none"><input name="inputMod_Calendar_DateTo5" type="text" class="input_center" id="inputMod_Calendar_DateTo5" value="<?=$rowh5[dateto]?>" size="10" maxlength="10"></td>
                                          <td id="idDateTo10" style="display:none"><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateTo5', 'y-mm-dd');" value=" ... "></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr><td align="right" class="table_col1">เวลา</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td width="30">จาก</td>
                                          <?
										    $myTimeHH=substr($rowh5[timefrom],0,2);
										    $myTimeMM=substr($rowh5[timefrom],3,2);
										    $myTimeHH2=substr($rowh5[timeto],0,2);
										   $myTimeMM2=substr($rowh5[timeto],3,2);
										   ?>
                                          <td><select name="inputTimeFromHH5" class="select" id="inputTimeFromHH5">
                                              <? for($i=0;$i<=23;$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="inputTimeFromMM5" class="select" id="inputTimeFromMM5">
                                              <? 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="inputIsTimeTo5" type="checkbox" id="inputIsTimeTo5" value="Yes" onClick="if(document.getElementById('idTimeTo13').style.display=='') { document.getElementById('idTimeTo13').style.display='none'; document.getElementById('idTimeTo14').style.display='none';  document.getElementById('idTimeTo15').style.display='none'; } else { document.getElementById('idTimeTo13').style.display=''; document.getElementById('idTimeTo14').style.display=''; document.getElementById('idTimeTo15').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td  id="idTimeTo13" style="display:none"><select name="inputTimeToHH5" class="select" id="inputTimeToHH5">
                                              <? for($i=0;$i<=23;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeHH2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                          <td  id="idTimeTo14" style="display:none"><b>:</b></td>
                                          <td  id="idTimeTo15" style="display:none"><select name="inputTimeToMM5" class="select" id="inputTimeToMM5">
                                              <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeMM2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">สถานที่</td>
                                    <td height="22" class="table_col2"><input type="text" name="placeh5" id="textfield17"   value="<?=$rowh5[place]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">หน่วยงานผู้จัด</td>
                                    <td height="22" class="table_col2"><input type="text" name="orgh5" id="textfield16"  value="<?=$rowh5[organize]?>">
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input type="checkbox" name="delhis5" id="checkbox5" value="1">
ลบข้อมูลออก</td>
                                  </tr>
                                  <tr>
                                    <td height="22" colspan="2" align="right" class="table_col1">&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ประวัติชื่อโครงการอบรม</td>
                                    <td height="22" class="table_col2"><input type="text" name="nameh6" id="textfield18" value="<?=$rowh6[name]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">วันที่</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td nowrap>จาก&nbsp;</td>
                                          <td><input name="inputMod_Calendar_DateFrom6" type="text" class="input_center" id="inputMod_Calendar_DateFrom6" value="<?=$rowh6[datefrom]?>" size="10" maxlength="10"></td>
                                          <td><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateFrom6', 'y-mm-dd');" value=" ... ">                                          </td>
                                          <td width="25" align="right"><input name="inputIsDateTo6" type="checkbox" id="inputIsDateTo6" value="Yes" onClick="if(document.getElementById('idDateTo61').style.display=='') { document.getElementById('idDateTo61').style.display='none'; document.getElementById('idDateTo62').style.display='none'; } else { document.getElementById('idDateTo61').style.display=''; document.getElementById('idDateTo62').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td id="idDateTo61" style="display:none"><input name="inputMod_Calendar_DateTo6" type="text" class="input_center" id="inputMod_Calendar_DateTo6" value="<?=$rowh6[dateto]?>" size="10" maxlength="10"></td>
                                          <td id="idDateTo62" style="display:none"><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateTo6', 'y-mm-dd');" value=" ... "></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr><td align="right" class="table_col1">เวลา</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td width="30">จาก</td>
                                          <?
										    $myTimeHH=substr($rowh6[timefrom],0,2);
										    $myTimeMM=substr($rowh6[timefrom],3,2);
										    $myTimeHH2=substr($rowh6[timeto],0,2);
										   $myTimeMM2=substr($rowh6[timeto],3,2);
										   ?>
                                          <td><select name="inputTimeFromHH6" class="select" id="inputTimeFromHH6">
                                              <? for($i=0;$i<=23;$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="inputTimeFromMM6" class="select" id="inputTimeFromMM6">
                                              <? 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="inputIsTimeTo6" type="checkbox" id="inputIsTimeTo6" value="Yes" onClick="if(document.getElementById('idTimeTo61').style.display=='') { document.getElementById('idTimeTo61').style.display='none'; document.getElementById('idTimeTo62').style.display='none';  document.getElementById('idTimeTo63').style.display='none'; } else { document.getElementById('idTimeTo61').style.display=''; document.getElementById('idTimeTo62').style.display=''; document.getElementById('idTimeTo63').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td  id="idTimeTo61" style="display:none"><select name="inputTimeToHH6" class="select" id="inputTimeToHH5">
                                              <? for($i=0;$i<=23;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeHH2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                          <td  id="idTimeTo62" style="display:none"><b>:</b></td>
                                          <td  id="idTimeTo63" style="display:none"><select name="inputTimeToMM6" class="select" id="inputTimeToMM5">
                                              <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeMM2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">สถานที่</td>
                                    <td height="22" class="table_col2"><input type="text" name="placeh6" id="textfield17"   value="<?=$rowh6[place]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">หน่วยงานผู้จัด</td>
                                    <td height="22" class="table_col2"><input type="text" name="orgh6" id="textfield16"  value="<?=$rowh6[organize]?>">
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input type="checkbox" name="delhis6" id="checkbox5" value="1">
ลบข้อมูลออก</td>
                                  </tr>
                                  <tr>
                                    <td height="22" colspan="2" align="right" class="table_col1">&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ประวัติชื่อโครงการอบรม</td>
                                    <td height="22" class="table_col2"><input type="text" name="nameh7" id="textfield18" value="<?=$rowh7[name]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">วันที่</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td nowrap>จาก&nbsp;</td>
                                          <td><input name="inputMod_Calendar_DateFrom7" type="text" class="input_center" id="inputMod_Calendar_DateFrom7" value="<?=$rowh7[datefrom]?>" size="10" maxlength="10"></td>
                                          <td><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateFrom7', 'y-mm-dd');" value=" ... ">                                          </td>
                                          <td width="25" align="right"><input name="inputIsDateTo7" type="checkbox" id="inputIsDateTo7" value="Yes" onClick="if(document.getElementById('idDateTo71').style.display=='') { document.getElementById('idDateTo71').style.display='none'; document.getElementById('idDateTo72').style.display='none'; } else { document.getElementById('idDateTo71').style.display=''; document.getElementById('idDateTo72').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td id="idDateTo71" style="display:none"><input name="inputMod_Calendar_DateTo7" type="text" class="input_center" id="inputMod_Calendar_DateTo7" value="<?=$rowh7[dateto]?>" size="10" maxlength="10"></td>
                                          <td id="idDateTo72" style="display:none"><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateTo7', 'y-mm-dd');" value=" ... "></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr><td align="right" class="table_col1">เวลา</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td width="30">จาก</td>
                                          <?
										    $myTimeHH=substr($rowh7[timefrom],0,2);
										    $myTimeMM=substr($rowh7[timefrom],3,2);
										    $myTimeHH2=substr($rowh7[timeto],0,2);
										   $myTimeMM2=substr($rowh7[timeto],3,2);
										   ?>
                                          <td><select name="inputTimeFromHH7" class="select" id="inputTimeFromHH7">
                                              <? for($i=0;$i<=23;$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="inputTimeFromMM7" class="select" id="inputTimeFromMM7">
                                              <? 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="inputIsTimeTo7" type="checkbox" id="inputIsTimeTo7" value="Yes" onClick="if(document.getElementById('idTimeTo71').style.display=='') { document.getElementById('idTimeTo71').style.display='none'; document.getElementById('idTimeTo72').style.display='none';  document.getElementById('idTimeTo73').style.display='none'; } else { document.getElementById('idTimeTo71').style.display=''; document.getElementById('idTimeTo72').style.display=''; document.getElementById('idTimeTo73').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td  id="idTimeTo71" style="display:none"><select name="inputTimeToHH7" class="select" id="inputTimeToHH5">
                                              <? for($i=0;$i<=23;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeHH2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                          <td  id="idTimeTo72" style="display:none"><b>:</b></td>
                                          <td  id="idTimeTo73" style="display:none"><select name="inputTimeToMM7" class="select" id="inputTimeToMM5">
                                              <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeMM2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">สถานที่</td>
                                    <td height="22" class="table_col2"><input type="text" name="placeh7" id="textfield17"   value="<?=$rowh7[place]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">หน่วยงานผู้จัด</td>
                                    <td height="22" class="table_col2"><input type="text" name="orgh7" id="textfield16"  value="<?=$rowh7[organize]?>">
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input type="checkbox" name="delhis7" id="checkbox5" value="1">
ลบข้อมูลออก</td>
                                  </tr>
                                  <tr>
                                    <td height="22" colspan="2" align="right" class="table_col1">&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ประวัติชื่อโครงการอบรม</td>
                                    <td height="22" class="table_col2"><input type="text" name="nameh8" id="textfield18" value="<?=$rowh8[name]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">วันที่</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td nowrap>จาก&nbsp;</td>
                                          <td><input name="inputMod_Calendar_DateFrom8" type="text" class="input_center" id="inputMod_Calendar_DateFrom8" value="<?=$rowh8[datefrom]?>" size="10" maxlength="10"></td>
                                          <td><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateFrom8', 'y-mm-dd');" value=" ... ">                                          </td>
                                          <td width="25" align="right"><input name="inputIsDateTo8" type="checkbox" id="inputIsDateTo8" value="Yes" onClick="if(document.getElementById('idDateTo81').style.display=='') { document.getElementById('idDateTo81').style.display='none'; document.getElementById('idDateTo82').style.display='none'; } else { document.getElementById('idDateTo81').style.display=''; document.getElementById('idDateTo82').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td id="idDateTo81" style="display:none"><input name="inputMod_Calendar_DateTo8" type="text" class="input_center" id="inputMod_Calendar_DateTo8" value="<?=$rowh8[dateto]?>" size="10" maxlength="10"></td>
                                          <td id="idDateTo82" style="display:none"><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateTo8', 'y-mm-dd');" value=" ... "></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr><td align="right" class="table_col1">เวลา</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td width="30">จาก</td>
                                          <?
										    $myTimeHH=substr($rowh8[timefrom],0,2);
										    $myTimeMM=substr($rowh8[timefrom],3,2);
										    $myTimeHH2=substr($rowh8[timeto],0,2);
										   $myTimeMM2=substr($rowh8[timeto],3,2);
										   ?>
                                          <td><select name="inputTimeFromHH8" class="select" id="inputTimeFromHH8">
                                              <? for($i=0;$i<=23;$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="inputTimeFromMM8" class="select" id="inputTimeFromMM8">
                                              <? 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="inputIsTimeTo8" type="checkbox" id="inputIsTimeTo8" value="Yes" onClick="if(document.getElementById('idTimeTo81').style.display=='') { document.getElementById('idTimeTo81').style.display='none'; document.getElementById('idTimeTo82').style.display='none';  document.getElementById('idTimeTo83').style.display='none'; } else { document.getElementById('idTimeTo81').style.display=''; document.getElementById('idTimeTo82').style.display=''; document.getElementById('idTimeTo83').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td  id="idTimeTo81" style="display:none"><select name="inputTimeToHH8" class="select" id="inputTimeToHH5">
                                              <? for($i=0;$i<=23;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeHH2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                          <td  id="idTimeTo82" style="display:none"><b>:</b></td>
                                          <td  id="idTimeTo83" style="display:none"><select name="inputTimeToMM8" class="select" id="inputTimeToMM5">
                                              <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeMM2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">สถานที่</td>
                                    <td height="22" class="table_col2"><input type="text" name="placeh8" id="textfield17"   value="<?=$rowh8[place]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">หน่วยงานผู้จัด</td>
                                    <td height="22" class="table_col2"><input type="text" name="orgh8" id="textfield16"  value="<?=$rowh8[organize]?>">
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input type="checkbox" name="delhis8" id="checkbox5" value="1">
ลบข้อมูลออก</td>
                                  </tr>
                                  <tr>
                                    <td height="22" colspan="2" align="right" class="table_col1">&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ประวัติชื่อโครงการอบรม</td>
                                    <td height="22" class="table_col2"><input type="text" name="nameh9" id="textfield18" value="<?=$rowh9[name]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">วันที่</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td nowrap>จาก&nbsp;</td>
                                          <td><input name="inputMod_Calendar_DateFrom9" type="text" class="input_center" id="inputMod_Calendar_DateFrom9" value="<?=$rowh9[datefrom]?>" size="10" maxlength="10"></td>
                                          <td><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateFrom9', 'y-mm-dd');" value=" ... ">                                          </td>
                                          <td width="25" align="right"><input name="inputIsDateTo9" type="checkbox" id="inputIsDateTo9" value="Yes" onClick="if(document.getElementById('idDateTo91').style.display=='') { document.getElementById('idDateTo91').style.display='none'; document.getElementById('idDateTo92').style.display='none'; } else { document.getElementById('idDateTo91').style.display=''; document.getElementById('idDateTo92').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td id="idDateTo91" style="display:none"><input name="inputMod_Calendar_DateTo9" type="text" class="input_center" id="inputMod_Calendar_DateTo9" value="<?=$rowh9[dateto]?>" size="10" maxlength="10"></td>
                                          <td id="idDateTo92" style="display:none"><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateTo9', 'y-mm-dd');" value=" ... "></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr><td align="right" class="table_col1">เวลา</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td width="30">จาก</td>
                                          <?
										    $myTimeHH=substr($rowh9[timefrom],0,2);
										    $myTimeMM=substr($rowh9[timefrom],3,2);
										    $myTimeHH2=substr($rowh9[timeto],0,2);
										   $myTimeMM2=substr($rowh9[timeto],3,2);
										   ?>
                                          <td><select name="inputTimeFromHH9" class="select" id="inputTimeFromHH9">
                                              <? for($i=0;$i<=23;$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="inputTimeFromMM9" class="select" id="inputTimeFromMM9">
                                              <? 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="inputIsTimeTo9" type="checkbox" id="inputIsTimeTo9" value="Yes" onClick="if(document.getElementById('idTimeTo91').style.display=='') { document.getElementById('idTimeTo91').style.display='none'; document.getElementById('idTimeTo92').style.display='none';  document.getElementById('idTimeTo93').style.display='none'; } else { document.getElementById('idTimeTo91').style.display=''; document.getElementById('idTimeTo92').style.display=''; document.getElementById('idTimeTo93').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td  id="idTimeTo91" style="display:none"><select name="inputTimeToHH9" class="select" id="inputTimeToHH5">
                                              <? for($i=0;$i<=23;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeHH2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                          <td  id="idTimeTo92" style="display:none"><b>:</b></td>
                                          <td  id="idTimeTo93" style="display:none"><select name="inputTimeToMM9" class="select" id="inputTimeToMM5">
                                              <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeMM2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">สถานที่</td>
                                    <td height="22" class="table_col2"><input type="text" name="placeh9" id="textfield17"   value="<?=$rowh9[place]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">หน่วยงานผู้จัด</td>
                                    <td height="22" class="table_col2"><input type="text" name="orgh9" id="textfield16"  value="<?=$rowh9[organize]?>">
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input type="checkbox" name="delhis9" id="checkbox5" value="1">
ลบข้อมูลออก</td>
                                  </tr>
                                  <tr>
                                    <td height="22" colspan="2" align="right" class="table_col1">&nbsp;</td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">ประวัติชื่อโครงการอบรม</td>
                                    <td height="22" class="table_col2"><input type="text" name="nameh10" id="textfield18" value="<?=$rowh10[name]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">วันที่</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td nowrap>จาก&nbsp;</td>
                                          <td><input name="inputMod_Calendar_DateFrom10" type="text" class="input_center" id="inputMod_Calendar_DateFrom10" value="<?=$rowh10[datefrom]?>" size="10" maxlength="10"></td>
                                          <td><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateFrom10', 'y-mm-dd');" value=" ... ">                                          </td>
                                          <td width="25" align="right"><input name="inputIsDateTo10" type="checkbox" id="inputIsDateTo10" value="Yes" onClick="if(document.getElementById('idDateTo101').style.display=='') { document.getElementById('idDateTo101').style.display='none'; document.getElementById('idDateTo102').style.display='none'; } else { document.getElementById('idDateTo101').style.display=''; document.getElementById('idDateTo102').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td id="idDateTo101" style="display:none"><input name="inputMod_Calendar_DateTo10" type="text" class="input_center" id="inputMod_Calendar_DateTo9" value="<?=$rowh9[dateto]?>" size="10" maxlength="10"></td>
                                          <td id="idDateTo102" style="display:none"><input type="button" class="button_th_normal" onClick="return showCalendar('inputMod_Calendar_DateTo10', 'y-mm-dd');" value=" ... "></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr><td align="right" class="table_col1">เวลา</td>
                                    <td height="22" class="table_col2"><table border="0" cellspacing="0" cellpadding="1">
                                        <tr>
                                          <td width="30">จาก</td>
                                          <?
										    $myTimeHH=substr($rowh10[timefrom],0,2);
										    $myTimeMM=substr($rowh10[timefrom],3,2);
										    $myTimeHH2=substr($rowh10[timeto],0,2);
										   $myTimeMM2=substr($rowh10[timeto],3,2);
										   ?>
                                          <td><select name="inputTimeFromHH10" class="select" id="inputTimeFromHH10">
                                              <? for($i=0;$i<=23;$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="inputTimeFromMM10" class="select" id="inputTimeFromMM10">
                                              <? 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="inputIsTimeTo10" type="checkbox" id="inputIsTimeTo10" value="Yes" onClick="if(document.getElementById('idTimeTo101').style.display=='') { document.getElementById('idTimeTo101').style.display='none'; document.getElementById('idTimeTo102').style.display='none';  document.getElementById('idTimeTo103').style.display='none'; } else { document.getElementById('idTimeTo101').style.display=''; document.getElementById('idTimeTo102').style.display=''; document.getElementById('idTimeTo103').style.display=''; } "></td>
                                          <td nowrap>To&nbsp;</td>
                                          <td  id="idTimeTo101" style="display:none"><select name="inputTimeToHH10" class="select" id="inputTimeToHH5">
                                              <? for($i=0;$i<=23;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeHH2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                          <td  id="idTimeTo102" style="display:none"><b>:</b></td>
                                          <td  id="idTimeTo103" style="display:none"><select name="inputTimeToMM10" class="select" id="inputTimeToMM5">
                                              <? for($i=0;$i<=59;$i++) { if($i<10) { $myi= "0".$i; } else { $myi=$i; } ?>
                                              <option value="<?=$myi?>"<? if($myTimeMM2==$i) { echo " selected"; } ?>>
                                              <?=$myi?>
                                              </option>
                                              <? } ?>
                                          </select></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">สถานที่</td>
                                    <td height="22" class="table_col2"><input type="text" name="placeh10" id="textfield17"   value="<?=$rowh10[place]?>"></td>
                                  </tr>
                                  <tr>
                                    <td align="right" class="table_col1">หน่วยงานผู้จัด</td>
                                    <td height="22" class="table_col2"><input type="text" name="orgh10" id="textfield16"  value="<?=$rowh10[organize]?>">
                                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input type="checkbox" name="delhis10" id="checkbox5" value="1">
ลบข้อมูลออก</td>
                                  </tr>
                                  

                                  
                                  
                                  <!--------------tr>
                                    <td height="22" align="right" class="table_col1">ชื่อเล่น &nbsp; </td>
                                    <td height="22" class="table_col2"><input name="inputNickName" type="text"   class="input_left" id="inputNickName" value="<?=$inputNickName?>" size="30" maxlength="30"></td>
                                  </tr---------------------->
                                  <!-----------------------tr>
                                    <td height="22" colspan="2" class="table_col3">&nbsp;&nbsp;<img src="../../webengine/images/bullet/box21.gif" width="11" height="11">&nbsp;&nbsp;ข้อมูลการทำงาน</td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">อาชีพ&nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"><select name="inputOccupationID" class="select" id="inputOccupationD">
                                        <?
										  $sql = "SELECT * FROM ".$System_TableName_Occupation." WHERE ".$System_TableName_Occupation."_Status='Enable' ORDER BY ".$System_TableName_Occupation."_ID";
										  $Query_Occupation = mysql_query($sql);
										  ?>
                                        <? while ($Row_Occupation = mysql_fetch_array($Query_Occupation)) { ?>
                                        <option value="<?=$Row_Occupation[$System_TableName_Occupation."_ID"]?>">
                                        <?=$Row_Occupation[$System_TableName_Occupation."_Name".$System_Session_Language]?>
                                        </option>
                                        <? } ?>
                                      </select>
                                        <? if($inputOccupationID>0){?>
                                        <script language="javascript">
	document.myForm.inputOccupationID.value='<?=$inputOccupationID?>';
	                                    </script>
                                        <? }?></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">อาชีพอื่นๆ&nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"><input name="inputOccupation" type="text" class="input_left" id="inputOccupation" value="<?=$inputOccupation?>" size="40" maxlength="100"></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">ประเภทธุรกิจ&nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"><select name="inputBusinessTypeID" class="select" id="inputBusinessTypenD">
                                        <?
										  $sql = "SELECT * FROM ".$System_TableName_BusinessType." WHERE ".$System_TableName_BusinessType."_Status='Enable' ORDER BY ".$System_TableName_BusinessType."_ID";
										  $Query_BusinessType = mysql_query($sql);
										  ?>
                                        <? while ($Row_BusinessType = mysql_fetch_array($Query_BusinessType)) { ?>
                                        <option value="<?=$Row_BusinessType[$System_TableName_BusinessType."_ID"]?>">
                                        <?=$Row_BusinessType[$System_TableName_BusinessType."_Name".$System_Session_Language]?>
                                        </option>
                                        <? } ?>
                                      </select>
                                        <? if($inputBusinessTypeID>0){?>
                                        <script language="javascript">
	document.myForm.inputBusinessTypeID.value='<?=$inputBusinessTypeID?>';
	                                    </script>
                                        <? }?></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">ประเภทอื่นๆ&nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"><input name="inputBusinessType" type="text" class="input_left" id="inputBusinessType" value="<?=$inputBusinessType?>" size="40" maxlength="100"></td>
                                  </tr>
                                  <tr>
                                    <td height="22" align="right" class="table_col1">ตำแหน่ง&nbsp;&nbsp;</td>
                                    <td height="22" class="table_col2"><input name="inputPosition" type="text" class="input_left" id="inputPosition" value="<?=$inputPosition?>" size="40" maxlength="100"></td>
                                  </tr------------------->
                                  <!----------------tr>
                                    <td height="22" align="right" class="table_col1">&nbsp;</td>
                                    <td height="22" class="table_col2"><input name="inputAddress2" type="text" class="input_left" id="inputAddress2" value="<?=$inputAddress2?>" size="40" maxlength="100"></td>
                                  </tr------------------->
                                </table></td>
                              </tr>
                              <tr> 
                              <td><table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
                                  <tr align="right"> 
                                    <td height="30" colspan="4" align="center" class="table_footer"> 
                                      <table width="300" border="0" cellspacing="0" cellpadding="2">
                                        <tr align="center"> 
                                          <td> 
<script language="JavaScript" src="../../webengine/lib/checkemail.js"></script> 
<script language="JavaScript" type="text/JavaScript">
function isBlank(myObj) { if(myObj.value=='') { return true; } return false; }
function isNumber(myObj) { return !isNaN(myObj.value*1) }
function isEqual(myObj1,myObj2) {	if(myObj1.value==myObj2.value) { return true; }	return false;}
function verifySubmit() {
	with(document.myForm) {
		if(isBlank(inputname)) {alert("กรุณากรอกชื่อ");  inputname.focus(); return false; }
		if(isBlank(inputlname)) {alert("กรุณากรอกนามสกุล");  ame.focus(); return false; }
	}
	 document.myForm.submit();
}
</script>
										 <input name="btAdd2" type="button" class="button_80" id="btAdd2" value="Save" onClick="verifySubmit();"> </td>
                                          <td> <input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="document.myReturnForm.submit();" value="Cancel"> </td>
                                        </tr>
                                      </table></td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table></td>
                      </tr>
                    </form>
                  </table>
                  <br>
                  <br>
                  <? 
#########################################################
} else if($action=="update") { 

	 $MaxID = $CheckBoxID1;
	 
	 if($inputhospital=="other") { 
	 $inputhospital="";  
	 $sqlho = "INSERT INTO hospital (Name) values ('$otherdetail')";
	 $queryho = mysql_query($sqlho);
	} 
	 
	$sql = "UPDATE mfu_mod_teacher SET prefix='$inputprefix',name='$inputname',lname='$inputlname',exptnm='$inputexpert',dspnm='$inputfaculty',dspnm2='$inputfaculty2',dspnm3='$inputfaculty3',dspnm4='$inputfaculty4',posnmfull='$inputposition',email='$inputemail',hptnm='$inputhospital$otherdetail',telephone='$inputtel',history='$inputhistory',historytrain='$inputhistorytrain',Choose='$inputchoose',lastupdate=Now()"."  WHERE Id='$MaxID'";

	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
		
$myrand = rand(1111,9999);
	$exts = explode(".", $_FILES['inputMap']['name']);
	$ext = strtolower(($exts[count($exts) - 1]));	
	$ImageType = $ext;

	if(copy($_FILES["inputMap"]["tmp_name"],"../../upload/member/$MaxID-$myrand.$ImageType")) 
	{ 
	$inputmap=$_FILES["inputMap"]["name"];
	$picmap = "$MaxID-$myrand.$ImageType";
	
    	  $sql="update mfu_mod_teacher set picture='$picmap' where Id='$MaxID'";
		 
		$query=mysql_query($sql);
	}  
	
$conn=":";
$tf1=$inputTimeFromHH.$conn.$inputTimeFromMM;
$tt1=$inputTimeToHH.$conn.$inputTimeToMM;

$tf2=$inputTimeFromHH2.$conn.$inputTimeFromMM2;
$tt2=$inputTimeToHH2.$conn.$inputTimeToMM2;

$tf3=$inputTimeFromHH3.$conn.$inputTimeFromMM3;
$tt3=$inputTimeToHH3.$conn.$inputTimeToMM3;

$tf4=$inputTimeFromHH4.$conn.$inputTimeFromMM4;
$tt4=$inputTimeToHH4.$conn.$inputTimeToMM4;

$tf5=$inputTimeFromHH5.$conn.$inputTimeFromMM5;
$tt5=$inputTimeToHH5.$conn.$inputTimeToMM5;

$tf6=$inputTimeFromHH6.$conn.$inputTimeFromMM6;
$tt6=$inputTimeToHH6.$conn.$inputTimeToMM6;

$tf7=$inputTimeFromHH7.$conn.$inputTimeFromMM7;
$tt7=$inputTimeToHH7.$conn.$inputTimeToMM7;

$tf8=$inputTimeFromHH5.$conn.$inputTimeFromMM5;
$tt8=$inputTimeToHH8.$conn.$inputTimeToMM8;

$tf9=$inputTimeFromHH9.$conn.$inputTimeFromMM9;
$tt9=$inputTimeToHH9.$conn.$inputTimeToMM9;

$tf10=$inputTimeFromHH10.$conn.$inputTimeFromMM10;
$tt10=$inputTimeToHH10.$conn.$inputTimeToMM10;


$sqlcc1="select * from history where idteacher='$MaxID' and orderi='1'";
$querycc1=mysql_query($sqlcc1);
$numcc1=mysql_num_rows($querycc1);

$sqlcc2="select * from history where idteacher='$MaxID' and orderi='2'";
$querycc2=mysql_query($sqlcc2);
$numcc2=mysql_num_rows($querycc2);

$sqlcc3="select * from history where idteacher='$MaxID' and orderi='3'";
$querycc3=mysql_query($sqlcc3);
$numcc3=mysql_num_rows($querycc3);

$sqlcc4="select * from history where idteacher='$MaxID' and orderi='4'";
$querycc4=mysql_query($sqlcc4);
$numcc4=mysql_num_rows($querycc4);

$sqlcc5="select * from history where idteacher='$MaxID' and orderi='5'";
$querycc5=mysql_query($sqlcc5);
$numcc5=mysql_num_rows($querycc5);

$sqlcc6="select * from history where idteacher='$MaxID' and orderi='6'";
$querycc6=mysql_query($sqlcc6);
$numcc6=mysql_num_rows($querycc6);

$sqlcc7="select * from history where idteacher='$MaxID' and orderi='7'";
$querycc7=mysql_query($sqlcc7);
$numcc7=mysql_num_rows($querycc7);

$sqlcc8="select * from history where idteacher='$MaxID' and orderi='8'";
$querycc8=mysql_query($sqlcc8);
$numcc8=mysql_num_rows($querycc8);

$sqlcc9="select * from history where idteacher='$MaxID' and orderi='9'";
$querycc9=mysql_query($sqlcc9);
$numcc9=mysql_num_rows($querycc9);

$sqlcc10="select * from history where idteacher='$MaxID' and orderi='10'";
$querycc10=mysql_query($sqlcc10);
$numcc10=mysql_num_rows($querycc10);


if($nameh1!=""&&$numcc1=="1"){
	 	  $sql = "update history set name='$nameh1',datefrom='$inputMod_Calendar_DateFrom',dateto='$inputMod_Calendar_DateTo',timefrom='$tf1',timeto='$tt1',place='$placeh1',organize='$orgh1',createby='$System_Session_User_ID'     where idteacher='$MaxID' and orderi='1'";
		$query=mysql_query($sql);
}	 	
if($nameh1!=""&&$numcc1=="0"){
	 	  $sql = "INSERT INTO history (name,datefrom,dateto,timefrom,timeto,place,organize,createby,idteacher,orderi) values ('$nameh1','$inputMod_Calendar_DateFrom','$inputMod_Calendar_DateTo','$tf1','$tt1','$placeh1','$orgh1','$System_Session_User_ID','$MaxID','1')";
		$query=mysql_query($sql);
}
if($nameh2!=""&&$numcc2=="1"){
	 	  $sql = "update history set name='$nameh2',datefrom='$inputMod_Calendar_DateFrom2',dateto='$inputMod_Calendar_DateTo2',timefrom='$tf2',timeto='$tt2',place='$placeh2',organize='$orgh2',createby='$System_Session_User_ID'     where idteacher='$MaxID' and orderi='2'";
		$query=mysql_query($sql);
}
if($nameh2!=""&&$numcc2=="0"){
		$sql = "INSERT INTO history (name,datefrom,dateto,timefrom,timeto,place,organize,createby,idteacher,orderi) values ('$nameh2','$inputMod_Calendar_DateFrom2','$inputMod_Calendar_DateTo2','$tf2','$tt2','$placeh2','$orgh2','$System_Session_User_ID','$MaxID','2')";
		$query=mysql_query($sql);
}
if($nameh3!=""&&$numcc3=="1"){		
	 	  $sql = "update history set name='$nameh3',datefrom='$inputMod_Calendar_DateFrom3',dateto='$inputMod_Calendar_DateTo3',timefrom='$tf3',timeto='$tt3',place='$placeh3',organize='$orgh3',createby='$System_Session_User_ID'     where idteacher='$MaxID' and orderi='3'";
		$query=mysql_query($sql);	 	
}
if($nameh3!=""&&$numcc3=="0"){
		$sql = "INSERT INTO history (name,datefrom,dateto,timefrom,timeto,place,organize,createby,idteacher,orderi) values ('$nameh3','$inputMod_Calendar_DateFrom3','$inputMod_Calendar_DateTo3','$tf3','$tt3','$placeh3','$orgh3','$System_Session_User_ID','$MaxID','3')";
		$query=mysql_query($sql);	 	

}
if($nameh4!=""&&$numcc4=="1"){	
	 	  $sql = "update history set name='$nameh4',datefrom='$inputMod_Calendar_DateFrom4',dateto='$inputMod_Calendar_DateTo4',timefrom='$tf4',timeto='$tt4',place='$placeh4',organize='$orgh4',createby='$System_Session_User_ID'     where idteacher='$MaxID' and orderi='4'";
		$query=mysql_query($sql);	 	
}
if($nameh4!=""&&$numcc4=="0"){
		$sql = "INSERT INTO history (name,datefrom,dateto,timefrom,timeto,place,organize,createby,idteacher,orderi) values ('$nameh4','$inputMod_Calendar_DateFrom4','$inputMod_Calendar_DateTo4','$tf4','$tt4','$placeh4','$orgh4','$System_Session_User_ID','$MaxID','4')";
		$query=mysql_query($sql);	 	

}
if($nameh5!=""&&$numcc5=="1"){	
	 	  $sql = "update history set name='$nameh5',datefrom='$inputMod_Calendar_DateFrom5',dateto='$inputMod_Calendar_DateTo5',timefrom='$tf5',timeto='$tt5',place='$placeh5',organize='$orgh5',createby='$System_Session_User_ID'     where idteacher='$MaxID' and orderi='5'";
		$query=mysql_query($sql);	
}
if($nameh5!=""&&$numcc5=="0"){
		$sql = "INSERT INTO history (name,datefrom,dateto,timefrom,timeto,place,organize,createby,idteacher,orderi) values ('$nameh5','$inputMod_Calendar_DateFrom5','$inputMod_Calendar_DateTo5','$tf5','$tt5','$placeh5','$orgh5','$System_Session_User_ID','$MaxID','5')";
		$query=mysql_query($sql);	

}
if($nameh6!=""&&$numcc6=="1"){	
	 	  $sql = "update history set name='$nameh6',datefrom='$inputMod_Calendar_DateFrom6',dateto='$inputMod_Calendar_DateTo6',timefrom='$tf6',timeto='$tt6',place='$placeh6',organize='$orgh6',createby='$System_Session_User_ID'     where idteacher='$MaxID' and orderi='6'";
		$query=mysql_query($sql);	
}
if($nameh6!=""&&$numcc6=="0"){
		$sql = "INSERT INTO history (name,datefrom,dateto,timefrom,timeto,place,organize,createby,idteacher,orderi) values ('$nameh6','$inputMod_Calendar_DateFrom6','$inputMod_Calendar_DateTo6','$tf6','$tt6','$placeh6','$orgh6','$System_Session_User_ID','$MaxID','6')";
		$query=mysql_query($sql);	

}

if($nameh7!=""&&$numcc7=="1"){	
	 	  $sql = "update history set name='$nameh7',datefrom='$inputMod_Calendar_DateFrom7',dateto='$inputMod_Calendar_DateTo7',timefrom='$tf7',timeto='$tt7',place='$placeh7',organize='$orgh7',createby='$System_Session_User_ID'     where idteacher='$MaxID' and orderi='7'";
		$query=mysql_query($sql);	
}
if($nameh7!=""&&$numcc7=="0"){
		$sql = "INSERT INTO history (name,datefrom,dateto,timefrom,timeto,place,organize,createby,idteacher,orderi) values ('$nameh7','$inputMod_Calendar_DateFrom7','$inputMod_Calendar_DateTo7','$tf7','$tt7','$placeh7','$orgh7','$System_Session_User_ID','$MaxID','7')";
		$query=mysql_query($sql);	

}
if($nameh8!=""&&$numcc8=="1"){	
	 	  $sql = "update history set name='$nameh8',datefrom='$inputMod_Calendar_DateFrom8',dateto='$inputMod_Calendar_DateTo8',timefrom='$tf8',timeto='$tt8',place='$placeh8',organize='$orgh8',createby='$System_Session_User_ID'     where idteacher='$MaxID' and orderi='8'";
		$query=mysql_query($sql);	
}
if($nameh8!=""&&$numcc8=="0"){
		$sql = "INSERT INTO history (name,datefrom,dateto,timefrom,timeto,place,organize,createby,idteacher,orderi) values ('$nameh8','$inputMod_Calendar_DateFrom8','$inputMod_Calendar_DateTo8','$tf8','$tt8','$placeh8','$orgh8','$System_Session_User_ID','$MaxID','8')";
		$query=mysql_query($sql);	

}
if($nameh9!=""&&$numcc9=="1"){	
	 	  $sql = "update history set name='$nameh9',datefrom='$inputMod_Calendar_DateFrom9',dateto='$inputMod_Calendar_DateTo9',timefrom='$tf9',timeto='$tt9',place='$placeh9',organize='$orgh9',createby='$System_Session_User_ID'     where idteacher='$MaxID' and orderi='9'";
		$query=mysql_query($sql);	
}
if($nameh9!=""&&$numcc9=="0"){
		$sql = "INSERT INTO history (name,datefrom,dateto,timefrom,timeto,place,organize,createby,idteacher,orderi) values ('$nameh9','$inputMod_Calendar_DateFrom9','$inputMod_Calendar_DateTo9','$tf9','$tt9','$placeh9','$orgh9','$System_Session_User_ID','$MaxID','9')";
		$query=mysql_query($sql);	

}
if($nameh10!=""&&$numcc10=="1"){	
	 	  $sql = "update history set name='$nameh10',datefrom='$inputMod_Calendar_DateFrom10',dateto='$inputMod_Calendar_DateTo10',timefrom='$tf10',timeto='$tt10',place='$placeh10',organize='$orgh10',createby='$System_Session_User_ID'     where idteacher='$MaxID' and orderi='10'";
		$query=mysql_query($sql);	
}
if($nameh10!=""&&$numcc10=="0"){
		$sql = "INSERT INTO history (name,datefrom,dateto,timefrom,timeto,place,organize,createby,idteacher,orderi) values ('$nameh10','$inputMod_Calendar_DateFrom10','$inputMod_Calendar_DateTo10','$tf10','$tt10','$placeh10','$orgh10','$System_Session_User_ID','$MaxID','10')";
		$query=mysql_query($sql);	

}

if($delhis1=="1"){
	 	 $sql = "delete from history where idteacher='$MaxID' and orderi='1'";
		$query=mysql_query($sql);
}
if($delhis2=="1"){
	 	$sql = "delete from history where idteacher='$MaxID' and orderi='2'";
		$query=mysql_query($sql);
}
if($delhis3=="1"){
	 	$sql = "delete from history where idteacher='$MaxID' and orderi='3'";
		$query=mysql_query($sql);
}
if($delhis4=="1"){
	 	$sql = "delete from history where idteacher='$MaxID' and orderi='4'";
		$query=mysql_query($sql);
}
if($delhis5=="1"){
	 	$sql = "delete from history where idteacher='$MaxID' and orderi='5'";
		$query=mysql_query($sql);
}
if($delhis6=="1"){
	 	$sql = "delete from history where idteacher='$MaxID' and orderi='6'";
		$query=mysql_query($sql);
}
if($delhis7=="1"){
	 	$sql = "delete from history where idteacher='$MaxID' and orderi='7'";
		$query=mysql_query($sql);
}
if($delhis8=="1"){
	 	$sql = "delete from history where idteacher='$MaxID' and orderi='8'";
		$query=mysql_query($sql);
}
if($delhis9=="1"){
	 	$sql = "delete from history where idteacher='$MaxID' and orderi='9'";
		$query=mysql_query($sql);
}
if($delhis10=="1"){
	 	$sql = "delete from history where idteacher='$MaxID' and orderi='10'";
		$query=mysql_query($sql);
}

				//$sql = "UPDATE ".$myModule_Table." SET ".$myModule_Table."_ThumbnailPhoto='$ThumbnailPictureName' WHERE ".$myModule_Table."_ID=".$MaxID;
				//$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
		//	}
		//}
	//}
	?>
                  <form action="?" 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="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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
					<input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
                  </form>
                  <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
                  <? 
#########################################################
} else if($action=="delete") { 
	for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			
			$sql = "DELETE FROM ".$myModule_Table." WHERE Id=".$$myVar;
			$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
			
			
			}

	}
?>
                  <form action="?" 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="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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
					<input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
                  </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_Table." SET ". $myModule_Table."_Status='$SelectStatus' WHERE ". $myModule_Table."_ID=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
?>
                  <form action="?" 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="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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
					<input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
                  </form>
                  <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
                  <?
} else if($action=="setactivatestatus") { 
	$myCheckBoxID=0;
	for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID=$$myVar;
		}
	}
	$sql="UPDATE ".$myModule_Table." SET ". $myModule_Table."_Activate='$SelectStatus' WHERE ". $myModule_Table."_ID=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
?>
                  <form action="?" 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="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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
					<input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
                  </form>
                  <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
                  <?
} else if($action=="setmembertypestatus") { 
	$myCheckBoxID=0;
	for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID=$$myVar;
		}
	}
	
?>
                  <form action="?" 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="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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
					<input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
                  </form>
                  <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
                  <? 
#########################################################
} else if($action=="setrecommendstatus") { 
	$myCheckBoxID=0;
	for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID=$$myVar;
		}
	}
	$sql="UPDATE ".$myModule_Table." SET ". $myModule_Table."_RecommendStatus='$SelectStatus' WHERE ". $myModule_Table."_ID=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
?>
                  <form action="?" 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="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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
					<input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
                  </form>
                  <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>

                  <?
} else if($action=="export_data") { 
		
		//$export_string = gen_exportstring($System_DataBase_Name,$myModule_Table," ORDER BY ".$myModule_Table."_ID ASC LIMIT 0,2000");
		
		$max_record = 2000;
		$sql = "SELECT Count(*) FROM ".$myModule_Table;
		$Query = mysql_query($sql);
		$Row = mysql_fetch_row($Query);
		$file_count = ceil($Row[0]/$max_record);
		
		for ($i=1;$i<=$file_count;$i++) {
			$export_string[$i] = gen_exportstring($System_DataBase_Name,$myModule_Table," ORDER BY ".$myModule_Table."_ID ASC LIMIT ".($max_record*($i-1)).",".$max_record);
		}
		
		
		//$export_string = str_replace("/n","",$export_string);
		//$export_string = str_replace("/r","",$export_string);
		//$export_string = nl2br($export_string);
		//$export_string = addslashes($export_string);
		//$export_string = str_replace("<br>","",$export_string);
		/*
		$export_string = nl2br($export_string);
		$export_string = str_replace("<br>","",$export_string);
		*/
		//$export_string = str_replace("<br>","<newline>",$export_string);
?>
			      <table width="50%" border="0" cellpadding="0" cellspacing="0">
					  <? for ($i=1;$i<=count($export_string);$i++) { ?>
					  <form action="../system/exportdata.php" method="post" name="myExportForm<?=$i?>" id="myExportForm<?=$i?>">
						<input name="export_string" type="hidden" id="export_string" value='<?=$export_string[$i]?>'>
					  </form>
					  <? } ?>
					  <form action="?" 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="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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
						<input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
                      <tr> 
                        <td  bgcolor="#FFFFFF" class="table_col2"> <table width="100%" border="0" cellpadding="2" cellspacing="1">
                            <tr> 
                              <td height="24" colspan="2" align="center" class="menu_table_header">Export 
                                <?=getMenuName($SystemMenuID)?> Data                              </td>
                            </tr>
                          </table>
						<table width="100%" border="0"  cellpadding="0" cellspacing="1">
                              <tr> 
                                <td> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="table_col3">
                                  <tr>
                                    <td width="100%" height="70" align="center" class="table_col3">finished export data<br>
                                      please click &quot;Export&quot; button<br>
                                      for download data </td>
                                  </tr>
                                </table></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_footer"> 
                                <table width="300" border="0" cellspacing="0" cellpadding="2">
                                  <tr align="center"> 
                                  <td>
								  <? for ($i=1;$i<=count($export_string);$i++) { ?>
								  <input name="btExport" type="button" class="button_80" id="btExport" onClick="document.myExportForm<?=$i?>.submit()" value="Export <?=$i?>">
								  <? } ?>
&nbsp;&nbsp;<input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="document.myForm.submit()" value="Back"> </td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table></td>
                      </tr>
                    </form>
                  </table>
			      <strong><br>
                  <?
} 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); }
# Count total record size #########################
$sql = "SELECT * FROM ".$myModule_Table;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("<br><br><b><font color=#FF0000>ไม่สามารถใช้งานระบบได้<br>หากคุณเข้าใช้งานเป็นครั้งแรก<br><a href=\"#\" onClick=\"Popup('popupCreateDatabaseWindow','createdatabase.php',220,180,1);\">กรุณาคลิ๊กที่นี่</a><br>เพื่อทำการสร้างฐานข้อมูลใหม่</font></b>\n");

$sql = "SELECT * FROM ".$myModule_Table." where 1";

if($PageSearch!="") {
	$sql .= " AND ".$PageSearchInField." LIKE '%".$PageSearch."%'";

}

$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$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 Id $ASCDESC ";
$sql.=" LIMIT $RecordStart , $PageSize";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$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>
                  </strong>
			      <div id="divMemberType" style="display:none; position:absolute; top:-115px; left:180px; width: 200px; z-index: 1;Filter:Alpha(opacity=95)"> 
                    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="table_border">
                      <form action="?" method="post" name="myMemberTypeForm" id="myMemberTypeForm">
                        <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('divMemberType').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 width="26" height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="normal" checked></td>
                                <td height="22" class="text_bold">ลูกค้าทั่วไป</td>
                              </tr>
                              <tr> 
                                <td width="26" height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="adsl"></td>
                                <td height="22" class="text_bold">ลูกค้า TOT</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.myMemberTypeForm.toolbarStatus[0].checked) {
	document.myForm.SelectStatus.value=document.myMemberTypeForm.toolbarStatus[0].value;
}
if(document.myMemberTypeForm.toolbarStatus[1].checked) {
	document.myForm.SelectStatus.value=document.myMemberTypeForm.toolbarStatus[1].value;
}
document.myForm.action.value='setmembertypestatus';
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('divMemberType').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>
                  <div id="divActivate" style="display:none; position:absolute; top:-115px; left:180px; width: 200px; z-index: 1;Filter:Alpha(opacity=95)"> 
                    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="table_border">
                      <form action="?" method="post" name="myActivateForm" id="myActivateForm">
                        <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('divActivate').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 width="26" height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="0" checked></td>
                                <td height="22" class="text_bold">Not</td>
                              </tr>
                              <tr> 
                                <td width="26" height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="1"></td>
                                <td height="22" class="text_bold">Activate</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.myActivateForm.toolbarStatus[0].checked) {
	document.myForm.SelectStatus.value=document.myActivateForm.toolbarStatus[0].value;
}
if(document.myActivateForm.toolbarStatus[1].checked) {
	document.myForm.SelectStatus.value=document.myActivateForm.toolbarStatus[1].value;
}
document.myForm.action.value='setactivatestatus';
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('divActivate').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>
                  <div id="divDataPicker" style="display:none; position:absolute; top:-115px; left:180px; width: 200px; z-index: 1;Filter:Alpha(opacity=95)"> 
                    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="table_border">
                      <form action="?" method="post" name="myStatusForm" id="myStatusForm">
                        <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 width="26" height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="Enable" checked></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>
                    <div id="divRecommend" style="display:none; position:absolute; top:-115px; left:180px; width: 200px; z-index: 1;Filter:Alpha(opacity=95)"> 
                    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="table_border">
                      <form action="?" method="post" name="myRecommendForm" id="myRecommendForm">
                        <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 width="26" height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="Yes" ></td>
                                <td height="22" class="text_bold">Yes</td>
                              </tr>
                              <tr> 
                                <td width="26" height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="No" checked></td>
                                <td height="22" class="text_bold">No</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.myRecommendForm.toolbarStatus[0].checked) {
	document.myForm.SelectStatus.value=document.myRecommendForm.toolbarStatus[0].value;
}
if(document.myRecommendForm.toolbarStatus[1].checked) {
	document.myForm.SelectStatus.value=document.myRecommendForm.toolbarStatus[1].value;
}
document.myForm.action.value='setrecommendstatus';
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('divRecommend').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>
                  <br>
                  <br>
                  <strong>จำนวนประวัติการเข้าอบรมตาม พ.ศ.</strong><br>
                  <br>
                  <table width="90%" border="0" cellpadding="0" cellspacing="1" class="table_border">
                    <tr> 
                      <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="2" cellspacing="1">
                          <form action="?" 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="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="PageSearchInField" type="hidden" id="PageSearchInField" value="<?=$PageSearchInField?>">
							<input name="inputAge" type="hidden" id="inputAge" value="<?=$inputAge?>">
							<input name="inputMonth" type="hidden" id="inputMonth" value="<?=$inputMonth?>">
							<input name="inputGender" type="hidden" id="inputGender" value="<?=$inputGender?>">
							<input name="inputInterrest" type="hidden" id="inputInterrest" value="<?=$inputInterrest?>">
							<input name="inputSalary" type="hidden" id="inputSalary" value="<?=$inputSalary?>">
							<input name="inputDegree" type="hidden" id="inputDegree" value="<?=$inputDegree?>">
                            <input name="SelectStatus" type="hidden" id="SelectStatus">
							<input name="MemberType" type="hidden" id="MemberType" value="<?=$MemberType?>">
							<input name="SpecialType" type="hidden" id="SpecialType" value="<?=$SpecialType?>">
                            <tr align="center" class="menu_table_header"> 
                              <!---td width="30" height="24" align="center" style="display:none "> 
                              <? 
$myOrderBy = $myModule_Table."_ID";
if($OrderBy==$myOrderBy) { 
	if($ASCDESC=="DESC") { ?>
                                  <img src="../images/controlpage/desc_order.gif" width="7" height="7"> 
                                  <? }
	if($ASCDESC=="ASC") { ?>
                                  <img src="../images/controlpage/asc_order.gif" width="7" height="7"> 
                                  <? }
} 
?>
                                  <a href="#" class="link_headbar" onClick="
with(document.myForm) { 
	<? if($OrderBy==$myOrderBy) { echo "action.value='switchorder';\n"; } ?>
	OrderBy.value='<?=$myOrderBy?>';
	submit(); 
}
					">ID</a></td------>
                              <td width="69" height="24"><div align="center">รูปภาพ</div></td>
                              <td width="81">ชื่อ-นามสกุล<a href="#" class="link_headbar" onClick="
with(document.myForm) { 
	<? if($OrderBy==$myOrderBy) { echo "action.value='switchorder';\n"; } ?>
	OrderBy.value='<?=$myOrderBy?>';
	submit(); 
}
					"></a></td>
                              <td width="77">2556</td>
                              <td width="70" height="24">2557</td>
                              <td width="74">2558</td>
                              <td width="65">2559</td>
                              <td width="73">2560</td>
                              <td width="76">2561</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);
?>							
                             <tr class="<?=$myClassRow?>" onMouseOver="this.className='table_rowover'" onMouseOut="this.className='<?=$myClassRow?>'">  
                              <td height="30">
							  <? if($Row[picture]!=""){?>
							  <img src="../../upload/member/<?=$Row[picture]?>">
							  <? } ?>							  </td>
                              <td height="30"><a href="#" onClick="
Paging_CheckedThisItem( document.myForm.CheckBoxAll, <?=$index?>, 'CheckBoxID', document.myForm.TotalCheckBoxID.value );
document.myForm.action.value='view';
document.myForm.submit();"  class="link_submenu">
								<?=$Row[prefix]?><?=$Row[name]?>
                                &nbsp;&nbsp;
                                <?=$Row[lname]?>
                              </a>
							  <?  if($Row[Choose]!="0") { ?>
							    <br>
                              <? if($Row[Choose]=="1"){ echo"หัวหน้าภาควิชา";}if($Row[Choose]=="2"){ echo"รองหัวหน้าภาควิชา";}?><? } ?>
							  <br>
                              <?=$Row[posnmfull]?>
							  <br>
                              <?=$Row[dspnm]?>
                              <br>
                              <?=$Row[email]?><br>

                              <?=$Row[hptnm]?></td>
                              <td align="center">
                              <?
							  $sql56="select count(*) from history where idteacher='$Row[Id]' and datefrom like '%2013%'";
							  $query56=mysql_query($sql56);
							  $row56=mysql_fetch_array($query56);
							  echo $row56[0];
							  ?>
                              </td>  
                             <td width="70" height="30" align="center"> <?
							  $sql56="select count(*) from history where idteacher='$Row[Id]' and datefrom like '%2014%'";
							  $query56=mysql_query($sql56);
							  $row56=mysql_fetch_array($query56);
							  echo $row56[0];
							  ?></td>
                             <td width="74" height="30" align="center"> <?
							  $sql56="select count(*) from history where idteacher='$Row[Id]' and datefrom like '%2015%'";
							  $query56=mysql_query($sql56);
							  $row56=mysql_fetch_array($query56);
							  echo $row56[0];
							  ?></td>
                             <td width="65" height="30" align="center"> <?
							  $sql56="select count(*) from history where idteacher='$Row[Id]' and datefrom like '%2016%'";
							  $query56=mysql_query($sql56);
							  $row56=mysql_fetch_array($query56);
							  echo $row56[0];
							  ?></td>
                             <td width="73" height="30" align="center"> <?
							  $sql56="select count(*) from history where idteacher='$Row[Id]' and datefrom like '%2017%'";
							  $query56=mysql_query($sql56);
							  $row56=mysql_fetch_array($query56);
							  echo $row56[0];
							  ?></td>
                             <td width="76" height="30" align="center"> <?
							  $sql56="select count(*) from history where idteacher='$Row[Id]' and datefrom like '%2018%'";
							  $query56=mysql_query($sql56);
							  $row56=mysql_fetch_array($query56);
							  echo $row56[0];
							  ?></td>
                            </tr>
	<?
		$index++;
	}
} else {  ?>
                        <tr class="table_row1"> 
                          <td height="80" colspan="11" align="center">Data not 
                            found!</td>
                        </tr>
 <? } ?>						
                            <input name="TotalCheckBoxID" type="hidden" id="TotalCheckBoxID" value="<?=$index-1?>">
                          </form>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br>
                  <? 
}
#########################################################
?>
                   
                  <title>Web Engine : 
<?=$System_Variable_Title?>
                  </title>
            <? }  else { echo "&nbsp;&nbsp;&nbsp;"; } ?>		</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="#A13626"><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="3" align="center" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
    <td height="3" align="center" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
    <td width="4" height="3" align="center" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
  </tr>
  <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