<?php
$must_login            = true ;
$require_path          = '../../../' ;
$require_sub           = '../../' ;
require( $require_sub.'header.php' ) ;

if ( $boolean_login ){
	$status   		       = '201' ;

	$search_query        = '' ;
    $search_query     .= " AND suggestion_id = '".$array['id']."'" ;

    $query             = "SELECT suggestion_id, title, content, file, status, created_at FROM suggestion
                          WHERE deleted_at IS NULL " . $search_query ;
    $mysqli_query      = $mysqli->query( $query . " ORDER BY created_at DESC LIMIT " . getLimit( $current ) ) ;

    if ( $mysqli_query->num_rows > 0 ){

        $status            = '200' ;

        $row               = $mysqli_query->fetch_assoc() ;
        $row['id']         = dataFilter( $row['suggestion_id'] ) ;
        $row['title']      = dataFilter( $row['title'] ) ;
        $row['content']    = dataFilter( $row['content'] ) ;
        $row['comment']    = dataFilter( $row['comment'] ) ;
        $row['file']       = ( $row['file'] != '' ? PATH.'uploads/Suggestion/b/'.$row['file'] : '' ) ;
        $row['created_at'] = dataFilter( $row['created_at'] ) ;

        $data['list']      = $row ;
    }
}

require( $require_sub.'footer.php' ) ;
?>