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

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

    if ( $array['id'] != '' && $array['view_id'] != '' && $array['association_rated'] != '' && $array['association_comment'] != '' ){
        $status        = '201' ;

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

        $query         = "SELECT association_id, association_type, date_start, date_end, file, status, created_at FROM association
                          WHERE deleted_at IS NULL " . $search_query ;
        $mysqli_query  = $mysqli->query( $query ) ;

        if ( $mysqli_query->num_rows > 0 ){
            $status    = '200' ;

            $row       = $mysqli_query->fetch_assoc() ;

            $mysqli->query( "UPDATE staff_association SET 
                             rated         = '".$array['association_rated']."',
                             comment       = '".$array['association_comment']."',
                             status        = 'rated'
                             WHERE view_id = '".$array['view_id']."'" ) ;

        }

    }

}

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