--- a/include/common-template.inc.php +++ b/include/common-template.inc.php @@ -1,117 +1,92 @@ - ' . $pageTitle . ' - '; - if ($datepicker) echo ''; - if (isDebugServer()) echo ' - - + - '; - else echo ' - - - '; - if ($datepicker) echo ' - '; - echo ''; - if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod')) { + + + + + + + + '; + echo ''; + echo ''; + if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) { echo ' @@ -123,8 +98,11 @@ function success(position) { $('#error').val('Location now detected. Please wait for data to load.'); $('#geolocate').val(position.coords.latitude+','+position.coords.longitude); -$.ajax({ url: \"include/common.inc.php?geolocate=yes&lat=\"+position.coords.latitude+\"&lon=\"+position.coords.longitude }); -location.reload(true); +$.ajax({ async: false, +success: function(){ + location.reload(true); + }, +url: \"include/common.inc.php?geolocate=yes&lat=\"+position.coords.latitude+\"&lon=\"+position.coords.longitude }); } function error(msg) { $('#error').val('Error: '+msg); @@ -142,20 +120,21 @@ } $(document).ready(function() { $('#here').click(function(event) { $('#geolocate').val(geolocate()); return false;}); -$('#here').show(); + $('#here').show(); }); "; -if (!isset($_SESSION['lat']) || $_SESSION['lat'] == "") echo "geolocate();"; -echo " "; + if (!isset($_SESSION['lat']) || $_SESSION['lat'] == "") echo "geolocate();"; + echo " "; } if (isAnalyticsOn()) echo ' -"; -echo ' + echo '