function goAction($act, $category_id, $course_id, $courses, $exercises) { if (!$act || $act == null) { $act = "default"; } switch ($act) { case 'default': showPage(); break; case 'getCategory': showCategories(); break; case 'getCategoryJson': showCategoryTree(); break; case 'getCourses': showCourses($category_id); break; case 'getTracks': showTracks($category_id, $course_id); break; case 'getScores': showScores($category_id, $course_id); break; case 'getSummary': showSummary($category_id, $courses, $exercises); break; case 'getExcel': showExcel($category_id, $courses, $exercises); break; case 'getCfgs': showConfig($category_id, $course_id); break; case 'saveCfgs': $count = $_GET['count']; $configs = $_GET['config']; setConfig($category_id, $course_id, $count, $configs); break; case 'createCfgs': $quiz_count = @$_GET['count']; if (!isset($quiz_count) || $quiz_count == null || $quiz_count <= 0) { drawConfigPanel($category_id, $course_id); } else { drawConfigPanel($category_id, $course_id, $quiz_count); } break; case 'removeCfgs': removeConfig($category_id, $course_id); break; case 'getStudents': showStudentConfigs(); break; case 'saveStudents': $students = $_GET['s']; saveStudentConfigs($students); break; } }
echo json_encode($response); } } function addNewWarning() { global $core; $formData = isset($_REQUEST["formData"]) ? json_decode($_REQUEST["formData"]) : false; if (!$formData) { echo "has no form data!"; return false; } echo $core->addNewWarning($formData); } if ($job == "showCategoryTree") { header('Content-Type: application/json'); showCategoryTree(); } if ($job == "showProjectList") { header('Content-Type: application/json'); showProjectList(); } if ($job == "getCityList") { $search = isset($_REQUEST["search"]) ? json_decode($_REQUEST["search"]) : ""; $start = isset($_REQUEST["start"]) ? intval($_REQUEST["start"]) : ""; $limit = isset($_REQUEST["limit"]) ? intval($_REQUEST["limit"]) : ""; //echo "DEBUG: start = ".$start.", limit = ".$limit.", search = ".$search; header('Content-Type: application/json'); echo $core->getCityList($search, $start, $limit); //print_r($list); } if ($job == "getAccessTemplateList") {