//query //Get latest events from database. The order and limit of the results are defined by what is set in //the drop down list in /includes/option_menu.php. If nothing is set defaults are used. $tmp_table = "SELECT * FROM {$table} AS T\nWHERE DATE(event_time_stamp) LIKE '{$date}'\nAND camera LIKE '{$camera}'\nAND file_type = 1\nORDER BY {$order_criteria} {$order_by} LIMIT {$query_max_rows}"; $query_details = "SELECT COUNT(frame) as frame_count,id, camera, event_id, filename, frame, file_type, time_stamp, event_time_stamp, TIMESTAMPDIFF( \nSECOND , MIN( time_stamp ) , MAX( time_stamp ) ) AS length\nFROM ({$tmp_table}) AS T2\nGROUP BY event_id \nHAVING length >= {$longer_than}\nORDER BY {$order_criteria} {$order_by} \nLIMIT {$limit}"; //echo $query_details; $result = mysqli_query($connection, $query_details) or die("Query Error: {$query_details}. " . mysqli_error($connection)); //Main loop displays the latest events and their details. //Ensure $result matches the page it is being included on. ?> <ul class="thumbnails"> <?php while ($row_details = mysqli_fetch_array($result)) { //convert the event's time stamp from a string to a timestamp. $timestamp = strtotime($row_details['event_time_stamp']); echo '<li class="span3">'; echo '<div class="thumbnail">'; //Display an image of the event and link to the event page for that event. $event_link = 'event.php?id=' . $row_details['event_id']; $event_img = $image_path . baseimage($row_details['filename']); echo '<a href="' . $event_link . '"><img src="' . $event_img . '"></a>'; echo '<ul class="unstyled">'; include 'includes/detail_list.php'; echo '</ul></div></li>'; } ?> </ul>
} echo '</form>'; ?> </li> <div class="clearfix"></div> </ul> </div> </div> </div> <div class="row"> <div class="span12"> <?php //loop to display all frames. if ($result_frames->num_rows < $show_max_frames) { ?> <ol class="frame_list"> <?php while ($row_frames = mysqli_fetch_array($result_frames)) { $f = $image_path . baseimage($row_frames['filename']); echo '<li><a href="' . $f . '"><img class="frame_event_preview" src="' . $f . '"/></a></li>'; } } else { echo "Not showing frames."; } ?> </ol> </div> </div> <?php include 'includes/footer.php';