Hacked By AnonymousFox
<?
include("../lib/session.php");
include("../lib/config.php");
include("../lib/connect.php");
include("../lib/function.php");
?>
<html><!-- InstanceBegin template="/Templates/WebEngine-Adminpanel1.dwt.php" 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 -->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
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];}
}
//-->
</script>
<link href="../css/mystyle.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#E9E6DF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../../images/thai.gif','../../images/eng.gif','../../images/chaina.gif','../../images/object/topbar-thai-over.gif','../../images/object/topbar-english-over.gif','../images/bullet/lang_over_02_1.gif','../images/bullet/lang_over_01_1.gif','../images/bullet/lang_over_03.gif')">
<table width="95%" height="26" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="1" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
<td background="../../images/main/main-t-bg.gif" bgcolor="#831B0E"><table width="100%" height="26" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="867" valign="top"><img src="../../images/main/logo.gif" width="273" height="70" alt="กระทรวงศึกษาธิการ" /> </td>
<td width="115" align="right" valign="top"><a href="setlanguage.php?setlang=Thai&&action=setlanguage" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('TopBarTh','','../images/bullet/lang_over_04.gif',1)"><? if($System_Session_Language=="Thai"){$Use = "_over";} else { $Use = "_nor";}?><img src="../images/bullet/lang<?=$Use?>_04.gif" alt="Thai Language" name="TopBarTh" border="0"></a><a href="setlanguage.php?setlang=Eng&&action=setlanguage" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('TopBarEn','','../images/bullet/lang_over_03.gif',1)"><? if($System_Session_Language=="Eng"){$Use = "_over";} else { $Use = "_nor";}?>
<img src="../images/bullet/lang<?=$Use?>_03.gif" alt="English Language" name="TopBarEn"border="0"></a> </td>
</tr>
</table></td><td width="1" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
</table>
<table width="95%" height="6" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="1" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
<td width="587" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
<td width="1" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="1" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
<td align="center" valign="top"><table width="100%" height="480" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="215" align="center" valign="top" bgcolor="#9C9994" style="background-repeat:repeat-x; "><br>
<!--Start Menu ----------------------------------------------------------------------------------->
<? if(strlen($System_Session_User_ID)==0) { ?>
<? if($alert=="yes") { ?>
<table width="90%" border="0" cellpadding="1" cellspacing="0" class="messagebox_alert">
<form name="myLoginForm" method="post" action="../../system/login.php" onSubmit="
with(document.myLoginForm) {
if(inputUserName.value=='') {
inputUserName.focus();
return false;
}
if(inputPassword.value=='') {
inputPassword.focus();
return false;
}
}">
<tr align="center">
<td height="40" colspan="2">Incorrect your<br>
UserName or Password.</td>
</tr>
</form>
</table>
<br>
<? } ?>
<table width="97%" height="18" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="8"><img src="../../images/blank.gif" width="1" height="1"></td>
<td ><strong><font color="#FFFFFF"> <img src="../../images/object/bar-icon.gif" width="9" height="5" align="absmiddle"> เข้าสู่ระบบ</font></strong></td>
</tr>
</table>
<table width="100%" height="3" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
</table>
<table width="97%" border="0" cellpadding="0" cellspacing="0" bgcolor="#DFDFDF">
<tr>
<td width="6" height="6"><img src="../../images/object/dot-border-1.gif" width="6" height="6"></td>
<td height="6" background="../../images/object/dot-border-2.gif"><img src="../../images/blank.gif" width="1" height="1"></td>
<td width="6" height="6"><img src="../../images/object/dot-border-3.gif" width="6" height="6"></td>
</tr>
<tr>
<td width="6" background="../../images/object/dot-border-4.gif"><img src="../../images/blank.gif" width="1" height="1"></td>
<td align="center" valign="top">
<table width="100%" height="120" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="80" align="center" valign="middle">
<form name="myLoginForm" method="post" action="login.php" onSubmit="
with(document.myLoginForm) {
if(inputUserName.value=='') {
inputUserName.focus();
return false;
}
if(inputPassword.value=='') {
inputPassword.focus();
return false;
}
}
">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td height="18" colspan="2" valign="bottom"><font color="#990000"><strong>Username</strong></font><font color="#990000"> </font></td>
</tr>
<tr>
<td width="10"> </td>
<td> <input name="inputUserName" type="text" class="input_left" id="inputUserName" size="20" maxlength="50"></td>
</tr>
<tr>
<td height="18" colspan="2" valign="bottom"><font color="#990000"><strong>Password</strong></font><font color="#990000"> </font></td>
</tr>
<tr>
<td width="10"> </td>
<td><input name="inputPassword" type="password" class="input_left" id="inputPassword" size="20" maxlength="50"></td>
</tr>
<tr>
<td width="10"> </td>
<td align="right"><input name="Submit" type="submit" class="button_60" value="LogIn"></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
<td width="6" background="../../images/object/dot-border-5.gif"><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
<tr>
<td width="6" height="6"><img src="../../images/object/dot-border-6.gif" width="6" height="6"></td>
<td height="6" background="../../images/object/dot-border-7.gif"><img src="../../images/blank.gif" width="1" height="1"></td>
<td width="6" height="6"><img src="../../images/object/dot-border-8.gif" width="6" height="6"></td>
</tr>
</table>
<br>
<? } else { ?>
<? if($SystemMenuID=="") { $SystemMenuID=-1; } ?>
<table width="205" height="21" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/bg-search.gif" style="background-repeat:repeat-x; ">
<tr>
<td width="5%" > </td>
<td width="95%" height="43" ><strong><font color="#FFFFFF"> <img src="../../images/object/bar-icon.gif" width="9" height="5" align="absmiddle"> เมนูหลัก</font></strong></td>
</tr>
</table>
<table width="205" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#F3F3F3"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<form action="../../Templates/" method="get" name="myMenuForm" id="myMenuForm">
<input type="hidden" name="SystemMenuID">
<input type="hidden" name="SystemModuleKey">
<input type="hidden" name="System_EXID" value="<?=$System_EXID?>">
</form>
<? if($System_Session_User_ID>0) { ?>
<tr>
<td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="1" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="document.myMenuForm.action='../home/index.php'; document.myMenuForm.submit();">
<table width="100%" height="24" border="0" cellpadding="2" cellspacing="0" class="menu_table_text">
<tr>
<td width="22" align="center"><img src="../images/icon/ico516.gif" width="16" height="14"></td>
<td>Home</td>
</tr>
</table></td>
</tr>
<tr>
<td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="22" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="
document.myMenuForm.action='../system/user_information.php';
document.myMenuForm.SystemMenuID.value=-3;
document.myMenuForm.submit();
"><table width="100%" height="25" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="22" align="center"><img src="../images/icon/ico559.gif" width="15" height="16"></td>
<td>
<? if($SystemMenuID==-3) { ?>
<b><font color="#990000">User Information</font></b>
<? } else { ?>
User Information
<? } ?>
</td>
</tr>
</table></td>
</tr>
<? } ?>
<!---------------------------------------------------------------------------->
<? if($System_Session_Level=="Admin") { ?>
<tr>
<td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="22" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="
document.myMenuForm.action='../system/user_management.php';
document.myMenuForm.SystemMenuID.value=-4;
document.myMenuForm.submit();
"><table width="100%" height="25" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="22" align="center"><img src="../images/icon/ico051.gif" width="13" height="19"></td>
<td>
<? if($SystemMenuID==-4) { ?>
<b><font color="#990000">Manage User Admin</font></b>
<? } else { ?>
Manage User Admin
<? } ?>
</td>
</tr>
</table></td>
</tr>
<? } ?>
<!---------------------------------------------------------------------------->
<? if($System_Session_User_ID==0) { ?>
<tr>
<td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="22" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="
document.myMenuForm.action='../mod_dmenu/index.php';
document.myMenuForm.SystemMenuID.value=-2;
document.myMenuForm.submit();
"><table width="100%" height="25" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="22" align="center"><img src="../images/icon/ico509.gif" width="16" height="13"></td>
<td>
<? if($SystemMenuID==-2) { ?>
<b><font color="#990000">Menu Bulider</font></b>
<? } else { ?>
Menu Bulider
<? } ?>
</td>
</tr>
</table></td>
</tr>
<? } ?>
<? if($System_Session_User_ID>0) { ?>
<?
$sql = "SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_ParentID=0 AND ".$System_TableName_Menu."_Language = '$System_Session_Language' ORDER BY ".$System_TableName_Menu."_Order ASC ";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$MenuRecordCount=MYSQL_NUMROWS($Query);
$index=1;
if($MenuRecordCount>0) {
while($index<$MenuRecordCount+1) {
$Row=MYSQL_FETCH_ARRAY($Query);
// checking for User Permission
$myUserID = $System_Session_User_ID;
$myMenuID = $Row[$System_TableName_Menu."_ID"];
$myMenuPermission = getUserPermissionOnMenu($myUserID,$myMenuID);
if($Row[$System_TableName_Menu."_Type"]=="Group") {
$isUserOnGroup=isUserOnGroup($myUserID,$myMenuID);
} else {
$isUserOnGroup=1;
}
if( strlen($myMenuPermission)>0 && $myMenuPermission!="NA" && $isUserOnGroup>0) {
?>
<tr>
<td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="22" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="
<? if($Row[$System_TableName_Menu."_ModuleType"]=="Group") { ?>
menuHideSubShow('idMenuSub<?=$Row[$System_TableName_Menu."_ID"]?>');
<? } else { ?>
with(document.myMenuForm) {
SystemMenuID.value=<?=$Row[$System_TableName_Menu."_ID"]?>;
SystemModuleKey.value='<?=$Row[$System_TableName_Menu."_ModuleKey"]?>';
action='<?=$Row[$System_TableName_Menu."_LinkPath"]?>';
submit();
}
<? } ?>
"><table width="100%" height="25" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="22" align="center"><? if($Row[$System_TableName_Menu."_Icon"]==""){ ?>
<img src="../images/icon/145.gif"> <? }else{ ?>
<img src="<?=$Row[$System_TableName_Menu."_Icon"]?>"><? } ?></td>
<td>
<? if($SystemMenuID==$Row[$System_TableName_Menu."_ID"]) { ?>
<b><font color="#990000">
<?=$Row[$System_TableName_Menu."_Name".$System_Session_Language]?>
</font></b>
<? } else { ?>
<?=$Row[$System_TableName_Menu."_Name".$System_Session_Language]?>
<? } ?>
</td>
<? if($Row[$System_TableName_Menu."_ModuleType"]=="Group") { ?>
<td width="14" align="left"><img src="../images/arrow1.gif" width="13" height="10"></td>
<? } ?>
</tr>
</table></td>
</tr>
<?
$ParentID=$Row[$System_TableName_Menu."_ID"];
$sql1 = "SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_ParentID='$ParentID' ORDER BY ".$System_TableName_Menu."_Order ASC ";
$Query1=MYSQL_DB_QUERY($System_DataBase_Name,$sql1) OR DIE("Error: เกิดความผิดพลาด <br>$sql1<br>\n");
$RecordCount1=MYSQL_NUMROWS($Query1);
// checking for this sub menu active
$sql2 = "SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_ID='$SystemMenuID' AND ".$System_TableName_Menu."_ParentID='$ParentID' ";
$Query2=MYSQL_DB_QUERY($System_DataBase_Name,$sql2) OR DIE("Error: เกิดความผิดพลาด <br>$sql2<br>\n");
$isActiveMenu=MYSQL_NUMROWS($Query2);
if($RecordCount1>0) {
?>
<tr id="idMenuSub<?=$ParentID?>" <? if($isActiveMenu==0) { ?> style="display:none" <? } ?>>
<td height="22" align="left" class="menu_table_bg_sub" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="8" >
<td height="8" background="../images/rare1.gif" bgcolor="#EACFD3" style="background-position:top; background-repeat:repeat-x; "><img src="../images/spacer.gif" width="24" height="8" /></td>
</tr>
</table><?
$index1=1;
while($index1<$RecordCount1+1) {
$Row1=MYSQL_FETCH_ARRAY($Query1);
$myID=$Row1[$System_TableName_Menu."_ID"];
// checking for User Permission
$myUserID = $System_Session_User_ID;
$myMenuID = $myID;
$myMenuPermission = getUserPermissionOnMenu($myUserID,$myMenuID);
if( strlen($myMenuPermission)>0 && $myMenuPermission!="NA") {
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="menu_table_bg_sub" onMouseOver="this.className='menu_table_bg_oversub'; " onMouseOut="this.className='menu_table_bg_sub'; " >
<tr>
<td width="4"> </td>
<td width="171" align="left"><table width="100%" height="25" border="0" cellpadding="1" cellspacing="0"
onClick="
with(document.myMenuForm) {
SystemMenuID.value=<?=$Row1[$System_TableName_Menu."_ID"]?>;
SystemModuleKey.value='<?=$Row1[$System_TableName_Menu."_ModuleKey"]?>';
action='<?=$Row1[$System_TableName_Menu."_LinkPath"]?>';
submit();
}
">
<tr>
<td width="22" align="left"><? if($Row1[$System_TableName_Menu."_Icon"]==""){ ?>-<? }else{ ?><img src="<?=$Row1[$System_TableName_Menu."_Icon"]?>"><? }?></td>
<td align="left">
<? if($SystemMenuID==$Row1[$System_TableName_Menu."_ID"]) { ?>
<b><font color="#990000">
<?=$Row1[$System_TableName_Menu."_Name".$System_Session_Language]?>
</font></b>
<? } else { ?>
<font color="#6666AA"><?=$Row1[$System_TableName_Menu."_Name".$System_Session_Language]?></font>
<? } ?> </td>
</tr>
</table></td>
</tr>
<tr align="left">
<td colspan="2"><img src="../images/line3.gif" width="195"></td>
</tr>
</table>
<?
} // if Permission
$index1++;
} // while
} // if RecordCount1
?> </td>
</tr>
<?
} // if myMenuPermission
$index++;
} // while
} // if RecordCount
?>
<? } ?>
<tr>
<td height="1" class="menu_table_bg_hilight"><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="22" class="menu_table_bg_normal" onMouseOver="this.className='menu_table_bg_over'; " onMouseOut="this.className='menu_table_bg_normal'; " onClick="document.myMenuForm.action='../system/logout.php'; document.myMenuForm.submit();"><table width="100%" height="25" border="0" cellpadding="2" cellspacing="0">
<tr>
<td width="22" align="center"><img src="../images/icon/ico569.gif" width="13" height="13"></td>
<td>Logout</td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
<table width="205" height="30" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/bg-search2.gif">
<tr>
<td> </td>
</tr>
</table>
<? } ?>
<script language="JavaScript" type="text/JavaScript">
function menuHideSubShow(myIdName) {
if(document.getElementById(myIdName).style.display=='none') {
document.getElementById(myIdName).style.display=''
} else {
document.getElementById(myIdName).style.display='none';
}
}
</script>
<!--End Menu -----------------------------------------------------------------------------------> </td>
<td align="center" valign="top" bgcolor="#E9E6DF">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="16" valign="top" bgcolor="#C4BDB1"> </td>
<td align="center" valign="top" bgcolor="#C4BDB1"> </td>
<td valign="top" bgcolor="#C4BDB1"> </td>
</tr>
<tr>
<td width="20" valign="top" background="../images/object/border_03.gif"><img src="../images/object/border_16.gif" width="20" height="83"></td>
<td align="center" valign="top" bgcolor="#FFFFFF">
<? if(strlen($System_Session_User_ID)>0) { ?>
<!-- InstanceBeginEditable name="Programmable Region" -->
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="mytable">
<tr>
<td height="26" bgcolor="#FFFFFF" class="mytable_bar"> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="table_header">
<tr>
<td width="30" align="center"><img src="images/icon/ico225.gif" width="16" height="16"></td>
<td class="mytext_big"><font color="#DDDDDD">Manage User Admin </font></td>
</tr>
</table></td>
</tr>
</table>
<table width="97%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="2" class="table_col3"><img src="images/blank.gif" width="2" height="2"></td>
</tr>
<form action="?" method="get" name="myPageRedirectForm" id="myPageRedirectForm">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="ShowID" type="hidden" id="ShowID">
<tr>
<td height="20" align="right"><table height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="5" align="left" valign="bottom" class="table_col3"><img src="images/tab-w.gif" width="1" height="1"></td>
<td width="100" align="center" class="table_col3"> <a href="#" class="link_headbar" onClick="
document.myPageRedirectForm.action='user_management.php';
document.myPageRedirectForm.submit();
">User</a> </td>
<td width="20" class="table_col3"><img src="images/tab-w-slop-down.gif" width="20" height="20"></td>
<td width="5" align="left" valign="bottom" class="table_col2"><img src="images/tab-w.gif" width="1" height="1"></td>
<td width="100" align="center" class="table_col2"><strong><a href="#" class="link_headbar" onClick="
document.myPageRedirectForm.action='department_manager.php';
document.myPageRedirectForm.submit();
">Department</a></strong></td>
<td width="20" class="table_col2"><img src="images/tab-w-slop-down.gif" width="20" height="20"></td>
<td width="5" align="left" valign="bottom" class="table_col2"><img src="images/tab-w.gif" width="1" height="1"></td>
<td width="100" align="center" class="table_col2"><strong><a href="#" class="link_headbar" onClick="
document.myPageRedirectForm.action='position_manager.php';
document.myPageRedirectForm.submit();
">Position</a></strong></td>
<td width="20" class="table_col2"><img src="images/tab-w-slop-down.gif" width="20" height="20"></td>
</tr>
</table></td>
</tr>
</form>
</table><? if($System_Session_Level!="Admin") { ?>
<form action="../home/home.php" method="post" name="myForm" id="myForm">
<input name="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<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>
<? } ?>
<?
//# Default Value ############################################
$SystemModule_defaultPageSize = 20;
$SystemModule_defaultPageShow = 1;
$SystemModule_MaxPage = 20;
$SystemModule_ReduceRange = 10; // +,- from current page show
$SystemModule_ASCDESC = "ASC";
$SystemModule_OrderBy = $System_TableName_Staff."_ID";
//########################################################
?>
<?
//########################################################
if ($action=="addnew") {
$inputUserName = trim($inputUserName);
$sql = "SELECT * FROM ".$System_TableName_Staff." WHERE ".$System_TableName_Staff."_UserName= '".$inputUserName."'";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$RecordCount=MYSQL_NUMROWS($Query);
if($RecordCount==0) {
$sql = "INSERT INTO ".$System_TableName_Staff."(".
$System_TableName_Staff."_Prefix,".
$System_TableName_Staff."_Gender,".
$System_TableName_Staff."_FNameEng,".
$System_TableName_Staff."_FNameThai,".
$System_TableName_Staff."_LNameEng,".
$System_TableName_Staff."_LNameThai,".
$System_TableName_Staff."_UserName,".
$System_TableName_Staff."_Password,".
$System_TableName_Staff."_DepartmentID,".
$System_TableName_Staff."_Location,".
$System_TableName_Staff."_Telephone,".
$System_TableName_Staff."_Mobile,".
$System_TableName_Staff."_Email,".
$System_TableName_Staff."_Other,".
$System_TableName_Staff."_CreateByID,".
$System_TableName_Staff."_CreateDate,".
$System_TableName_Staff."_LastLoginDate,".
$System_TableName_Staff."_Level,".
$System_TableName_Staff."_Status".
") VALUES('$inputPrefix','$inputGender','$inputFNameEng','$inputFNameThai','$inputLNameEng','$inputLNameThai','$inputUserName','".$inputPassword."',$inputDepartmentID,'$inputLocation','$inputTelephone','$inputMobile','$inputEmail','$inputOther',$System_Session_User_ID,Now(),Now(),'$inputLevel','Enable') ";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$MaxID = mysql_insert_id();
// Add Permission
$Field=$System_TableName_StaffOnPermission;
if($inputLevel=="Staff"){
$PermissionStr=$Permission;
}else{
$PermissionStr=$PermissionAdmin;
}
$pmArr=explode(",",$PermissionStr);
for($i=0;$i<count($pmArr);$i++){
$pmDivide=explode(":",$pmArr[$i]);
$sql="INSERT INTO ".$Field."(".$Field."_StaffID,".$Field."_MenuID,".$Field."_Permission) VALUES(".$MaxID.",".$pmDivide[0].",'".$pmDivide[1]."')";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
// Set Picture
if($useDefault==0){
$dataArr=explode(".",$inputPicture_name);
$dataArr[1] = strtolower($dataArr[1]);
if($dataArr[1]=="bmp"||$dataArr[1]=="jpg"||$dataArr[1]=="gif"){
copy($inputPicture,"../upload/account_images/$MaxID.".$dataArr[1]);
$sql="UPDATE ".$System_TableName_Staff." SET ".$System_TableName_Staff."_Picture='".$MaxID.".".$dataArr[1]."' WHERE ".$System_TableName_Staff."_ID=".$MaxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
}
// Set Position
for($i=0;$i<sizeof($inputPositionID);$i++) {
if(strlen($inputPositionID[$i])>0) {
$sql = " INSERT INTO ".$System_TableName_StaffOnPosition."(".$System_TableName_StaffOnPosition."_AccountID ,".$System_TableName_StaffOnPosition."_PositionID ) ".
" VALUES ($MaxID,$inputPositionID[$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="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<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 {
$action="add";
$showalert="yes";
}
}
?>
<?
//########################################################
if ($action=="update") {
$inputUserName = trim($inputUserName);
$sql = "SELECT * FROM ".$System_TableName_Staff." WHERE ".$System_TableName_Staff."_UserName= '".$inputUserName."' AND ".$System_TableName_Staff."_ID<>".$myCheckBoxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$RecordCount=MYSQL_NUMROWS($Query);
$MaxID = $myCheckBoxID;
if($RecordCount==0) {
$sql = "UPDATE ".$System_TableName_Staff." SET ".
$System_TableName_Staff."_Prefix = '".$inputPrefix."',".
$System_TableName_Staff."_Gender = '".$inputGender."',".
$System_TableName_Staff."_FNameEng = '".$inputFNameEng."',".
$System_TableName_Staff."_FNameThai = '".$inputFNameThai."',".
$System_TableName_Staff."_LNameEng = '".$inputLNameEng."',".
$System_TableName_Staff."_LNameThai = '".$inputLNameThai."',".
$System_TableName_Staff."_UserName = '".$inputUserName."',".
$System_TableName_Staff."_Password = '".$inputPassword."',".
$System_TableName_Staff."_DepartmentID = ".$inputDepartmentID.",".
$System_TableName_Staff."_Location = '".$inputLocation."',".
$System_TableName_Staff."_Telephone = '".$inputTelephone."',".
$System_TableName_Staff."_Mobile = '".$inputMobile."',".
$System_TableName_Staff."_Email = '".$inputEmail."',".
$System_TableName_Staff."_Other = '".$inputOther."',".
$System_TableName_Staff."_CreateByID = ".$System_Session_User_ID.",".
$System_TableName_Staff."_CreateDate = Now(),".
$System_TableName_Staff."_Level = '".$inputLevel."'".
" WHERE ".$System_TableName_Staff."_ID = ".$myCheckBoxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
// Add Permission
$Field=$System_TableName_StaffOnPermission;
$sql="DELETE FROM ".$Field." WHERE ".$Field."_StaffID=".$MaxID." AND ".$Field."_Language = '$System_Session_Language'";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
if($inputLevel=="Staff"){
$PermissionStr=$Permission;
}else{
$PermissionStr=$PermissionAdmin;
}
$pmArr=explode(",",$PermissionStr);
for($i=0;$i<count($pmArr);$i++){
$pmDivide=explode(":",$pmArr[$i]);
$sql="INSERT INTO ".$Field."(".$Field."_StaffID,".$Field."_MenuID,".$Field."_Permission,".$Field."_Language) VALUES (".$MaxID.",".$pmDivide[0].",'".$pmDivide[1]."','$System_Session_Language')";
echo $sql;
echo "<br><br>";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
// Set Picture
if ($useDefault==1) {
$sql="SELECT ".$System_TableName_Staff."_Picture FROM ".$System_TableName_Staff." WHERE ".$System_TableName_Staff."_ID=".$MaxID;
$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);
if($row[0]!="default.gif"){
unlink("../../upload/account_images/".$row[0]);
}
}
$sql="UPDATE ".$System_TableName_Staff." SET ".$System_TableName_Staff."_Picture='default.gif' WHERE ".$System_TableName_Staff."_ID=".$MaxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
} else {
$dataArr=explode(".",$inputPicture_name);
$dataArr[1] = strtolower($dataArr[1]);
if($dataArr[1]=="bmp"||$dataArr[1]=="jpg"||$dataArr[1]=="gif"){
$sql="SELECT ".$System_TableName_Staff."_Picture FROM ".$System_TableName_Staff." WHERE ".$System_TableName_Staff."_ID=".$MaxID;
$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);
if($row[0]!="default.gif"){
unlink("../../upload/account_images/".$row[0]);
}
}
copy($inputPicture,"../../upload/account_images/$MaxID.".$dataArr[1]);
$sql="UPDATE ".$System_TableName_Staff." SET ".$System_TableName_Staff."_Picture='".$MaxID.".".$dataArr[1]."' WHERE ".$System_TableName_Staff."_ID=".$MaxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
}
}
// Set Position
$sql = "DELETE FROM ".$System_TableName_StaffOnPosition." WHERE ".$System_TableName_StaffOnPosition."_AccountID = ".$myCheckBoxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
for($i=0;$i<sizeof($inputPositionID);$i++) {
if(strlen($inputPositionID[$i])>0) {
$sql = "INSERT INTO ".$System_TableName_StaffOnPosition."(".$System_TableName_StaffOnPosition."_AccountID ,".$System_TableName_StaffOnPosition."_PositionID ) ".
" VALUES ($MaxID,$inputPositionID[$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="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<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 {
$action="edit";
$showalert="yes";
}
}
?>
<?
####################################################################
if($action=="add") {
for($i=0;$i<sizeof($inputPositionID);$i++) {
$position = $inputPositionID[$i];
$PositionID[$position] = 1;
}
?>
<br>
<table width="95%" border="0" cellpadding="0" cellspacing="1" class="mytable_border">
<form action="?" method="post" name="myReturnForm" id="myReturnForm">
<input name="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<input name="action" type="hidden" id="action" value="">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
</form>
<form action="" method="post" name="myForm" id="myForm" enctype="multipart/form-data">
<input name="Permission" type="hidden" id="Permission" value="">
<input name="PermissionAdmin" type="hidden" id="PermissionAdmin" value="">
<input name="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<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?>">
<tr>
<td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="2" cellspacing="1">
<tr>
<td height="24" colspan="4" align="center" class="menu_table_header">Add New User Admin </td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> User Information</td>
</tr>
<tr>
<td width="20%" height="22" align="right" class="table_col1">* Prefix </td>
<td width="30%" height="22" class="table_col2"><input name="inputPrefix" type="radio" value="Mr." onClick="document.myForm.inputGender[0].checked=true" <? if ($inputPrefix=="Mr.") echo "checked"; ?>>
<span class="mytext_bold">Mr.</span>
<input name="inputPrefix" type="radio" value="Miss" onClick="document.myForm.inputGender[1].checked=true" <? if ($inputPrefix=="Miss") echo "checked"; ?>>
<span class="mytext_bold">Miss</span>
<input name="inputPrefix" type="radio" value="Mrs." onClick="document.myForm.inputGender[1].checked=true" <? if ($inputPrefix=="Mrs.") echo "checked"; ?>>
<span class="mytext_bold">Mrs.</span></td>
<td width="20%" height="22" align="right" class="table_col1">* Gender </td>
<td width="30%" height="22" class="table_col2"><input name="inputGender" type="radio" value="Male" onClick="document.myForm.inputPrefix[0].checked=true" <? if ($inputGender=="Male") echo "checked"; ?>>
<span class="mytext_bold">Male </span>
<input name="inputGender" type="radio" value="Female" onClick="document.myForm.inputPrefix[1].checked=true" <? if ($inputGender=="Female") echo "checked"; ?>>
<span class="mytext_bold">Female</span></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* <span class="style1">Eng</span> First Name </td>
<td height="22" class="table_col2"><input name="inputFNameEng" type="text" class="input_left" id="inputFNameEng" value="<?=$inputFNameEng?>" size="30" maxlength="50"></td>
<td align="right" class="table_col1">* <span class="style1">Eng</span> Last Name </td>
<td class="table_col2"><input name="inputLNameEng" type="text" class="input_left" id="inputLNameEng" value="<?=$inputLNameEng?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* <span class="style1">Thai</span> First Name </td>
<td height="22" class="table_col2"><input name="inputFNameThai" type="text" class="input_left" id="inputFNameThai" value="<?=$inputFNameThai?>" size="30" maxlength="50"></td>
<td class="table_col1" align="right">* <span class="style1">Thai</span> Last Name </td>
<td class="table_col2"><input name="inputLNameThai" type="text" class="input_left" id="inputLNameThai" value="<?=$inputLNameThai?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* Position </td>
<td height="22" class="table_col2"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<?
$sql = "select * from ".$System_TableName_Position." Order By ".$System_TableName_Position."_ID Asc";
$query = mysql_query($sql);
while ($row = mysql_fetch_array($query)) {
?>
<tr>
<td width="30" align="center"><input name="inputPositionID[]" id="inputPositionID" type="checkbox" class="myform_checkbox" value="<?=$row[$System_TableName_Position."_ID"]?>" <? if ($PositionID[$row[$System_TableName_Position."_ID"]]==1) echo "checked"; ?>></td>
<td align="left"><?=$row[$System_TableName_Position."_Name"]?></td>
<tr>
<? } ?>
</table></td>
<td colspan="2" rowspan="6" align="center" class="table_col2"><table width="10" height="10" border="0" cellpadding="0" cellspacing="1" class="mytable_border">
<tr>
<td bgcolor="#FFFFFF"><table width="100%" height="100%" border="0" cellpadding="2" cellspacing="1">
<tr>
<td height="22" align="center" class="table_col3">Picture</td>
</tr>
<tr>
<td align="center" class="table_col1"><img src="<?=$System_RelativePath_Upload?>/account_images/default.gif" name="PreviewImage" width="100" height="130" id="PreviewImage"></td>
</tr>
<tr>
<td height="22" align="center" class="table_col3">
<input name="checkbox" id="checkbox" type="checkbox" class="myform_checkbox" value="checkbox" checked onClick="
if(document.getElementById('checkbox').checked==true){
document.getElementById('inputPicture').disabled=true;
document.getElementById('useDefault').value=1;
document.getElementById('PreviewImage').src='../../upload/account_images/default.gif';
}else{
document.getElementById('inputPicture').disabled=false;
document.getElementById('PreviewImage').src='images/blankPic.gif';
document.getElementById('useDefault').value=0;
}
//alert(document.getElementById('useDefault').value);
">
Use default </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* Department </td>
<td height="22" class="table_col2"><select name="inputDepartmentID" class="select" id="inputDepartmentID">
<?
echo "<option value='0'>------ Select ------</option>";
$sql = "select * from ".$System_TableName_Department;
$query = mysql_query($sql);
while ($row = mysql_fetch_array($query)) {
echo "<option value='".$row[$System_TableName_Department."_ID"]."'>".$row[$System_TableName_Department."_Name"]."</option>";
}
?>
</select>
<?
if ($inputDepartmentID<>"") echo "<script language='JavaScript'>document.myForm.inputDepartmentID.value='".$inputDepartmentID."';</script>";
?></td>
</tr>
<tr>
<td height="10" align="right" class="table_col1">Location</td>
<td height="10" class="table_col2"><input name="inputLocation" type="text" class="input_left" id="inputLocation" value="<?=$inputLocation?>" size="30" maxlength="100"></td>
</tr>
<tr>
<td height="11" align="right" class="table_col1">Telephone </td>
<td height="11" class="table_col2"><input name="inputTelephone" type="text" class="input_left" id="inputTelephone" value="<?=$inputTelephone?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">Mobile </td>
<td height="22" class="table_col2"><input name="inputMobile" type="text" class="input_left" id="inputMobile" value="<?=$inputMobile?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* E-mail </td>
<td height="22" class="table_col2"><input name="inputEmail" type="text" class="input_left" id="inputEmail" value="<?=$inputEmail?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">Other </td>
<td height="22" class="table_col2"><input name="inputOther" type="text" class="input_left" id="inputOther" value="<?=$inputOther?>" size="30" maxlength="50"></td>
<td height="22" class="table_col1" align="right"><input name="useDefault" type="hidden" id="useDefault" value="1">
Picture </td>
<td class="table_col2">
<input name="inputPicture" type="file" class="input_left" id="inputPicture" disabled
onChange="
myfile = this.value;
if(myfile!='') {
myfile = myfile.toLowerCase();
Temp = myfile.charAt(myfile.length-4) + myfile.charAt(myfile.length-3) + myfile.charAt(myfile.length-2) + myfile.charAt(myfile.length-1);
if(Temp=='.jpg' || Temp=='.gif' || Temp=='jpeg') {
document.getElementById('PreviewImage').src=myfile;
} else {
alert('System allow to upload image files only.');
this.focus();
}
} " size="19">
</td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> System Information</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* UserName </td>
<td height="22" class="table_col2">
<input name="inputUserName" type="text" class="input_left" id="inputUserName" value="<?=$inputUserName?>" size="30" maxlength="50">
</td>
<td height="22" class="table_col1" align="right">* Password </td>
<td height="22" class="table_col2"><input name="inputPassword" type="password" class="input_left" id="inputPassword" value="<?=$inputPassword?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1"> </td>
<td height="22" class="table_col2">
<? if($showalert=="yes") { ?><font color="#FF0000"><strong>UserName was existed!</strong></font>
<? } ?>
</td>
<td height="22" class="table_col1" align="right">* Confirm Password </td>
<td height="22" class="table_col2"><input name="inputPassword1" type="password" class="input_left" id="inputPassword1" value="<?=$inputPassword1?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> Level and Under Information</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* Level </td>
<td colspan="3" valign="top" class="table_col2"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20" height="18" align="center">
<input name="inputLevel" type="radio" class="myform_checkbox" value="Admin" <? if ($inputLevel=='Admin') echo 'checked'; ?> onClick="
document.getElementById('trAdmin').style.display='';
document.getElementById('trStaff').style.display='none';
"></td>
<td width="38" height="18">Admin</td>
<td width="20" height="18" align="center">
<input name="inputLevel" type="radio" class="myform_checkbox" value="Staff" checked <? if ($inputLevel=='Staff') echo 'checked'; ?> onClick="
document.getElementById('trAdmin').style.display='none';
document.getElementById('trStaff').style.display='';
"></td>
<td height="18">Staff</td>
</tr>
</table></td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> Permission Manage</td>
</tr>
<tr id="trAdmin" style="display:none ">
<td height="22" colspan="4" align="center" class="table_col1"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr align="center">
<td height="24" class="table_col3">Menu List</td>
<td height="24" align="center" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAllAdmin('AdminR');" value="Select All"></td>
<td height="24" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAllAdmin('AdminRW');" value="Select All"></td>
<td height="24" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAllAdmin('AdminNA');" value="Select All"></td>
</tr>
<?
//CST Admin
$Field=$System_TableName_Menu;
$sqlTopic="SELECT * FROM ".$System_TableName_Menu." ORDER BY ".$Field."_Order";
$QueryTopic=MYSQL_DB_QUERY($System_DataBase_Name,$sqlTopic) OR DIE("Error: เกิดความผิดพลาด <br>$sqlTopic<br>\n");
if(mysql_num_rows($QueryTopic)==0){
?>
<tr align="center">
<td height="50" colspan="4" class="table_col2">Data not found </td>
</tr>
<?
}else{
$topicIndex=0;
?>
<?
while($topic=mysql_fetch_array($QueryTopic)){
$sqlSub="SELECT * FROM ".$System_TableName_Menu." ORDER BY ".$Field."_Order";
$QuerySub=MYSQL_DB_QUERY($System_DataBase_Name,$sqlSub) OR DIE("Error: เกิดความผิดพลาด <br>$sqlSub<br>\n");
$dataArrAdmin[$topicIndex][0]=$topic[$Field."_ID"];
$dataArrAdmin[$topicIndex][1]=$topic[$Field."_ID"];
$topicIndex+=1;
?>
<tr class="table_row2">
<td width="52%" height="24">
<table width="294" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="32" align="center"><? if($topic[$Field."_Icon"]){?><img src="<?=$topic[$Field."_Icon"]?>" border="0" align="absmiddle"><? } else{ ?> - <? } ?></td>
<td width="262"><?=$topic[$Field."_Name".$System_Session_Language]?></td>
</tr>
</table></td>
<td width="16%" height="24" align="center"><input name="AdminP<?=$topic[$Field."_ID"]?>" id="AdminR<?=$topic[$Field."_ID"]?>" type="radio" class="myform_checkbox" value="R" onClick="checkInSubAdmin('AdminR',<?=$topic[$Field."_ID"]?>)" >
<font color="#B98B00">Read</font></td>
<td width="16%" height="24" align="center"><input name="AdminP<?=$topic[$Field."_ID"]?>" id="AdminRW<?=$topic[$Field."_ID"]?>"type="radio" class="myform_checkbox" value="RW" onClick="checkInSubAdmin('AdminRW',<?=$topic[$Field."_ID"]?>)" checked>
<font color="#B98B00">Read/Write</font></td>
<td width="16%" height="24" align="center"><input name="AdminP<?=$topic[$Field."_ID"]?>" id="AdminNA<?=$topic[$Field."_ID"]?>" type="radio" class="myform_checkbox" value="NA" onClick="checkInSubAdmin('AdminNA',<?=$topic[$Field."_ID"]?>)">
<font color="#B98B00">Not Access</font></td>
</tr>
<?
//if(mysql_num_rows($QuerySub)>0){
// }
}
}
?>
</table></td>
</tr>
<script language="javascript">
var idArrAdmin=new Array(<?=$topicIndex?>);
for(i=0;i<<?=$topicIndex?>;i++){
idArrAdmin[i]=new Array(2);
}
<? for($i=0;$i<$topicIndex;$i++){
echo "idArrAdmin[".$i."][0]=".$dataArrAdmin[$i][0].";";
echo "idArrAdmin[".$i."][1]=".$dataArrAdmin[$i][1].";";
}
?>
function checkAllAdmin(type){
for(i=0;i<<?=$topicIndex?>;i++){
document.getElementById(type+idArrAdmin[i][0]).checked=true;
}
}
function checkInSubAdmin(type,topicId){
for(i=0;i<<?=$topicIndex?>;i++){
if(idArrAdmin[i][1]==topicId){
document.getElementById(type+idArrAdmin[i][0]).checked=true;
}
}
}
function genDataAdmin(){
var genStrAdmin="";
for(i=0;i<<?=$topicIndex?>;i++){
if(document.getElementById("AdminR"+idArrAdmin[i][0]).checked==true) {
genStrAdmin+=idArrAdmin[i][0]+":R";
} else if(document.getElementById("AdminRW"+idArrAdmin[i][0]).checked==true) {
genStrAdmin+=idArrAdmin[i][0]+":RW";
}else{
genStrAdmin+=idArrAdmin[i][0]+":NA";
}
if(i!=<?=$topicIndex-1?>){
genStrAdmin+=",";
}
}
document.getElementById("PermissionAdmin").value=genStrAdmin;
}
</script>
<? ############ ##### ?>
<tr id="trStaff">
<td height="22" colspan="4" align="center" class="table_col1"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr align="center">
<td height="24" class="table_col3">Menu List</td>
<td height="24" align="center" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAll('R');" value="Select All"></td>
<td height="24" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAll('RW');" value="Select All"></td>
<td height="24" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAll('NA');" value="Select All"></td>
</tr>
<?
//Dealer Staff
$Field=$System_TableName_Menu;
$sqlTopic="SELECT * FROM ".$System_TableName_Menu." ORDER BY ".$Field."_Order";
$QueryTopic=MYSQL_DB_QUERY($System_DataBase_Name,$sqlTopic) OR DIE("Error: เกิดความผิดพลาด <br>$sqlTopic<br>\n");
if(mysql_num_rows($QueryTopic)==0){
?>
<tr align="center">
<td height="50" colspan="4" class="table_col2">Data not found </td>
</tr>
<?
}else{
$topicIndex=0;
?>
<?
while($topic=mysql_fetch_array($QueryTopic)){
$sqlSub="SELECT * FROM ".$System_TableName_Menu." ORDER BY ".$Field."_Order";
$QuerySub=MYSQL_DB_QUERY($System_DataBase_Name,$sqlSub) OR DIE("Error: เกิดความผิดพลาด <br>$sqlSub<br>\n");
$dataArr[$topicIndex][0]=$topic[$Field."_ID"];
$dataArr[$topicIndex][1]=$topic[$Field."_ID"];
$topicIndex+=1;
?>
<tr class="table_row2">
<td width="52%" height="24">
<table width="294" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="32" align="center"><? if($topic[$Field."_Icon"]){?><img src="<?=$topic[$Field."_Icon"]?>" border="0" align="absmiddle"><? } else{ ?> - <? } ?></td>
<td width="262"><?=$topic[$Field."_Name".$System_Session_Language]?></td>
</tr>
</table></td>
<td width="16%" height="24" align="center"><input name="P<?=$topic[$Field."_ID"]?>" id="R<?=$topic[$Field."_ID"]?>" type="radio" class="myform_checkbox" value="R" onClick="checkInSub('R',<?=$topic[$Field."_ID"]?>)" >
<font color="#B98B00">Read</font></td>
<td width="16%" height="24" align="center"><input name="P<?=$topic[$Field."_ID"]?>" id="RW<?=$topic[$Field."_ID"]?>"type="radio" class="myform_checkbox" value="RW" onClick="checkInSub('RW',<?=$topic[$Field."_ID"]?>)" checked>
<font color="#B98B00">Read/Write</font></td>
<td width="16%" height="24" align="center"><input name="P<?=$topic[$Field."_ID"]?>" id="NA<?=$topic[$Field."_ID"]?>" type="radio" class="myform_checkbox" value="NA" onClick="checkInSub('NA',<?=$topic[$Field."_ID"]?>)">
<font color="#B98B00">Not Access</font></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">
<script language="javascript">
var idArr=new Array(<?=$topicIndex?>);
for(i=0;i<<?=$topicIndex?>;i++){
idArr[i]=new Array(2);
}
<? for($i=0;$i<$topicIndex;$i++){
echo "idArr[".$i."][0]=".$dataArr[$i][0].";";
echo "idArr[".$i."][1]=".$dataArr[$i][1].";";
}
?>
function checkAll(type){
for(i=0;i<<?=$topicIndex?>;i++){
document.getElementById(type+idArr[i][0]).checked=true;
}
}
function checkInSub(type,topicId){
for(i=0;i<<?=$topicIndex?>;i++){
if(idArr[i][1]==topicId){
document.getElementById(type+idArr[i][0]).checked=true;
}
}
}
function genData(){
var genStr="";
for(i=0;i<<?=$topicIndex?>;i++){
if(document.getElementById("R"+idArr[i][0]).checked==true) {
genStr+=idArr[i][0]+":R";
} else if(document.getElementById("RW"+idArr[i][0]).checked==true) {
genStr+=idArr[i][0]+":RW";
}else{
genStr+=idArr[i][0]+":NA";
}
if(i!=<?=$topicIndex-1?>){
genStr+=",";
}
}
document.getElementById("Permission").value=genStr;
}
</script>
<table width="300" border="0" cellspacing="0" cellpadding="2">
<tr align="center">
<td>
<script language="JavaScript" src="../lib/checkemail.js"></script>
<script language="JavaScript" type="text/JavaScript">
function isBlank(myObj) {
if(myObj.value=='') { return true; }
return false;
}
function verifySubmit() {
genData();
genDataAdmin();
with(document.myForm) {
if (inputPrefix[0].checked==false && inputPrefix[1].checked==false && inputPrefix[2].checked==false) {
alert('กรุณาเลือกคำนำหน้าชื่อ');
inputPrefix[0].focus();
return false;
}
if (inputGender[0].checked==false && inputGender[1].checked==false) {
alert('กรุณาเลือกเพศ');
inputGender[0].focus();
return false;
}
if (isBlank(inputFNameEng)) { inputFNameEng.focus(); return false; }
if (isBlank(inputLNameEng)) { inputLNameEng.focus(); return false; }
if (isBlank(inputFNameThai)) { inputFNameThai.focus(); return false; }
if (isBlank(inputLNameThai)) { inputLNameThai.focus(); return false; }
foundPosition = false;
if (inputPositionID.length>1) {
for (index=0;index<inputPositionID.length;index++) {
if (inputPositionID[index].checked==true) foundPosition = true;
}
if (!foundPosition) {
alert('กรุณาเลือกตำแหน่ง');
inputPositionID[0].focus();
return false;
}
} else {
if (inputPositionID.checked==true) foundPosition = true;
if (!foundPosition) {
alert('กรุณาเลือกตำแหน่ง');
inputPositionID.focus();
return false;
}
}
if (inputDepartmentID.value==0) { inputDepartmentID.focus(); return false; }
if(isBlank(inputEmail)) { inputEmail.focus(); return false; }
if (!isEmail(inputEmail.value)) {
alert('Email ไม่ถูกต้อง กรุณาใช้รูปแบบของ Email เป็นดังนี้\nyourname@yourdomain\n\nตัวอย่างเช่น\n\n sample@gm.com\n sample@hotmail.com\n sample@net-com.co.th');
inputEmail.focus();
return false;
}
if (isBlank(inputUserName)) { inputUserName.focus(); return false; }
if (isBlank(inputPassword)) { inputPassword.focus(); return false; }
if (isBlank(inputPassword1)) { inputPassword1.focus(); return false; }
if (inputPassword.value!=inputPassword1.value) {
alert('กรุณากรอกข้อมูลรหัสผ่าน และยืนยันรหัสผ่าน ให้เหมือนกันทั้งสองช่อง');
inputPassword.focus();
return false;
}
if (inputLevel[0].checked==false && inputLevel[1].checked==false) {
alert('กรุณาเลือกระดับของผู้ใช้งาน');
inputLevel[0].focus();
return false;
}
}
return true;
}
</script>
<script language="JavaScript" type="text/JavaScript" src="../lib/popup.js"></script>
<script language="JavaScript" type="text/JavaScript" src="../lib/Check_Duplicate.js"></script>
<input name="btAdd" type="button" class="button_80" id="btAdd" value="Add" onClick="
if(verifySubmit()) {
SQL1 = 'SELECT * FROM <?=$System_TableName_Staff?> WHERE <?=$System_TableName_Staff?>_FNameEng=<speech>'+document.myForm.inputFNameEng.value+'<speech> AND <?=$System_TableName_Staff?>_LNameEng=<speech>'+document.myForm.inputLNameEng.value+'<speech> ';
SQL2 = 'SELECT * FROM <?=$System_TableName_Staff?> WHERE <?=$System_TableName_Staff?>_FNameThai=<speech>'+document.myForm.inputFNameThai.value+'<speech> AND <?=$System_TableName_Staff?>_LNameThai=<speech>'+document.myForm.inputLNameThai.value+'<speech> ';
SQL3 = 'SELECT * FROM <?=$System_TableName_Staff?> WHERE <?=$System_TableName_Staff?>_UserName=<speech>'+document.myForm.inputUserName.value+'<speech>';
Check_Duplicate_Manual(SQL1+'<tab>'+SQL2+'<tab>'+SQL3,'inputFNameEng<tab>inputFNameEng<tab>inputUserName','Englist First Name and Last Name<tab>Thai First Name and Last Name<tab>UserName');
}
">
</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>
<iframe id="frameCheckDuplicate" src="#" height="100" width="100%" frameborder="0" scrolling="no" style="display:none"></iframe>
<br>
<?
//########################################################
} else if ($action=="edit") {
// Load data , if inputPostionID is set
for($i=0;$i<sizeof($inputPositionID);$i++) {
$position = $inputPositionID[$i];
$PositionID[$position] = 1;
}
if($showalert<>"yes") {
for($i=1;$i<=$TotalCheckBoxID;$i++) {
$myVar="CheckBoxID".$i;
if(strlen($$myVar)>0) {
$myCheckBoxID=$$myVar;
}
}
// Load Account Data
$sql="SELECT * FROM ".$System_TableName_Staff." WHERE ".$System_TableName_Staff."_ID=".$myCheckBoxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$Row=MYSQL_FETCH_ARRAY($Query);
$inputPrefix = $Row[$System_TableName_Staff."_Prefix"];
$inputGender = $Row[$System_TableName_Staff."_Gender"];
$inputFNameEng = $Row[$System_TableName_Staff."_FNameEng"];
$inputFNameThai = $Row[$System_TableName_Staff."_FNameThai"];
$inputLNameEng = $Row[$System_TableName_Staff."_LNameEng"];
$inputLNameThai = $Row[$System_TableName_Staff."_LNameThai"];
$inputUserName = $Row[$System_TableName_Staff."_UserName"];
$inputPassword = $Row[$System_TableName_Staff."_Password"];
$inputPassword1 = $Row[$System_TableName_Staff."_Password"];
$inputDepartmentID = $Row[$System_TableName_Staff."_DepartmentID"];
$inputLocation = $Row[$System_TableName_Staff."_Location"];
$inputTelephone = $Row[$System_TableName_Staff."_Telephone"];
$inputMobile = $Row[$System_TableName_Staff."_Mobile"];
$inputEmail = $Row[$System_TableName_Staff."_Email"];
$inputOther = $Row[$System_TableName_Staff."_Other"];
$inputPicture = $Row[$System_TableName_Staff."_Picture"];
$inputLevel = $Row[$System_TableName_Staff."_Level"];
// Load Position Data
$sql="SELECT * FROM ".$System_TableName_StaffOnPosition." WHERE ".$System_TableName_StaffOnPosition."_AccountID=".$myCheckBoxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
while ($Row=MYSQL_FETCH_ARRAY($Query)) {
$sql="SELECT * FROM ".$System_TableName_Position." WHERE ".$System_TableName_Position."_ID=".$Row[$System_TableName_StaffOnPosition."_PositionID"];
$Query1=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$Row1=MYSQL_FETCH_ARRAY($Query1);
$position = $Row1[$System_TableName_Position."_ID"];
$PositionID[$position] = 1;
}
}
?>
<br>
<table width="95%" border="0" cellpadding="0" cellspacing="1" class="mytable_border">
<form action="" method="post" name="myReturnForm" id="myReturnForm">
<input name="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<input name="action" type="hidden" id="action" value="">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
</form>
<form action="" method="post" name="myForm" id="myForm" enctype="multipart/form-data">
<input name="Permission" type="hidden" id="Permission" value="">
<input name="PermissionAdmin" type="hidden" id="PermissionAdmin" value="">
<input name="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<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="myCheckBoxID" type="hidden" id="myCheckBoxID" value="<?=$myCheckBoxID?>">
<tr>
<td bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="2" cellspacing="1">
<tr>
<td height="24" colspan="4" align="center" class="menu_table_header">Edit User Admin </td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> User Information</td>
</tr>
<tr>
<td width="20%" height="22" align="right" class="table_col1">* Prefix </td>
<td width="30%" height="22" class="table_col2"><input name="inputPrefix" type="radio" value="Mr." onClick="document.myForm.inputGender[0].checked=true" <? if ($inputPrefix=="Mr.") echo "checked"; ?>>
<span class="mytext_bold">Mr.</span>
<input name="inputPrefix" type="radio" value="Miss" onClick="document.myForm.inputGender[1].checked=true" <? if ($inputPrefix=="Miss") echo "checked"; ?>>
<span class="mytext_bold">Miss</span>
<input name="inputPrefix" type="radio" value="Mrs." onClick="document.myForm.inputGender[1].checked=true" <? if ($inputPrefix=="Mrs.") echo "checked"; ?>>
<span class="mytext_bold">Mrs.</span></td>
<td width="20%" height="22" align="right" class="table_col1">* Gender </td>
<td width="30%" height="22" class="table_col2"><input name="inputGender" type="radio" value="Male" onClick="document.myForm.inputPrefix[0].checked=true" <? if ($inputGender=="Male") echo "checked"; ?>>
<span class="mytext_bold">Male </span>
<input name="inputGender" type="radio" value="Female" onClick="document.myForm.inputPrefix[1].checked=true" <? if ($inputGender=="Female") echo "checked"; ?>>
<span class="mytext_bold">Female</span></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* <span class="style1">Eng</span> First Name </td>
<td height="22" class="table_col2"><input name="inputFNameEng" type="text" class="input_left" id="inputFNameEng" value="<?=$inputFNameEng?>" size="30" maxlength="50"></td>
<td align="right" class="table_col1">* <span class="style1">Eng</span> Last Name </td>
<td class="table_col2"><input name="inputLNameEng" type="text" class="input_left" id="inputLNameEng" value="<?=$inputLNameEng?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* <span class="style1">Thai</span> First Name </td>
<td height="22" class="table_col2"><input name="inputFNameThai" type="text" class="input_left" id="inputFNameThai" value="<?=$inputFNameThai?>" size="30" maxlength="50"></td>
<td class="table_col1" align="right">* <span class="style1">Thai</span> Last Name </td>
<td class="table_col2"><input name="inputLNameThai" type="text" class="input_left" id="inputLNameThai" value="<?=$inputLNameThai?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* Position </td>
<td height="22" class="table_col2"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<?
$sql = "select * from ".$System_TableName_Position." Order By ".$System_TableName_Position."_ID Asc";
$query = mysql_query($sql);
while ($row = mysql_fetch_array($query)) {
?>
<tr>
<td width="30" align="center"><input name="inputPositionID[]" id="inputPositionID" type="checkbox" class="myform_checkbox" value="<?=$row[$System_TableName_Position."_ID"]?>" <? if ($PositionID[$row[$System_TableName_Position."_ID"]]==1) echo "checked"; ?>></td>
<td align="left"><?=$row[$System_TableName_Position."_Name"]?></td>
<tr>
<? } ?>
</table></td>
<td colspan="2" rowspan="6" align="center" class="table_col2"><table width="10" height="10" border="0" cellpadding="0" cellspacing="1" class="table_border">
<tr>
<td bgcolor="#FFFFFF"><table width="100%" height="100%" border="0" cellpadding="2" cellspacing="1">
<tr>
<td height="22" align="center" class="table_col3">Picture</td>
</tr>
<tr>
<td align="center" class="table_col1"><img src="<?=$System_RelativePath_Upload?>/account_images/<?=$inputPicture?>" name="PreviewImage" width="100" height="130" id="PreviewImage"></td>
</tr>
<tr>
<td height="22" align="center" class="table_col3">
<input name="checkbox" id="checkbox" type="checkbox" class="myform_checkbox" value="checkbox" <? if($inputPicture=="default.gif"){ echo "checked ";} ?>onClick="
if(document.getElementById('checkbox').checked==true){
document.getElementById('inputPicture').disabled=true;
document.getElementById('useDefault').value=1;
document.getElementById('PreviewImage').src='../../upload/account_images/default.gif';
}else{
document.getElementById('inputPicture').disabled=false;
document.getElementById('PreviewImage').src='images/blankPic.gif';
document.getElementById('useDefault').value=0;
}
//alert(document.getElementById('useDefault').value);
">
Use default </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* Department </td>
<td height="22" class="table_col2"><select name="inputDepartmentID" class="select" id="inputDepartmentID">
<?
echo "<option value='0'>------ Select ------</option>";
$sql = "select * from ".$System_TableName_Department;
$query = mysql_query($sql);
while ($row = mysql_fetch_array($query)) {
echo "<option value='".$row[$System_TableName_Department."_ID"]."'>".$row[$System_TableName_Department."_Name"]."</option>";
}
?>
</select>
<?
if ($inputDepartmentID<>"") echo "<script language='JavaScript'>document.myForm.inputDepartmentID.value='".$inputDepartmentID."';</script>";
?></td>
</tr>
<tr>
<td height="10" align="right" class="table_col1">Location</td>
<td height="10" class="table_col2"><input name="inputLocation" type="text" class="input_left" id="inputLocation" value="<?=$inputLocation?>" size="30" maxlength="100"></td>
</tr>
<tr>
<td height="11" align="right" class="table_col1">Telephone </td>
<td height="11" class="table_col2"><input name="inputTelephone" type="text" class="input_left" id="inputTelephone" value="<?=$inputTelephone?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">Mobile </td>
<td height="22" class="table_col2"><input name="inputMobile" type="text" class="input_left" id="inputMobile" value="<?=$inputMobile?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* E-mail </td>
<td height="22" class="table_col2"><input name="inputEmail" type="text" class="input_left" id="inputEmail" value="<?=$inputEmail?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">Other </td>
<td height="22" class="table_col2"><input name="inputOther" type="text" class="input_left" id="inputOther" value="<?=$inputOther?>" size="30" maxlength="50"></td>
<td height="22" class="table_col1" align="right"><input name="useDefault" type="hidden" id="useDefault" value="<?
if($inputPicture=="default.gif") echo "1";
else echo "0";
?>">
Picture </td>
<td class="table_col2">
<input name="inputPicture" type="file" class="input_left" id="inputPicture" <? if($inputPicture=="default.gif"){ echo "disabled ";} ?>
onChange="
myfile = this.value;
if(myfile!='') {
myfile = myfile.toLowerCase();
Temp = myfile.charAt(myfile.length-4) + myfile.charAt(myfile.length-3) + myfile.charAt(myfile.length-2) + myfile.charAt(myfile.length-1);
if(Temp=='.jpg' || Temp=='.gif' || Temp=='jpeg') {
document.getElementById('PreviewImage').src=myfile;
} else {
alert('System allow to upload image files only.');
this.focus();
}
} " size="20">
</td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> System Information</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* UserName </td>
<td height="22" class="table_col2">
<input name="inputUserName" type="text" class="input_left" id="inputUserName" value="<?=$inputUserName?>" size="30" maxlength="50">
</td>
<td height="22" class="table_col1" align="right">* Password </td>
<td height="22" class="table_col2"><input name="inputPassword" type="password" class="input_left" id="inputPassword" value="<?=$inputPassword?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1"> </td>
<td height="22" class="table_col2">
<? if($showalert=="yes") { ?>
<font color="#FF0000"><strong>UserName was existed!</strong></font>
<? } ?>
</td>
<td height="22" class="table_col1" align="right">* Confirm Password </td>
<td height="22" class="table_col2"><input name="inputPassword1" type="password" class="input_left" id="inputPassword1" value="<?=$inputPassword1?>" size="30" maxlength="50"></td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> Level and Under Information</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">* Level </td>
<td colspan="3" valign="top" class="table_col2"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20" height="18" align="center">
<input name="inputLevel" type="radio" class="myform_checkbox" value="Admin" <? if ($inputLevel=='Admin') echo 'checked'; ?> onClick="
document.getElementById('trAdmin').style.display='';
document.getElementById('trStaff').style.display='none';
"></td>
<td width="38" height="18">Admin</td>
<td width="20" height="18" align="center">
<input name="inputLevel" type="radio" class="myform_checkbox" value="Staff" <? if ($inputLevel=='Staff') echo 'checked'; ?> onClick="
document.getElementById('trAdmin').style.display='none';
document.getElementById('trStaff').style.display='';
"></td>
<td height="18">Staff</td>
</tr>
</table></td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> Permission Manage</td>
</tr>
<tr id="trAdmin" <? if($inputLevel=="Staff"){?>style="display:none" <? }?>>
<td height="22" colspan="4" align="center" class="table_col1"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr align="center">
<td height="24" class="table_col3">Menu List</td>
<td height="24" align="center" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAllAdmin('AdminR');" value="Select All"></td>
<td height="24" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAllAdmin('AdminRW');" value="Select All"></td>
<td height="24" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAllAdmin('AdminNA');" value="Select All"></td>
</tr>
<?
//CST Admin
$Field=$System_TableName_Menu;
$sqlTopic="SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_Language = '".$System_Session_Language."' ORDER BY ".$Field."_Order";
$QueryTopic=MYSQL_DB_QUERY($System_DataBase_Name,$sqlTopic) OR DIE("Error: เกิดความผิดพลาด <br>$sqlTopic<br>\n");
if(mysql_num_rows($QueryTopic)==0){
?>
<tr align="center">
<td height="50" colspan="4" class="table_col2">Data not found </td>
</tr>
<?
}else{
$topicIndex=0;
?>
<?
while($topic=mysql_fetch_array($QueryTopic)){
$sqlSub="SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_Language = '".$System_Session_Language."' ORDER BY ".$Field."_Order";
$QuerySub=MYSQL_DB_QUERY($System_DataBase_Name,$sqlSub) OR DIE("Error: เกิดความผิดพลาด <br>$sqlSub<br>\n");
$dataArrAdmin[$topicIndex][0]=$topic[$Field."_ID"];
$dataArrAdmin[$topicIndex][1]=$topic[$Field."_ID"];
$topicIndex+=1;
?>
<tr class="table_row2">
<td width="52%" height="24">
<table width="294" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="32" align="center"><? if($topic[$Field."_Icon"]){?><img src="<?=$topic[$Field."_Icon"]?>" border="0" align="absmiddle"><? } else{ ?> - <? } ?></td>
<td width="262"><?=$topic[$Field."_Name".$System_Session_Language]?></td>
</tr>
</table></td>
<td width="16%" height="24" align="center"><input name="AdminP<?=$topic[$Field."_ID"]?>" id="AdminR<?=$topic[$Field."_ID"]?>" type="radio" class="myform_checkbox" value="R" onClick="checkInSubAdmin('AdminR',<?=$topic[$Field."_ID"]?>)" >
<font color="#B98B00">Read</font></td>
<td width="16%" height="24" align="center"><input name="AdminP<?=$topic[$Field."_ID"]?>" id="AdminRW<?=$topic[$Field."_ID"]?>"type="radio" class="myform_checkbox" value="RW" onClick="checkInSubAdmin('AdminRW',<?=$topic[$Field."_ID"]?>)" checked>
<font color="#B98B00">Read/Write</font></td>
<td width="16%" height="24" align="center"><input name="AdminP<?=$topic[$Field."_ID"]?>" id="AdminNA<?=$topic[$Field."_ID"]?>" type="radio" class="myform_checkbox" value="NA" onClick="checkInSubAdmin('AdminNA',<?=$topic[$Field."_ID"]?>)">
<font color="#B98B00">Not Access</font></td>
</tr>
<?
}
}
?>
</table></td>
</tr><script language="javascript">
var idArrAdmin=new Array(<?=$topicIndex?>);
for(i=0;i<<?=$topicIndex?>;i++){
idArrAdmin[i]=new Array(2);
}
<? for($i=0;$i<$topicIndex;$i++){
echo "idArrAdmin[".$i."][0]=".$dataArrAdmin[$i][0].";";
echo "idArrAdmin[".$i."][1]=".$dataArrAdmin[$i][1].";";
}
?>
function checkAllAdmin(type){
for(i=0;i<<?=$topicIndex?>;i++){
document.getElementById(type+idArrAdmin[i][0]).checked=true;
}
}
function checkInSubAdmin(type,topicId){
for(i=0;i<<?=$topicIndex?>;i++){
if(idArrAdmin[i][1]==topicId){
document.getElementById(type+idArrAdmin[i][0]).checked=true;
}
}
}
function genDataAdmin(){
var genStrAdmin="";
for(i=0;i<<?=$topicIndex?>;i++){
if(document.getElementById("AdminR"+idArrAdmin[i][0]).checked==true) {
genStrAdmin+=idArrAdmin[i][0]+":R";
} else if(document.getElementById("AdminRW"+idArrAdmin[i][0]).checked==true) {
genStrAdmin+=idArrAdmin[i][0]+":RW";
}else{
genStrAdmin+=idArrAdmin[i][0]+":NA";
}
if(i!=<?=$topicIndex-1?>){
genStrAdmin+=",";
}
}
document.getElementById("PermissionAdmin").value=genStrAdmin;
}
</script>
<tr id="trStaff" <? if($inputLevel=="Admin"){?>style="display:none" <? }?>>
<td height="22" colspan="4" align="center" class="table_col1"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr align="center">
<td height="24" class="table_col3">Menu List</td>
<td height="24" align="center" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAll('R');" value="Select All"></td>
<td height="24" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAll('RW');" value="Select All"></td>
<td height="24" class="table_col3"><input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="checkAll('NA');" value="Select All"></td>
</tr>
<?
//CST Staff
$Field=$System_TableName_Menu;
$sqlTopic="SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_Language = '".$System_Session_Language."' ORDER BY ".$Field."_Order";
$QueryTopic=MYSQL_DB_QUERY($System_DataBase_Name,$sqlTopic) OR DIE("Error: เกิดความผิดพลาด <br>$sqlTopic<br>\n");
if(mysql_num_rows($QueryTopic)==0){
?>
<tr align="center">
<td height="50" colspan="4" class="table_col2">Data not found </td>
</tr>
<?
}else{
$topicIndex=0;
?>
<?
while($topic=mysql_fetch_array($QueryTopic)){
$sqlSub="SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_Language = '".$System_Session_Language."' ORDER BY ".$Field."_Order";
$QuerySub=MYSQL_DB_QUERY($System_DataBase_Name,$sqlSub) OR DIE("Error: เกิดความผิดพลาด <br>$sqlSub<br>\n");
$dataArr[$topicIndex][0]=$topic[$Field."_ID"];
$dataArr[$topicIndex][1]=$topic[$Field."_ID"];
$topicIndex+=1;
?>
<tr class="table_row2">
<td width="52%" height="24">
<table width="294" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="32" align="center"><? if($topic[$Field."_Icon"]){?><img src="<?=$topic[$Field."_Icon"]?>" border="0" align="absmiddle"><? } else{ ?> - <? } ?></td>
<td width="262"><?=$topic[$Field."_Name".$System_Session_Language]?></td>
</tr>
</table></td>
<td width="16%" height="24" align="center"><input name="P<?=$topic[$Field."_ID"]?>" id="R<?=$topic[$Field."_ID"]?>" type="radio" class="myform_checkbox" value="R" onClick="checkInSub('R',<?=$topic[$Field."_ID"]?>)" >
<font color="#B98B00">Read</font></td>
<td width="16%" height="24" align="center"><input name="P<?=$topic[$Field."_ID"]?>" id="RW<?=$topic[$Field."_ID"]?>"type="radio" class="myform_checkbox" value="RW" onClick="checkInSub('RW',<?=$topic[$Field."_ID"]?>)" checked>
<font color="#B98B00">Read/Write</font></td>
<td width="16%" height="24" align="center"><input name="P<?=$topic[$Field."_ID"]?>" id="NA<?=$topic[$Field."_ID"]?>" type="radio" class="myform_checkbox" value="NA" onClick="checkInSub('NA',<?=$topic[$Field."_ID"]?>)">
<font color="#B98B00">Not Access</font></td>
</tr>
<?
}
}
?>
</table></td>
</tr>
</table>
<?
if($inputLevel=="Staff"){
$Prefix="";
}else{
$Prefix="Admin";
}
$Field=$System_TableName_StaffOnPermission;
$sqlPM="SELECT * FROM ".$Field." WHERE ".$Field."_StaffID=".$myCheckBoxID;
$QueryPM=MYSQL_DB_QUERY($System_DataBase_Name,$sqlPM) OR DIE("Error: เกิดความผิดพลาด55 <br>$sqlPM<br>\n");
if(mysql_num_rows($QueryPM)>0){
echo '<script language="JavaScript">';
while($pm=mysql_fetch_array($QueryPM)){
echo 'document.getElementById("'.$Prefix.$pm[$Field."_Permission"].$pm[$Field."_MenuID"].'").checked=true;';
}
echo '</script>';
}
?>
<table width="100%" height="24" border="0" cellpadding="3" cellspacing="0">
<tr align="right">
<td height="30" colspan="4" align="center" class="table_footer">
<script language="javascript">
var idArr=new Array(<?=$topicIndex?>);
for(i=0;i<<?=$topicIndex?>;i++){
idArr[i]=new Array(2);
}
<? for($i=0;$i<$topicIndex;$i++){
echo "idArr[".$i."][0]=".$dataArr[$i][0].";";
echo "idArr[".$i."][1]=".$dataArr[$i][1].";";
}
?>
function checkAll(type){
for(i=0;i<<?=$topicIndex?>;i++){
document.getElementById(type+idArr[i][0]).checked=true;
}
}
function checkInSub(type,topicId){
for(i=0;i<<?=$topicIndex?>;i++){
if(idArr[i][1]==topicId){
document.getElementById(type+idArr[i][0]).checked=true;
}
}
}
function genData(){
var genStr="";
for(i=0;i<<?=$topicIndex?>;i++){
if(document.getElementById("R"+idArr[i][0]).checked==true) {
genStr+=idArr[i][0]+":R";
} else if(document.getElementById("RW"+idArr[i][0]).checked==true) {
genStr+=idArr[i][0]+":RW";
}else{
genStr+=idArr[i][0]+":NA";
}
if(i!=<?=$topicIndex-1?>){
genStr+=",";
}
}
document.getElementById("Permission").value=genStr;
}
</script>
<table width="300" border="0" cellspacing="0" cellpadding="2">
<tr align="center">
<td>
<script language="JavaScript" src="../lib/checkemail.js"></script>
<script language="JavaScript" type="text/JavaScript">
function isBlank(myObj) {
if(myObj.value=='') { return true; }
return false;
}
function verifySubmit() {
genData();
genDataAdmin();
with(document.myForm) {
if (inputPrefix[0].checked==false && inputPrefix[1].checked==false && inputPrefix[2].checked==false) {
alert('กรุณาเลือกคำนำหน้าชื่อ');
inputPrefix[0].focus();
return false;
}
if (inputGender[0].checked==false && inputGender[1].checked==false) {
alert('กรุณาเลือกเพศ');
inputGender[0].focus();
return false;
}
if (isBlank(inputFNameEng)) { inputFNameEng.focus(); return false; }
if (isBlank(inputLNameEng)) { inputLNameEng.focus(); return false; }
if (isBlank(inputFNameThai)) { inputFNameThai.focus(); return false; }
if (isBlank(inputLNameThai)) { inputLNameThai.focus(); return false; }
foundPosition = false;
if (inputPositionID.length>1) {
for (index=0;index<inputPositionID.length;index++) {
if (inputPositionID[index].checked==true) foundPosition = true;
}
if (!foundPosition) {
alert('กรุณาเลือกตำแหน่ง');
inputPositionID[0].focus();
return false;
}
} else {
if (inputPositionID.checked==true) foundPosition = true;
if (!foundPosition) {
alert('กรุณาเลือกตำแหน่ง');
inputPositionID.focus();
return false;
}
}
if (inputDepartmentID.value==0) { inputDepartmentID.focus(); return false; }
if(isBlank(inputEmail)) { inputEmail.focus(); return false; }
if (!isEmail(inputEmail.value)) {
alert('Email ไม่ถูกต้อง กรุณาใช้รูปแบบของ Email เป็นดังนี้\nyourname@yourdomain\n\nตัวอย่างเช่น\n\n sample@gm.com\n sample@hotmail.com\n sample@net-com.co.th');
inputEmail.focus();
return false;
}
if (isBlank(inputUserName)) { inputUserName.focus(); return false; }
if (isBlank(inputPassword)) { inputPassword.focus(); return false; }
if (isBlank(inputPassword1)) { inputPassword1.focus(); return false; }
if (inputPassword.value!=inputPassword1.value) {
alert('กรุณากรอกข้อมูลรหัสผ่าน และยืนยันรหัสผ่าน ให้เหมือนกันทั้งสองช่อง');
inputPassword.focus();
return false;
}
if (inputLevel[0].checked==false && inputLevel[1].checked==false) {
alert('กรุณาเลือกระดับของผู้ใช้งาน');
inputLevel[0].focus();
return false;
}
}
return true;
}
</script>
<script language="JavaScript" type="text/JavaScript" src="../lib/popup.js"></script>
<script language="JavaScript" type="text/JavaScript" src="../lib/Check_Duplicate.js"></script>
<input name="btSave" type="button" class="button_80" id="btSave" value="Save" onClick="
if(verifySubmit()) {
SQL1 = 'SELECT * FROM <?=$System_TableName_Staff?> WHERE <?=$System_TableName_Staff?>_FNameEng=<speech>'+document.myForm.inputFNameEng.value+'<speech> AND <?=$System_TableName_Staff?>_LNameEng=<speech>'+document.myForm.inputLNameEng.value+'<speech> AND <?=$System_TableName_Staff?>_ID<><?=$myCheckBoxID?> ';
SQL2 = 'SELECT * FROM <?=$System_TableName_Staff?> WHERE <?=$System_TableName_Staff?>_FNameThai=<speech>'+document.myForm.inputFNameThai.value+'<speech> AND <?=$System_TableName_Staff?>_LNameThai=<speech>'+document.myForm.inputLNameThai.value+'<speech> AND <?=$System_TableName_Staff?>_ID<><?=$myCheckBoxID?> ';
SQL3 = 'SELECT * FROM <?=$System_TableName_Staff?> WHERE <?=$System_TableName_Staff?>_UserName=<speech>'+document.myForm.inputUserName.value+'<speech> AND <?=$System_TableName_Staff?>_ID<><?=$myCheckBoxID?>';
Check_Duplicate_Manual(SQL1+'<tab>'+SQL2+'<tab>'+SQL3,'inputFNameEng<tab>inputFNameEng<tab>inputUserName','Englist First Name and Last Name<tab>Thai First Name and Last Name<tab>UserName');
}
">
</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>
<iframe id="frameCheckDuplicate" src="#" height="100" width="100%" frameborder="0" scrolling="no" style="display:none"></iframe>
<br>
<?
//########################################################
} else if ($action=="view") {
$myCheckBoxID=0;
//echo $TotalCheckBoxID;
for($i=1;$i<=$TotalCheckBoxID;$i++) {
$myVar="CheckBoxID".$i;
if(strlen($$myVar)>0) {
$myCheckBoxID=$$myVar;
}
}
$sql="SELECT * FROM ".$System_TableName_Staff." WHERE ".$System_TableName_Staff."_ID=".$myCheckBoxID;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$Row=MYSQL_FETCH_ARRAY($Query);
?>
<br>
<table width="95%" border="0" cellpadding="0" cellspacing="1" class="mytable_border">
<form action="" method="post" name="myForm" id="myForm">
<input name="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<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="myCheckBoxID" type="hidden" id="myCheckBoxID" value="<?=$myCheckBoxID?>">
<tr>
<td bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="2" cellspacing="1">
<tr>
<td height="24" colspan="4" align="center" class="menu_table_header">View
User Admin </td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> User
Information</td>
</tr>
<tr>
<td width="20%" height="22" align="right" class="table_col1">Prefix </td>
<td width="30%" height="22" class="table_col2">
<?=$Row[$System_TableName_Staff."_Prefix"]?>
</td>
<td width="20%" height="22" align="right" class="table_col1">Gender </td>
<td width="40%" height="22" class="table_col2">
<?=$Row[$System_TableName_Staff."_Gender"]?>
</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1"><span class="style1">Eng</span> First
Name </td>
<td height="22" class="table_col2">
<?=$Row[$System_TableName_Staff."_FNameEng"]?>
</td>
<td class="table_col1" align="right"><span class="style1">Eng</span> Last
Name </td>
<td class="table_col2">
<?=$Row[$System_TableName_Staff."_LNameEng"]?>
</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1"><span class="style1">Thai</span> First
Name </td>
<td height="22" class="table_col2">
<?=$Row[$System_TableName_Staff."_FNameThai"]?>
</td>
<td class="table_col1" align="right"><span class="style1">Thai</span> Last
Name </td>
<td class="table_col2">
<?=$Row[$System_TableName_Staff."_LNameThai"]?>
</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">Position </td>
<td class="table_col2">
<?
$sql = "Select * from ".$System_TableName_StaffOnPosition." where ".$System_TableName_StaffOnPosition."_AccountID=".$Row[$System_TableName_Staff."_ID"]." Order By ".$System_TableName_StaffOnPosition."_PositionID Asc";
$Query_StaffOnPosition = mysql_query($sql);
$Query_Num = mysql_num_rows($Query_StaffOnPosition);
if ($Query_Num>0) {
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0">';
while ($Row_StaffOnPosition = mysql_fetch_array($Query_StaffOnPosition)) {
$sql = "Select * from ".$System_TableName_Position." where ".$System_TableName_Position."_ID=".$Row_StaffOnPosition[$System_TableName_StaffOnPosition."_PositionID"];
$Query_Position = mysql_query($sql);
$Row_Position = mysql_fetch_array($Query_Position);
echo '<tr><td width="14" align="center"><img src="images/bullet/circle.gif" width="6" height="6"></td><td>'.$Row_Position[$System_TableName_Position."_Name"].'</td><tr> ';
}
echo '</table>';
}
?>
</td>
<td colspan="2" rowspan="6" class="table_col2" align="center"><table width="10" height="10" border="0" cellpadding="0" cellspacing="1" class="mytable_border">
<tr>
<td bgcolor="#FFFFFF"><table width="10" height="10" border="0" cellpadding="0" cellspacing="1" class="mytable_border">
<tr>
<td bgcolor="#FFFFFF"><table width="100%" height="100%" border="0" cellpadding="2" cellspacing="1">
<tr>
<td height="22" align="center" class="table_col3">Picture</td>
</tr>
<tr>
<td align="center" class="table_col1"><img src="<?=$System_RelativePath_Upload?>/account_images/<?=$Row[$System_TableName_Staff."_Picture"]?>" name="PreviewImage" width="101" height="136" id="PreviewImage"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">Department </td>
<td class="table_col2">
<?
if ($Row[$System_TableName_Staff."_DepartmentID"]>0) {
$sql = "SELECT * FROM ".$System_TableName_Department." WHERE ".$System_TableName_Department."_ID=".$Row[$System_TableName_Staff."_DepartmentID"];
$Query_Department = mysql_query($sql);
$Row_Department = mysql_fetch_array($Query_Department);
echo $Row_Department[$System_TableName_Department."_Name"];
}
?>
</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">Location </td>
<td class="table_col2">
<?=$Row[$System_TableName_Staff."_Location"]?>
</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">Telephone </td>
<td class="table_col2">
<?=$Row[$System_TableName_Staff."_Telephone"]?>
</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">Mobile </td>
<td class="table_col2">
<?=$Row[$System_TableName_Staff."_Mobile"]?>
</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">E-mail </td>
<td class="table_col2">
<?=$Row[$System_TableName_Staff."_Email"]?>
</td>
</tr>
<tr>
<td height="22" align="right" class="table_col1">Other </td>
<td class="table_col2">
<?=$Row[$System_TableName_Staff."_Other"]?>
</td>
<td class="table_col1" align="right">Picture </td>
<td class="table_col2">
<?=$Row[$System_TableName_Staff."_Picture"]?>
</td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> System
Information</td>
</tr>
<tr>
<td width="20%" height="22" align="right" class="table_col1">UserName </td>
<td height="22" class="table_col2">
<?=$Row[$System_TableName_Staff."_UserName"]?>
</td>
<td width="20%" height="22" align="right" class="table_col1">Password </td>
<td width="40%" height="22" class="table_col2"> <<
not show >> </td>
</tr>
<tr>
<td width="20%" height="22" align="right" class="table_col1"> </td>
<td height="22" class="table_col2"> </td>
<td width="20%" height="22" align="right" class="table_col1">Last
Login </td>
<td width="40%" height="22" class="table_col2">
<?=ShowDateLong($Row[$System_TableName_Staff."_LastLoginDate"],$System_Session_Language)?>
</td>
</tr>
<tr>
<td width="20%" height="22" align="right" class="table_col1">Create
By </td>
<td height="22" class="table_col2">
<?
if ($Row[$System_TableName_Staff."_CreateByID"]==0) echo "Root System";
else {
$sql = "Select ".$System_TableName_Staff."_FName".$System_Session_Language." , ".$System_TableName_Staff."_LName".$System_Session_Language." From ".$System_TableName_Staff." Where ".$System_TableName_Staff."_ID=".$Row[$System_TableName_Staff."_CreateByID"];
$Query = mysql_query($sql);
if (mysql_num_rows($Query)>0) {
$Row_CreateBy = mysql_fetch_row($Query);
echo $Row_CreateBy[0]." ".$Row_CreateBy[1];
}
}
?>
</td>
<td width="20%" height="22" align="right" class="table_col1">Create
Date </td>
<td width="40%" height="22" class="table_col2">
<?=ShowDateLong($Row[$System_TableName_Staff."_CreateDate"],$System_Session_Language)?>
</td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> Level
and Under Information</td>
</tr>
<tr>
<td width="20%" height="22" align="right" class="table_col1">Level </td>
<td colspan="3" valign="top" class="table_col2">
<?=$Row[$System_TableName_Staff."_Level"]?>
</td>
</tr>
<tr>
<td height="26" colspan="4" class="table_col3"> <img src="images/bullet/box21.gif" width="11" height="11"> Permission
Manage</td>
</tr>
<tr align="center">
<td height="22" colspan="4" class="table_col1"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr align="center">
<td height="24" class="table_col3">Menu List</td>
<td height="24" align="center" class="table_col3">Select</td>
<td height="24" align="center" class="table_col3">Select</td>
<td height="24" align="center" class="table_col3">Select</td>
</tr>
<?
//CST
$Field=$System_TableName_Menu;
if($Row[$System_TableName_Staff."_Level"]=="Staff"){
$sqlTopic="SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_Language = '".$System_Session_Language."' ORDER BY ".$Field."_Order";
}else{
$sqlTopic="SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_Language = '".$System_Session_Language."' ORDER BY ".$Field."_Order";
}
$QueryTopic=MYSQL_DB_QUERY($System_DataBase_Name,$sqlTopic) OR DIE("Error: เกิดความผิดพลาด <br>$sqlTopic<br>\n");
if(mysql_num_rows($QueryTopic)==0){
?>
<tr align="center">
<td height="50" colspan="4" class="table_col2">Data
not found </td>
</tr>
<?
}else{
$topicIndex=0;
?>
<?
while($topic=mysql_fetch_array($QueryTopic)){
if($Row[$System_TableName_Staff."_Level"]=="Staff"){
$sqlSub="SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_Language = '".$System_Session_Language."' ORDER BY ".$Field."_Order";
}else{
$sqlSub="SELECT * FROM ".$System_TableName_Menu." WHERE ".$System_TableName_Menu."_Language ='".$System_Session_Language."' ORDER BY ".$Field."_Order";
}
$QuerySub=MYSQL_DB_QUERY($System_DataBase_Name,$sqlSub) OR DIE("Error: เกิดความผิดพลาด <br>$sqlSub<br>\n");
$dataArr[$topicIndex][0]=$topic[$Field."_ID"];
$dataArr[$topicIndex][1]=$topic[$Field."_ID"];
$topicIndex+=1;
?>
<tr class="table_row2">
<td width="52%" height="22"> <table width="294" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="32" align="center"><? if($topic[$Field."_Icon"]){?><img src="<?=$topic[$Field."_Icon"]?>" border="0" align="absmiddle"><? } else{ ?> - <? } ?></td>
<td width="262">
<?=$topic[$Field."_Name".$System_Session_Language]?>
</td>
</tr>
</table></td>
<td width="16%" height="22" align="center"><img src="images/blank.gif" width="11" height="11" id="R<?=$topic[$Field."_ID"]?>"> <font color="#B98B00">Read</font></td>
<td width="16%" height="22" align="center"><img src="images/blank.gif" width="11" height="11" id="RW<?=$topic[$Field."_ID"]?>"> <font color="#B98B00">Read/Write</font></td>
<td width="16%" height="22" align="center"><img src="images/blank.gif" width="11" height="11" id="NA<?=$topic[$Field."_ID"]?>"> <font color="#B98B00">Not
Access</font></td>
</tr>
<?
}
}
?>
<?
$Field=$System_TableName_StaffOnPermission;
$sqlPM="SELECT * FROM ".$Field." WHERE ".$Field."_StaffID=".$myCheckBoxID." AND ".$Field."_Language = '".$System_Session_Language."'";
$QueryPM=MYSQL_DB_QUERY($System_DataBase_Name,$sqlPM) OR DIE("Error: เกิดความผิดพลาด <br>$sqlPM<br>\n");
if(mysql_num_rows($QueryPM)>0){
echo '<script language="JavaScript">';
while($pm=mysql_fetch_array($QueryPM)){
echo 'document.getElementById("'.$pm[$Field."_Permission"].$pm[$Field."_MenuID"].'").src="images/bullet/p_true.gif";';
}
echo '</script>';
}
?>
</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="btEdit" type="button" class="button_80" id="btEdit" value="Edit" onClick="
document.myForm.action.value='edit';
document.myForm.submit();
"></td>
<td>
<input name="btCalcel" type="button" class="button_80" id="btCalcel" onClick="
document.myForm.action.value='';
document.myForm.submit();
" value="Back">
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</form>
</table>
<br>
<?
//########################################################
} else if ($action=="delete") {
$Field=$System_TableName_StaffOnPermission;
for($i=1;$i<=$TotalCheckBoxID;$i++) {
$myVar="CheckBoxID".$i;
if(strlen($$myVar)>0) {
$sql="DELETE FROM ".$Field." WHERE ".$Field."_StaffID=".$$myVar;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$sql = "DELETE FROM ".$System_TableName_StaffOnPosition." WHERE ".$System_TableName_StaffOnPosition."_AccountID=".$$myVar;
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: เกิดความผิดพลาด <br>$sql<br>\n");
$sql = "DELETE FROM ".$System_TableName_Staff." WHERE ".$System_TableName_Staff."_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="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<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 { ?>
<?
// Check to set default value #########################
if($PageSize=="") { $PageSize = $SystemModule_defaultPageSize; }
if($PageShow=="") { $PageShow = $SystemModule_defaultPageShow; }
if($ASCDESC=="") { $ASCDESC = $SystemModule_ASCDESC; }
if($OrderBy=="") { $OrderBy = $System_TableName_Staff."_ID"; }
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_Staff;
if($PageSearch<>"") {
$sql = $sql." WHERE ( ".
$System_TableName_Staff."_FName".$System_Session_Language." LIKE '%$PageSearch%' OR ".
$System_TableName_Staff."_LName".$System_Session_Language." LIKE '%$PageSearch%' OR ".
$System_TableName_Staff."_Email LIKE '%$PageSearch%' OR ".
$System_TableName_Staff."_Level 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 = $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);
?>
<br>
<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>
<table width="95%" height="26" border="0" cellpadding="2" cellspacing="0">
<form action="?" method="post" name="myHeaderButton" id="myHeaderButton" onSubmit="return false;">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<tr valign="bottom">
<td> <table border="0" cellspacing="0" cellpadding="2">
<tr>
<? if($System_Session_Level=="Admin") { ?>
<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_80" id="btView" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==1) {
document.myForm.action.value='view';
document.myForm.submit();
} else {
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==0) alert('Please select 1 record');
else alert('Please select only 1 record');
}
" value="View"></td>
<? if($System_Session_Level=="Admin") { ?>
<td><input name="btEdit" type="button" class="button_80" id="btEdit" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==1) {
document.myForm.action.value='edit';
document.myForm.submit();
} else {
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==0) alert('Please select 1 record');
else alert('Please select only 1 record');
}
" value="Edit"></td>
<td><input name="btDelete" type="button" class="button_80" id="btDelete" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)>0) {
if(confirm('Are you sure to delete this record?')) {
document.myForm.action.value='delete';
document.myForm.submit();
}
} else {
alert('Please select 1 or more record');
}
" value="Delete"></td>
<? }?>
</tr>
</table></td>
<? if(strlen($type)>0) { ?>
<td align="right"> </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="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<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="table_toolbar">
<tr>
<td width="10"> </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"> </td>
<td>size</td>
<td> <input name="toolbarPageSize" type="text" class="input_left" id="toolbarPageSize" value="<?=$PageSize?>" size="3" maxlength="3"></td>
<td> <input name="btChangePageSize" type="button" class="button_30" 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"> </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="mytable_border">
<tr>
<td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="1" cellspacing="1">
<form action="?" method="post" name="myRedirectForm" id="myRedirectForm">
<input name="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<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">
</form>
<form action="" method="post" name="myForm" id="myForm">
<input name="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<input name="action" type="hidden" id="action">
<input name="PageSize" type="hidden" id="PageSize" value="<?=$PageSize?>">
<input name="PageShow" type="hidden" id="PageShow" value="<?=$PageShow?>">
<input name="ASCDESC" type="hidden" id="ASCDESC" value="<?=$ASCDESC?>">
<input name="OrderBy" type="hidden" id="OrderBy" value="<?=$OrderBy?>">
<input name="PageSearch" type="hidden" id="PageSearch" value="<?=$PageSearch?>">
<input name="SelectStatus" type="hidden" id="SelectStatus">
<tr align="center" class="menu_table_header">
<td width="24" height="30"><input name="CheckBoxAll" type="checkbox" id="CheckBoxAll" value="Yes" onClick="Paging_CheckAll(this,'CheckBoxID',document.myForm.TotalCheckBoxID.value)"></td>
<td width="45" height="30" align="center" class="menu_table_header">
<?
$myOrderBy = $System_TableName_Staff."_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 height="30">
<?
$myOrderBy = $System_TableName_Staff."_FName".$System_Session_Language;
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();
}
">FName</a> -
<?
$myOrderBy = $System_TableName_Staff."_LName".$System_Session_Language;
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();
}
">LName</a> </td>
<td height="30">Position</td>
<td width="70" height="30">
<?
$myOrderBy = $System_TableName_Staff."_Level";
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();
}
">Level</a></td>
<td width="110" height="30">
<?
$myOrderBy = $System_TableName_Staff."_LastLoginDate";
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();
}
">Last Access</a></td>
<td width="75" height="30">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="24" height="24" align="center"> <input name="CheckBoxID<?=$index?>" type="checkbox" class="myform_checkbox" id="CheckBoxID<?=$index?>" onClick="Paging_CheckAllHandle(document.myForm.CheckBoxAll,'CheckBoxID',document.myForm.TotalCheckBoxID.value)" value="<?=$Row[$System_TableName_Staff."_ID"]?>"></td>
<td width="45" height="24" align="center">
<?=$RecordStart+$index?>
<!--?=$Row[$System_TableName_Staff."_ID"]?-->
</td>
<td height="24"> <a href="#" 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();
">
<?=$Row[$System_TableName_Staff."_FName".$System_Session_Language]." ".$Row[$System_TableName_Staff."_LName".$System_Session_Language]?>
</a></td>
<td>
<?
$sql = "Select * from ".$System_TableName_StaffOnPosition." where ".$System_TableName_StaffOnPosition."_AccountID=".$Row[$System_TableName_Staff."_ID"]." Order By ".$System_TableName_StaffOnPosition."_PositionID Asc";
$Query_StaffOnPosition = mysql_query($sql);
$Query_Num = mysql_num_rows($Query_StaffOnPosition);
if ($Query_Num>0) {
echo '<table width="100%" border="0" cellpadding="0" cellspacing="0">';
while ($Row_StaffOnPosition = mysql_fetch_array($Query_StaffOnPosition)) {
$sql = "Select * from ".$System_TableName_Position." where ".$System_TableName_Position."_ID=".$Row_StaffOnPosition[$System_TableName_StaffOnPosition."_PositionID"];
$Query_Position = mysql_query($sql);
$Row_Position = mysql_fetch_array($Query_Position);
echo '<tr><td width="14" align="center"><img src="images/bullet/circle.gif" width="6" height="6"></td><td>'.$Row_Position[$System_TableName_Position."_Name"].'</td><tr> ';
}
echo '</table>';
}
?>
</td>
<td width="70" align="center">
<?=$Row[$System_TableName_Staff."_Level"]?>
</td>
<td width="110" height="24" align="center">
<?=ShowDateLong($Row[$System_TableName_Staff."_LastLoginDate"],$System_Session_Language)?>
</td>
<td width="75" height="24" align="center" valign="middle">
<table border="0" cellspacing="0" cellpadding="1">
<tr align="center" valign="bottom">
<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><? if($System_Session_Level=="Admin") { ?>
<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><? } ?>
<? if($System_Session_Level=="Admin") { ?><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="mytable_row1">
<td height="120" colspan="7" align="center" class="table_row1">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="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<tr align="right">
<td colspan="7" 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="ShowID" type="hidden" id="ShowID" value="<?=$ShowID?>">
<input name="type" type="hidden" id="type" value="<?=$type?>">
<input name="System_MenuID" type="hidden" id="System_MenuID" value="<?=$System_MenuID?>">
<input name="System_MenuGroupID" type="hidden" id="System_MenuGroupID" value="<?=$System_MenuGroupID?>">
<tr>
<td valign="top"><table border="0" cellspacing="0" cellpadding="2">
<tr>
<? if($System_Session_Level=="Admin") { ?>
<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_80" id="btView" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==1) {
document.myForm.action.value='view';
document.myForm.submit();
} else {
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==0) alert('Please select 1 record');
else alert('Please select only 1 record');
}
" value="View"></td>
<? if($System_Session_Level=="Admin") { ?>
<td><input name="btEdit" type="button" class="button_80" id="btEdit" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==1) {
document.myForm.action.value='edit';
document.myForm.submit();
} else {
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)==0) alert('Please select 1 record');
else alert('Please select only 1 record');
}
" value="Edit"></td>
<td><input name="btDelete" type="button" class="button_80" id="btDelete" onClick="
if(Paging_CountChecked('CheckBoxID',document.myForm.TotalCheckBoxID.value)>0) {
if(confirm('Are you sure to delete this record?')) {
document.myForm.action.value='delete';
document.myForm.submit();
}
} else {
alert('Please select 1 or more record');
}
" value="Delete"></td>
<? }?>
</tr>
</table></td>
</tr>
</form>
</table>
<br>
<?
}
//########################################################
?>
<!-- InstanceEndEditable -->
<? } else { echo " "; } ?> </td>
<td width="17" valign="top" background="../images/object/border_07.gif"><img src="../images/object/border_17.gif" width="17" height="119"></td>
</tr>
<tr>
<td height="16"><img src="../images/object/border_09.gif" width="20" height="16"></td>
<td height="16" background="../images/object/border_11.gif"><img src="../images/object/border_11.gif" width="1" height="16"></td>
<td><img src="../images/object/border_13.gif" width="17" height="16"></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="1" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="4" height="3" align="center" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
<td height="3" align="center" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
<td width="4" height="3" align="center" bgcolor="#A13626"><img src="../../images/blank.gif" width="1" height="1"></td>
</tr>
<tr>
<td width="4" height="30" align="left" valign="bottom" background="../../images/main/main-t-bg.gif"> </td>
<td height="30" align="center" background="../../images/main/main-t-bg.gif"> </td>
<td width="4" height="30" align="right" valign="bottom" background="../../images/main/main-t-bg.gif"> </td>
</tr>
</table>
<table width="95%" height="22" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left"><font color="#666666">Copyrights <img src="../../images/web/copyright.gif" width="8" height="9">
2008 MOE. All rights are reserved.</font></td>
<td align="right"><font color="#666666">Powered by <strong><a href="http://www.net-com.co.th">Net-Com</a></strong></font></td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
Hacked By AnonymousFox1.0, Coded By AnonymousFox