<?php
include("../db.php");
header("Access-Control-Allow-Origin: * ");

$teacher_id = $_GET['teacher_id'];

$status = 0;
$data = array();

$sql = $db->getRows("select * from liveclass_list where teacher_id='$teacher_id' order by id desc");
if (count($sql) > 0) {

    $status = 1;

    foreach ($sql as $teacher) {
        $sec = json_decode($teacher['section']);
        array_push($data, ["id" => $teacher['id'], "date" => "$teacher[date]", "time" => "$teacher[time]", "class" => "$teacher[class]", "section" => $sec,
            "subject" => "$teacher[subject]", "url" => "$teacher[url]", "teacher_id" => "$teacher[teacher_id]", "Status" => "$teacher[status]"]);
    }


}

echo json_encode(array('status' => $status, 'data' => $data));