_minify_js = isset($_REQUEST["min"])?FALSE:TRUE; $MAP_OBJECT->setDSN("mysql://user:password@localhost/db_name"); $MAP_OBJECT->disableSidebar(); //Set Mobile Parameters $MAP_OBJECT->mobile=true; $MAP_OBJECT->width="100%"; $MAP_OBJECT->height="100%"; $balloon_query_name; //Connection with the MySQL data base for obtain names actives balloons $con = get_DB_connection(); //Make a query for obtain actives balloons $query = "SELECT DISTINCT(Name) AS Name FROM verdiern1 ORDER BY Name ASC"; //Execute the query $result = mysqli_query($con,$query); //This array is for store balloons names for the dropdown nambar $names_of_balloons = array(); while ($row = $result->fetch_assoc()) { $names_of_balloons[] = $row['Name']; } mysqli_free_result($result); mysqli_close($con); //Make a query MySQL for obtain balloon data if we have balloons actives //Test if we have balloons stored in the data base if (count($names_of_balloons)>0){ //Connection with the MySQL data base $con = get_DB_connection(); //Debug purpose line //echo count($names_of_balloons); //Obtain the actual balloon from the querystring in the url, if it is the first time //we open the site we use the name of the first balloon stored in the database if($_GET['balloon']!=""){ $balloon=$_GET['balloon']; $name=$balloon; }else{ $name=$names_of_balloons[0]; } //Build our query to the database with the appropriate balloon name $query = "SELECT Name, Latitude_Decimal_Degree, Longitude_Decimal_Degree ,Status, Date_MDY_HM12 FROM verdiern1 WHERE Name='$name'"; //Execute the query $result = mysqli_query($con,$query); //Build coordinates array for poly-line $coords_array = array(); //Build array for show the last balloon position $last_position=array(); //Var for store last reception time $last_time = ''; //Var for store last status received $status = ''; //Stored in arrays all balloon data while ($row = $result->fetch_assoc()) { array_push($coords_array, array("lat"=>str_replace(",",".",$row['Latitude_Decimal_Degree']),"long"=>str_replace(",",".",$row['Longitude_Decimal_Degree']))); $last_position = array(str_replace(",",".",$row['Latitude_Decimal_Degree']),str_replace(",",".",$row['Longitude_Decimal_Degree'])); //echo $last_position[0] . " " . $last_position[1]. "\n"; $last_time = $row['Date_MDY_HM12']; $status = $row['Status']; } //Free resources mysqli_free_result($result); //Close connection with the database mysqli_close($con); //Add the poly-line and the marker $polyline_id = $MAP_OBJECT->addPolylineByCoordsArray($coords_array, $id=false,$color='#FF0000',$weight=2, $opacity=.8); $MAP_OBJECT->addMarkerByCoords($last_position[1],$last_position[0]); } //Obtain balloon what we are showing from url, if it is the first time we open the site we show the data of the first balloon if ($_GET['balloon']!=""){ $balloon=$_GET['balloon']; $balloon_img=$balloon; //echo $balloon; }else{ $balloon_img=$names_of_balloons[0]; } //Generate all the images with graphs balloon runtime image_update($balloon_img); //Refresh the site periodically if (count($names_of_balloons)>0){ header("refresh:180; url=$self"); //Refresh every 3 minutes } ?> getHeaderJS();?> getMapJS();?>

Balloons Website

Last Web Update:

Balloon 1){ $name=$names_of_balloons[0]; }else{ $name=''; } } echo "$name
Last Update: $last_time
Status: $status ";?>

printOnLoad();?> printMap();?> printSidebar();?>