Пример #1
0
 $showPlayback = $map['showPlayback'] ? 'true' : 'false';
 $showStaticSidebar = $map['showStaticSidebar'] ? 'true' : 'false';
 $staticSidebarContent = $map['staticSidebarContent'];
 updateMap($mapId, $user['id'], 'show_export', $showExport);
 updateMap($mapId, $user['id'], 'show_measure', $showMeasure);
 updateMap($mapId, $user['id'], 'show_minimap', $showMinimap);
 updateMap($mapId, $user['id'], 'show_filelayer', $showFilelayer);
 updateMap($mapId, $user['id'], 'show_svg', $showSvg);
 updateMap($mapId, $user['id'], 'show_search', $showSearch);
 updateMap($mapId, $user['id'], 'show_playback', $showPlayback);
 updateMap($mapId, $user['id'], 'show_static_sidebar', $showStaticSidebar);
 updateMap($mapId, $user['id'], 'static_sidebar_content', $staticSidebarContent);
 updateMap($mapId, $user['id'], 'layers_id', $map['layerId']);
 updateMap($mapId, $user['id'], 'groups_id', $map['groupId']);
 updateMap($mapId, $user['id'], 'projects_id', $map['projectId']);
 updateMap($mapId, $user['id'], 'image_overlays', json_encode($map['imageOverlays']));
 $properties = array();
 $type = array();
 $coordinates = array();
 $styles = array();
 $shapeCustomProperties = array();
 foreach ($map['markers'] as $marker) {
     $marker = (array) $marker;
     $marker['showGetDirection'] = $marker['showGetDirection'] ? 'true' : 'false';
     $marker['showInfoBox'] = $marker['showInfoBox'] ? 'true' : 'false';
     $marker['showLocationOnPopup'] = $marker['showLocationOnPopup'] ? 'true' : 'false';
     $marker['hideLabel'] = $marker['hideLabel'] ? 'true' : 'false';
     $properties[] = '[{"name":"Location","value":"' . $marker['location'] . '","defaultProperty":true},{"name":"Popu-Up Content","value":"' . $marker['description'] . '","defaultProperty":false}]';
     $type[] = 'Point';
     $coordinates[] = '[' . $marker['longitude'] . ',' . $marker['latitude'] . ']';
     $styles[] = '{"icon":"' . $marker['markerStyle'] . '","prefix":"fa","markerColor":"' . $marker['markerColor'] . '"}';
Пример #2
0
         for ($acts = 0; $acts < $fighters[$currentturn]['act']; $acts++) {
             $j = -1;
             do {
                 $j++;
             } while (!condition($currentturn, $j));
             action($currentturn, $j);
             //if(onlyOneTeam() || $currTurn >= $maxTurns) {
             //  break 2;
             //}
             if (onlyOneTeam() == $fighters[0]['party'] && $currTurn < $maxTurns) {
                 $reportintro .= "Victory!";
                 break 2;
             }
         }
     }
     updateMap($roomstats[$key]['length'], $roomstats[$key]['width'], $roomstats[$key]['floor']);
     DevalueStatus();
     $currTurn++;
 }
 // getTurnOrder();
 /*if(onlyOneTeam() == $fighters[0]['party'] && $currTurn < $maxTurns) {
     $reportintro .= "Victory!";
   } else {
     $reportintro .= "Defeat!";
     exit;
   }
   $reportintro .= "|";*/
 foreach ($fighters as $ind => $fighter) {
     if ($fighter['party'] != $hero['party']) {
         echo "Unsetting: " . $fighter['name'] . "<br>";
         unset($fighters[$ind]);
Пример #3
0
     }
     // addslashes
     $_REQUEST['name'] = addslashes($_REQUEST['name']);
     $_REQUEST['description'] = addslashes($_REQUEST['description']);
     $_REQUEST['address'] = addslashes($_REQUEST['address']);
     $_REQUEST['street'] = addslashes($_REQUEST['street']);
     $_REQUEST['city'] = addslashes($_REQUEST['city']);
     $_REQUEST['state'] = addslashes($_REQUEST['state']);
     $_REQUEST['country'] = addslashes($_REQUEST['country']);
     $_REQUEST['tel'] = addslashes($_REQUEST['tel']);
     $_REQUEST['fax'] = addslashes($_REQUEST['fax']);
     $_REQUEST['web'] = addslashes($_REQUEST['web']);
     $sql = "name = '{$_REQUEST['name']}', " . "description = '{$_REQUEST['description']}', " . "modified = '{$_REQUEST['modified']}', " . "address = '{$_REQUEST['address']}', " . "lat = '{$lat}', " . "lng = '{$lng}', " . "street = '{$_REQUEST['street']}', " . "city = '{$_REQUEST['city']}', " . "code = '{$_REQUEST['code']}', " . "state = '{$_REQUEST['state']}', " . "country = '{$_REQUEST['country']}', " . "tel = '{$_REQUEST['tel']}', " . "fax = '{$_REQUEST['fax']}', " . "web = '{$_REQUEST['web']}'";
     $sql = "UPDATE {$_TABLES['maps_markers']} SET {$sql} " . "WHERE mkid = {$_REQUEST['mkid']}";
     DB_query($sql);
     updateMap($_REQUEST['mid']);
     //Send notification to admin
     MAPS_sendNotification($_REQUEST, true);
     if (DB_error()) {
         $msg = $LANG_MAPS_1['save_fail'];
     } else {
         $msg = $LANG_MAPS_1['save_success'];
     }
     // save complete, return to markers list
     echo COM_refresh($_MAPS_CONF['site_url'] . '/markers.php?mode=show&mkid=' . $_REQUEST['mkid'] . '&mid=' . $_REQUEST['mid'] . '&msg=' . urlencode($msg));
     exit;
     break;
     break;
 case 'show':
     if (isset($_REQUEST['mid']) && isset($_REQUEST['mkid'])) {
         $display .= MAPS_getMarkerDetail($_REQUEST['mid'], $_REQUEST['mkid']);
Пример #4
0
<?php

require_once dirname(__FILE__) . "/../include/master.inc.php";
if (!isLogin()) {
    redirect("login.php");
}
$user = getUserInfo();
$map_id = createMap($user['id'], 550, 1000, 6, 'false', 'true', 'false', '', '[0,0]', '', '{}');
if ($map_id) {
    updateMap($map_id, $user['id'], 'source', 'website');
    redirect("map-edit.php?action=create&id=" . $map_id);
} else {
    redirect("map.php");
}
Пример #5
0
                $shape->properties = json_encode($tempProp);
                $shapes[$key] = $shape;
                $properties[] = $shape->properties;
                $type[] = $shape->geometry->type;
                $coordinates[] = json_encode($shape->geometry->coordinates) == "" ? "[]" : json_encode($shape->geometry->coordinates);
                $shapeCustomProperties[] = json_encode($customProperties[$key]) == "" ? "{}" : json_encode($customProperties[$key]);
                $styles[] = json_encode($shapeStyles[$key]) == "" ? "{}" : json_encode($shapeStyles[$key]);
            }
            updateMap((int) $_POST['id'], $user['id'], 'mapcenter', $_POST['mapcenter']);
            updateMap((int) $_POST['id'], $user['id'], 'zoom', (int) $_POST['zoom']);
            updateMap((int) $_POST['id'], $user['id'], 'overlay_title', $_POST['overlay_title']);
            updateMap((int) $_POST['id'], $user['id'], 'overlay_blurb', $_POST['overlay_blurb']);
            updateMap((int) $_POST['id'], $user['id'], 'overlay_content', $_POST['overlay_content']);
            updateMap((int) $_POST['id'], $user['id'], 'legend_content', $_POST['legend_content']);
            updateMap((int) $_POST['id'], $user['id'], 'image_overlays', $_POST['image_overlays']);
            updateMap((int) $_POST['id'], $user['id'], 'gpx_tracks', $_POST['gpx_tracks']);
            updateMap((int) $_POST['id'], $user['id'], 'map_bounds', $_POST['map_bounds']);
            updateMap((int) $_POST['id'], $user['id'], 'static_sidebar_content', $_POST['static_sidebar_content']);
            if (updateShapes((int) $_POST['id'], $properties, $type, $coordinates, $styles, $shapeCustomProperties)) {
                $success = "Map Successfully Saved!";
            } else {
                $error = "Invalid Map Data";
            }
        }
    } else {
        $error = "Invalid Request";
    }
}
$_SESSION['response']['map-edit']['error'] = $error;
$_SESSION['response']['map-edit']['success'] = $success;
redirect(BASEURL . "app/map-edit.php?id=" . $_POST['id']);
Пример #6
0
 $hide_label = strtolower($get['hide_label']) == 'no' ? 'false' : 'true';
 $mapId = createMap($user['id'], $height, $width, $zoom, $defaultopen, $showsidebar, 'true', $name, '[' . $latlng['lat'] . ',' . $latlng['lng'] . ']', $password, '[]');
 if ($mapId) {
     updateMap($mapId, $user['id'], 'cluster', $cluster);
     updateMap($mapId, $user['id'], 'show_overlay', $show_overlay);
     updateMap($mapId, $user['id'], 'overlay_title', $overlay_title);
     updateMap($mapId, $user['id'], 'overlay_blurb', $overlay_blurb);
     updateMap($mapId, $user['id'], 'overlay_content', $overlay_content);
     updateMap($mapId, $user['id'], 'show_legend', $show_legend);
     updateMap($mapId, $user['id'], 'legend_content', $legend_content);
     updateMap($mapId, $user['id'], 'show_export', $show_export);
     updateMap($mapId, $user['id'], 'show_measure', $show_measure);
     updateMap($mapId, $user['id'], 'show_minimap', $show_minimap);
     updateMap($mapId, $user['id'], 'show_filelayer', $show_filelayer);
     updateMap($mapId, $user['id'], 'show_static_sidebar', $show_static_sidebar);
     updateMap($mapId, $user['id'], 'static_sidebar_content', $static_sidebar_content);
     $properties = array();
     $properties[] = '[{"name":"Location","value":"' . $address . '","defaultProperty":true},{"name":"Popu-Up Content","value":"' . $description . '","defaultProperty":false}]';
     $type = array();
     $type[] = 'Point';
     $coordinates = array();
     $coordinates[] = '[' . $longitude . ',' . $latitude . ']';
     $styles = array();
     $styles[] = '{"icon":"' . $marker_style . '","prefix":"fa","markerColor":"' . $marker_color . '"}';
     $shapeCustomProperties = array();
     $shapeCustomProperties[] = '{"get_direction":' . $get_direction . ',"bootstrap_popup":' . $bootstrap_popup . ',"show_address_on_popup":' . $showlocation . ',"hide_label":' . $hide_label . '}';
     updateShapes($mapId, $properties, $type, $coordinates, $styles, $shapeCustomProperties);
     $result = array('view' => BASEURL . "app/map-view.php?mapid=" . $mapId, 'download' => BASEURL . "app/map-download-html.php?mapid=" . $mapId, 'iframe' => "<iframe src='" . BASEURL . "app/map-view.php?mapid=" . $mapId . "' height='" . $height . "' width='" . $width . "' scrolling='no' style='border:none'></iframe>");
     $RESPONSE['response']['success'] = true;
     $RESPONSE['response']['message'] = $result;
 } else {
Пример #7
0
    if (!$mapId) {
        $error = "Map is not created!";
    } else {
        updateMap($mapId, $userId, 'source', 'website');
        $properties = array();
        $type = array();
        $coordinates = array();
        $styles = array();
        $customproperties = array();
        foreach ($validRows as $row) {
            $shape = prepareShapeData($row);
            $type[] = $shape['type'];
            $coordinates[] = $shape['coordinates'];
            $properties[] = $shape['properties'];
            $styles[] = $shape['styles'];
            $customproperties[] = $shape['customproperties'];
        }
        updateMap($mapId, $userId, 'stylingcolumn', $_POST['stylingColumn']);
        updateMap($mapId, $userId, 'shapestyling', $_POST['shapeStyling']);
        updateMap($mapId, $userId, 'name', $_POST['map-name']);
        updateMap($mapId, $userId, 'height', (int) $_POST['map-height']);
        updateMap($mapId, $userId, 'width', (int) $_POST['map-width']);
        updateMap($mapId, $userId, 'zoom', (int) $_POST['map-zoom']);
        updateMap($mapId, $userId, 'password', $_POST['map-password']);
        updateShapes($mapId, $properties, $type, $coordinates, $styles, $customproperties);
        $_SESSION['csv']['data'] = null;
        redirect(BASEURL . "app/csv-edit.php?id=" . $mapId);
    }
}
$_SESSION['response']['csv-create']['error'] = $error;
redirect(BASEURL . "app/csv-create.php?action=");
Пример #8
0
                         $dontSave = true;
                     }
                 } else {
                     if ($name == "projects_id") {
                         $value = (int) $value;
                         if ((int) $value < 0) {
                             $dontSave = true;
                         }
                     }
                 }
             }
         }
     }
 }
 if ($error == "" || $dontSave) {
     updateMap($maps_id, $user['id'], $name, $value);
     if ($name == "layers_id") {
         $defaulLayer = getLayerById((int) $value);
         $defaulLayer = array('url' => $defaulLayer['url'], 'key' => $defaulLayer['lkey'], 'attribution' => $defaulLayer['attribution']);
         echo json_encode($defaulLayer);
     } else {
         if ($name == "groups_id") {
             global $db;
             $baseLayers = array();
             $res = pg_query($db, "SELECT * FROM layers WHERE id IN (SELECT layers_id FROM groups_has_layers WHERE groups_id = " . (int) $value . ")") or die("Database Error");
             if (pg_num_rows($res) > 0) {
                 while ($data = pg_fetch_assoc($res)) {
                     $baseLayers[] = array('name' => $data['name'], 'url' => $data['url'], 'key' => $data['lkey'], 'attribution' => $data['attribution']);
                 }
             }
             echo json_encode($baseLayers);