LAPTOP-V9RRD1TL\Michelle's Computer f8f8fcaf96 first commit
2025-07-21 21:38:17 +08:00

46 lines
1.5 KiB
PHP

<?php
$must_login = true ;
$require_path = '../../../' ;
$require_sub = '../../' ;
require( $require_sub.'header.php' ) ;
if ( $boolean_login ){
$status = '201' ;
$join_filter = '' ;
$join_query = '' ;
$query_sortable = 'ORDER BY created_at DESC' ;
$search_query = '' ;
switch ( $array['filter'] ){
case 'myself' :
$search_query .= " AND staff_id = '".$staff_info['staff_id']."'" ;
break ;
case 'group' :
$search_query .= " AND branch_id = '".$array['branch_id']."' AND status = 'confirmed'" ;
break ;
}
$query = "SELECT title, file, filetype, status, created_at FROM request_gallery
WHERE deleted_at IS NULL AND branch_id = '".$array['branch_id']."' " . $search_query ;
$mysqli_query = $mysqli->query( $query . " ".$query_sortable." LIMIT " . getLimit( $current ) ) ;
if ( $mysqli_query->num_rows > 0 ){
$status = '200' ;
$list = [] ;
while ( $row = $mysqli_query->fetch_assoc() ){
$row['date'] = resetDateFormat( $row['created_at'] ) ;
$row['time'] = resetTimeFormat( $row['created_at'] ) ;
$row['file'] = ( $row['file'] != '' ? PATH.'uploads/RequestGallery/b/'.$row['file'] : '' ) ;
$list[] = $row ;
}
$data['list'] = $list ;
}
}
require( $require_sub.'footer.php' ) ;
?>