[Phonehome-commits] r88 - trunk/server

lauren at garage.maemo.org lauren at garage.maemo.org
Sun Oct 19 21:57:08 EEST 2008


Author: lauren
Date: 2008-10-19 21:57:07 +0300 (Sun, 19 Oct 2008)
New Revision: 88

Modified:
   trunk/server/gpsdata.php
   trunk/server/images.php
Log:
adding profile and device management

Modified: trunk/server/gpsdata.php
===================================================================
--- trunk/server/gpsdata.php	2008-10-19 16:35:04 UTC (rev 87)
+++ trunk/server/gpsdata.php	2008-10-19 18:57:07 UTC (rev 88)
@@ -22,7 +22,7 @@
 include 'common/header.php';
 
 // device droplist
-echo "<div><b>Your Devices</b>
+echo "<div><b>View GPS Data for...</b>
 <form method='post' action='{$_SERVER['PHP_SELF']}'>
 <select name='device' onchange='document.forms[0].submit()'><option value='0'>Select the device to see data for...</option>";
 $res = mysql_query("select device_id,name,mac from devices where user_id={$_uid} order by name");

Modified: trunk/server/images.php
===================================================================
--- trunk/server/images.php	2008-10-19 16:35:04 UTC (rev 87)
+++ trunk/server/images.php	2008-10-19 18:57:07 UTC (rev 88)
@@ -8,19 +8,53 @@
 	die();
 }
 
+$did = getvar("did","n");
+
 ?>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
-<title>ET-MAEMO | Images</title>
+<title>ET-MAEMO | Image Data</title>
 <link rel="stylesheet" type="text/css" href="css/main.css">
 </head>
 <body>
 <?php
 include 'common/header.php';
 
-echo "<h1>Images here</h1>";
+// device droplist
+echo "<div><b>View Image Data for...</b>
+<form method='post' action='{$_SERVER['PHP_SELF']}'>
+<select name='device' onchange='document.forms[0].submit()'><option value='0'>Select the device to see data for...</option>";
+$res = mysql_query("select device_id,name,mac from devices where user_id={$_uid} order by name");
+while ($row = mysql_fetch_assoc($res)){
+	// save first device for initial list
+	if ($did == 0){
+		$did = $row['device_id'];
+	}
+	// add to droplist
+	if ($did == $row['device_id']){
+		echo "<option value='{$row['device_id']}' selected>{$row['name']} - ({$row['mac']})</option>";
+	}
+	else {
+		echo "<option value='{$row['device_id']}'>{$row['name']} - ({$row['mac']})</option>";
+	}
+}
+echo "</select>
+</form>
+</div>";
 
+// do they have a device registered?
+if ($did == 0){
+	echo "<h3 style='color:red;'>
+		Please enter at least one device<br>
+		on your <a href='profile.php'>PROFILE</a> page to use ET-MAEMO
+	</h3>";
+}
+// else we can draw data for selected device or initial device
+else {
+
+}
+
 include 'common/footer.php';
 ?>
 </body>



More information about the Phonehome-commits mailing list