<?
include_once("clsUmMenu.php");

class 
ummenur extends ummenu {
    
function 
GetRecord(){
    
$ret parent::GetRecord();
    
    
$this->Mseq $this->result['Mseq'];
    
$this->MmnID $this->result['MmnID'];
    
$this->MmnNameT $this->result['MmnNameT'];
    
$this->SMseq $this->result['SMseq'];
    
$this->SMmnID $this->result['SMmnID'];
    
$this->SMmnNameT $this->result['SMmnNameT'];
    
    
$this->sMnID $this->result['sMnID'];
    
$this->sMnSeq $this->result['sMnSeq'];
    
$this->sMnNameT $this->result['sMnNameT'];
    
$this->sMnLevel $this->result['sMnLevel'];
    
$this->pMnID $this->result['pMnID'];
    
$this->pMnSeq $this->result['pMnSeq'];
    
$this->pMnNameT $this->result['pMnNameT'];
    
$this->pMnLevel $this->result['pMnLevel'];
        
    return 
$ret;
}

function 
RsMainMenuList($StID=""){
    if (
$StID<>""){
        
$cond="and MnStID=$StID"    ;
    }
    
    
$sql="  select * 
            from ummenu
            where MnParentMnID=0 $cond
            order by MnStID, MnSeq "
;
    
    
$this->SetQuery($sql);
}

function 
RsMenuList($PrMnID){
    
$cond="and MnParentMnID=$PrMnID ";
    
    
$sql="SELECT *
            FROM ummenu m INNER JOIN ummenu sm ON sm.MnParentMnID = m.MnID
            WHERE 1=1 $cond
            ORDER BY MnParentMnID, m.MnSeq"
;
    
    
$this->SetQuery($sql);
}

function 
RsMenuList1($PrMnID){
    
$cond="and s.MnParentMnID=$PrMnID ";
    
    
$sql="SELECT s.MnID as sMnID, s.MnSeq as sMnSeq, s.MnNameT as sMnNameT, s.MnLevel as sMnLevel, 
                     p.MnID as pMnID, p.MnSeq as pMnSeq, p.MnNameT as pMnNameT, p.MnLevel as pMnLevel 
            FROM ummenu s INNER JOIN ummenu p ON s.MnParentMnID = p.MnID
            WHERE 1=1 $cond
            ORDER BY sMnSeq"
;
    
    
$this->SetQuery($sql);
}

function 
RsMainMenuByUsGrp($UsID$GpID){
    
$cond="and UgUsID=$UsID and UgGpID=$GpID ";
    
    
$sql="SELECT *
            FROM ummenu INNER JOIN umsystem  ON MnStID=StID 
                             INNER JOIN umgroup ON StID=GpStID
                             INNER JOIN umusergroup ON GpID=UgGpID
            WHERE 1=1 and MnLevel=0  $cond
            ORDER BY MnParentMnID, MnSeq"
;
    
    
$this->SetQuery($sql);    
}


}
?>