2010-02-25 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_gis.php: in function "addPath" fix the query to extract the path from a time. * operation/agentes/gis_view.php: add no-ajax control for filter the time to show path. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2421 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c58e3c3a5d
commit
6f91b31b80
|
@ -476,7 +476,7 @@ function addPath($layerName, $idAgent, $history_time = null) {
|
|||
$where = '1 = 1';
|
||||
}
|
||||
else {
|
||||
$where = 'start_timestamp = FROM_UNIXTIME(UNIX_TIMESTAMP() - ' . $history_time . ')';
|
||||
$where = 'start_timestamp >= FROM_UNIXTIME(UNIX_TIMESTAMP() - ' . $history_time . ')';
|
||||
}
|
||||
|
||||
$listPoints = get_db_all_rows_sql('SELECT *
|
||||
|
|
|
@ -40,7 +40,7 @@ echo "<h3>" . __("Map with the last position/s") . " " . human_time_description
|
|||
|
||||
/* Map with the current position */
|
||||
echo "<div id=\"".$agent_name."_agent_map\" style=\"border:1px solid black; width:98%; height: 30em;\"></div>";
|
||||
echo getAgentMap($agentId, "500px", "98%", true);
|
||||
echo getAgentMap($agentId, "500px", "98%", true, true, $period);
|
||||
|
||||
$timestampLastOperation = get_db_value_sql("SELECT UNIX_TIMESTAMP()");
|
||||
|
||||
|
@ -51,6 +51,28 @@ if ($agentData === false) {
|
|||
echo "<p>" . __("There is no GIS data for this agent, so it's positioned in default position of map.") . "</p>";
|
||||
}
|
||||
|
||||
$intervals = array ();
|
||||
$intervals[30] = human_time_description_raw (30);
|
||||
$intervals[60] = human_time_description_raw (60);
|
||||
$intervals[300] = human_time_description_raw (300);
|
||||
$intervals[600] = human_time_description_raw (600);
|
||||
$intervals[1200] = human_time_description_raw (1200);
|
||||
$intervals[1800] = human_time_description_raw (1800);
|
||||
$intervals[3600] = human_time_description_raw (3600);
|
||||
$intervals[7200] = human_time_description_raw (7200);
|
||||
$intervals[86400] = human_time_description_raw (86400);
|
||||
$intervals[172800] = human_time_description_raw (172800);
|
||||
$intervals[604800] = human_time_description_raw (604800);
|
||||
|
||||
echo "<br />";
|
||||
//debugPrint($_SERVER);
|
||||
echo "<form action='index.php?" . $_SERVER['QUERY_STRING'] . "' method='POST'>";
|
||||
echo __("Period to show data as path") . ": ";
|
||||
print_extended_select_for_time ($intervals, 'period', $period, '', '', '0', 10);
|
||||
echo __(" seconds.");
|
||||
print_submit_button(__('Refresh'), 'refresh', false, 'class = "sub upd"');
|
||||
echo "</form>";
|
||||
|
||||
echo "<h3>" . __("Positional data from the last") . " " . human_time_description ($period) ."</h3>";
|
||||
/* Get the total number of Elements for the pagination */
|
||||
$sqlCount = sprintf ("SELECT COUNT(*) FROM tgis_data_history WHERE tagente_id_agente = %d AND end_timestamp > %d ORDER BY end_timestamp DESC", $agentId, get_system_time () - $period);
|
||||
|
|
Loading…
Reference in New Issue