예제 #1
0
<?php

require_once '../_lib/GetData.php';
if (isset($_POST["operation"])) {
    switch ($_POST["operation"]) {
        case 'academicyear':
            if (isset($_POST["inst_id"])) {
                $instID = $_POST["inst_id"];
                $academicyear = getData::getCurrentAcademicYear($instID);
                $academicyear_Json = json_encode($academicyear);
                echo $academicyear_Json;
            }
            break;
        case 'departments':
            if (isset($_POST["inst_id"])) {
                $instID = $_POST["inst_id"];
                $departments = getData::getDepartments($instID);
                $departments_Json = json_encode($departments);
                echo $departments_Json;
            }
            break;
        case 'departmentyears':
            if (isset($_POST["inst_id"]) && isset($_POST["dep_id"])) {
                $instID = $_POST["inst_id"];
                $depID = $_POST["dep_id"];
                $departmentyears = getData::getDepartmentYear($instID, $depID);
                $departmentyears_Json = json_encode($departmentyears);
                echo $departmentyears_Json;
            }
            break;
        case 'groups':