<?php
    header('Access-Control-Allow-Origin: *');
    header('Access-Control-Allow-Methods: GET, POST');
    header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");
    include '../../../config/index.php';

    $fileName='uploads/files/'.$_GET['fileName'];
    $sql = "UPDATE  MentorStudentAssignment SET
        Assignment='".$fileName."',
        Status='Submitted'
        WHERE MentorStudentAssignment_id='".$_GET["MentorStudentAssignment_id"]."' ";
    if (mysqli_query($conn, $sql)) {

        $curl_post_data = array(
            'Success' => 'true',
            'MentorStudentAssignment_id' => $_GET["MentorStudentAssignment_id"] ,
        );
        echo json_encode($curl_post_data);  
    } else {

        $curl_post_data = array(
            'Success' => 'false',
            'MentorStudentAssignment_id' => $_GET["MentorStudentAssignment_id"], 
        );
        echo json_encode($curl_post_data);              
    }
        

    


    // echo json_encode($data);
?>
