Всем добрый Иеется такой файл - он парсит в каталоге файлы с именем HLTV_-1100122153-stalkyard.zip и публикует их списком (формат цифр это - \год\мес\день\час\минуты\ - карта в общем это скрипт парсинга демок для Half-life скрип выводит весь список на страницу, хотел бы добавить фильтр по дням - т.к. демки сохраняются за 7 дней и фильт по картам, т.к. список карт один и тот же, чтоб было как в Excel поставил фильтр он выдал только то что по фильтру, снял фильтр, он вывел опять все код парсера Код (Text): <?php echo ("<html>"); echo ("<head>"); echo ("<title>Демки</title>"); echo ("</head>"); echo ("<body align=center bgcolor=\"#FBFBFB\" link=\"#8B0000\" vlink=\"#997777\">"); function format_size($size, $round = 0) { //Size must be bytes! $sizes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); for ($i=0; $size > 1024 && isset($sizes[$i+1]); $i++) $size /= 1024; return round($size,$round)." ".$sizes[$i]; } $path = "."; // folder $count = 0; // Arrays start $chandle = 0; // boolean for tables if($dir=opendir($path)) { while($file=readdir($dir)) { if (!is_dir($file) && $file != "." && $file != ".." && $file != "index.php" && $file != "hltv.jpg" && $file != "register.php" && $file != "script.php" && $file != "logout.php" && $file != "pq_test.php" && $file != "plrhist.php" && $file != "imgsess.php") if (!is_dir($file) && $file != "themes.php" && $file != "awards.php" && $file != "server.php" && $file != "player.php" && $file != "role.php" && $file != "maps.php" && $file != "live.php" && $file != "clan.php" && $file != "dem_copy.php" && $file != "favicon.ico") if (!is_dir($file) && $file != "weapons.php" && $file != "imgconn.php" && $file != "weapon.php" && $file != "heatimg.php" && $file != "editplr.php" && $file != "editclan.php" && $file != "logo.jpg" && $file != "overview.php" && $file != "imgquick.php" && $file != "opt.php") if (!is_dir($file) && $file != "map.php" && $file != "demos.php" && $file != "Desktop.ini" && $file != "dem.php" && $file != "search.php" && $file != "config.php" && $file != "2.php" && $file != "mapheat.php" && $file != "roles.php" && $file != "query.php" && $file != "login.php" && $file != "imgcc.php" && $file != "clans.php" && $file != "logo2.jpg") { $tmpfilesize = filesize($file); $data[$count][year] = substr($file,5,2); // position 11 because of: "warserver1-09... $data[$count][month] = substr($file,7,2); $data[$count][day] = substr($file,9,2); $data[$count][hour] = substr($file,11,2); $data[$count][minute] = substr($file,13,2); $data[$count][map] =substr($file,16,-8); $data[$count][file] = $file; $data[$count][size] = format_size($tmpfilesize); $count++; } } closedir($dir); } sort($data); $data = array_reverse($data); echo ("<table border=1 width=100% cellpadding=0 cellspacing=0>"); echo ("<tr align=center>"); echo ("<td width=150><b>Карта</b></td>"); echo ("<td width=150><b>Дата</b></td>"); echo ("<td width=150><b>Время</b></td>"); echo ("<td width=150><b>Размер</b></td>"); echo ("<td><b>Скачать</b></td>"); echo ("</tr>"); foreach($data as $field) { if ($chandle == 0) { echo ("<tr align=center bgcolor=\"#EEEEEE\">"); $chandle = 1; } else { echo ("<tr align=center bgcolor=\"#D0D0D0\">"); $chandle = 0; } echo ("<td>$field[map]</td>"); echo ("<td>$field[day].$field[month].$field[year]</td>"); echo ("<td>$field[hour]:$field[minute]</td>"); echo ("<td>$field[size]</td>"); echo ("<td><a href=\"$field[file]\">Скачать</a></td>"); echo ("</tr>"); } echo ("</table>"); echo ("</body>"); echo ("</html>"); ?> <?php echo ("<html>"); echo ("<head>"); echo ("<title>Демки</title>"); echo ("</head>"); echo ("<body align=center bgcolor=\"#FBFBFB\" link=\"#8B0000\" vlink=\"#997777\">"); function format_size($size, $round = 0) { //Size must be bytes! $sizes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); for ($i=0; $size > 1024 && isset($sizes[$i+1]); $i++) $size /= 1024; return round($size,$round)." ".$sizes[$i]; } $path = "."; // folder $count = 0; // Arrays start $chandle = 0; // boolean for tables if($dir=opendir($path)) { while($file=readdir($dir)) { if (!is_dir($file) && $file != "." && $file != ".." && $file != "index.php" && $file != "hltv.jpg" && $file != "register.php" && $file != "script.php" && $file != "logout.php" && $file != "pq_test.php" && $file != "plrhist.php" && $file != "imgsess.php") if (!is_dir($file) && $file != "themes.php" && $file != "awards.php" && $file != "server.php" && $file != "player.php" && $file != "role.php" && $file != "maps.php" && $file != "live.php" && $file != "clan.php" && $file != "dem_copy.php" && $file != "favicon.ico") if (!is_dir($file) && $file != "weapons.php" && $file != "imgconn.php" && $file != "weapon.php" && $file != "heatimg.php" && $file != "editplr.php" && $file != "editclan.php" && $file != "logo.jpg" && $file != "overview.php" && $file != "imgquick.php" && $file != "opt.php") if (!is_dir($file) && $file != "map.php" && $file != "demos.php" && $file != "Desktop.ini" && $file != "dem.php" && $file != "search.php" && $file != "config.php" && $file != "2.php" && $file != "mapheat.php" && $file != "roles.php" && $file != "query.php" && $file != "login.php" && $file != "imgcc.php" && $file != "clans.php" && $file != "logo2.jpg") { $tmpfilesize = filesize($file); $data[$count][year] = substr($file,5,2); // position 11 because of: "warserver1-09... $data[$count][month] = substr($file,7,2); $data[$count][day] = substr($file,9,2); $data[$count][hour] = substr($file,11,2); $data[$count][minute] = substr($file,13,2); $data[$count][map] =substr($file,16,-8); $data[$count][file] = $file; $data[$count][size] = format_size($tmpfilesize); $count++; } } closedir($dir); } sort($data); $data = array_reverse($data); echo ("<table border=1 width=100% cellpadding=0 cellspacing=0>"); echo ("<tr align=center>"); echo ("<td width=150><b>Карта</b></td>"); echo ("<td width=150><b>Дата</b></td>"); echo ("<td width=150><b>Время</b></td>"); echo ("<td width=150><b>Размер</b></td>"); echo ("<td><b>Скачать</b></td>"); echo ("</tr>"); foreach($data as $field) { if ($chandle == 0) { echo ("<tr align=center bgcolor=\"#EEEEEE\">"); $chandle = 1; } else { echo ("<tr align=center bgcolor=\"#D0D0D0\">"); $chandle = 0; } echo ("<td>$field[map]</td>"); echo ("<td>$field[day].$field[month].$field[year]</td>"); echo ("<td>$field[hour]:$field[minute]</td>"); echo ("<td>$field[size]</td>"); echo ("<td><a href=\"$field[file]\">Скачать</a></td>"); echo ("</tr>"); } echo ("</table>"); echo ("</body>"); echo ("</html>"); ?>