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

$status = 0;
$msg = "Unable to execute operation at this time..! Please retry later";

if (isset($_POST['teacher_id']) && isset($_POST['content']) && isset($_POST['session'])){

    $date         = date("Y-m-d");

    $teacher_id   = $_POST['teacher_id'];
    $content      = $_POST['content'];
    $session      = $_POST['session'];

    $aryData = array("date" => $date, "teacher_id" => $teacher_id, "content" => $content, "session" => $session);

    $insert_activity = $db->insertAry("teacher_task_report", $aryData);

    if ($insert_activity > 0) {
        $status = 1;
        $msg = "Record added successfully";
    } else {
        $msg = "Failed to add record..! Please try again later";
    }

}

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