query( $query . " ORDER BY b.created_at DESC LIMIT " . getLimit( $current ) ) ; if ( $mysqli_query->num_rows > 0 ){ $status = '200' ; $list = [] ; while ( $row = $mysqli_query->fetch_assoc() ){ $row['title'] = dataFilter( $row['title'] ) ; $row['description'] = dataFilter( $row['description'] ) ; $row['created_at'] = resetDateFormat( $row['created_at'] ) ; $list[] = $row ; } $data['list'] = $list ; } // total inbox $mysqli_query = $mysqli->query( "SELECT COUNT( a.view_id ) as total FROM staff_inbox_view a WHERE a.deleted_at IS NULL AND a.staff_id = '".$staff_info['staff_id']."' AND a.is_read = '0'" ) ; if ( $mysqli_query->num_rows > 0 ){ $row = $mysqli_query->fetch_assoc() ; $count_inbox = $row['total'] ; } $data['count_inbox'] = $count_inbox ; // mark notification as 0 $mysqli->query( "UPDATE staff_notification SET badge = '0' WHERE staff_id = '".$staff_info['staff_id']."'" ) ; } require( $require_sub.'footer.php' ) ; ?>