<?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 = array();
$sql1 = "SELECT * FROM course_outline WHERE course_id='" . $_GET["course_id"] . "' ";
$result1 = mysqli_query($conn, $sql1);
if (mysqli_num_rows($result1) > 0) {
    while ($row1 = mysqli_fetch_assoc($result1)) {


        $course_outline = "";
        if (file_exists("/home/sendusco/lms.digifunzi.com/" . $row1["course_outline"])) {
            $course_outline = file_get_contents("/home/sendusco/lms.digifunzi.com/" . $row1["course_outline"]);
        }
        if (file_exists("/home/sendusco/digifunzi.com/" . $row1["course_outline"])) {
            $course_outline = file_get_contents("/home/sendusco/digifunzi.com/" . $row1["course_outline"]);
        }
        if (file_exists("/home/sendusco/app/" . $row1["course_outline"])) {
            $course_outline = file_get_contents("/home/sendusco/app/" . $row1["course_outline"]);
        }
        $curl_post_data = array(
            'course_outline_id' => $row1["course_outline_id"],
            'course_id' => $row1["course_id"],
            'course_session' => $row1["course_session"],
            'outline_topic' => $row1["outline_topic"],
            'course_outline' => $course_outline,
            'dated' => $row1["dated"],
        );
        array_push($data, $curl_post_data);
    }
}
echo json_encode($data);
