Hacked By AnonymousFox

Current Path : C:/AppServ/www/mfu/webengine/mod_about/
Upload File :
Current File : C:/AppServ/www/mfu/webengine/mod_about/_index(Befor Status).php

<? 
include("../lib/session.php"); 
include("../lib/config.php");
include("../lib/connect.php");
include("../lib/function.php");
?>
<html><!-- InstanceBegin template="/Templates/WebEngine-Adminpanel.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Web Engine : <?=$System_Variable_Title?></title>
<!-- InstanceEndEditable -->
<link href="../css/mystyle.css" rel="stylesheet" type="text/css">
<script 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];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</script>
<style type="text/css">
<!--
#Layer1 {
	position:absolute;
	width:135px;
	height:101px;
	z-index:1;
	visibility: hidden;
}
#Layer2 {	position:absolute;
	width:185px;
	height:37px;
	z-index:2;
	visibility: hidden;
}
#Layer3 {	position:absolute;
	width:140px;
	height:54px;
	z-index:3;
	visibility: hidden;
}
#Layer4 {
	position:absolute;
	width:113px;
	height:84px;
	z-index:4;
	visibility: hidden;
}
-->
</style>
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../../images/main/mnuover_25.gif','../../images/main/mnuover_27.gif','../../images/main/mnuover_28.gif','../../images/main/mnuover_29.gif','../../images/main/mnuover_30.gif','../../images/main/mnuover_31.gif','../../images/main/mnuover_32.gif','../../images/main/mnuover_33.gif','../../images/main/mnuover_34.gif','../../images/main/mnuover_35.gif','../../images/main/mnuover_36.gif','../../images/main/submnuover1_01.gif','../../images/main/submnuover1_02.gif','../../images/main/submnuover1_03.gif','../../images/main/submnuover1_04.gif','../../images/main/submnuover1_05.gif','../../images/main/submnuover2_01.gif','../../images/main/submnuover2_02.gif','../../images/main/submnuover2_03.gif','../../images/main/submnuover2_04.gif','../../images/main/submnuover3_01.gif','../../images/main/submnuover3_03.gif','../images/flags/th.gif','../images/flags/en.gif')">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="27" rowspan="2" valign="top"><img src="../../images/main/main_03.gif" width="27" height="505" /></td>
    <td colspan="2" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="159" background="../../images/main/main_05.gif"><img src="../../images/main/main_04.gif" width="189" height="45" /></td>
        <td width="159" background="../../images/main/main_05.gif" style="background-repeat:no-repeat">&nbsp;</td>
        <td background="../../images/main/main_06.gif" style="background-repeat:repeat-x "><table width="93%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="right"><strong><font color="#FFFFFF">Administration Panel</font></strong>
          </td>
            </tr>
            <tr>
              <td height="20">&nbsp;</td>
            </tr>
          </table></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2" align="center" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center" valign="top"><table width="90%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="center"><br><br>
              <? 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)?></td>
              </tr>
            </table>
            <table width="97%" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="1" class="table_col3"><img src="../images/blank.gif" width="10" height="2"></td>
              </tr>
              <form action="?" method="get" name="myPageRedirectForm" id="myPageRedirectForm">
                <input name="MID" type="hidden" id="MID" value="<?=$MID?>">
                <input name="SystemMenuID" type="hidden" id="SystemMenuID" value="<?=$SystemMenuID?>">
                <input name="actionType" type="hidden" id="actionType" value="<?=$actionType?>">
              </form>
            </table>
            <br>
			<br>
            <script language="JavaScript" src="../lib/popup.js" type="text/JavaScript"></script>
                     
            <? 
## Load Module Configuration Variable ############################################
include("config.php");

