Revision 165 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed
<?phpphp//$Id: dist.class.php 168 2011-07-10 19:11:02Z lars $/*** @author Lars Tiefland* @copyright 2007* @package openvz_admin**/class Dist{protected $dist_name;protected $id;protected $template;function __construct( $dist = null ){global $db;if ( ! is_null( $dist ) ){$sql = "SELECT * FROM distributions WHERE dist_id=$dist";$res = $db->query( $sql );$row = $res->fetchRow();$this->id = $row["dist_id"];$this->dist_name = $row["dist_name"];$this->template = $row["dist_template"];}else{$this->dist_name = "";}}function toArray(){$out["dist_id"] = $this->id;$out["dist_name"] = $this->dist_name;$out["template"] = $this->template;return $out;}static function getDists(){global $db;$sql = "SELECT dist_id, dist_name FROM distributions";$res = $db->query( $sql );$out[-1] = "Bitte wählen!";while ( $row = $res->fetchRow() ){$out[$row["dist_id"]] = $row["dist_name"];}return $out;}}?>