function view_single_img($camera, $cam_name, $period, $hour, $minute, $date, $file_path) { $peices = explode("-", $date); $real_date = $peices[0] . $peices[1] . $peices[2]; $time_m = $hour . $minute; $real_path = $file_path . $cam_name . "/" . $real_date . "/"; $images_array = array_diff(scandir($real_path, 1), array('..', '.')); $full_img_name = "sss.jpg"; for ($i = 0; $i < count($images_array); $i++) { $p = explode("_", $images_array[$i]); $time = $p[2][8] . $p[2][9] . $p[2][10] . $p[2][11]; if ($time == $time_m) { $full_img_name = $images_array[$i]; break; } } if (file_exists($real_path . $full_img_name)) { echo "<h2><a href='camera.php'>Back To Main Page</a<</h2><table border='1'>\n<tbody><tr><td colspan='3'><img src='{$real_path}{$full_img_name}'></td></tr> <br/><br/>"; view_single_img_footer($camera, $cam_name, $period, $hour, $minute, $date, $file_path, $time_m); show_all_other_minutes_with_same_time($time, $file_path, $full_img_name, $cam_name, $real_path, $camera, $period, $hour, $minute, $date, $time_m); } else { jump_to_next_avilable_photo($time, $file_path, $full_img_name, $cam_name, $real_path, $camera, $period, $hour, $minute, $date, $time_m); echo "<h2><a href='camera.php'>Back To Main Page</a<</h2><table border='1'>\n<tbody><tr><td colspan='3'>Image Not FOund</td></tr>"; view_single_img_footer($camera, $cam_name, $period, $hour, $minute, $date, $file_path, $time_m); echo ""; } echo "</tbody></table>"; }
function view_single_img($camera, $cam_name, $period, $hour, $minute, $date, $file_path) { $peices = explode("-", $date); $real_date = $peices[0] . $peices[1] . $peices[2]; $time_m = $hour . $minute; $real_path = $file_path . $cam_name . "/" . $real_date . "/"; $images_array = array_diff(scandir($real_path, 1), array('..', '.')); $full_img_name = "sss.jpg"; view_single_img_footer($camera, $cam_name, $period, $hour, $minute, $date, $file_path, $time_m); for ($i = 0; $i < count($images_array); $i++) { $p = explode("_", $images_array[$i]); $time = $p[2][8] . $p[2][9] . $p[2][10] . $p[2][11]; if ($time == $time_m) { $full_img_name = $images_array[$i]; break; } } if (file_exists($real_path . $full_img_name)) { echo "<div class='container'><img style='width: 100%;' src='{$real_path}{$full_img_name}'></div>"; show_all_other_minutes_with_same_time($time, $file_path, $full_img_name, $cam_name, $real_path, $camera, $period, $hour, $minute, $date, $time_m); } else { echo "<div class='container content-center center-align'>\n<img src='images/notfound.png'>\n</div>"; echo ""; } }