layer-8/public/image.php

47 lines
1.2 KiB
PHP
Raw Normal View History

2024-11-14 22:59:55 +01:00
<h1 class='cat_heading'>> chosen file type: image<br>&nbsp;&nbsp;listing files...</h1>
<form class='db_utilities' method='POST'>
<label for='sel_order'>order by</label>
<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>
<label for='inp_search'>search</label>
<input type='search' name='inp_search' id='inp_search'></input>
<input type='submit' value='filter'></input>
</form>
<?php
include_once('../app/db_connector.php');
if( isset($_POST['sel_order']) && isset($_POST['inp_search']) ) {
$sort = 'date';
$sdir = 'DESC';
var_dump($sort, $sdir);
switch($_POST['sel_order']) {
case 'new':
break;
case 'old':
$sdir = 'ASC';
break;
case 'az':
$sort = 'img_name';
$sdir = 'ASC';
break;
case 'za':
$sort = 'img_name';
break;
default:
break;
}
get_images($pdo, $_POST['inp_search'], $sort, $sdir);
}
else {
get_images($pdo);
}
?>