Viewing file: umGPermission.php (4.39 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
include_once("pagebody.php");
pageHeader();
$pageTitle="กำหนดสิทธิ์ของกลุ่มงาน"; // $StID";
?>
<table width=100% class="pageTitleBgColor" align="center">
<tr><td align=center><? echo $pageTitle; ?></td></tr>
</table>
<!--your code here-------------------------------------------------------------------------->
<br>
<?
include_once("clsUmGroup.php");
include_once("clsUmSystem.php");
include_once("clsUmMenu.php");
include_once("clsUmGPermission.php");
$oC = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']);
$oGp = new umgroup($oC);
$oSt = new umSystem($oC);
$oMnT = new umMenu($oC);
$oMn = new umMenu($oC);
$oGPm = new umgpermission($oC);
$rw=0;
//get App group info
$oGp->SearchByKey($GpID);
$oGp->GetRecord();
//get App info
$oSt->SearchByKey($oGp->GpStID);
$oSt->GetRecord();
$StName = $oSt->StNameT;
echo "<form name=form1 method=post action=processUmGPermission.php>\n";
echo "<input type=hidden name=GpID value=$oGp->GpID>\n";
echo "<input type=hidden name=GpStID value=$oGp->GpStID>\n";
$oT = new clsTable();
$oT->bgColor="#eeeeee";
$oT->headerBgColor="#dddddd";
$oT->align="center";
$oT->rowStart();
$oT->addCell("<b>ระบบ ".$oSt->StNameT."</b>","","",6);
$oT->rowEnd();
$oT->rowStart();
$oT->addCell(" <b>กลุ่มงาน ".$oGp->GpNameT."</b>","","",6);
$oT->rowEnd();
$oT->rowStart("",$oT->headerBgColor);
//$oT->addCell("");
$oT->addCell("<b>เมนู</b>","center");
$oT->addCell("<b>X</b>","center");
$oT->addCell("<b>C</b>","center");
$oT->addCell("<b>R</b>","center");
$oT->addCell("<b>U</b>","center");
$oT->addCell("<b>D</b>","center");
$oT->rowEnd();
$oMnT->RSMainMenuBySt($oGp->GpStID);
while ($oMnT->GetRecord()){
ShowmenuGP($oGp->GpID, $oMnT->MnID);
}
$oT->rowStart("","#dddddd");
//$oT->addCell("");
$oT->addCell("");
$oT->addCell("<input type=submit name=check value=\"บันทึก\">",'','','5');
$oT->rowEnd();
echo $oT->output();
echo "<form>\n";
//////////////////////////////////////////
function ShowMenuGP($GpID, $MnID){
global $oC;
global $oT;
global $Str;
global $oGPm;
global $rw;
include_once("../class/clsDB.php");
$oMn = new ummenu($oC);
$oMn->SearchByKey($MnID);
$oMn->GetRecord();
if ($oMn->MnLevel==0){
$bs="<b>";
$be="</b>";
}
$lv = $oMn->MnLevel+1;
$checkX= "checked";
$checkC= "checked";
$checkR= "checked";
$checkU= "checked";
$checkD= "checked";
$oT->rowStart();
//$oT->addCell("$oMn->MnID<input type=\"hidden\" name=mnid[] value=$oMn->MnID>");
$oT->addCell("<input type=\"hidden\" name=mnid[] value=$oMn->MnID>" . str_pad("",10*6*$oMn->MnLevel, " ", STR_PAD_RIGHT).$bs.$oMn->MnNameT.$be);
$oGPm->SearchByKey($GpID,$oMn->MnID);
if ($oGPm->GetRowSelected()>0){
//found in group permission
$oGPm->GetRecord();
if ($oGPm->gpX==0) $checkX="";
if ($oGPm->gpC==0) $checkC="";
if ($oGPm->gpR==0) $checkR="";
if ($oGPm->gpU==0) $checkU="";
if ($oGPm->gpD==0) $checkD="";
}
$oT->addCell("<input type=checkbox name=\"_".$oMn->MnID."x\" $checkX>");
$oT->addCell("<input type=checkbox name=\"_".$oMn->MnID."c\" $checkC>");
$oT->addCell("<input type=checkbox name=\"_".$oMn->MnID."r\" $checkR>");
$oT->addCell("<input type=checkbox name=\"_".$oMn->MnID."u\" $checkU>");
$oT->addCell("<input type=checkbox name=\"_".$oMn->MnID."d\" $checkD>");
$oT->rowEnd();
//show column header
$rw++;
if ($rw % 15 == 0){
$oT->rowStart("",$oT->headerBgColor);
//$oT->addCell("");
$oT->addCell("<b>เมนู</b>","center");
$oT->addCell("<b>X</b>","center");
$oT->addCell("<b>C</b>","center");
$oT->addCell("<b>R</b>","center");
$oT->addCell("<b>U</b>","center");
$oT->addCell("<b>D</b>","center");
$oT->rowEnd();
}
//show column header
$oMn->RSmenuByParentMn($MnID);
while ($oMn->GetRecord()){
ShowMenuGP($GpID, $oMn->MnID);
}
}
?>
<br>
<!--------------------------------------------------------------------->
<?
pageFooter();
?>
<!--------------------------------------------------------------------->
<!--put javascript here-->
<script language="javascript">
function doEditMenu(StID, MnID){
window.location="umEditMenu.php?MnStID=" + StID + "&MnID=" + MnID;
}
function doDelete(f, txt, StID, MnID){
if (confirm('ต้องการลบเมนู ' + txt + ' ใช่หรือไม่') ) {
window.location="processUmMenu.php?method=delete&MnStID=" + StID + "&MnID=" + MnID;
}
}
</script>
|