Jelajahi Sumber

In homr screen, the location map has now it's own section, and is shown if there is a location report event when no festivals are taking place.

Iñigo Valentin 9 tahun lalu
induk
melakukan
61d432828d
2 mengubah file dengan 20 tambahan dan 21 penghapusan
  1. 5 9
      www/css/index.css
  2. 15 12
      www/index.php

+ 5 - 9
www/css/index.css

@@ -32,7 +32,7 @@ table.festival_section_table tr td div#festivals_summary img{
 	margin-right:	2em;
 }
 
-table.festival_section_table tr td div#festival_entry_map{
+div#map{
 	text-align:	center;
 }
 
@@ -40,15 +40,11 @@ div.festival_event{
 	margin-left:	1.5em;
 }
 
-table.festival_section_table tr td div#festival_entry_map h3{
-	text-align:	left;
-}
-
-table.festival_section_table tr td div#festival_entry_map iframe{
-	width:		80%;
+div#map iframe{
+	width:		100%;
 	margin:		auto;
-	min-height:	15em;
-	max-height:	20em;
+	min-height:	20em;
+	max-height:	25em;
 }
 
 table.festival_section_table tr td div.festival_schedule span.title{

+ 15 - 12
www/index.php

@@ -61,7 +61,21 @@
 	<body>
 		<?php include("header.php"); ?>
 		<div id="content">
-			<?php
+
+<?php		//Location section
+				$q_location = mysqli_query($con, "SELECT lat, lon FROM location WHERE action = 'report' AND dtime > NOW() - INTERVAL 30 MINUTE ORDER BY dtime DESC LIMIT 1;");
+          if (mysqli_num_rows($q_location) > 0){
+            $r_location = mysqli_fetch_array($q_location);
+?>
+						<div class='section' id='location'>
+							<h3 class='section_title'><?=$lng[index_festivals_location]?></h3>
+            	<div class='entry' id='map'>
+								<iframe src='https://www.google.com/maps/embed/v1/place?key=AIzaSyCZHP7t2on_G3eyyoCTfhGAlDx1mJnX7iI&q=<?=$r_location[lat]?>,<?=$r_location[lon]?>' allowfullscreen></iframe>
+							</div>
+						</div>
+<?php
+          }
+
 				//Festivals section
 				$year = date("Y");
 				$q_settings = mysqli_query($con, "SELECT value FROM settings WHERE name = 'festivals';");
@@ -99,17 +113,6 @@
 						echo "</div></td>\n";
 					}
 					
-					
-					//Location
-					$q_location = mysqli_query($con, "SELECT lat, lon FROM location WHERE action = 'report' AND dtime > NOW() - INTERVAL 30 MINUTE ORDER BY dtime DESC LIMIT 1;");
-					if (mysqli_num_rows($q_location) > 0){
-						$r_location = mysqli_fetch_array($q_location);
-						echo "<td><div class='entry' id='festival_entry_map'>\n";
-						echo "<h3 class='entry_title'>$lng[index_festivals_location]</h3>\n";
-						echo "<iframe src='https://www.google.com/maps/embed/v1/place?key=AIzaSyCZHP7t2on_G3eyyoCTfhGAlDx1mJnX7iI&q=$r_location[lat],$r_location[lon]' allowfullscreen></iframe>\n";
-						echo "</div>\n";
-					}
-					
 					echo "</tr></table>\n";
 					echo "<table class='festival_section_table'><tr>\n";