Hacked By AnonymousFox

Current Path : C:/AppServ/www/new_msd1/webengine/system/
Upload File :
Current File : C:/AppServ/www/new_msd1/webengine/system/index_school.php

<? 
include("../lib/session.php"); 
include("../lib/config.php");
include("../lib/connect.php");
include("../lib/function.php");
?>
<html><!-- InstanceBegin template="/Templates/_WebEngine-Adminpanel.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Web Engine : 
<?=$System_Variable_Title?>
</title>
<!-- InstanceEndEditable --> 
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<link href="../css/mystyle.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #8F5E1A}
.style2 {color: #774E15}
-->
</style>
</head>

<body background="../../images/bg.gif"  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">  
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td background="../../images/bg_menu.jpg"><table width="99%" border="0" cellpadding="0" cellspacing="0">
              <tr style="display:none ">
                <td><table width="95%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td bgcolor="#00FFFF">ffffffffffff</td>
                    <td>ffffffffffff</td>
                    <td>ffffffffffff</td>
                    <td>ffffffffffff</td>
                    <td>ffffffffffff</td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td height="0" bgcolor="#174D13">&nbsp;</td>
              </tr>
            </table></td>
            <td width="11" background="../../images/r_menu.jpg"><p>&nbsp;</p>
            <p>&nbsp;</p></td>
          </tr>
          <tr>
            <td valign="top" bgcolor="#EEEFE6"><table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td>
					
                      <table   width=100% border=0 cellpadding=1 cellspacing=0 class=defaults id="content">
					   
                        <tr valign="top" >
                          <td vAlign=center bgColor=#22711C height=1><strong></strong></td>
                          <td align="center" valign="top" bgcolor="#22711C">                          <div align="right"><font color="#FFCC66"><strong><img src="../../images/icon/h1.gif" width="14" height="14" border="0" align="absmiddle">&nbsp;&nbsp;</strong></font><strong><font color="#FFFFFF">Welcome to SIPA Administrator.&nbsp;&nbsp;&nbsp;</font></strong></div></td>
                        </tr>
                        <tr valign="top">
                          <td width="196" align="center" bgcolor="#A3E69D"> <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="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td height="22" align="center" bgcolor="#C8943C" class="menu_table_header">Administrator Login</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="80" align="center" valign="middle">
                                    <form name="myLoginForm" method="post" action="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 colspan="2"><font color="#990000"><strong>UserName</strong></font></td>
                                        </tr>
                                        <tr>
                                          <td width="10">&nbsp;</td>
                                          <td><input name="inputUserName" type="text" class="input_left" id="inputUserName3" size="15" maxlength="50"></td>
                                        </tr>
                                        <tr>
                                          <td colspan="2"><font color="#990000"><strong>Password</strong></font></td>
                                        </tr>
                                        <tr>
                                          <td width="10">&nbsp;</td>
                                          <td><input name="inputPassword" type="password" class="input_left" id="inputPassword" size="15" maxlength="50"></td>
                                        </tr>
                                        <tr>
                                          <td width="10">&nbsp;</td>
                                          <td align="right"><input name="Submit" type="submit" class="button_th_normal" value="LogIn"></td>
                                        </tr>
                                      </table>
                                    </form></td>
                                </tr>
                              </table>
                              <? } else { ?>
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <form action="../../template/?" method="post" name="myMenuForm" id="myMenuForm">
                                  <input type="hidden" name="SystemMenuID">
                                  <input type="hidden" name="SystemModuleKey">
                                </form>
                                <tr>
                                  <td height="22" align="center" class="menu_table_header">Main Menu</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='../home/home.php'; document.myMenuForm.submit();">
                                    <table width="100%" height="22" 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_shadow"><img src="../../images/blank.gif" width="1" height="1"></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='../system/module_management.php'; document.myMenuForm.submit();"><table width="100%" height="22" border="0" cellpadding="2" cellspacing="0" class="menu_table_text">
                                      <tr>
                                        <td width="22" align="center"><img src="../images/icon/ico509.gif" width="16" height="13"></td>
                                        <td>Menu Bulider</td>
                                      </tr>
                                  </table></td>
                                </tr>
                                <tr>
                                  <td height="1" class="menu_table_bg_shadow"><img src="../../images/blank.gif" width="1" height="1"></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='../system/user_information.php'; document.myMenuForm.submit();"><table width="100%" height="22" border="0" cellpadding="2" cellspacing="0" class="menu_table_text">
                                      <tr>
                                        <td width="22" align="center"><img src="../images/icon/ico559.gif" width="15" height="16"></td>
                                        <td>User Information</td>
                                      </tr>
                                  </table></td>
                                </tr>
                                <tr>
                                  <td height="1" class="menu_table_bg_shadow"><img src="../../images/blank.gif" width="1" height="1"></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.submit();"><table width="100%" height="22" border="0" cellpadding="2" cellspacing="0" class="menu_table_text">
                                      <tr>
                                        <td width="22" align="center"><img src="../images/icon/ico051.gif" width="13" height="19"></td>
                                        <td>Manage User Admin</td>
                                      </tr>
                                  </table></td>
                                </tr>
                                <tr>
                                  <td height="1" class="menu_table_bg_shadow"><img src="../../images/blank.gif" width="1" height="1"></td>
                                </tr>
                                <? } ?>
                                <!---------------------------------------------------------------------------->
                                <? if($System_Session_User_ID>0) { ?>
                                <?
$sql = "SELECT * FROM ".$System_TableName_Menu." 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);
		if( isUserOnMenu($System_Session_User_ID,$Row[$System_TableName_Menu."_ID"]) ) {
		?>
                                <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="
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="22" border="0" cellpadding="2" cellspacing="0" class="menu_table_text">
                                      <tr>
                                        <td width="22" align="center">
										<img src="<?=$Row[$System_TableName_Menu."_Icon"]?>"></td>
                                        <td>
                                          <?=$Row[$System_TableName_Menu."_Name"]?>
                                        </td>
                                      </tr>
                                  </table></td>
                                </tr>
                                <tr>
                                  <td height="1" class="menu_table_bg_shadow"><img src="../../images/blank.gif" width="1" height="1"></td>
                                </tr>
                                <? 
		}
		$index++;
	}
}
?>
                                <? } ?>
                                <!---------------------------------------------------------------------------->
                                <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="22" border="0" cellpadding="2" cellspacing="0" class="menu_table_text">
                                      <tr>
                                        <td width="22" align="center"><img src="../images/icon/ico569.gif" width="13" height="13"></td>
                                        <td>Logout</td>
                                      </tr>
                                  </table></td>
                                </tr>
                                <tr>
                                  <td height="1" class="menu_table_bg_shadow"><img src="../../images/blank.gif" width="1" height="1"></td>
                                </tr>
                              </table>
                              <? } ?>
                              <!--End Menu ----------------------------------------------------------------------------------->                              <p>&nbsp;</p>
                              <p>&nbsp;</p>
                              <p>&nbsp;</p>
                              <p>&nbsp;</p>
                              <p>&nbsp;</p>                              <p>&nbsp;</p>
                              <p>&nbsp;</p>
                              <p>&nbsp;</p>
                              <p>&nbsp;</p>
                              <p><br>
                                  <br>                          
                          </p></td>
                          
                        <td width="806" align="center" valign="top" bgcolor="#FFFFFF"> 
                          <? if(strlen($System_Session_User_ID)>0) { ?>
                          <!-- InstanceBeginEditable name="Programmable Region" --> 
                    <br>
                    <table width="98%" height="22" border="0" cellpadding="2" cellspacing="0" class="table_header">
                      <tr> 
                        <td width="30" align="center"><img src="<?=getMenuIcon($SystemMenuID)?>"></td>
                        <td>
                          <?=getMenuName($SystemMenuID)?>
                          &nbsp;</td>
                      </tr>
                    </table>
<table width="94%" border="0" cellpadding="0" cellspacing="0">
                      <tr> 
                        <td height="1" class="table_col3"><img src="../images/blank.gif" width="10" height="2"></td>
                      </tr>
      </table>					
                    <script language="JavaScript" src="../lib/popup.js" type="text/JavaScript"></script>
                    <br>
                    <? 
## Default Value ############################################
$SystemModule_defaultPageSize = 30;
$SystemModule_defaultPageShow = 1;
$SystemModule_MaxPage = 20;
$SystemModule_ReduceRange = 10; 		// +,- from current page show
$SystemModule_ASCDESC = "DESC";
$SystemModule_OrderBy = $System_TableName_School."_Order";


#########################################################
if ($action=="addnew") { 

		$sql = "SELECT Max(".$System_TableName_School."_Order) FROM ".$System_TableName_School." WHERE ".$System_TableName_School."_ModuleKey='$SystemModuleKey' AND ".$System_TableName_School."_Language='$System_Session_Language'  ";
		$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
		$Row=MYSQL_FETCH_ARRAY($Query);
		$MaxOrder = $Row[0]+1;
		
		if ($inputGroupID=="") $inputGroupID = 0;

		$sql = "INSERT INTO ".$System_TableName_School."(".
		$System_TableName_School."_ModuleKey,".
		$System_TableName_School."_Language,".
		$System_TableName_School."_Name,".
		$System_TableName_School."_Status,".
		$System_TableName_School."_Order".
		") VALUES ('$SystemModuleKey','$System_Session_Language','".trim($inputName)."','Enable',$MaxOrder)";
		$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="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                    </form>
                    <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
                    <? 
} 
?>
                    <? 
####################################################################
if($action=="add") { 
?>
                    <table width="98%" 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 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="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                      </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="addnew">
                        <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
                        <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
                        <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
                        <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
                        <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
						<input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                        <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 Character Data</td>
                        </tr>
                        <tr> 
                          <td height="26" colspan="2" class="table_col3">&nbsp;&nbsp;<img src="../images/bullet/box21.gif" width="11" height="11">&nbsp;Main 
                            Information </td>
                        </tr>
                        <tr> 
                          <td width="140" height="22" align="right" class="table_col1">Name&nbsp;</td>
                          <td height="22" class="table_col2"> <input name="inputName" type="text" class="input_left" id="inputName" size="50" maxlength="100"></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(inputName)) {	inputName.focus(); return false; }
	}
	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>
                    <br>
                    <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 ".$System_TableName_School." WHERE ".$System_TableName_School."_ID=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	$Row=MYSQL_FETCH_ARRAY($Query);
