<?php
/*************this php page is for the ajax calls***********/

//include config.php
include_once('../../config.php');
include_once('controller.php');
$logic = new ControlAdminUser();

// check if $_POST['action'] is set
if (!empty($logic -> getDataPost('action'))) {
    
    $action = $logic->getDataPost('action', true);

    $departmentId = $logic -> getDataPost('departmentId', true);

    if ($action == 'getDepartmentFunctionList' && !empty($departmentId)) {
        $lang = (!empty($logic -> getDataPost('language')) ? $logic -> getDataPost('language', true) : "ja");
        
        echo '<table class="table col bdr default odd w60p fontXS m_auto mb20" id="functionDetails" style="display:none;">' 
            . $logic->getDepartmentFunctionList($departmentId, $lang) . '</table>';
    }
}
?>