<?php
class AdminClass {
var $admin_conn;
function load_admin_db($db) {
$this->admin_conn = mysql_connect($db['host'], $db['user'], $db['pass']) or die ("Unable to connect!");
mysql_select_db($db['db_forum'], $this->admin_conn) or die ("Unable to select database!");
return $this->admin_conn;
}
public function load_admins($group) {
switch ($group) {
case "trans":
$id_group = 17;
break;
case "admins":
$id_group = 9;
break;
case "la":
$id_group = 13;
break;
case "eu":
$id_group = 14;
break;
case "head":
$id_group = 1;
break;
}
$query = mysql_query("SELECT * FROM `smf_members` WHERE `id_group`='$id_group'", $this->admin_conn);
$admins = array();
while ($admin = mysql_fetch_array($query)) {
$uid = $admin['id_member'];
$admins[$uid] = $admin['member_name'];
}
return $admins;
}
public function close_admin_db() {
mysql_close($this->admin_conn);
}
}
?>