function LocateList() { include "global.php"; $sql = "SELECT id, name FROM locations ORDER by id"; $colums = array("id" => new Column_Number("ID", 0), "name" => new Column("Название")); $colums["name"]->SetLink("locate_edit.php", "id"); $table = new Table($db, "locations_list", $sql, $colums); $table->SetTheme("system"); $table->Show_PageSwitch(false); $table->Show(); }
function GroupList() { include "global.php"; $sql = "SELECT id, name " . "FROM groups WHERE is_deleted=0 " . "ORDER by name"; $colums = array("name" => new Column("Название"), "delete" => new Column_Button("Действие", "?action=group_delete", "id", "удалить")); $colums["name"]->SetLink("group_edit.php", "id"); $table = new Table($db, "system_group_list", $sql, $colums); $table->SetTheme("system"); $table->Show_PageSwitch(false); $table->Show(); }
function UserList() { include "global.php"; $sql = "SELECT id, login, family, name, mobile_telephone, register " . "FROM users WHERE is_deleted=0 ORDER by login"; $colums = array("login" => new Column("Логин"), "family" => new Column_Custom("Полное имя", "[[family]] [[name]]"), "mobile_telephone" => new Column("Мобильный"), "register" => new Column("Зарегистрирован"), "delete" => new Column_Button("Действие", "?action=user_delete", "id", "удалить")); $colums["login"]->SetLink("user_edit.php", "id"); $table = new Table($db, "system_user_list", $sql, $colums); $table->SetTheme("system"); $table->Show_PageSwitch(false); $table->Show(); }
function users_connection_list() { include "global.php"; // echo $db->QueryNums(); $sql = "SELECT uid as id, users.login as login, ip, last_view, time_last_active, time_login " . "FROM users_online LEFT JOIN users ON users_online.uid=users.id " . "ORDER by time_last_active DESC"; $colums = array("login" => new Column("Логин"), "ip" => new Column_IP("IP"), "last_view" => new Column("Последний просмотр", 1, "left"), "time_last_active" => new Column("Активность"), "time_login" => new Column("Время входа")); $colums["login"]->SetLink("user_edit.php", "id"); $table = new Table($db, "system_users_online", $sql, $colums); $table->SetTheme("system"); $table->Show_PageSwitch(false); $table->Show(); // echo $db->QueryNums(); }
function users_connection_history() { include "global.php"; $sql = "SELECT users_connection_history.id as id, uid, login, ip, time_active, state " . "FROM users_connection_history LEFT JOIN users ON users_connection_history.uid=users.id " . "ORDER by id DESC"; $columns = array("id" => new Column_Number("ID", 0), "login" => new Column("Логин"), "ip" => new Column_IP("IP"), "time_active" => new Column("Время"), "state" => new Column_Bool("Статус", "пришёл", "ушёл")); $columns["id"]->SetDBTableName("users_connection_history"); $columns["login"]->SetLink("user_edit.php", "uid"); $badlines = array("state" => new Row("=", 0)); $table = new Table($db, "system_users_history", $sql, $columns, $badlines, "95%"); $table->SetTheme("system"); $table->Show_PageSwitch(true); $table->Show_Search("login"); $table->Show(); }
function ExternalIPList() { include "global.php"; $sql = "SELECT id, ip, location, description, date_create " . "FROM external_ip ORDER by ip"; $colums = array("ip" => new Column_IP("IP адрес"), "location" => new Column_List($db, "SELECT id, name FROM locations ORDER by name", "Локация"), "description" => new Column("Описание"), "date_create" => new Column("Время присвоения"), "ping_ajax" => new Column_Custom("Пинг (быстрый)", "<div id='ping_[[id]]'> </div><script language='javascript'>sndReq('id=[[id]]&action=ping&ip=[[ip]]', '" . $inc_path . "ajax.php');</script>", 0), "ping" => new Column_UserFunc("Пинг (долгий)", "Ping", array("ip"), 0)); $colums["ip"]->SetLink("external_ip_edit.php", "id"); $colums["description"]->SetLink("external_ip_edit.php", "id"); $badlines = array("ping" => new Row('=', 'Нет')); $table = new Table($db, "external_ip_list", $sql, $colums, $badlines); $table->Show_PageSwitch(true); $table->Show_AllCols(true); $table->Show_Search("description"); $table->SetWidth("95%"); $table->Show(); }
function ShowMenuItems($id) { global $db; $sql = "SELECT id, name, position, parent_id FROM menus WHERE parent_id='" . $id . "' ORDER by position"; //$columns['id'] = new Column_Number('ID', 0); $columns['name'] = new Column('Название'); $columns['position'] = new Column_Number('Позиция', 0); if ($id != 0) { $columns['back'] = new Column_Custom('Назад', '<input type="button" value="<" onClick="GoURL(\'?id=' . GetParentID($id) . '\')" />'); } $columns['more'] = new Column_UserFunc('Далее', 'GetChildIDButton', array('id')); // $columns['more'] = new Column_Button('Далее', '', 'id', '>>>'); $table = new Table($db, 'menu_edit', $sql, $columns); $table->Show_PageSwitch(false); $table->Show(); }