mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-14 18:49:28 +00:00
f6f533a23b
Fixed translations
57 lines
1.2 KiB
PHP
57 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* FH-Complete
|
|
*
|
|
* @package FHC-API
|
|
* @author FHC-Team
|
|
* @copyright Copyright (c) 2016, fhcomplete.org
|
|
* @license GPLv3
|
|
* @link http://fhcomplete.org
|
|
* @since Version 1.0
|
|
* @filesource
|
|
*/
|
|
// ------------------------------------------------------------------------
|
|
|
|
if(!defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
class Plan extends REST_Controller
|
|
{
|
|
/**
|
|
* Course API constructor.
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
// Load model PersonModel
|
|
$this->load->model('studies/plan_model', 'PlanModel');
|
|
// Load set the addonID of the model to let to check the permissions
|
|
$this->PlanModel->setAddonID($this->_getAddonID());
|
|
}
|
|
|
|
public function getPlan()
|
|
{
|
|
$courseOfStudiesID = $this->get('studiengang_kz');
|
|
|
|
$result = $this->PlanModel->getPlan($courseOfStudiesID);
|
|
|
|
if(is_object($result) && $result->num_rows() > 0)
|
|
{
|
|
$payload = [
|
|
'success' => TRUE,
|
|
'message' => 'Plan found',
|
|
'data' => $result->result()
|
|
];
|
|
$httpstatus = REST_Controller::HTTP_OK;
|
|
}
|
|
else
|
|
{
|
|
$payload = [
|
|
'success' => FALSE,
|
|
'message' => 'Plan not found'
|
|
];
|
|
$httpstatus = REST_Controller::HTTP_OK;
|
|
}
|
|
|
|
$this->response($payload, $httpstatus);
|
|
}
|
|
} |