Design 2 column data layout
Design 2 column data layout

--- a/include/common-template.inc.php
+++ b/include/common-template.inc.php
@@ -126,7 +126,25 @@
 border-radius: 15px;
     }
  
-
+/*#leftcolumn { 
+	float: none;
+}			
+.min-width-768px #leftcolumn {
+	float: left;
+	width: 30%;
+}
+#rightcolumn { 
+	float: none;
+}			
+.min-width-768px #rightcolumn {
+	float: right;
+	width: 68%;
+}*/	
+
+#footer {
+clear:both;
+text-align:center;
+}
     // source http://webaim.org/techniques/skipnav/
     #skip a, #skip a:hover, #skip a:visited 
 { 
@@ -145,7 +163,7 @@
 height:auto; 
 }
 </style>';
-	if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod')) {
+	if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
 		echo '<meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <link rel="apple-touch-startup-image" href="startup.png" />
@@ -176,7 +194,11 @@
 }
 $(document).ready(function() {
         $('#here').click(function(event) { $('#geolocate').val(geolocate()); return false;});
-$('#here').show();
+        $('#here').show();
+	/*if ($.mobile.media('screen and (min-width: 768px)')) {
+	  $('map a:first').click();
+	  $('#settings a:first').click();
+	}*/
 });
 ";
 		if (!isset($_SESSION['lat']) || $_SESSION['lat'] == "") echo "geolocate();";
@@ -251,7 +273,7 @@
         or enter an address/co-ordinates in the box below.';
 	}
 	echo '</div>';
-	echo '<div data-role="collapsible" data-collapsed="' . !$geoerror . '">
+	echo '<div id="settings" data-role="collapsible" data-collapsed="' . !$geoerror . '">
         <h3>Change Time/Place (' . (isset($_SESSION['time']) ? $_SESSION['time'] : "Current Time,") . ' ' . ucwords(service_period()) . ')...</h3>
         <form action="' . basename($_SERVER['PHP_SELF']) . "?" . $_SERVER['QUERY_STRING'] . '" method="post">
         <div class="ui-body"> 

--- a/include/db/route-dao.inc.php
+++ b/include/db/route-dao.inc.php
@@ -200,7 +200,7 @@
 	$query = $conn->prepare($query);
 	$query->bindParam(":service_period", $service_period);
 	$query->bindParam(":distance", $distance);
-	$query->bindParam(":limit", $limit);
+	if ($limit != "") $query->bindParam(":limit", $limit);
 	$query->execute();
 	if (!$query) {
 		databaseError($conn->errorInfo());

file:a/stop.php -> file:b/stop.php
--- a/stop.php
+++ b/stop.php
@@ -60,6 +60,7 @@
 	}
 }
 include_header($stop['stop_name'], "stop");
+echo '<span id="leftcolumn">';
 timePlaceSettings();
 echo $stopLinks;
 if (sizeof($stops) > 0) {
@@ -75,6 +76,7 @@
 		)
 	)) ;
 }
+echo '</span><span id="rightcolumn">';
 echo '  <ul data-role="listview"  data-inset="true">';
 if (sizeof($allStopsTrips) > 0) {
     sktimesort($allStopsTrips,"arrival_time", true);
@@ -107,6 +109,7 @@
 	}
 }
 echo '</ul>';
+echo '</span>';
 include_footer();
 ?>
 

file:a/trip.php -> file:b/trip.php
--- a/trip.php
+++ b/trip.php
@@ -16,7 +16,7 @@
 include_header("Stops on " . $trip['route_short_name'] . ' ' . $trip['route_long_name'], "trip");
 trackEvent("Route/Trip View","View Route",  $trip['route_short_name'] . ' ' . $trip['route_long_name'], $routeid);
 
-
+echo '<span id="leftcolumn">';
 echo '<h2>Via:</h2> <small>' . viaPointNames($tripid) . '</small>';
 echo '<h2>Other Trips:</h2> ';
 foreach (getRouteTrips($routeid) as $othertrip) {
@@ -27,6 +27,7 @@
 foreach (getRoutesByNumber($trip['route_short_name']) as $row) {
 	if ($row['route_id'] != $routeid) echo '<a href="trip.php?routeid=' . $row['route_id'] . '">' . $row['route_long_name'] . ' (' . ucwords($row['service_id']) . ')</a> ';
 }
+echo '</span><span id="rightcolumn">';
 flush(); @ob_flush();
 echo '  <ul data-role="listview"  data-inset="true">';
 $stopsGrouped = Array();
@@ -44,10 +45,11 @@
 			$stopsGrouped["endTime"] = $tripStopTime['arrival_time'];
 			echo '<a href="stop.php?stopids=' . implode(",", $stopsGrouped['stop_ids']) . '">';
 			echo '<p class="ui-li-aside">' . $stopsGrouped['startTime'] . ' to ' . $stopsGrouped['endTime'];
-                        echo '</p>';
+                        
                         if (isset($_SESSION['lat']) && isset($_SESSION['lon'])) {
-						echo '<span class="ui-li-count">' . distance($stop['stop_lat'],$stop['stop_lon'], $_SESSION['lat'], $_SESSION['lon'], true) . 'm away</span>';
+						echo '<br>' . distance($tripStopTime['stop_lat'],$tripStopTime['stop_lon'], $_SESSION['lat'], $_SESSION['lon'], true) . 'm away';
 					}
+                                        echo '</p>';
 			echo bracketsMeanNewLine($tripStopTime["stop_name"]);
 			echo '</a></li>';
                         flush(); @ob_flush();
@@ -56,10 +58,11 @@
 		else {
 			// just a normal stop
 			echo '<a href="stop.php?stopid=' . $tripStopTime['stop_id'] . (startsWith($tripStopTime['stop_code'], "Wj") ? '&amp;stopcode=' . $tripStopTime['stop_code'] : "") . '">';
-			echo '<p class="ui-li-aside">' . $tripStopTime['arrival_time'] . '</p>';
+			echo '<p class="ui-li-aside">' . $tripStopTime['arrival_time']; 
 			if (isset($_SESSION['lat']) && isset($_SESSION['lon'])) {
-						echo '<span class="ui-li-count">' . distance($stop['stop_lat'],$stop['stop_lon'], $_SESSION['lat'], $_SESSION['lon'], true) . 'm away</span>';
+						echo '<br>' . distance($tripStopTime['stop_lat'],$tripStopTime['stop_lon'], $_SESSION['lat'], $_SESSION['lon'], true) . 'm away';
 					}
+                                        echo '</p>';
                                         echo bracketsMeanNewLine($tripStopTime['stop_name']);
 			echo '</a></li>';
                         flush(); @ob_flush();
@@ -85,6 +88,8 @@
 	}
 }
 echo '</ul>';
+
+echo '</span>';
 include_footer();
 ?>