## Default Value ############################################
$SystemModule_defaultPageSize = 10;
$SystemModule_defaultPageShow = 1;
$SystemModule_MaxPage = 20;
$SystemModule_ReduceRange = 10; 		// +,- from current page show
$SystemModule_ASCDESC = "DESC";
$SystemModule_OrderBy = $myModule_Table_Profile."_ID";

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

	if ($PageShow=="") $PageShow = 0;
	
	// move page after
	$CurrentOrdering = 0;
	$sql = "SELECT * FROM ".$myModule_Table_Profile." WHERE ".$myModule_Table_Profile."_ID=".$PageShow." AND ".$myModule_Table_Profile." _Language='$System_Session_Language'";
	$Query = mysql_query($sql);
	if (mysql_num_rows($Query)>0) {
		$Row = mysql_fetch_array($Query);
		$CurrentOrdering = $Row[$myModule_Table_Profile."_Order"];
		
	}
	$sql = "SELECT * FROM ".$myModule_Table_Profile." WHERE ".$myModule_Table_Profile."_ModuleKey='".$SystemModuleKey.
	"' AND ".$myModule_Table_Profile."_Order>".$CurrentOrdering." ORDER BY ".$myModule_Table_Profile."_Order ASC";
	$Query = mysql_query($sql);
	if (mysql_num_rows($Query)>0) {
		$Ordering = $CurrentOrdering +1;
		while ($Row = mysql_fetch_array($Query)) {
			$Ordering++;
			$sql = "UPDATE ".$myModule_Table_Profile." SET ".$myModule_Table_Profile."_Order=".$Ordering." WHERE ".$myModule_Table_Profile."_ID=".$Row[$myModule_Table_Profile."_ID"];
			$Query1 = mysql_query($sql);
		}
	}
	
	$NextOrdering = $CurrentOrdering +1;
	/*
	$NextOrdering = 0;
	$sql = "SELECT MAX(".$myModule_Table_Profile."_Ordering) FROM ".$myModule_Table_Profile." WHERE ".$myModule_Table_Profile."_ModuleKey=".$SystemMenuID;
	$Query = mysql_query($sql);
	if (mysql_num_rows($Query)>0) {
		$Row = mysql_fetch_row($Query);
		$NextOrdering = $Row[0];
	}
	$NextOrdering++;
	*/

	$sql = "INSERT INTO ".$myModule_Table_Profile."(".
	$myModule_Table_Profile."_ModuleKey,".
	$myModule_Table_Profile."_Order,".
	$myModule_Table_Profile."_CreateByID,".
	$myModule_Table_Profile."_CreateBy,".
	$myModule_Table_Profile."_CreateDate,".
	$myModule_Table_Profile."_Language,".
	$myModule_Table_Profile."_Status,".
	$myModule_Table_Profile."_LastUpdate".
	") VALUES('".$SystemModuleKey."',".$NextOrdering.",$System_Session_User_ID,'$System_Session_UserName',NOW(),'$System_Session_Language','".$System_Approve_DefaultStatus."',NOW())";
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	$MaxID = mysql_insert_id();

	srand(make_seed());
	$myrand = rand(1111,9999);
	if(!is_dir($System_RelativePath_Upload."/".$SystemModuleKey)) { mkdir($System_RelativePath_Upload."/".$SystemModuleKey,0777); }
	if(!is_dir($myModule_Path_HTMLFiles)) { mkdir($myModule_Path_HTMLFiles,0777); }
	if(!is_dir($myModule_Path_ImageLibrary)) { mkdir($myModule_Path_ImageLibrary,0777); }
	/* Check to create module data directory. ---------
	chmod("../../".$System_Path_Relative_Upload,0777);
	if(!is_dir("../../".$System_Path_Relative_Upload."/".$SystemModuleKey)) { mkdir("../../".$System_Path_Relative_Upload."/".$SystemModuleKey,0777); }
	if(!is_dir($myModule_Path_HTMLFiles)) { mkdir($myModule_Path_HTMLFiles,0777); }
	if(!is_dir($myModule_Path_ImageLibrary)) { mkdir($myModule_Path_ImageLibrary,0777); }
	/ ------------------------------------------------*/

	$HTMLFileName = "$MaxID-$myrand.html";
	$HTMLToolContent=stripslashes($HTMLToolContent);
	$fp = fopen ($myModule_Path_HTMLFiles."/".$HTMLFileName, "w+");
	fwrite($fp,$HTMLToolContent);
	fclose($fp);

	$sql = "UPDATE ".$myModule_Table_Profile." SET ".$myModule_Table_Profile."_HTMLFileName='$HTMLFileName' WHERE ".$myModule_Table_Profile."_ID=".$MaxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");

		$inputSubject="Profile ".$NextOrdering;
		// Send to Content Approve System
		$ViewPath = "http://".$HTTP_HOST.$PHP_SELF."?SystemModuleKey=".$SystemModuleKey."&SystemMenuID=".$SystemMenuID."&action=view&myCheckBoxID=".$MaxID;
		$QueryUpdate = "UPDATE ".$myModule_Table_Profile." SET ".$myModule_Table_Profile."_Status=\'[mystatus]\' WHERE ".$myModule_Table_Profile."_ID=".$MaxID;
		SaveApprove($SystemModuleKey,$MaxID,addslashes($inputSubject),$ViewPath,$QueryUpdate);

	?>
	        <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="<?=$MaxID?>">
	          <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
	          <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
	          <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
	        </form>
            <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
	        <? 
