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 "
"; echo ""; echo $oT->output(); 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); } } ?>