?>
                    <table width="98%" 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" >
                        <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="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                      </form>
					 <form action="?" method="post" name="myForm" id="myForm">
					  <input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
					  <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
					  <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
					  <input name="action" type="hidden" id="action" 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="CheckBoxID1" type="hidden" id="CheckBoxID1" value="<?=$myCheckBoxID?>">
					  <input name="TotalCheckBoxID" type="hidden" id="TotalCheckBoxID" value="1">
					  <input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                        <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">View 
                            Character Data</td>
                        </tr>
                        <tr> 
                          <td height="26" colspan="2" class="table_col3">&nbsp;&nbsp;<img src="../images/bullet/box21.gif" width="11" height="11">&nbsp;Main 
                            Information</td>
                        </tr>
                        <tr> 
                          <td width="140" height="22" align="right" class="table_col1">Name&nbsp;</td>
                          <td height="22" class="table_col2">&nbsp;<?=$Row[$System_TableName_School."_Name"]?></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> <input name="btEdit" type="submit" class="button_80" id="btEdit" value="Edit" onClick="
document.myForm.submit();
						"> </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>
                      </form>
                    </table>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <? 					
#########################################################
} else if ($action=="edit") { 
	$myCheckBoxID=0;
	for($i=1;$i<=$TotalCheckBoxID;$i++) {
		$myVar="CheckBoxID".$i;
		if(strlen($$myVar)>0) {
			$myCheckBoxID=$$myVar;
		}
	}
	$sql="SELECT * FROM ".$System_TableName_School." WHERE ".$System_TableName_School."_ID=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	$Row=MYSQL_FETCH_ARRAY($Query);
?>
                    <table width="98%" 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">
                        <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="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                      </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="update">
                        <input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
                        <input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
                        <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
                        <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
                        <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
                        <input name="CheckBoxID1" type="hidden" id="CheckBoxID1" value="<?=$myCheckBoxID?>">
						<input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                        <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">Edit 
                            Character Data</td>
                        </tr>
                        <tr> 
                          <td height="26" colspan="2" class="table_col3">&nbsp;&nbsp;<img src="../images/bullet/box21.gif" width="11" height="11"> 
                            &nbsp;Main Information</td>
                        </tr>
						<tr> 
                          <td width="140" height="22" align="right" class="table_col1">Name&nbsp;</td>
                          <td height="22" class="table_col2"> <input name="inputName" type="text" class="input_left" id="inputName" value="<?=$Row[$System_TableName_School."_Name"]?>" size="50" maxlength="100"></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(inputName)) {	inputName.focus(); return false; }
	}
	document.myForm.submit();
}
						</script> <input name="btSave" type="button" class="button_80" id="btSave" value="Save" 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>
                    <br>
                    <br>
                    <br>
                    <br>
                    <? 
