<?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 = "SELECT * FROM centerSettings WHERE center_id='".$_GET[ 'center_id' ]."'";
$result = mysqli_query( $conn, $sql );

if ( mysqli_num_rows( $result ) > 0 ) {
    while( $row = mysqli_fetch_assoc( $result ) ) {
        $CurriculumName;  $SessionName;  $NoSessions;
        $sql1 = "SELECT * FROM curriculum WHERE curriculum_id='".$row[ 'curriculum_id' ]."' ";
        $result1 = mysqli_query( $conn, $sql1 );

        if ( mysqli_num_rows( $result1 ) > 0 ) {
            while( $row1 = mysqli_fetch_assoc( $result1 ) ) {
                $CurriculumName=$row1["CurriculumName"];
                $SessionName=$row1["SessionName"];
                $NoSessions=$row1["NoSessions"];
            }
        }
        $curl_post_data = array(
            'Success' => 'true',
            'center_id' => $row["center_id"],
            'curriculum_id' => $row["curriculum_id"],
            'curriculumEnrollment_id' => $row["curriculumEnrollment_id"],
            'CurrentPackage' => $row["CurrentPackage"],
            'ClassesUpdated' => $row["ClassesUpdated"],
            'Branches' => $row["Branches"],
            'CurrentInvoice' => $row["CurrentInvoice"],
            'CurriculumName' => $CurriculumName,
            'SessionName' => $SessionName,
            'NoSessions' => $NoSessions,
        );
        echo json_encode( $curl_post_data );
    }
}

?>