$images[] = $img_file; } } closedir($img_dir); } return $images; } function getRandomFromArray($ar) { mt_srand((double) microtime() * 1000000); // php 4.2+ not needed $num = array_rand($ar); return $ar[$num]; } // Obtain list of images from directory $imgList = getImagesFromDir($root . $path); $img = getRandomFromArray($imgList); ?> <!DOCTYPE html> <html lang="en"><head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="../../favicon.ico"> <title>Alaska Airlines Style Guide</title> <!-- Bootstrap core CSS --> <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> <link rel="stylesheet" href="http://www.alaskaair.com/stylesheets/brand.css">
} if (isset($_POST['action'])) { $action = $_POST['action']; } else { $action = ""; } if (isset($_POST['directory'])) { $current_dir = $_POST['directory'] . "/"; } else { $current_dir = "omr_errors/"; } if ($action == "apply_changes") { saveMrFile($quiz->getDir() . $current_dir . $_POST['image_file'] . ".mmr_data"); exec($quiz_bin_dir . "omr_errors_resolved.sh " . $quiz->getName()); } getImagesFromDir($quiz->getDir() . $current_dir); if (isset($images[0])) { $current_image = $images[0]; } else { $current_image = ""; } if (isset($_POST['image_file'])) { $lastImageIndex = findIndexOfImage($_POST['image_file']); if ($lastImageIndex != -1) { if ($action == "next_image") { if (isset($images[$lastImageIndex + 1])) { $current_image = $images[$lastImageIndex + 1]; } else { $current_image = $_POST['image_file']; } } else {