#########################################################
} else if ($action=="update") { 
		if ($inputGroupID=="") $inputGroupID = 0;
		
		$MaxID = $CheckBoxID1;
		$sql = "UPDATE ".$System_TableName_School." SET ".
		$System_TableName_School."_Name='".trim($inputName)."',".
		$System_TableName_School."_CreateByID=".$System_Session_User_ID.",".
		$System_TableName_School."_CreateBy='".$System_Session_FullName."',".
		$System_TableName_School."_LastUpdate=Now()".
		"  WHERE ".$System_TableName_School."_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="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                    </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 ".$System_TableName_School." WHERE ".$System_TableName_School."_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="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                    </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 ".$System_TableName_School." SET ".$System_TableName_School."_Status='$SelectStatus' WHERE ".$System_TableName_School."_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="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                    </form>
                    <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
                    <? 
//########################################################
} else if ($action=="makeordering") { 
	$sql = "SELECT * FROM ".$System_TableName_School." WHERE ".$System_TableName_School."_GroupID=".$GroupID." ORDER BY ".$System_TableName_School."_Order DESC ";
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	$RecordCount=MYSQL_NUMROWS($Query);
?>
                    <table width="500" border="0" cellpadding="0" cellspacing="1" class="table_border">
                      <form action="?" method="post" name="myRedirectForm" id="myRedirectForm">
                      <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="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                      </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="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                        <tr> 
                          <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="mytable_inner">
                              <tr align="center"> 
                                
                          <td height="24" colspan="2" align="center" class="table_header">Make 
                            Ordering<span class="menu_table_header"> Character</span></td>
                              </tr>
                              <tr> 
                                <td width="100" align="right" valign="top" class="table_col1"><br>
                            Character List&nbsp;</td>
                                <td height="40" align="left" class="table_col2"> 
                                  <table height="60" border="0" cellpadding="2" cellspacing="0">
                                    <tr> 
                                      <td align="center"> <select name="listUser[]" size="15" multiple class="input_textarea" id="listUser" style="width:200">
                                          <?
if($RecordCount>0) {
	$index=1;
	while($index<$RecordCount+1) {
		$Row=MYSQL_FETCH_ARRAY($Query);
		echo "<option value=\"".$Row[$System_TableName_School."_ID"]."\">";
		if(strlen($Row[$System_TableName_School."_Name"])>20) {
			echo substr($Row[$System_TableName_School."_Name"],0,20);
		} else {
			echo $Row[$System_TableName_School."_Name"];
		}
		echo "</option>\n";
		$index++;
	}
}
?>
                                        </select> </td>
                                      <td valign="top"><table height="100%" border="0" cellpadding="1" cellspacing="0">
                                          <tr> 
                                            <td height="10"><input type="button"  class="button_100" id="RemoveUp" name="RemoveUp"  value="Move Up" onClick="funcMultipleMoveUp(document.myForm.elements['listUser[]'])"></td>
                                          </tr>
                                          <tr> 
                                            <td><script language="JavaScript" type="text/JavaScript">
function funcMultipleSelectAll(myListObj) {
	var Len = myListObj.options.length;
	if(Len>0) 
		for(var i=0;i<Len;i++)
		   myListObj.options[i].selected=true;
}
function funcMultipleMoveUp(myListObj) {
	var Len = myListObj.options.length;
	var tmpID,tmpValue;
	if(Len>0) 
		for(var i=1;i<Len;i++)
	    	if (myListObj.options[i]!=null && myListObj.options[i].selected==true) {
					if(!myListObj.options[i-1].selected) {
					   myListObj.options[i].selected=false;
					   tmpID = myListObj.options[i].value;
					   tmpValue = myListObj.options[i].text;
					   myListObj.options[i].value = myListObj.options[i-1].value;
					   myListObj.options[i].text = myListObj.options[i-1].text;
					   myListObj.options[i-1].value = tmpID;
					   myListObj.options[i-1].text = tmpValue;
					   myListObj.options[i-1].selected=true;
				}
			}
}
function funcMultipleMoveDown(myListObj) {
	var Len = myListObj.options.length;
	var tmpID,tmpValue;
	if(Len>0) 
		for(var i=Len-2;i>=0;i--)
	    	if (myListObj.options[i]!=null && myListObj.options[i].selected==true) {
					if(!myListObj.options[i+1].selected) {
					   myListObj.options[i].selected=false;
					   tmpID = myListObj.options[i].value;
					   tmpValue = myListObj.options[i].text;
					   myListObj.options[i].value = myListObj.options[i+1].value;
					   myListObj.options[i].text = myListObj.options[i+1].text;
					   myListObj.options[i+1].value = tmpID;
					   myListObj.options[i+1].text = tmpValue;
					   myListObj.options[i+1].selected=true;
				}
			}
}
								  </script> </td>
                                          </tr>
                                          <tr> 
                                            <td height="10"><input type="button"  class="button_100" id="MoveDown" name="MoveDown"  value="Move Down" onClick="funcMultipleMoveDown(document.myForm.elements['listUser[]'])"></td>
                                          </tr>
                                        </table></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> <input name="btSave" type="button" class="button_80" id="btSave" value="Save"  onClick="
if(confirm('Are you sure to save a change?')) {
	document.myForm.action.value='updateordering';
	funcMultipleSelectAll(document.myForm.elements['listUser[]']);
	document.myForm.submit();
}
						"> </td>
                                      <td> <input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="
if(confirm('Are you sure to return to list?')) {
	document.myRedirectForm.submit();
}
						" value="Cancel"> </td>
                                    </tr>
                                  </table></td>
                              </tr>
                            </table></td>
                        </tr>
                      </form>
                    </table>
                    <br>
                    <? 
//########################################################
} else if ($action=="updateordering") { 
$CountList=count($listUser);
$index=1;
if($listUser!="") {
	while (list ($key, $val) = each ($listUser)) {
		$valueOrder=($CountList-$index)+1;
		$sql="UPDATE ".$System_TableName_School." SET ".$System_TableName_School."_Order='$valueOrder' WHERE ".$System_TableName_School."_ID=".$val;
		$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
		$index++;
	}
}
?>
                    <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="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                    </form>
                    <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
              <?	
#########################################################
} else { ?>
              <?

# Check to set default value #########################
if($PageSize=="") { $PageSize = $SystemModule_defaultPageSize; }
if($PageShow=="") { $PageShow = $SystemModule_defaultPageShow; }
if($ASCDESC=="") { $ASCDESC = $SystemModule_ASCDESC; } 
if($OrderBy=="") { $OrderBy = $SystemModule_OrderBy; } 
if($action=="switchorder") { 
	if($ASCDESC=="ASC") { $ASCDESC = "DESC"; }  else { $ASCDESC="ASC"; } 
} 
if($PageSearch!="") { $PageSearch=trim($PageSearch); }

# Count total record size #########################

$sql = "SELECT * FROM ".$System_TableName_School." WHERE ".$System_TableName_School."_ModuleKey='$SystemModuleKey' AND ".$System_TableName_School."_Language='$System_Session_Language'  ";

if ($GroupID>0) {
	$sql .= " AND ".$System_TableName_School."_GroupID=".$GroupID;
}

if ($PageSearch<>"") {
	$sql .= " AND ( ".$System_TableName_School."_Name 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 $OrderBy $ASCDESC 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>
                    <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="170" 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>
                    <script language="JavaScript" type="text/JavaScript">
var StatusIndex=0;
function ShowDataPicker(myDivName,RefX,RefY) {
	document.getElementById(myDivName).style.display=''; 
	document.getElementById(myDivName).style.left = document.body.scrollLeft + window.event.clientX + RefX;
	document.getElementById(myDivName).style.top= document.body.scrollTop+ window.event.clientY + RefY;
}
	  </script>
                    
              <table width="95%" height="22" border="0" cellpadding="2" cellspacing="0">
                <form action="?" method="post" name="myHeaderButton" id="myHeaderButton" onSubmit="return false;">
                  <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
                  <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
                  <tr valign="bottom"> 
                    <td> <table border="0" cellspacing="0" cellpadding="2">
                        <tr> 
                          <td><input name="btAdd" type="button" class="button_80" id="btAdd" value="Add New" onClick="
document.myForm.action.value='add';
document.myForm.submit();
				"></td>
                          <td><input name="btView" type="button" class="button_60" id="btView" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==1) {
	document.myForm.action.value='view';
	document.myForm.submit();
} else {
	alert('Please checked 1 item to view this record.');
}
				  " value="View"></td>
                          <td><input name="btEdit" type="button" class="button_60" id="btEdit" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==1) {
	document.myForm.action.value='edit';
	document.myForm.submit();
} else {
	alert('Please checked 1 item to edit this record.');
}
				  " value="Edit"></td>
                          <td><input name="btDelete" type="button" class="button_60" id="btDelete" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)>0) {
	if(confirm('Are you sure to delete selected record?')) {
		document.myForm.action.value='delete';
		document.myForm.submit();
	}
} else {
	alert('Please checked 1 or more item to delete record.');
}
				  " value="Delete"></td>
                        </tr>
                      </table></td>
                  </tr>
                </form>
              </table>
                    <table width="98%" height="26" border="0" cellpadding="0" cellspacing="0" class="table_toolbar">
                      <form action="?" method="post" name="myToolbarForm" id="myToolbarForm" onSubmit="return false;">
                        <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
                        <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
                        <tr> 
                          <td width="5" align="left" valign="top"> <img src="../images/bgborder1w.gif" width="5" height="5"></td>
                          <td valign="bottom"> <table border="0" cellpadding="2" cellspacing="0" class="toolbar">
                              <tr> 
                                <td width="10">&nbsp;</td>
                                <td>Page</td>
                                <td> 
                                  <? 
				  if($NoOfPage>1) { 
				  ?>
                                  <select name="toolbarPageShow" class="select" onChange="document.myForm.PageShow.value=this.value; document.myForm.submit(); ">
                                    <? 
if($NoOfPage<$SystemModule_MaxPage) {
	// Show page list #########################
	for($i=1;$i<=$NoOfPage;$i++) { 
		echo "<option value=\"$i\"";
		if($i==$PageShow) { echo " selected"; }
		echo ">$i</option>";
	} 
}  else {
	// # If total page count greater than default max page  value then reduce page select size #########################
	$starti = $PageShow-$SystemModule_ReduceRange;
	if($starti<1) { $starti=1; }
	$endi = $PageShow+$SystemModule_ReduceRange;
	if($endi>$NoOfPage) { $endi=$NoOfPage; }
	//#####################
	for($i=$starti ;$i<=$endi;$i++) { 
		echo "<option value=\"$i\"";
		if($i==$PageShow) { echo " selected"; }
		echo ">$i</option>";
	} 
}
?>
                                  </select> 
                                  <? 
 } else { 
	echo "1";
 }
 ?>
                                </td>
                                <td>of 
                                  <?=$NoOfPage?>
                                </td>
                                <td width="10">&nbsp;</td>
                                <td>Page size</td>
                                <td> <input name="toolbarPageSize" type="text" class="input_center" id="toolbarPageSize" value="<?=$PageSize?>" size="3" maxlength="3"></td>
                                <td> <input name="btChangePageSize" type="button" class="button_normal" id="btChangePageSize" value=" Go " onClick="
