Portions created by the Initial Developer are Copyright (C) 2008-2025 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (!permission_exists('sql_query')) { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //add the header and title require_once "resources/header.php"; $document['title'] = $text['title-databases']; //include paging require_once "resources/paging.php"; //get variables used to control the order $order_by = $_GET["order_by"] ?? ''; $order = $_GET["order"] ?? ''; //show the content echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
".$text['header-databases'].""; echo " \n"; if (if_group("superadmin")) { echo " \n"; } echo "
\n"; echo " ".$text['description-databases'].".

\n"; echo "
\n"; //prepare to page the results $sql = "select count(*) from v_databases "; $database = new database; $num_rows = $database->select($sql, null, 'column'); //prepare to page the results $rows_per_page = $settings->get('domain','paging',50); $param = ""; $page = $_GET['page']; if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); $offset = $rows_per_page * $page; //get the list $sql = str_replace('count(*)', '*', $sql); $sql .= order_by($order_by, $order); $sql .= limit_offset($rows_per_page, $offset); $database = new database; $result = $database->select($sql, null, 'all'); unset($sql); $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; echo "
\n"; echo "\n"; echo "\n"; echo th_order_by('database_type', $text['label-type'], $order_by, $order); echo th_order_by('database_host', $text['label-host'], $order_by, $order); echo th_order_by('database_name', $text['label-name'], $order_by, $order); echo th_order_by('database_description', $text['label-description'], $order_by, $order); echo "\n"; echo "\n"; if (is_array($result) && @sizeof($result) != 0) { foreach($result as $row) { $tr_link = "href='exec.php?id=".escape($row['database_uuid'])."'"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; $c = ($c == 0) ? 1 : 0; } } unset($result, $row); echo "
 
".escape($row['database_type'])." ".escape($row['database_host'])." ".escape($row['database_name'])." ".escape($row['database_description'])." "; echo " ".$v_link_label_edit."\n"; echo "
"; echo "
\n"; echo "

"; //include the footer require_once "resources/footer.php";