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

49 lines
1.9 KiB
PHP

<?php
$must_login = true ;
$require_path = '../../../' ;
$require_sub = '../../' ;
require( $require_sub.'header.php' ) ;
if ( $boolean_login ){
$status = '201' ;
$search_query = '' ;
$search_query .= " AND grievance_id = '".$array['grievance_id']."'" ;
$query = "SELECT grievance_id, title, content, comment, status, status, created_at, updated_at FROM grievance
WHERE deleted_at IS NULL " . $search_query ;
$mysqli_query = $mysqli->query( $query . " LIMIT 1" ) ;
if ( $mysqli_query->num_rows > 0 ){
$status = '200' ;
$list = [] ;
$row = $mysqli_query->fetch_assoc() ;
$row['title'] = dataFilter( $row['title'] ) ;
$row['content'] = dataFilter( $row['content'] ) ;
$row['comment'] = dataFilter( $row['comment'] ) ;
// get all media
$select_media = $mysqli->query( "SELECT media_id, file FROM grievance_media
WHERE deleted_at IS NULL AND grievance_id = '".$array['grievance_id']."'" ) ;
$photos = [] ;
if ( $select_media->num_rows > 0 ){
while ( $row_media = $select_media->fetch_assoc() ){
$photos[] = [
'media_id' => $row_media['media_id'],
'type' => 'online',
'file' => ( $row_media['file'] != '' ? PATH.'uploads/Grievance/b/'.$row_media['file'] : '' )
] ;
}
}
$row['photos'] = $photos ;
$data = $row ;
}
}
require( $require_sub.'footer.php' ) ;
?>