if(isNaN(document.myToolbarForm.toolbarPageSize.value*1)) {
	document.myToolbarForm.toolbarPageSize.value='<?=$PageSize?>';
	document.myToolbarForm.toolbarPageSize.focus();
	return false;
}
if(document.myToolbarForm.toolbarPageSize.value<=0) {
	document.myToolbarForm.toolbarPageSize.value='<?=$PageSize?>';
	document.myToolbarForm.toolbarPageSize.focus();
	return false;
}
document.myForm.PageSize.value=document.myToolbarForm.toolbarPageSize.value; 
document.myForm.submit(); 
				  "> </td>
                              </tr>
                            </table></td>
                          <td align="right" valign="bottom"> <table border="0" cellpadding="0" cellspacing="0">
                              <tr> 
                                <td>Found 
                                  <?=$TotalRecordCount?>
                                  record</td>
                                <td width="10">&nbsp;</td>
                                <? if($PageShow>1) { ?>
                                <td width="21" align="center"> <img src="../images/controlpage/playset_start.gif" width="21" height="21" 
				  onMouseOver="this.src='../images/controlpage/playset_start_active.gif'; this.style.cursor='hand';" 
				  onMouseOut="this.src='../images/controlpage/playset_start.gif';" 
				  onClick="document.myForm.PageShow.value=1; document.myForm.submit();"></td>
                                <? } else { ?>
                                <td width="21" align="center"><img src="../images/controlpage/playset_start_disable.gif" width="21" height="21"></td>
                                <? } ?>
                                <? if($PageShow>1) { ?>
                                <td width="21" align="center"> <img src="../images/controlpage/playset_backward.gif" width="21" height="21" 
				  onMouseOver="this.src='../images/controlpage/playset_backward_active.gif'; this.style.cursor='hand';" 
				  onMouseOut="this.src='../images/controlpage/playset_backward.gif';" 
				  onClick="document.myForm.PageShow.value--; document.myForm.submit();"></td>
                                <? } else { ?>
                                <td width="21" align="center"><img src="../images/controlpage/playset_backward_disable.gif" width="21" height="21"></td>
                                <? } ?>
                                <td width="21" align="center"> <img src="../images/controlpage/playset_stop.gif" width="21" height="21" 
				  onMouseOver="this.src='../images/controlpage/playset_stop_active.gif'; this.style.cursor='hand';" 
				  onMouseOut="this.src='../images/controlpage/playset_stop.gif';" 
				  onClick="
					with(document.myForm) {
						PageShow.value='';
						PageSize.value='';
						ASCDESC.value='';
						OrderBy.value='';
						PageSearch.value='';
						submit();
					}
					"></td>
                                <? if($PageShow<$NoOfPage) { ?>
                                <td width="21" align="center"> <img src="../images/controlpage/playset_forward.gif" width="21" height="21" 
				  onMouseOver="this.src='../images/controlpage/playset_forward_active.gif'; this.style.cursor='hand';" 
				  onMouseOut="this.src='../images/controlpage/playset_forward.gif';" 
				  onClick="document.myForm.PageShow.value++; document.myForm.submit();"></td>
                                <? } else { ?>
                                <td width="10" align="center"><img src="../images/controlpage/playset_forward_disable.gif" width="21" height="21"></td>
                                <? } ?>
                                <? if($PageShow<$NoOfPage) { ?>
                                <td width="10" align="center"><img src="../images/controlpage/playset_end.gif" width="21" height="21" 
				  onMouseOver="this.src='../images/controlpage/playset_end_active.gif'; this.style.cursor='hand';" 
				  onMouseOut="this.src='../images/controlpage/playset_end.gif';" 
				  onClick="document.myForm.PageShow.value='<?=$NoOfPage?>'; document.myForm.submit();"></td>
                                <? } else { ?>
                                <td width="10" align="center"><img src="../images/controlpage/playset_end_disable.gif" width="21" height="21"></td>
                                <? } ?>
                              </tr>
                            </table></td>
                          <td width="5" align="right" valign="top"><img src="../images/bgborder2w.gif" width="5" height="5"></td>
                        </tr>
                      </form>
                    </table>
                    <table width="98%" border="0" cellpadding="0" cellspacing="1" class="table_border">
                      <tr> 
                        <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="1" 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="SelectStatus" type="hidden" id="SelectStatus">
							  <input name="GroupID" type="hidden" id="GroupID" value="<?=$GroupID?>">
                              <tr align="center" class="menu_table_header"> 
                                <td width="26" height="22"><input name="CheckBoxAll" type="checkbox" class="form_checkbox" id="CheckBoxAll" value="Yes" onClick="Paging_CheckAll(this,'CheckBoxID',document.myForm.TotalCheckBoxID.value)"></td>
                                <td width="26" align="center"> 
                                  <? 