####################################################################
} else if($action=="add") { 
	$HTMLToolContentBG = "#FFFFFF";
?>
            <? include("htmltool/header.php"); ?>
            <table width="550" border="0" cellpadding="0" cellspacing="1" class="table_border">
              <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="<?=$CheckBoxID1?>">
                <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 name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
                <input name="PageShow" type="hidden" id="PageShow" value="<?=$CheckBoxID1?>">
                <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" align="center" class="table_header">Edit 
                          <?=getMenuName($SystemMenuID)?>
                        </td>
                      </tr>
                      <tr>
                        <td height="26" class="table_col3">&nbsp;&nbsp;<img src="../images/bullet/box21.gif" width="11" height="11">&nbsp;Content</td>
                      </tr>
                      <tr align="center" valign="top">
                        <td height="350" class="table_col2"><table width="100%" height="500" border="0" align="center" cellpadding=1 cellspacing=1  bordercolorlight="#000000" bordercolordark="#E0E0E0" bgcolor="#AAAAAA" class="table_border" id="htmltool_table">
                            <tr>
                              <td height="50" align="center" class="table_col3">
                                <? include("htmltool/toolbar.php"); ?>
                              </td>
                            </tr>
                            <tr>
                              <td align="center" class="table_col2">
                                <? include("htmltool/textarea.php"); ?>
                              </td>
                            </tr>
                          </table>
                          <script language="JavaScript" type="text/JavaScript">
fnInit(idContent);
              </script></td>
                      </tr>
                      <tr align="left" valign="top">
                        <td align="right" class="table_col2">กดปุ่ม <span class="text_hilight">Shift+Enter</span> เมื่อต้องการขึ้นบรรทัดใหม่</td>
                      </tr>
                    </table>
                    <table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
                      <tr align="right">
                        <td height="30" align="center" class="table_footer">
                          <table width="300" border="0" cellspacing="0" cellpadding="2">
                            <tr align="center">
                              <td>
                                <input name="btAdd" type="button" class="button_80" id="btAdd3" value="Save" onClick="
								fnSave();
								document.myForm.submit();
								">
                              </td>
                              <td>
                                <input name="btCalcel" type="button" class="button_80" id="btCalcel3" value="Cancel" onClick="document.myReturnForm.submit()">
                              </td>
                            </tr>
                        </table></td>
                      </tr>
                  </table></td>
                </tr>
              </form>
            </table>
            <? 
#########################################################
} else if ($action=="edit") { 
	$myCheckBoxID = $CheckBoxID1;
	$sql="SELECT * FROM ".$myModule_Table_Profile." WHERE ".$myModule_Table_Profile."_ModuleKey='".$SystemModuleKey."' AND ".$myModule_Table_Profile."_ID=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	$Row=MYSQL_FETCH_ARRAY($Query);
	$HTMLsrc = $myModule_Path_HTMLFiles."/".$Row[$myModule_Table_Profile."_HTMLFileName"];
	$HTMLToolContentBG = $Row[$myModule_Table_Profile."_BackgroudColor"];
?>
            <? include("htmltool/header.php"); ?>
            
            <table width="550" border="0" cellpadding="0" cellspacing="1" class="table_border">
              <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="<?=$CheckBoxID1?>">
                <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="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?>">
                <tr>
                  <td bgcolor="#FFFFFF">
                    <table width="100%" border="0" cellpadding="2" cellspacing="1">
                      <tr>
                        <td height="24" align="center" class="table_header">Edit 
                          <?=getMenuName($SystemMenuID)?>
                        </td>
                      </tr>
                      <tr>
                        <td height="26" class="table_col3">&nbsp;&nbsp;<img src="../images/bullet/box21.gif" width="11" height="11">&nbsp;Content</td>
                      </tr>
                      <tr align="center" valign="top">
                        <td height="350" class="table_col2"><table width="100%" height="500" border="0" align="center" cellpadding=1 cellspacing=1  bordercolorlight="#000000" bordercolordark="#E0E0E0" bgcolor="#AAAAAA" class="table_border" id="htmltool_table">
                            <tr>
                              <td height="50" align="center" class="table_col3">
                                <? include("htmltool/toolbar.php"); ?>
                              </td>
                            </tr>
                            <tr>
                              <td align="center" class="table_col2">
                                <? include("htmltool/textarea.php"); ?>
                              </td>
                            </tr>
                          </table>
                          <script language="JavaScript" type="text/JavaScript">
fnInit(idContent);
              </script></td>
                      </tr>
                      <tr align="right" valign="top">
                        <td class="table_col2">กดปุ่ม <span class="text_hilight">Shift+Enter</span> เมื่อต้องการขึ้นบรรทัดใหม่</td>
                      </tr>
                    </table>
                    <table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
                      <tr align="right">
                        <td height="30" 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="
								fnSave();
								document.myForm.submit();
								">
                              </td>
                              <td>
                                <input name="btCalcel" type="button" class="button_80" id="btCalcel3" value="Cancel" onClick="document.myReturnForm.submit()">
                              </td>
                            </tr>
                        </table></td>
                      </tr>
                  </table></td>
                </tr>
              </form>
            </table>
            <? 
#########################################################
} else if ($action=="update") { 

		$MaxID = $CheckBoxID1;

		srand(make_seed());
		$myrand = rand(1111,9999);
		if(!is_dir($System_RelativePath_Upload."/".$SystemModuleKey)) { mkdir($System_RelativePath_Upload."/".$SystemModuleKey,0777); }
		if(!is_dir($myModule_Path_HTMLFiles)) { mkdir($myModule_Path_HTMLFiles,0777); }
		if(!is_dir($myModule_Path_ImageLibrary)) { mkdir($myModule_Path_ImageLibrary,0777); }

		/* Check to create module data directory. ---------
		chmod("../../".$System_Path_Relative_Upload,0777);
		if(!is_dir("../../".$System_Path_Relative_Upload."/".$SystemModuleKey)) { mkdir("../../".$System_Path_Relative_Upload."/".$SystemModuleKey,0777); }
		if(!is_dir($myModule_Path_HTMLFiles)) { mkdir($myModule_Path_HTMLFiles,0777); }
		if(!is_dir($myModule_Path_ImageLibrary)) { mkdir($myModule_Path_ImageLibrary,0777); }  */
		// ------------------------------------------------

		$sql = "SELECT * FROM ".$myModule_Table_Profile." WHERE ".$myModule_Table_Profile."_ID=".$MaxID;
		$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
		$Row=MYSQL_FETCH_ARRAY($Query);

		$inputSubject="Profile ".$Row[$myModule_Table_Profile."_Order"];

		$HTMLFileName = $Row[$myModule_Table_Profile."_HTMLFileName"];		
		if(file_exists($myModule_Path_HTMLFiles."/".$HTMLFileName)) {
			unlink($myModule_Path_HTMLFiles."/".$HTMLFileName);
		}
		$HTMLFileName = "$MaxID-$myrand.html";

		$HTMLToolContent=stripslashes($HTMLToolContent);
		$fp = fopen ($myModule_Path_HTMLFiles."/".$HTMLFileName, "w+");
		fwrite($fp,$HTMLToolContent);
		fclose($fp);

		$sql = "UPDATE ".$myModule_Table_Profile." SET ".
		$myModule_Table_Profile."_HTMLFileName='$HTMLFileName', ".
		$myModule_Table_Profile."_CreateByID=$System_Session_User_ID,".
		$myModule_Table_Profile."_CreateBy='$System_Session_UserName' ,".
		$myModule_Table_Profile."_LastUpdate=NOW()  WHERE ".$myModule_Table_Profile."_ID=".$MaxID;
		$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");

		// Send to Content Approve System
		$ViewPath = "http://".$HTTP_HOST.$PHP_SELF."?SystemModuleKey=".$SystemModuleKey."&SystemMenuID=".$SystemMenuID."&action=view&myCheckBoxID=".$MaxID;
		$QueryUpdate = "UPDATE ".$myModule_Table_Profile." SET ".$myModule_Table_Profile."_Status=\'[mystatus]\' WHERE ".$myModule_Table_Profile."_ID=".$MaxID;
		SaveApprove($SystemModuleKey,$MaxID,addslashes($inputSubject),$ViewPath,$QueryUpdate);

?>
            <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?>">
            </form>
            <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
            <? 
#########################################################
} else if ($action=="delete") { 

		$sql = "SELECT * FROM ".$myModule_Table_Profile." WHERE ".$myModule_Table_Profile."_ID=".$CheckBoxID1;
		$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
		$Row=MYSQL_FETCH_ARRAY($Query);

		$HTMLFileName = $Row[$myModule_Table_Profile."_HTMLFileName"];		
		if(file_exists($myModule_Path_HTMLFiles."/".$HTMLFileName)) {
			unlink($myModule_Path_HTMLFiles."/".$HTMLFileName);
		}

		$sql = "DELETE FROM ".$myModule_Table_Profile." WHERE ".$myModule_Table_Profile."_ID=".$CheckBoxID1;
		$Query = mysql_query($sql);

		// Delete Content Approve Data
		DeleteApprove($SystemModuleKey,$CheckBoxID1);

?>
            <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="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
              <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
              <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
            </form>
            <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
            <?
#########################################################
} else if ($action=="updateordering") { 

	for($i=0;$i<count($inputProfileID);$i++) {
		$sql="UPDATE ".$myModule_Table_Profile." SET ".
		$myModule_Table_Profile."_Order=".($i+1).
		" WHERE ".$myModule_Table_Profile."_ID=".$inputProfileID[$i];
		$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="0">
              <input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
              <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
              <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
            </form>
            <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
            <? 
//########################################################
} else if ($action=="makeorder") { 
	// Load Education Data
	$sql = "SELECT * FROM ".$myModule_Table_Profile." WHERE ".$myModule_Table_Profile."_ModuleKey='".$SystemModuleKey."' AND ".$myModule_Table_Profile."_Language='$System_Session_Language'  ".
	" ORDER BY ".$myModule_Table_Profile."_Order ASC";
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
?>
            <br>
			<script language="JavaScript">
			function moveUp(myListObj) {
				var array_list_value = new Array();
				var array_list_text = new Array();
				myListObj = document.getElementById(myListObj);
				currentPos=-1;
				listNum=myListObj.options.length;
				if(listNum==0){
					 return false;
				} else {
						for (i=0;i<listNum;i++) {
							  if (myListObj.options[i].selected==true) currentPos=i;
							  array_list_value[i]=myListObj.options[i].value;
							  array_list_text[i]=myListObj.options[i].text;
						 }
						 if(currentPos!=-1&&currentPos!=(0)){
								temp_value=myListObj.options[currentPos-1].value;
								temp_text=myListObj.options[currentPos-1].text;
								array_list_value[currentPos-1]=myListObj.options[currentPos].value;
								array_list_text[currentPos-1]=myListObj.options[currentPos].text;
								array_list_value[currentPos]=temp_value;
								array_list_text[currentPos]=temp_text;
								for (i=listNum-1;i>=0;i--) myListObj.options[i]=null;
								for (i=0;i<listNum;i++) myListObj.options[myListObj.options.length] = new Option(array_list_text[i],array_list_value[i]);
								myListObj.options[currentPos-1].selected=true;
							} else {
								return false;
							}						
					}								
			}
			function moveDown(myListObj) {
				var array_list_value = new Array();
				var array_list_text = new Array();
				myListObj = document.getElementById(myListObj);
				currentPos=-1;
				listNum=myListObj.options.length;
				if(listNum==0){
					 return false;
				} else {
						for (i=0;i<listNum;i++) {
							  if (myListObj.options[i].selected==true) currentPos=i;
							  array_list_value[i]=myListObj.options[i].value;
							  array_list_text[i]=myListObj.options[i].text;
						 }
						 if(currentPos!=-1&&currentPos!=(listNum-1)){
									temp_value=myListObj.options[currentPos+1].value;
									temp_text=myListObj.options[currentPos+1].text;
									array_list_value[currentPos+1]=myListObj.options[currentPos].value;
									array_list_text[currentPos+1]=myListObj.options[currentPos].text;
									array_list_value[currentPos]=temp_value;
									array_list_text[currentPos]=temp_text;
									for (i=listNum-1;i>=0;i--) myListObj.options[i]=null;
									for (i=0;i<listNum;i++) myListObj.options[myListObj.options.length] = new Option(array_list_text[i],array_list_value[i]);
									myListObj.options[currentPos+1].selected=true;
							} else {
								return false;
							}
					}								
			}
			</script>
            <table width="400" border="0" cellpadding="0" cellspacing="1" class="table_border">
              <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?>">
              </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?>">
                <tr>
                  <td bgcolor="#FFFFFF">
                    <table width="100%" border="0" cellpadding="2" cellspacing="1">
                      <tr>
                        <td height="24" align="center" class="table_header">Manage Order Content</td>
                      </tr>
                      <tr>
                        <td height="250" align="center" class="table_col2">
                          <table border="0" cellpadding="0" cellspacing="1" class="mytable">
                            <tr>
                              <td height="22" class="mymainpage_headbar">
                                <table width="100%" height="22" border="0" cellpadding="0" cellspacing="0" class="table_col3">
                                  <tr>
                                    <td width="22" align="center"><img src="../images/icon/ico531.gif" width="16" height="14"></td>
                                    <td>Content List</td>
                                  </tr>
                              </table></td>
                            </tr>
                            <tr>
                              <td align="center" class="table_row1">
                                <table border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td><select name="inputProfileID[]" size="15" multiple class="myform_myinput_textarea" id="inputProfileID" style="width:206">
									    <?
									$index = 0;
									while ($Row = mysql_fetch_array($Query)) {
										$index++;
										echo "<option value='".$Row[$myModule_Table_Profile."_ID"]."'>หน้าที่ ".$index."</option>";
									}
									?>
									</select></td>
                                    <td>
                                      <table height="100" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                          <td><img src="../images/icon/ico623.gif" alt="เลื่อนขึ้น" width="16" height="11" onClick="moveUp('inputProfileID')" style="cursor:hand; "></td>
                                        </tr>
                                        <tr>
                                          <td><br>
                                              <img src="../images/icon/ico481.gif" alt="เลื่อนลง" width="16" height="10" onClick="moveDown('inputProfileID')" style="cursor:hand; "></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                              </table></td>
                            </tr>
                            <tr>
                              <td height="6" class="table_footer"><img src="../system/images/blank.gif" width="1" height="1"></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 width="146"><input name="btnSave" type="button" class="button_80" id="btnSave" value="Save" onClick="
if(confirm('คุณต้องการบันทึกการเปลี่ยนแปลงนี้ ใช่หรือไม่?')) {
	// select all Education
	for (i=0;i<document.myForm.inputProfileID.options.length;i++) document.myForm.inputProfileID.options[i].selected=true;
	document.myForm.action.value='updateordering';
	document.myForm.submit();
}	
 ">
                              </td>
                              <td width="146"><input name="btCalcel2" type="button" class="button_80" id="btCalcel2" onClick="document.myReturnForm.submit()" value="Cancel"></td>
                            </tr>
                        </table></td>
                      </tr>
                  </table></td>
                </tr>
              </form>
            </table>
            <br>
            <? 
###########################################
} 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_Profile." SET ".$myModule_Table_Profile."_Status='$SelectStatus' WHERE ".$myModule_Table_Profile."_ID=".$myCheckBoxID;
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");

	// Update Content Approve Status
	UpdateApproveStatus($SystemModuleKey,$myCheckBoxID,$SelectStatus);
	
?>
            <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?>">
            </form>
            <script language="JavaScript" type="text/JavaScript"> document.myForm.submit(); </script>
	<? 
#########################################################
} else if ($action=="view" || $action=="") {
	$sql = "SELECT * FROM ".$myModule_Table_Profile." WHERE ".$myModule_Table_Profile."_Language='$System_Session_Language'  ";
	$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_Profile." WHERE ".$myModule_Table_Profile."_ModuleKey='".$SystemModuleKey."' AND ".$myModule_Table_Profile."_Language='$System_Session_Language'  ";
	if ($PageShow>0) $sql .= " AND ".$myModule_Table_Profile."_ID=".$PageShow;
	else $sql .= " ORDER BY ".$myModule_Table_Profile."_Order ASC";
	
	$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
	if (mysql_num_rows($Query)>0) {
		$Row=MYSQL_FETCH_ARRAY($Query);
		$myCheckBoxID = $Row[$myModule_Table_Profile."_ID"];
	}
?>
                    <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">
                                <? for ($i=1;$i<=$System_Approve_ContentStatus_Count;$i++) { ?>
								<? if (strstr($System_StaffLevel_StatusManage[$System_Session_Level],$System_Approve_ContentStatus_Value[$i])) { ?>
								<tr> 
                                  <td width="26" height="22" align="center"><input name="toolbarStatus" type="radio" class="form_checkbox" value="<?=$System_Approve_ContentStatus_Value[$i]?>"></td>
                                  <td height="22" class="text_bold"><font color="#<?=$System_Approve_ContentStatus_Color[$System_Approve_ContentStatus_Value[$i]]?>"><?=$System_Approve_ContentStatus_Name[$System_Approve_ContentStatus_Value[$i]]?></font></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.length>1) {
	for (var i=0;i<document.myStatusForm.toolbarStatus.length;i++) {
		if (document.myStatusForm.toolbarStatus[i].checked) {
			document.myForm.SelectStatus.value = document.myStatusForm.toolbarStatus[i].value;
		}
	}
} else {
	if (document.myStatusForm.toolbarStatus.checked) {
		document.myForm.SelectStatus.value = document.myStatusForm.toolbarStatus.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="550" border="0" cellpadding="0" cellspacing="1" class="table_border">
              <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="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
                <input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
                <input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
                <input name="CheckBoxID1" type="hidden" id="CheckBoxID1" value="<?=$myCheckBoxID?>">
                <input name="TotalCheckBoxID" type="hidden" id="TotalCheckBoxID" value="1">
                <tr>
                  <td bgcolor="#FFFFFF">
                    <table width="100%" border="0" cellpadding="2" cellspacing="1" >
                      <tr align="center">
                        <td width="100%" height="24" align="center" class="table_header">View 
                          <?=getMenuName($SystemMenuID)?>
                        </td>
                      </tr>
                      <tr>
                        <td height="26" class="table_col3"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="50%" class="table_col3">&nbsp;&nbsp;<img src="../images/bullet/box21.gif" width="11" height="11">&nbsp;Content 
                                <?
							 $sql = "SELECT * FROM ".$myModule_Table_Profile." WHERE ".$myModule_Table_Profile."_ModuleKey='".$SystemModuleKey."' AND ".$myModule_Table_Profile."_Language='$System_Session_Language'  ".
							" ORDER BY ".$myModule_Table_Profile."_Order ASC";
							$Query_Page = mysql_query($sql);
							if (mysql_num_rows($Query_Page)>1) {
								echo "Page ";
							?>
                              <select name="PageShow" class="select" onChange="document.myForm.submit()">
								  <?
								$page_index = 0;
								while ($Row_Page = mysql_fetch_array($Query_Page)) {
									$page_index++;
									echo "<option value='".$Row_Page[$myModule_Table_Profile."_ID"]."'>".$page_index."</option>";
								}
								?>
							</select>
							    <?
							}
							if ($PageShow>0 && mysql_num_rows($Query_Page)>1) echo "<script language='JavaScript'> document.myForm.PageShow.value='".$PageShow."'; </script>";
							?>
                              </td>
                              <td width="50%" align="right">
                                <? if (mysql_num_rows($Query_Page)>1) { ?>
									<? if($System_Session_Permission[$SystemMenuID]=="Write" ||  $System_Session_Permission[$SystemMenuID]=="Manage"){ ?>	  							  
                                <input name="Sort" type="button" value="Sort Page" class="button_80" onClick="
							document.myForm.action.value = 'makeorder';
							document.myForm.submit();
							">
							<? }?>
                                <? } ?>
                              </td>
                            </tr>
                        </table></td>
                      </tr>
                    </table>
                    <table width="100%" height="100" border="0" cellpadding="2" cellspacing="0"  bgcolor="#FFFFFF">
                      <tr>
                        <td align="left" valign="top">
                          <?
if ($Row[$myModule_Table_Profile."_HTMLFileName"]<>"") {
	$filename = $myModule_Path_HTMLFiles."/".$Row[$myModule_Table_Profile."_HTMLFileName"];
	$fd = fopen ($filename, "r");
	$contents = fread ($fd, filesize ($filename));
	fclose ($fd);
	echo $contents;
}
						?>
                        </td>
                      </tr>
                    </table>
                    <table width="100%" border="0" cellpadding="2" cellspacing="1" >
                      <tr>
                        <td height="27" colspan="2" class="table_col3">&nbsp;&nbsp;<img src="../images/bullet/box21.gif" width="11" height="11">&nbsp;More Information</td>
                      </tr>
                      <tr>
                        <td width="19%" height="22" align="right" class="table_col1">Create Date&nbsp;</td>
                        <td width="81%" height="22" class="table_col2">
                          <?=$Row[$myModule_Table_Profile."_CreateDate"]?>
                        </td>
                      </tr>
                      <tr>
                        <td height="22" align="right" class="table_col1">Last Update&nbsp;</td>
                        <td height="22" class="table_col2">
                          <?=$Row[$myModule_Table_Profile."_LastUpdate"]?>
                        </td>
                      </tr>
                      <tr>
                        <td height="22" align="right" class="table_col1">Update By&nbsp;</td>
                        <td height="22" class="table_col2">
                          <?=$Row[$myModule_Table_Profile."_CreateBy"]?>
                        </td>
                      </tr>
                      <tr style="display:none ">
                        <td height="22" align="right" class="table_col1">Status&nbsp;</td>
                        <td height="22" class="table_col2">
<? if($System_Session_Permission[$SystemMenuID]=="Write" ||  $System_Session_Permission[$SystemMenuID]=="Manage"){ ?>
<? if ($System_StaffLevel_StatusManage[$System_Session_Level]<>"") { ?>
			<img src="../images/icon/ico442.gif" width="8" height="14">&nbsp; 
		    <font  color="#990000">
			<span onMouseOver="this.style.cursor='hand'" onClick="
 if (document.myStatusForm.toolbarStatus=='[object]') {
	if (document.myStatusForm.toolbarStatus.value=='<?=$Row[$myModule_Table_Profile."_Status"]?>') {
		document.myStatusForm.toolbarStatus.checked = true;
	}
	StatusIndex = 1;
	ShowDataPicker('divDataPicker',-100,-170);
}
			"> 
											  <?=$Row[$myModule_Table_Profile."_Status"]?>
						</span>
						</font>
<? }?><? }else{?>								
		  <?=$Row[$myModule_Table_Profile."_Status"]?>  
<? }?>
                        </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">
<? if($System_Session_Permission[$SystemMenuID]=="Write" ||  $System_Session_Permission[$SystemMenuID]=="Manage"){ ?>	  							  						
                          <table width="300" border="0" cellspacing="0" cellpadding="2">
                            <tr align="center">
							  <td>
                                <input name="btEdit" type="button" class="button_80" id="btEdit" value="Edit" onClick="
<?
if ($myCheckBoxID>0) echo "document.myForm.action.value='edit';";
else echo "document.myForm.action.value='add';";
?>
document.myForm.submit();
						">
                              </td>
                              <? if($myCheckBoxID>0){?>
							  <td>
                                <input name="btDelete" type="button" class="button_80" id="btDelete" value="Delete" onClick="
if (confirm('คุณต้องการลบเนื้อหาหน้านี้ ใช่หรือไม่?')) {
	document.myForm.action.value='delete';
	document.myForm.submit();
}
						">
                              </td>
                              <? }?>
							  <? if($myCheckBoxID>0){?>
							  <td style="display:none ">
                                <input name="btAdd" type="button" class="button_100" id="btAdd" value="Add Next Page" onClick="
document.myForm.action.value='add';
document.myForm.submit();
						">
                              </td>
                              <? }?>
							</tr>
                        </table>
<? }?>						
						</td>
                      </tr>
                  </table></td>
                </tr>
              </form>
            </table>
            <? 
}
#########################################################
?>
            <br>
            <br>
                              <!-- InstanceEndEditable --> 
          <? }  else { echo "&nbsp;"; }?> </td>
          </tr>
        </table>          </td>
        <td width="14" valign="top"><img src="../../images/main/shadow_right.jpg" width="14" height="565"></td>
        <td width="200" align="center" valign="top"><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> 
              <? } ?>
              <font color="#990000"><strong>Language : 
              <?=$System_Session_Language?>
              </strong></font>
              <table width="30%"  border="0" align="center" cellpadding="0" cellspacing="4">
                <tr>
                  <td align="center">
				  		<?
						if($System_Session_Language == "Thai"){
						?>
						<img src="../images/flags/th.gif" width="19" height="14" border="0">
						<?
						}else{
						?>
						<a href="<? echo "../system/setlanguage.php?action=setlanguage&setlang=Thai&SystemModuleKey=".$SystemModuleKey."&SystemMenuID".$SystemMenuID; ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image27','','../images/flags/th.gif',1)"><img src="../images/flags/th_disable.gif" name="Image27" width="19" height="14" border="0"></a>
						<?
						}
						?>
				  </td>
                  <td align="center">
				  		<?
						if($System_Session_Language == "English"){
						?>
						<img src="../images/flags/en.gif" width="19" height="14" border="0">
						<?
						}else{
						?>
				  		<a href="<? echo "../system/setlanguage.php?action=setlanguage&setlang=English&SystemModuleKey=".$SystemModuleKey."&SystemMenuID=".$SystemMenuID; ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image28','','../images/flags/en.gif',1)"><img src="../images/flags/en_disable.gif" name="Image28" width="19" height="14" border="0"></a>
				  <?
						}
						?>				  </td>
                </tr>
              </table>
              <font color="#990000"><strong>              <br>
              </strong></font><strong> </strong> <table width="90%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="22" align="center" 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="../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 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="inputUserName" 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 { ?>
              <font color="#990000"><strong>Language : 
              <?=$System_Session_Language?>
              </strong></font>
              <table width="30%"  border="0" align="center" cellpadding="0" cellspacing="4">
                <tr>
                  <td align="center">
                    <?
						if($System_Session_Language == "Thai"){
						?>
                    <img src="../images/flags/th.gif" width="19" height="14" border="0">
                    <?
						}else{
						?>
                    <a href="<? echo "../system/setlanguage.php?action=setlanguage&setlang=Thai&SystemModuleKey=".$SystemModuleKey."&SystemMenuID".$SystemMenuID; ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image271','','../images/flags/th.gif',1)"><img src="../images/flags/th_disable.gif" name="Image271" width="19" height="14" border="0" id="Image271"></a>
                    <?
						}
						?>
                  </td>
                  <td align="center">
                    <?
						if($System_Session_Language == "English"){
						?>
                    <img src="../images/flags/en.gif" width="19" height="14" border="0">
                    <?
						}else{
						?>
                    <a href="<? echo "../system/setlanguage.php?action=setlanguage&setlang=English&SystemModuleKey=".$SystemModuleKey."&SystemMenuID=".$SystemMenuID; ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image281','','../images/flags/en.gif',1)"><img src="../images/flags/en_disable.gif" name="Image281" width="19" height="14" border="0" id="Image281"></a>
                    <?
						}
						?>
                  </td>
				  <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
				  <td align="center"><img src="../images/logout_btn.gif" style="cursor:hand " onClick="document.myMenuForm.action='../system/logout.php'; document.myMenuForm.submit();"></td>
                </tr>
              </table>
              <font color="#990000"><strong>              <br>
              </strong></font><strong> </strong> <table width="90%" border="0" cellspacing="0" cellpadding="0">
                <form action="?" method="get" 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="24" class="<? if ($SystemMenuID=="HOME") { ?>menu_table_bg_over<? } else { ?>menu_table_bg_normal<? } ?>" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='<? if ($SystemMenuID=="HOME") { ?>menu_table_bg_over<? } else { ?>menu_table_bg_normal<? } ?>'; " onClick="document.myMenuForm.action='../home/home.php'; document.myMenuForm.SystemMenuID.value='HOME'; 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_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="24" 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="24" 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="24" class="<? if ($SystemMenuID=="UserInformation") { ?>menu_table_bg_over<? } else { ?>menu_table_bg_normal<? } ?>" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='<? if ($SystemMenuID=="UserInformation") { ?>menu_table_bg_over<? } else { ?>menu_table_bg_normal<? } ?>'; " onClick="document.myMenuForm.action='../system/user_information.php'; document.myMenuForm.SystemMenuID.value='UserInformation'; 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/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="24" class="<? if ($SystemMenuID=="ManageUser") { ?>menu_table_bg_over<? } else { ?>menu_table_bg_normal<? } ?>" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='<? if ($SystemMenuID=="ManageUser") { ?>menu_table_bg_over<? } else { ?>menu_table_bg_normal<? } ?>'; " onClick="document.myMenuForm.action='../system/user_management.php'; document.myMenuForm.SystemMenuID.value='ManageUser'; 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/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." WHERE ".$System_TableName_Menu."_Status='Enable' 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);
		//if( isUserOnMenu($System_Session_User_ID,$Row[$System_TableName_Menu."_ID"]) ) {
		?>
		<?
		if($System_Session_Permission[$Row[$System_TableName_Menu."_ID"]] !="Hide"){
		?>
                <tr> 
                  <td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
                </tr>
                <tr> 
                  <td height="24" class="<? if ($SystemMenuID==$Row[$System_TableName_Menu."_ID"]) { ?>menu_table_bg_over<? } else { ?>menu_table_bg_normal<? } ?>" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='<? if ($SystemMenuID==$Row[$System_TableName_Menu."_ID"]) { ?>menu_table_bg_over<? } else { ?>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="24" 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="24" 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="24" 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 ----------------------------------------------------------------------------------->
          <br> </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td valign="top">&nbsp;</td>
    <td height="30" align="center" valign="top"><font color="#999999">Copyright &copy; 2005 Design &amp; construction All rights reserved.</font>
                  <font color="#999999">Developed &amp; Design by </font><font color="#666666">Net</font><font color="#99CC00">-Com</font></td>
    <td width="150" valign="top">&nbsp;</td>
  </tr>
</table>
</body>
<!-- InstanceEnd --></html>

Hacked By AnonymousFox1.0, Coded By AnonymousFox