コード例 #1
0
 * This is the main page of the sld-editor.
 * It displays the preview images and creates the sld_edit_form
 * used for editing the sld.
 *
 * @package sld_main
 * @author Markus Krzyzanowski
 */
require_once dirname(__FILE__) . "/sld_config.php";
require_once dirname(__FILE__) . "/../classes/class_wfs_conf.php";
$classWfsConf = new wfs_conf();
//read custom sld for this user&wms&layer&gui from the db instead using sld.xml
$con = db_connect($DBSERVER, $OWNER, $PW);
db_select_db($DB, $con);
//Read the layer_id from the DB
$dbutils = new DbUtils();
$layer_id = $dbutils->getLayerIdFromLayerName($_SESSION["sld_wms_id"], $_SESSION["sld_layer_name"]);
if ($layer_id) {
    $_SESSION["sld_layer_id"] = $layer_id;
}
//Read the mb_user_id from the Session
$mb_user_id = $_SESSION["mb_user_id"];
//if layer is not found in DB
if (!$layer_id) {
    echo "layer existiert nicht in Datenbank";
    exit;
} else {
    //Try to read sld from the DB
    $sql = "SELECT * FROM sld_user_layer WHERE fkey_gui_id = \$1 AND fkey_layer_id = \$2 AND fkey_mb_user_id = \$3";
    $v = array($_SESSION["sld_gui_id"], $layer_id, $mb_user_id);
    $t = array('s', 'i', 'i');
    $res = db_prep_query($sql, $v, $t);