} else { if ($action == 'AddUserVisitedHistory') { $courseLinksID = $_GET["courseLinksID"]; $userID = $_GET["userID"]; $CourseID = $_GET["CourseID"]; $View = '1'; $course = new Courses(); $course->activateCoursesDetails($courseLinksID, $userID, $CourseID, $View); } else { if ($action == 'checkForAssessmentTest') { $userId = $_GET["userId"]; $courseId = $_GET["course"]; $course = new Courses(); $json = $course->viewCourseFullDetails($courseId); // from courselink table $userjson = $course->getListOfActivatedCourseDetails($userId, $courseId); // from courseuserview table $dejson = json_decode($json); $deuserjson = json_decode($userjson); /* echo "JSON : ".$json; echo "USER-JSON : ".$userjson; */ $count = array(); for ($subcourseInd = 0; $subcourseInd < count($dejson); $subcourseInd++) { for ($userlistInd = 0; $userlistInd < count($deuserjson); $userlistInd++) { if ($dejson[$subcourseInd]->{'idCourseLinks'} == $deuserjson[$userlistInd]->{'courseLinksID'}) { $trigger = false; for ($countInd = 0; $countInd < count($count); $countInd++) { if ($count[$countInd] == $dejson[$subcourseInd]->{'idCourseLinks'}) { $trigger = true;