<?
include_once("clsUmSystem.php");

class 
umsystemr extends umsystem{
    
function 
GetRecord(){
    
$ret parent::GetRecord();
    
$this->GpID $this->result['GpID'];
    
$this->GpNameT $this->result['GpNameT'];
    
    return 
$ret;
}
    
function 
RsSystemGroup($StID=""){
    if (
$StID==""){
        
$sql ="SELECT StID, StNameT, GpID, GpNameT
                FROM umsystem, umgroup
                WHERE StID = GpStID
                ORDER BY StID, GpID"
;
    }else{
        
$sql ="SELECT StID, StNameT, GpID, GpNameT
                FROM umsystem, umgroup
                WHERE StID=$StID and StID = GpStID 
                ORDER BY StID, GpID"
;
    }
    
$this->SetQuery($sql);
}
    
function 
selectHTML($name$ID=""){
    
$s="<select name=\"$name\">\n";
    
$s.="<option value=\"\">---เลือกระบบงาน---\n";
    
$this->RSumsystem();
    while(
$this->GetRecord()){
        
$s.="<option value=\"$this->StID\" ";
        
$s.=($this->StID==$ID) ? "Selected" "" ;
        
$s.=">$this->StNameT\n";
    }
    return 
$s.="</select>\n";
}

}
?>