<?php
include("common_db.php");
include("functions.php");
dbconnect($host, $username, $password);
$strings = loadStrings($lang, 'SQLQ');
headers();
html();
head($strings['SQLQ_TITLE']);
menu();
navpane();
if(isset($_REQUEST['database'])) {
$db = $_REQUEST['database'];
} else {
if($_SESSION['current_db']) {
$db = $_SESSION['current_db'];
}
}
echo('<div id="mainpane"><h2>' . $strings['SQLQ_HEADING'] . '</h2>');
echo('<form method="post" action="sqlbrowse.php" name="queryForm" class="standalone lblock">');
echo('<label for="database">' . $strings['SQLQ_DATABASE'] . '<select name="database">');
echo(listDbs('<option value="%1$s">%1$s</option>', $db, '<option value="%1$s" selected="selected">%1$s</option>'));
?>
</select></label>
<label for="query"><?php echo($strings['SQLQ_QUERY']); ?><br /><textarea name="query" rows="10" cols="50" wrap="virtual"></textarea></label>
<input type="submit" value="<?php echo($strings['SQLQ_SUBMIT']); ?>" name="goButton" />
</form>
</div>
<?php
endhtml();
?>