function printLastLoc($unitname, $expand) { $result = cachedSQL("SELECT * FROM `" . $unitname . "` order BY time DESC LIMIT 1"); if ($row = mysql_fetch_array($result)) { do { # CALCULATE TIME DIFFERENCE $today = mktime(); $stamp = strtotime($row['time']); dateDiff($today, $stamp); if ($expand == "1") { echo ' (<a href="javascript:GEvent.trigger(exml.gmarkers[0],\'click\')">show on map</a>)'; } if ($expand == "newest") { echo ' (<a href="livemap.php?newest">show on map</a>)'; } echo "<br>"; echo "<b>Message:</b> " . $row['type'] . " <b>Time:</b> " . $row['time'] . " <b>Position:</b> " . $row['lng'] . ", " . $row['lat']; } while ($row = mysql_fetch_array($result)); } else { print "Sorry, no records were found!"; } }
// If no tag is selected don't do print the table if ($num_rows != 0) { ?> <table border="1" id="maintable" name="maintable"> <tr> <th width="100px">Map</th> <th width="100px">Time</th> <th>Lng</th> <th>Lat</th> <th>Image URL</th> <th>Notes</th> </tr> <?php // Loop for make maps $result = cachedSQL("SELECT * FROM `" . $unitname . "` WHERE tag LIKE \"" . $tag . "\" order BY time ASC"); $count = 0; while ($row = mysql_fetch_array($result)) { echo "<tr id=\"row" . $count . "\">\n"; echo "\t<td><div class=\"map\" id=\"map" . $count . "\" style=\"width: 100px; height: 100px;\"></div></td>\n"; echo "\t<td>" . date("jS F Y, g:i a T", $row['time']) . "</td>\n"; echo "\t<td>" . round($row['lng'], 3) . "</td>\n"; echo "\t<td>" . round($row['lat'], 3) . "</td>\n"; $loc = $row['lat'] . $row['lng']; if ($row['img'] != "") { echo "\t<td><img id=\"image" . $count . "\" class=\"my_image\" height=\"100\" src=\"" . $row['img'] . "\">"; } else { echo "\t<td><img id=\"image" . $count . "\" class=\"my_image\" height=\"100\" src=\"images/no-image.gif\">"; } echo "\n\n\t<form id=\"form" . $count . "\" name=\"form" . $count . "\" class=\"updater\" method=\"post\" action=\"" . $_SELF . "\">\n\t\t\t<input type=\"hidden\" value=\"" . $row['id'] . "\" name=\"id\">\n\t\t\t<input type=\"text\" value=\"" . $row['img'] . "\" name=\"imgurl\" id=\"imgurl" . $count . "\">\n\t</td>\n"; echo "\t<td>\n\t\t\t<textarea id=\"notes" . $count . "\" name=\"notes\">" . $row['notes'] . "</textarea>\n\t\t\t<br>\n\t\t\t<input type=\"submit\" value=\"Update\">\n\t\t\t<!-- To Be Implimented\n\t\t\t<input type=\"submit\" value=\"Delete\">\n\t\t\t-->\n\t\t\t<br>\n\t\t\t<input type=\"text\" name=\"newtag\" value=\"" . $row['tag'] . "\" id=\"tag" . $count . "\">\n\t\t</form>\n\t</td>\n";
<img src="images/icon-red.png"><br>SPOT<br> <img src="images/icon-yellow.png"><br>SPOT with Photo </div> <div id="box1"> <form id="tagbox" action="index.php" method="get"> Tag: <select name="tag" onChange="this.form.submit()"> <?php ///////////////////////////////////////////////////////////////// // // Get the list of all the tags and display in the drop down box // ///////////////////////////////////////////////////////////////// $tagresult = cachedSQL("SELECT DISTINCT tag FROM `" . $unitname . "`"); while ($tagrow = mysql_fetch_array($tagresult)) { if ($tagrow['tag'] == $tag && $tag != "All") { echo "<option selected>" . $tagrow['tag'] . "</option>\n"; } else { echo "<option>" . $tagrow['tag'] . "</option>\n"; } } // If the tag is set to "All" or to nothing, make All the selection option if ($tag == "All" || $tag == "%") { echo "<option selected>All</option>"; } else { echo "<option>All</option>"; } ?>