<?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';

$data = file_get_contents( 'php://input' );
$obj = json_decode( $data, true );

// $datarexeipt= 'assets/img/fav.png';
// if ($_POST[ 'Material' ] === "powerpoint") {
//     $data = $_POST[ 'Material' ];

// } else if ($_POST[ 'Material' ] === "Youtube") {
//     $data = $_POST[ 'Material' ];
// } else if ($_POST[ 'Material' ] === "Document") {
//     $data = $_POST[ 'Material' ];
// } else if ($_POST[ 'Material' ] === "Image") {
//     $data = $_POST[ 'Material' ];

// }

$sql = "INSERT INTO course_concept_lesson_materials VALUES (NULL,
            '".$_GET[ 'course_lesson_structure_concepts_id' ]."',
            '".$_GET[ 'MaterialType' ]."',
            '".$_GET[ 'LinkedMaterial' ]."',
            '".$_GET[ 'MaterialName' ]."',
            now())";
if ( mysqli_query( $conn, $sql ) ) {

    
    $curl_post_data = array(
        'Success' => 'true',
        'Reason' => 'You Have Succesfully added a Concept',
        'course_tags_id' => $course_tags_id ,
    );
    echo json_encode( $curl_post_data );

} else {

    $curl_post_data = array(
        'Success' => 'false',
        'Reason' => 'Unable to Succesfully Add a Concept, Kindly contact Admin for help?',
        'course_tags_id' => '',
    );
    echo json_encode( $curl_post_data );

}

?>