Viewing file: RptMenuList.php (4.2 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? include_once("pagebody.php"); pageHeader(); $pageTitle="รายงานสรุป เมนูการใช้งาน"; echo "<table width=100% class=\"pageTitleBgColor\" align=\"center\">\n"; echo "<tr><td align=center>$pageTitle</td></tr>\n"; echo "</table>"; ?> <!--your code here--------------------------------------------------------------------------> <br> <p align=center> <form name=form1 method=post> <table bgcolor=#eeeeee align="center"> <tr align=left> <td>เลือกระบบงาน</td> <td> <? include_once("clsUmSystemR.php"); $oC = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']); $oSt = new umsystemr($oC); $s="<select name='ID' onchange=\"reDir(this.options[this.selectedIndex].value)\">\n "; $s.="<option value=\"\">---เลือกระบบงาน---\n"; $oSt->RSumsystem(); while($oSt->GetRecord()){ $s.="<option value=\"$oSt->StID\" "; $s.=($oSt->StID==$ID) ? "Selected" : "" ; $s.=">$oSt->StNameT\n"; } $s.="</select>\n"; echo $s; //echo $oSt->selectHTML("ID", $ID); ?> </td> </tr> <tr align=left> <td>เลือกกลุ่มงาน</td> <td> <? //echo "===$ID---"; include_once("clsUmGroupR.php"); $oC = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']); $oGpr = new umgroupr($oC); echo $oGpr->selectHTMLByStID($ID, "GpID", $GpID); if ($ID<>""){ } ?> </td> </tr>
<tr> <td></td> <td><input type="submit" name="submit" value="Search"></td> </tr> </table> </form> </p> <? //echo "ID=$ID<br>GpID=$GpID";
if ($pg<>"" or $submit=="Search"){ include_once("functions.php"); 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; $oT = new clsTable(); $oT->bgColor="#eeeeee"; $oT->headerBgColor="#dddddd"; $oT->align="center"; // $oT->rowStart(); // $oT->addCell("<b>ระบบ ".$oSt->StNameT."</b>","","",2); // $oT->rowEnd(); // $oT->rowStart(); // $oT->addCell(" <b>กลุ่มงาน ".$oGp->GpNameT."</b>","","",2); // $oT->rowEnd(); $oT->rowStart("",$oT->headerBgColor); $oT->addCell("<b>เมนูหลัก-เมนูย่อยู</b>","center"); $oT->addCell("<b>หมายเหตุ</b>","center"); $oT->rowEnd(); $oMnT->RSMainMenuBySt($oGp->GpStID); while ($oMnT->GetRecord()){ ShowmenuGP($oGp->GpID, $oMnT->MnID); } echo $oT->output();
} ////////////////////////////////////////// function ShowMenuGP($GpID, $MnID){ global $oC; global $oT; global $Str; global $oGPm; global $rw; global $flgStrike; 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";
$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=""; } if ($checkX=="checked"){ $flgStrike=false; $oT->rowStart(); $oT->addCell("<input type=\"hidden\" name=mnid[] value=$oMn->MnID>" . str_pad("",10*6*$oMn->MnLevel, " ", STR_PAD_RIGHT).$bs.$oMn->MnNameT.$be); $oT->addCell(""); $oT->rowEnd(); }else{ $flgStrike=True; }
if ($flgStrike==false){ $oMn->RSmenuByParentMn($MnID); } while ($oMn->GetRecord()){ ShowMenuGP($GpID, $oMn->MnID); } } ?> <!---------------------------------------------------------------------> <? pageFooter(); ?> <!---------------------------------------------------------------------> <!--put javascript here--> <script language="javascript"> function reDir(id){ document.location.href = "RptMenuList.php?ID=" + id; } </script>
|