Multilinguified SQL Query. Added Manage button on Select Database page to link to Databases app. Fixed bug in CSV download file extension.

This commit is contained in:
Nate Jones
2013-06-07 00:11:52 +00:00
parent 720b53eb1e
commit 0d9ea1c194
6 changed files with 128 additions and 62 deletions

View File

@@ -33,7 +33,16 @@ else {
echo "access denied";
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
require_once "includes/header.php";
$page["title"] = $text['title-databases'];
require_once "includes/paging.php";
//get variables used to control the order
@@ -49,12 +58,16 @@ require_once "includes/paging.php";
echo "<table width='100%' border='0'>\n";
echo " <tr>\n";
echo " <td width='50%' align=\"left\" nowrap=\"nowrap\"><b>Databases</b></td>\n";
echo " <td width='50%' align=\"right\">&nbsp;</td>\n";
echo " <td width='50%' align=\"left\" nowrap=\"nowrap\"><b>".$text['header-databases']."</b></td>\n";
echo " <td width='50%' align=\"right\">";
if (if_group("superadmin")) {
echo " <input type='button' class='btn' name='' alt='".$text['button-manage']."' onclick=\"window.location='/core/databases/databases.php'\" value='".$text['button-manage']."'>\n";
}
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\" colspan='2'>\n";
echo " Select the database to use.<br /><br />\n";
echo " ".$text['description-databases'].".<br /><br />\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
@@ -78,9 +91,9 @@ require_once "includes/paging.php";
$rows_per_page = 100;
$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;
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 = "select * from v_databases ";
@@ -100,15 +113,11 @@ require_once "includes/paging.php";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('database_type', 'Type', $order_by, $order);
echo th_order_by('database_host', 'Host', $order_by, $order);
//echo th_order_by('database_port', 'Port', $order_by, $order);
echo th_order_by('database_name', 'Name', $order_by, $order);
//echo th_order_by('database_username', 'Username', $order_by, $order);
//echo th_order_by('database_path', 'Path', $order_by, $order);
echo th_order_by('database_description', 'Description', $order_by, $order);
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 "<td align='right' width='21'>\n";
//echo " <a href='database_edit.php' alt='add'>$v_link_label_add</a>\n";
echo "</td>\n";
echo "<tr>\n";
@@ -117,13 +126,10 @@ require_once "includes/paging.php";
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_type']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_host']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_port']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_name']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_username']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row['database_path']."&nbsp;</td>\n";
echo " <td valign='top' class='row_stylebg'>".$row['database_description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
echo " <a href='sql_query.php?id=".$row['database_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='sql_query.php?id=".$row['database_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }