<td WIDTH="160">
<td/>
</tr>

<?php 
#Use select box to select a wms
if (isset($_REQUEST['show_wms_list']) && $_REQUEST['show_wms_list'] == true) {
    #Querying information from wms data table
    $wms_sql = "SELECT wms_id, wms_title FROM wms WHERE wms_owner = \$1 ORDER BY wms_title";
    $v = array(Mapbender::session()->get("mb_user_id"));
    $t = array("i");
    $res_wms_sql = db_prep_query($wms_sql, $v, $t);
    #wms-selection
    $selectBox = "";
    while ($row = db_fetch_array($res_wms_sql)) {
        if ($adm->getWmsPermission($row["wms_id"], Mapbender::session()->get("mb_user_id"))) {
            $selectBox .= "<option value='" . $row["wms_id"] . "' ";
            if (isset($_REQUEST['wmsList']) && $_REQUEST['wmsList'] == $row["wms_id"]) {
                $selectBox .= "selected";
            }
            $selectBox .= "> " . $row["wms_title"] . "</option>";
        }
    }
    if ($selectBox != "") {
        echo "<tr><td>";
        echo "<select size=6 name='wmsList' onchange='submit()'>" . $selectBox . "</select>";
        echo "</td><td width='160px' align='right'>";
        echo "<input type='button' class='sbutton' value='save' onclick='save()'>";
        echo "</td></tr>";
    } else {
        echo "<div>no wms owner.</div>";
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once dirname(__FILE__) . "/../php/mb_validateSession.php";
require_once dirname(__FILE__) . "/../classes/class_wms.php";
require_once dirname(__FILE__) . "/../classes/class_administration.php";
$wms_id = $_GET["wms_id"];
$gui_id = $_GET["gui_id"];
$user_id = $_SESSION["mb_user_id"];
$noHtml = intval($_GET["noHtml"]);
$js = "";
// check if user is allowed to access this wms
$admin = new administration();
if ($admin->getWmsPermission($wms_id, $user_id)) {
    $mywms = new wms();
    if ($gui_id !== '') {
        $mywms->createObjFromDB($gui_id, $wms_id);
    } else {
        $mywms->createObjFromDBNoGui($wms_id);
    }
    if ($noHtml) {
        $output .= $mywms->createJsObjFromWMS_(false);
    } else {
        $output .= $mywms->createJsObjFromWMS_(true);
    }
    $js .= administration::convertOutgoingString($output);
    unset($output);
} else {
    $e = new mb_exception("You are not allowed to access this WMS (WMS ID " . $wms_id . ").");