RSgroupByUs($UsID); if ($oUg->GetRowSelected()>0){ while ($oUg->GetRecord()){ //get group info $oGp->SearchByKey ($oUg->UgGpID); $oGp->GetRecord(); //get app info $oSt->SearchByKey($oGp->GpStID); $oSt->GetRecord(); $StName = $oSt->StNameT; //create table echo "
GpID." method=post action=processUmPermission.php>\n"; echo "\n"; echo "GpID>\n"; echo "GpStID>\n"; $oT = new clsTable(); $oT->bgColor="#eeeeee"; $oT->headerBgColor="#dddddd"; $oT->align="center"; $oT->rowStart(); $oT->addCell("ระบบ ".$oSt->StNameT,"","",7); $oT->rowEnd(); $oT->rowStart(); $oT->addCell("       กลุ่มงาน ".$oGp->GpNameT,"","",7); $oT->rowEnd(); $oT->rowStart("",$oT->headerBgColor); //$oT->addCell(""); $oT->addCell("เมนู","center"); $oT->addCell("X","center"); $oT->addCell("C","center"); $oT->addCell("R","center"); $oT->addCell("U","center"); $oT->addCell("D","center"); $oT->rowEnd(); $oMnT->RSMainMenuBySt($oGp->GpStID); while ($oMnT->GetRecord()){ ShowmenuP($oGp->GpID, $oMnT->MnID, $UsID); } $oT->rowStart("","#dddddd"); //$oT->addCell(""); $oT->addCell(""); $oT->addCell("",'','','5'); $oT->rowEnd(); echo $oT->output(); echo "\n"; echo "

 

"; } //end while //reset all permission echo "GpID." method=post action=processUmPermission.php>\n"; echo "\n"; echo "GpID>\n"; echo "GpStID>\n"; $oT = new clsTable(); $oT->bgColor="#eeeeee"; $oT->headerBgColor="#dddddd"; $oT->align="center"; $oT->rowStart(); $oT->addCell(""); $oT->rowEnd(); echo $oT->output(); }else{ echo "

"; echo "Not assigned any groups to this user yet !!!"; echo "

"; } ////////////////////////////////////////// function ShowMenuP($GpID, $MnID, $UsID){ global $oC; global $oT; global $Str; global $oGPm; global $oPm; global $rw; include_once("../class/clsDB.php"); $oMn = new ummenu($oC); $oMn->SearchByKey($MnID); $oMn->GetRecord(); if ($oMn->MnLevel==0){ $bs=""; $be=""; } $lv = $oMn->MnLevel+1; $checkX= "checked"; $checkC= "checked"; $checkR= "checked"; $checkU= "checked"; $checkD= "checked"; $oT->rowStart(); //$oT->addCell("MnID>"); $oT->addCell("MnID>" . str_pad("",10*6*$oMn->MnLevel, " ", STR_PAD_RIGHT).$bs.$oMn->MnNameT.$be); //find in UmPermission $oPm->SearchByKey($UsID, $oMn->MnID); if ($oPm->GetRowSelected()>0){ //found in umPermission $oPm->GetRecord(); if ($oPm->pmX==0) $checkX=""; if ($oPm->pmC==0) $checkC=""; if ($oPm->pmR==0) $checkR=""; if ($oPm->pmU==0) $checkU=""; if ($oPm->pmD==0) $checkD=""; }else{ $oGPm->SearchByKey($GpID, $oMn->MnID); if ($oGPm->GetRowSelected()>0){ //found in umGPermission $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("MnID."x\" $checkX>"); $oT->addCell("MnID."c\" $checkC>"); $oT->addCell("MnID."r\" $checkR>"); $oT->addCell("MnID."u\" $checkU>"); $oT->addCell("MnID."d\" $checkD>"); $oT->rowEnd(); //show column header $rw++; if ($rw % 15 == 0){ $oT->rowStart("",$oT->headerBgColor); //$oT->addCell(""); $oT->addCell("เมนู","center"); $oT->addCell("X","center"); $oT->addCell("C","center"); $oT->addCell("R","center"); $oT->addCell("U","center"); $oT->addCell("D","center"); $oT->rowEnd(); } //show column header $oMn->RSmenuByParentMn($oMn->MnID); while ($oMn->GetRecord()){ ShowMenuP($GpID, $oMn->MnID, $UsID); } } ?>