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(); }