00001 <?php
00002
00003
00004
00005
00006
00007 if (count($cfg['Servers']) > 1) {
00008 if (!$cfg['DisplayServersList']) {
00009 ?>
00010 <form method="post" action="index.php" target="_parent" style="margin: 0px; padding: 0px;">
00011 <?php
00012 }
00013 if ($show_server_left) {
00014 echo '<div class="heada">' . $strServer . ':</div>';
00015 } else {
00016 ?>
00017 <!-- MySQL servers choice form -->
00018 <table border="0" cellpadding="3" cellspacing="0" bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
00019 <tr>
00020 <th class="tblHeaders"><?php echo $strServerChoice; ?></th>
00021 </tr>
00022 <tr>
00023 <td>
00024 <?php
00025 }
00026 if (!$cfg['DisplayServersList']) {
00027 ?>
00028 <form method="post" action="index.php" target="_parent" style="margin: 0px; padding: 0px;">
00029 <select name="server" onchange="this.form.submit();">
00030 <?php
00031 }
00032 foreach ($cfg['Servers'] AS $key => $val) {
00033 if (!empty($val['host'])) {
00034 $selected = 0;
00035 if (!empty($server) && ($server == $key)) {
00036 $selected = 1;
00037 }
00038 if (!empty($val['verbose'])) {
00039 $label = $val['verbose'];
00040 } else {
00041 $label = $val['host'];
00042 if (!empty($val['port'])) {
00043 $label .= ':' . $val['port'];
00044 }
00045 }
00046
00047
00048
00049 if (!empty($val['only_db'])) {
00050 $label .= ' - ' . (is_array($val['only_db']) ? implode(', ', $val['only_db']) : $val['only_db']);
00051 }
00052 if (!empty($val['user']) && ($val['auth_type'] == 'config')) {
00053 $label .= ' (' . $val['user'] . ')';
00054 }
00055
00056 if ($cfg['DisplayServersList']){
00057 if ($selected && !$show_server_left) {
00058 echo '» <b>' . $label . '</b><br />';
00059 }else{
00060 echo '» <a class="item" href="index.php?server=' . $key . '&lang=' . $lang . '&convcharset=' . $convcharset . '" target="_top">' . $label . '</a><br />';
00061 }
00062 } else {
00063 echo ' <option value="' . $key . '" ' . ($selected ? ' selected="selected"' : '') . '>' . $label . '</option>' . "\n";
00064 }
00065
00066 }
00067 }
00068
00069 if (!$cfg['DisplayServersList']){
00070 ?>
00071 </select>
00072 <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
00073 <input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
00074 <input type="submit" value="<?php echo $strGo; ?>" />
00075 </form>
00076 <?php
00077 }
00078 if (!$show_server_left) {
00079 ?>
00080 </td>
00081 </tr>
00082 </table>
00083 <br />
00084 <?php
00085 } else {
00086 echo '<hr />' . "\n";
00087 }
00088 }
00089 ?>