$myOrderBy = $System_TableName_School."_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(); 
}
					">No.</a></td>
                          <td> 
                            <? 
$myOrderBy = $System_TableName_School."_Subject";
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(); 
}
					">Name</a></td>
                                <td width="90"><? 
$myOrderBy = $System_TableName_School."_Status";
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(); 
}
					">Status</a></td>
                                <td width="80"><br>
                                Action</td>
                              </tr>
                              <?
$index=1;
if($RecordCount>0) {
	while($index<$RecordCount+1) {
		if($myClassRow=="table_row1") { $myClassRow="table_row2"; } else { $myClassRow="table_row1";  }
		$Row=MYSQL_FETCH_ARRAY($Query);
	?>
                              <tr class="<?=$myClassRow?>" onMouseOver="this.className='table_rowover'" onMouseOut="this.className='<?=$myClassRow?>'"> 
                                <td width="26" height="22" align="center"> <input name="CheckBoxID<?=$index?>" type="checkbox" class="form_checkbox" id="CheckBoxID<?=$index?>" onClick="Paging_CheckAllHandle(document.myForm.CheckBoxAll,'CheckBoxID',document.myForm.TotalCheckBoxID.value)" value="<?=$Row[$System_TableName_School."_ID"]?>"></td>
                                <td width="26" height="22" align="center"><?=$RecordStart+$index?>
                                  <!--?=$Row[$System_TableName_School."_ID"]?-->
                                </td>
							    <td height="22"> <strong><?=$Row[$System_TableName_School."_Name"]?></strong></td>
                                <td width="90" height="22" align="center" valign="middle"><img src="../images/icon/ico442.gif" width="8" height="14">&nbsp; 
                                  <font  color="#990000"><span onMouseOver="this.style.cursor='hand'" onClick="
if('<?=$Row[$System_TableName_School."_Status"]?>'=='Enable') {
	document.myStatusForm.toolbarStatus[0].checked=true;
}
if('<?=$Row[$System_TableName_School."_Status"]?>'=='Disable') {
	document.myStatusForm.toolbarStatus[1].checked=true;
}
StatusIndex = <?=$index?>;
ShowDataPicker('divDataPicker',-230,-150)
"> 
                                  <?=$Row[$System_TableName_School."_Status"]?>
                                  </span></font></td>
                                <td width="80" height="22" align="center" valign="middle">  <table border="0" cellspacing="0" cellpadding="1">
                              <tr align="center" valign="bottom"> 
                                <? if ($GroupID>0) { ?>
								<td width="16"> <img src="../images/icon/makeordering.gif" alt="Move Up" width="15" height="14" border="0" onMouseOver="this.style.cursor='hand'" onClick="
document.myForm.action.value='makeordering';
document.myForm.submit();
"> </td>
                                <? } ?>
								<td><img src="../images/icon/ico416.gif" alt="View" width="16" height="21" border="0" onMouseOver="this.style.cursor='hand'" onClick="
Paging_CheckedThisItem( document.myForm.CheckBoxAll, <?=$index?>, 'CheckBoxID', document.myForm.TotalCheckBoxID.value );
document.myForm.action.value='view';
document.myForm.submit();
						"></td>
                                <td><img src="../images/icon/ico425.gif" alt="Edit" width="16" height="16" border="0" onMouseOver="this.style.cursor='hand'" onClick="
if(confirm('Are you sure to edit this record?')) {
	Paging_CheckedThisItem( document.myForm.CheckBoxAll, <?=$index?>, 'CheckBoxID', document.myForm.TotalCheckBoxID.value );
	document.myForm.action.value='edit';
	document.myForm.submit();
}
						"></td>
                                <td><img src="../images/icon/ico417.gif" alt="Delete" width="16" height="16" border="0" onMouseOver="this.style.cursor='hand'" onClick="
if(confirm('Are you sure to delete this record?')) {
	Paging_CheckedThisItem( document.myForm.CheckBoxAll, <?=$index?>, 'CheckBoxID', document.myForm.TotalCheckBoxID.value );
	document.myForm.action.value='delete';
	document.myForm.submit();
}
						"></td>
                              </tr>
                            </table></td>
                              </tr>
                              <?
		$index++;
	}
} else {  ?>
                              <tr class="table_row1"> 
                                <td height="80" colspan="6" align="center"> Data 
                                  not found!</td>
                              </tr>
                              <? } ?>
                              <input name="TotalCheckBoxID" type="hidden" id="TotalCheckBoxID" value="<?=$index-1?>">
                            </form>
                          </table>
                          <table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
                            <form action="?" method="post" name="mySearchForm" id="mySearchForm" onSubmit="return false;">
                              <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
                              <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
                              <tr align="right"> 
                                <td colspan="4" align="right" class="table_footer"> 
                                  <table border="0" cellpadding="2" cellspacing="0" class="table_footer">
                                    <tr> 
                                      <td><input name="toolbarPageSearch" type="text" class="input_left" id="toolbarPageSearch" value="<?=$PageSearch?>" size="20" maxlength="50"></td>
                                      <td><input name="btPageSearch" type="button" class="button_60" id="btPageSearch" value="Search" onClick="
