<table border="0" width="750" align="left" cellspacing="2" cellpadding="0">
<?php
if (sizeof($cfg_host) > 1)
{
echo "<tr>";
echo "<th align=\"right\" class=\"white\"><b>Hosts:</b> </th>";
echo "<td>\n";
echo "<select name=\"conn\" onChange=\"submit()\">\n";
for ($i = 0; $i < sizeof($cfg_host); $i++) {
echo "<option value=\"" . $i . "\"" . (($conn == $i) ? " selected" : "") . ">" . $cfg_host[$i];
}
echo "</select>\n";
echo "</td>";
echo "</tr>\n";
}
if (!$host)
echo "<tr><th align=\"right\" class=\"white\">Host: </th><td><input type=\"text\" name=\"host\" value=\"" . $host . "\"></td></tr>\n";
if (!$user)
{
echo "<tr><th align=\"right\" class=\"white\">User: </th><td><input type=\"text\" name=\"user\" value=\"" . $user ."\"></td></tr>\n";
}
else
{
echo "<tr><th align=\"right\" class=\"white\"><b>Userstatus:</b> </th><td class=\"white\"><b>" . $user . "</b><input type=\"hidden\" name=\"user\" value=\"" . $user . "\"></td></tr>\n";
}
if (!$password)
{
echo "<tr><th align=\"right\" class=\"white\">Password: </th><td colspan=\"2\"><input type=\"password\" name=\"password\" value=\"" . $password ."\"></td></tr>\n";
}
if ($onlydatabase[$conn])
{
$database = $onlydatabase[$conn];
echo "<tr><th align=\"right\" class=\"white\">Database: </th><th align=\"left\" class=\"white\"><b>" . $database . "</b> <input type=\"button\" class=\"button\" name=\"mysql list tables\" value=\"mysql list tables\" onClick=\"promptMyAction(this.value, 0)\"></th></tr>\n";
}
else
{
if ($mysql_list == "mysql list dbs")
{
$result = @mysql_list_dbs($db_link) or mysql_client_error_msg($query_text, __FILE__, __LINE__);
echo "<tr>";
echo "<th align=\"right\" class=\"white\">Database: </th>\n";
echo "<td align=\"left\">";
echo "<select name=\"database\">\n";
while ($list_dbs = mysql_fetch_array($result, MYSQL_NUM))
{
echo "<option value=\"" . $list_dbs[0] . "\"" . (($database == $list_dbs[0]) ? " selected" : "") . ">" . $list_dbs[0] . "\n";
}
echo "</select> <input type=\"button\" class=\"button\" name=\"mysql list tables\" value=\"mysql list tables\" onClick=\"promptMyAction(this.value, 0)\"> <input type=\"button\" class=\"button\" name=\"myaction\" value=\"admin dbs\" onClick=\"promptMyAction(this.value, 0)\"></td></tr>\n";
}
else
{
echo "<tr><th align=\"right\" class=\"white\">Database: </th><td><input type=\"text\" name=\"database\" value=\"" . $database . "\"> <input type=\"button\" class=\"button\" name=\"mysql list dbs\" value=\"mysql list dbs\" onClick=\"promptMyAction(this.value, 0)\">" . ($database ? " <input type=\"button\" class=\"button\" name=\"mysql list tables\" value=\"mysql list tables\" onClick=\"promptMyAction(this.value, 0)\">" : "") . " <input type=\"button\" class=\"button\" name=\"myaction\" value=\"admin dbs\" onClick=\"promptMyAction(this.value, 0)\"></td></tr>\n";
}
}
if ($mysql_list == "mysql list tables")
{
$result = mysql_list_tables($database, $db_link) or mysql_client_error_msg($query_text, __FILE__, __LINE__);
echo "<tr>";
echo "<th align=\"right\" class=\"white\">Table: </th>\n";
echo "<td align=\"left\">";
echo "<select name=\"table\" onChange=\"this.document.clientform.query_text.value='SELECT * FROM ' + this.value;\">\n";
while ($list_tables = mysql_fetch_array($result, MYSQL_NUM))
{
echo "<option value=\"" . $list_tables[0] . "\"" . (($table == $list_tables[0]) ? " selected" : "") . ">" . $list_tables[0] . "\n";
}
echo "</select></td></tr>\n";
}
else
{
?>
<tr><th align="right" class="white">Table: </th><th align="left" class="white"><input type="text" name="table" value="<?php echo $table ?>"> <input type="button" class="button" name="myaction" value="create new table" onClick="promptMyAction(this.value, 1, 'Please enter number of fields you would like to have in your table first!')"> with <input type="text" name="fields" size="2"> fields</td></tr>
<?php
}
?>
<tr>
<th align="right" class="white">MySQL-Query: </th>
<td><input type="text" size="80" name="query_text" value=""></td>
</tr>
<tr>
<td align="right"> </td><td align="right" class="white"><b>LIMIT</b> ([Offset,] Rows)</font> <input type="text" name="limit" size="10"></td>
</tr>
<tr>
<td> </td>
<td align="left">
<input type="button" class="button" name="myaction" value="send query" onClick="promptMyAction(this.value, 0)"> <input <?php echo $style2; ?> type="checkbox" name="detailedview"<?php echo (($detailedview) ? " checked" : ""); ?>><font class="whitesmall">[detailed]</font>
</td>
</tr>
</table><br clear="all">