<?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();

$sql_cs = "SELECT * FROM centerSettings    WHERE   center_id='" . $_GET["center_id"] . "'   ";

$result_cs = mysqli_query($conn, $sql_cs);
if (mysqli_num_rows($result_cs) > 0) {
    while ($row_cs = mysqli_fetch_assoc($result_cs)) {
        $sql_enr = "SELECT * FROM curriculumEnrollment   WHERE   curriculum_id='" . $row_cs["curriculum_id"] . "' ";

        $result_enr = mysqli_query($conn, $sql_enr);
        if (mysqli_num_rows($result_enr) > 0) {
            while ($row_enr = mysqli_fetch_assoc($result_enr)) {

                $curl_post_data = array(
                    'curriculumEnrollment_id' => $row_enr["curriculumEnrollment_id"],
                    'curriculum_id' => $row_enr["curriculum_id"],
                    'YearName' => $row_enr["YearName"],
                    'StartDate' => $row_enr["StartDate"],
                    'EndDate' => $row_enr["EndDate"],
                    'Status' => $row_enr["Status"],
                    'dated' => $row_enr["dated"],
                );

                array_push($data, $curl_post_data);

            }
        }

    }
}




echo json_encode($data);



?>