document.myForm.PageSearch.value=document.mySearchForm.toolbarPageSearch.value;
document.myForm.submit();
						"></td>
                                    </tr>
                                  </table></td>
                              </tr>
                            </form>
                          </table></td>
                      </tr>
                    </table>
                    <table width="95%" height="22" border="0" cellpadding="2" cellspacing="0">
                      <form action="?" method="post" name="myFooterButton" id="myFooterButton" onSubmit="return false;">
                        <input name="SystemModuleKey" type="hidden" id="SystemModuleKey" value="<?=$SystemModuleKey?>">
                        <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
                        <tr> 
                          <td valign="top"><table border="0" cellspacing="0" cellpadding="2">
                              <tr> 
                                <td><input name="btAdd" type="button" class="button_80" id="btAdd" value="Add New" onClick="
document.myForm.action.value='add';
document.myForm.submit();
				"></td>
                                <td><input name="btView" type="button" class="button_60" id="btView" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==1) {
	document.myForm.action.value='view';
	document.myForm.submit();
} else {
	alert('Please checked 1 item to view this record.');
}
				  " value="View"></td>
                                <td><input name="btEdit" type="button" class="button_60" id="btEdit" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==1) {
	document.myForm.action.value='edit';
	document.myForm.submit();
} else {
	alert('Please checked 1 item to edit this record.');
}
				  " value="Edit"></td>
                                <td><input name="btDelete" type="button" class="button_60" id="btDelete" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)>0) {
	if(confirm('Are you sure to delete selected record?')) {
		document.myForm.action.value='delete';
		document.myForm.submit();
	}
} else {
	alert('Please checked 1 or more item to delete record.');
}
				  " value="Delete"></td>
                              </tr>
                            </table></td>
                        </tr>
                      </form>
                    </table>
                    <br>
                    <? 
}
#########################################################
?>
                    <br>
              <!-- InstanceEndEditable --> 
                          <? }  ?>
                          <p>&nbsp;</p></td>
                        </tr>
                    </table></td>
                  </tr>
              </table></td>
            <td background="../../images/ling_r.gif">&nbsp;</td>
          </tr>
      </table></td>
    </tr>
    <tr>
      <td height="1" bgcolor="#164B12"><div align="right">
        <table width="100%"  border="0">
          <tr>
            <td><div align="right"><font color="#FFCC66"><strong><img src="../../images/icon/boy.gif" width="16" height="16" border="0" align="absmiddle">&nbsp;<font color="#FFFFFF">&nbsp;</font></strong></font><font color="#FFFFFF"><strong>Contactus Management.&nbsp;&nbsp;&nbsp;</strong></font></div></td>
          </tr>
        </table>
      </div></td>
    </tr>
  </table>
</div>
</body>
<!-- InstanceEnd --></html>
<? 
include("../lib/disconnect.php");
?>

Hacked By AnonymousFox1.0, Coded By AnonymousFox