2024-11-14 22:59:55 +01:00
|
|
|
<h1 class='cat_heading'>> chosen file type: image<br> listing files...</h1>
|
2023-11-19 19:28:43 +01:00
|
|
|
|
2024-11-16 22:00:15 +01:00
|
|
|
<form class='db_utilities' method='POST'>
|
2024-11-21 21:44:26 +01:00
|
|
|
<label for='sel_order'>order by:</label>
|
2024-11-16 22:00:15 +01:00
|
|
|
<select name='sel_order' id='sel_order'>
|
|
|
|
<option value='new'>newest</option>
|
|
|
|
<option value='old'>oldest</option>
|
|
|
|
<option value='az'>A - Z</option>
|
|
|
|
<option value='za'>Z -A</option>
|
|
|
|
</select>
|
2024-11-21 21:44:26 +01:00
|
|
|
<label for='inp_search'>search:</label>
|
2024-11-16 22:00:15 +01:00
|
|
|
<input type='search' name='inp_search' id='inp_search'></input>
|
2024-11-21 21:44:26 +01:00
|
|
|
<label for='submit'> </label>
|
|
|
|
<input type='submit' name='submit' value=' filter '></input>
|
2024-11-16 22:00:15 +01:00
|
|
|
</form>
|
|
|
|
|
2023-11-19 19:28:43 +01:00
|
|
|
<?php
|
|
|
|
include_once('../app/db_connector.php');
|
2024-11-16 22:00:15 +01:00
|
|
|
|
|
|
|
if( isset($_POST['sel_order']) && isset($_POST['inp_search']) ) {
|
2024-11-18 23:18:36 +01:00
|
|
|
$sort = 'img_date';
|
2024-11-16 22:00:15 +01:00
|
|
|
$sdir = 'DESC';
|
2024-11-18 23:29:34 +01:00
|
|
|
|
2024-11-16 22:00:15 +01:00
|
|
|
switch($_POST['sel_order']) {
|
|
|
|
case 'new':
|
|
|
|
break;
|
|
|
|
case 'old':
|
|
|
|
$sdir = 'ASC';
|
|
|
|
break;
|
|
|
|
case 'az':
|
2024-11-18 23:18:36 +01:00
|
|
|
$sort = 'img_title';
|
2024-11-16 22:00:15 +01:00
|
|
|
$sdir = 'ASC';
|
|
|
|
break;
|
|
|
|
case 'za':
|
2024-11-18 23:18:36 +01:00
|
|
|
$sort = 'img_title';
|
2024-11-16 22:00:15 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
get_images($pdo, $_POST['inp_search'], $sort, $sdir);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
get_images($pdo);
|
|
|
|
}
|
2023-11-19 19:28:43 +01:00
|
|
|
?>
|
|
|
|
|