Revision 62 | Revision 86 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed
<?phpclass hostGroup{public $alias;public $hostgroup_id;public $members;public function __construct( $id ){$sql = "SELECTalias,hostgroup_idFROMhostgroupsWHEREinstance_id = " . $GLOBALS["cfg"]["instance"] . "ANDhostgroup_id = $id";$res = $GLOBALS["db"]->query( $sql );$row = $res->fetchRow();foreach ( $row as $feld => $wert ){$this->$feld = $wert;}$this->members = $this->getMemberList( $id );}public static function getList(){$sql="SELECThostgroup_idFROMhostgroupsWHEREinstance_id = " . $GLOBALS["cfg"]["instance"] . "";$res = $GLOBALS["db"]->query( $sql );while ( $row = $res->fetchRow() ){$ret[] = new hostGroup( $row["hostgroup_id"] );}return $ret;}public function getMemberList( $hg_id ){$sql = "SELECThost_object_idFROMhostgroup_membersWHEREinstance_id = " . $GLOBALS["cfg"]["instance"] . "ANDhostgroup_id = $hg_id";$res = $GLOBALS["db"]->query( $sql );while ( $row = $res->fetchRow() ){$ret[] = new host( $row["host_object_id"] );}return $ret;}}?>