diff --git a/pandora_console/operation/gis_maps/index.php b/pandora_console/operation/gis_maps/index.php new file mode 100644 index 0000000000..06469447ff --- /dev/null +++ b/pandora_console/operation/gis_maps/index.php @@ -0,0 +1,67 @@ +".__('GIS Maps')." » ".__('Summary').""; + +$maps = getMaps(); + +$table->width = "70%"; +$table->data = array (); +$table->head = array (); +$table->head[0] = __('Name'); +$table->head[1] = __('Group'); +$table->align = array (); +$table->align[1] = 'center'; + +$rowPair = true; +$iterator = 0; + +if ($maps !== false) { + foreach ($maps as $map) { + if ($rowPair) + $table->rowclass[$iterator] = 'rowPair'; + else + $table->rowclass[$iterator] = 'rowOdd'; + $rowPair = !$rowPair; + $iterator++; + + if (!give_acl ($config["id_user"], $map["group_id"], "AR")) { + continue; + } + $data = array (); + + $data[0] = '' . $map['map_name'].' '; + $data[1] = print_group_icon ($map["group_id"], true); + + array_push ($table->data, $data); + } +} + +if (!empty ($table->data)) { + print_table ($table); +} else { + echo '
'.__('No maps found').'
'; +} +unset ($table); +?> \ No newline at end of file diff --git a/pandora_console/operation/gis_maps/render_view.php b/pandora_console/operation/gis_maps/render_view.php new file mode 100644 index 0000000000..0dee8f2859 --- /dev/null +++ b/pandora_console/operation/gis_maps/render_view.php @@ -0,0 +1,93 @@ +".__('Visual console')." » ".__('Map'); +echo " " . $map['map_name'] . "  "; + +if ($config["pure"] == 0) { + echo ''; + print_image ("images/fullscreen.png", false, array ("title" => __('Full screen mode'))); + echo ""; +} else { + echo ''; + print_image ("images/normalscreen.png", false, array ("title" => __('Back to normal mode'))); + echo ""; +} + +echo " "; + +if (give_acl ($config["id_user"], $map['group_id'], "AW")) + echo ''.print_image ("images/setup.png", true, array ("title" => __('Setup'))).''; +echo ""; + +printMap('map', $map['zoom_level'], $numZoomLevels, $map['initial_latitude'], + $map['initial_longitude'], array($baseLayers[0]['typeBaseLayer'] => $baseLayers[0]['url']), $controls); + +if ($layers != false) { + foreach ($layers as $layer) { + makeLayer($layer['layer_name'], $layer['view_layer']); + + $agentNames = get_group_agents($layer['tgrupo_id_grupo']); + foreach ($agentNames as $agentName) { + $idAgent = get_agent_id($agentName); + $coords = get_agent_last_coords($idAgent); + + switch (get_agent_status($idAgent)) { + case 1: + case 4: + //Critical (BAD or ALERT) + $status = "bad"; + break; + case 0: + //Normal (OK) + $status = "ok"; + break; + case 2: + //Warning + $status = "warning"; + break; + default: + // Default is Grey (Other) + $status = false; + } + $icon = get_agent_icon_map($idAgent, $status); + + addPath($layer['layer_name'], $idAgent); + addPoint($layer['layer_name'], $agentName, $coords['last_latitude'], $coords['last_longitude'], $icon); + } + } +} + +?> +

+
\ No newline at end of file