Ejemplo n.º 1
0
                 echo json_encode($res);
             } else {
                 $res["error"] = TRUE;
                 $res["error_msg"] = "Student status Not updated";
                 echo json_encode($res);
             }
         } else {
             $res["error"] = TRUE;
             $res["error_msg"] = "Student Not found";
             echo json_encode($res);
         }
     }
 } else {
     if ($tag == "getStudentInfo") {
         $student_no = $_GET['student_no'];
         $result = $db->getStudentById($student_no);
         if ($result != false) {
             $res["error"] = FALSE;
             $res['result'] = $result;
             echo json_encode($res);
         } else {
             $res["error"] = TRUE;
             $res["error_msg"] = "Failed to retrieve student details";
             echo json_encode($res);
         }
     } else {
         if ($tag == "getStudents") {
             $result = $db->getStudents();
             if ($result != false) {
                 $res['error'] = false;
                 $res['result'] = $result;