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

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

    $query                         = "SELECT request_id, is_main, type, title, description, quantity, date_from, date_to, reason, content, comment, status, status, created_at, updated_at FROM request
                                      WHERE deleted_at IS NULL AND request_id = '".$array['request_id']."' AND date_from >= '".TODAYDATE."'" ;
    $mysqli_query                  = $mysqli->query( $query . " LIMIT 1" ) ;

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

        $mysqli->query( "UPDATE request SET
                         status           = 'cancelled'
                         WHERE request_id = '".$array['request_id']."'" ) ;

    }
}

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