Example #1
0
function update_schedule_detail()
{
    $schoolid = $_REQUEST['schoolid'];
    $hw_time = $_REQUEST['hw_time'];
    $att_time = $_REQUEST['att_time'];
    $slip_time = $_REQUEST['slip_time'];
    $non_scheduled_hw = $_REQUEST["non_scheduled_hw"];
    $non_scheduled_att = $_REQUEST["non_scheduled_att"];
    $teacher_hw_time = $_REQUEST["teacher_hw_time"];
    $teacher_att_time = $_REQUEST["teacher_att_time"];
    $send_sms_to_students = $_REQUEST["send_sms_to_students"];
    $output['success'] = 0;
    $res = DBConn::queryFetchRowAssoc("SELECT att_time,hw_time,slip_time FROM tab_sms_schedule WHERE schoolid=" . $schoolid) ? 1 : 0;
    if (!$res) {
        $output['success'] = DBConn::exec("INSERT INTO tab_sms_schedule(SchoolId,att_time,hw_time,slip_time,non_scheduled_hw,non_scheduled_att,teacher_hw_time,teacher_att_time,send_sms_to_students) VALUES ({$schoolid},'{$att_time}','{$hw_time}','{$slip_time}','{$non_scheduled_hw}','{$non_scheduled_att}','{$teacher_hw_time}','{$teacher_att_time}','{$send_sms_to_students}')");
    } else {
        $output['success'] = DBConn::exec("UPDATE tab_sms_schedule SET att_time='{$att_time}',hw_time='{$hw_time}',slip_time='{$slip_time}',non_scheduled_hw='{$non_scheduled_hw}',non_scheduled_att='{$non_scheduled_att}',teacher_att_time='{$teacher_att_time}',teacher_hw_time='{$teacher_hw_time}',send_sms_to_students='{$send_sms_to_students}' WHERE SchoolId={$schoolid}");
    }
    echo json_encode($output);
}