mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-29 01:49:27 +00:00
50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
|
|
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
class Zeitsperren extends FHCAPI_Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct([
|
|
'getZeitsperrenUser' => self::PERM_LOGGED,
|
|
'getTypenZeitsperren' => self::PERM_LOGGED,
|
|
]);
|
|
|
|
// Load Libraries
|
|
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
|
$this->load->library('form_validation');
|
|
|
|
// Load language phrases
|
|
$this->loadPhrases([
|
|
'ui',
|
|
'person'
|
|
]);
|
|
|
|
// Load models
|
|
$this->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
|
|
$this->load->model('ressource/Zeitsperretyp_model', 'ZeitsperretypModel');
|
|
}
|
|
|
|
public function getZeitsperrenUser($uid)
|
|
{
|
|
$result = $this->ZeitsperreModel->getZeitsperrenUser($uid);
|
|
|
|
if (isError($result)) {
|
|
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
|
}
|
|
$this->terminateWithSuccess((getData($result) ?: []));
|
|
}
|
|
|
|
public function getTypenZeitsperren()
|
|
{
|
|
$this->ZeitsperretypModel->addOrder('beschreibung', 'ASC');
|
|
$result = $this->ZeitsperretypModel->load();
|
|
if (isError($result)) {
|
|
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
|
}
|
|
$this->terminateWithSuccess((getData($result) ?: []));
|
|
}
|
|
|
|
}
|