include_once("pagebody.php");
pageHeader();
$pageTitle="กำหนดเมนูระบบงาน"; // $StID";
?>
include_once("clsUmSystem.php");
include_once("clsUmMenu.php");
$oC = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB'], $GLOBALS['USER'], $GLOBALS['PASSWORD']);
//-------------------------------------------
if ($method=="updSeq") include_once("processUpdMenuSeq.php");
//-------------------------------------------
$oSt = new umSystem($oC);
$oSt->SearchByKey($MnStID);
$oSt->GetRecord();
$StName = $oSt->StNameT;
$oSt->Close();
$oMnT = new umMenu($oC);
$oMn = new umMenu($oC);
$oT = new clsTable(array("เมนู", "ดำเนินการ","ลำดับ"));
$oT->bgColor="#efefef";
$oT->headerBgColor="#dddddd";
$oT->align="center";
$oMnT->RSMainMenuBySt($MnStID);
$rw=0;
while ($oMnT->GetRecord()){
ShowmenuM($oMnT->MnID);
}
$oT->rowStart("","#dddddd");
$oT->addCell("");
$oT->addCell("
");
$oT->addCell("", "center");
$oT->rowEnd();
echo "";
//////////////////////////////////////////
function ShowMenuM($MnID){
global $oC;
global $oT;
global $Str;
global $rw;
//include_once("../class/clsDB.php");
$oMn = new ummenu($oC);
$oMn->SearchByKey($MnID);
$oMn->GetRecord();
///////////////////////////////////////////////
// if (!$oMn->hasSubMenu($oMn->MnID) and $oMn->MnLevel>=1){
// if ($oMn->numMenuInSameParent($oMn->MnParentMnID)>1){
// $mn = $oMn->getMinSeq($oMn->MnParentMnID);
// $mx = $oMn->getMaxSeq($oMn->MnParentMnID);
// $bnkimg=str_repeat(" | ", ($oMn->MnLevel-1)*2);
// if ($mn<>$mx){
// if ($oMn->MnSeq==$mn)
// $updown = $bnkimg .
// "MnStID','$oMn->MnID', '$oMn->MnSeq', '$oMn->MnParentMnID', '$oMn->MnLevel')\">
//
";
// elseif ($oMn->MnSeq==$mx)
// $updown = $bnkimg .
// "MnStID','$oMn->MnID', '$oMn->MnSeq', '$oMn->MnParentMnID', '$oMn->MnLevel')\">
//
";
// else
// $updown = $bnkimg .
// "MnStID','$oMn->MnID', '$oMn->MnSeq', '$oMn->MnParentMnID', '$oMn->MnLevel')\">
//
// MnStID','$oMn->MnID', '$oMn->MnSeq', '$oMn->MnParentMnID', '$oMn->MnLevel')\">
//
";
// }
// }
// }
/////////////////////////////////////////////
if ($oMn->MnLevel==0){
$bs="";
$be="";
}
$lv = $oMn->MnLevel+1;
$oT->addRow(array(str_repeat("
", $oMn->MnLevel*3). $bs .$oMn->MnNameT. $be ,
"MnStID&Level=$lv&ParentMnID=$oMn->MnID\" >
MnStID','$oMn->MnID')\">
MnNameT', '$oMn->MnStID', '$MnID')\">
",
"MnID\" readonly>" .
str_repeat("
", $oMn->MnLevel*1) .
"MnSeq\" style=text-align:center onKeypress='CheckNum(event.keyCode)'> "));
$oMn->RSmenuByParentMn($MnID);
while ($oMn->GetRecord()){
ShowMenuM($oMn->MnID);
}
}
?>
pageFooter();
?>