mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 09:22:22 +00:00
Models
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Erhalter_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_erhalter';
|
||||
$this->pk = 'erhalter_kz';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Fachbereich_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_fachbereich';
|
||||
$this->pk = 'fachbereich_kurzbz';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Ferien_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_ferien';
|
||||
$this->pk = array('studiengang_kz', 'bezeichnung');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Geschaeftsjahr_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_geschaeftsjahr';
|
||||
$this->pk = 'geschaeftsjahr_kurzbz';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Gruppe_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_gruppe';
|
||||
$this->pk = 'gruppe_kurzbz';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Lehrverband_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_lehrverband';
|
||||
$this->pk = array('gruppe', 'verband', 'semester', 'studiengang_kz');
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,14 @@
|
||||
<?php
|
||||
|
||||
class Organisationseinheit_model extends DB_Model
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable='public.tbl_organisationseinheit';
|
||||
$this->pk='oe_kurzbz';
|
||||
$this->dbTable = 'public.tbl_organisationseinheit';
|
||||
$this->pk = 'oe_kurzbz';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Organisationseinheittyp_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_organisationseinheittyp';
|
||||
$this->pk = 'organisationseinheittyp_kurzbz';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Semesterwochen_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_semesterwochen';
|
||||
$this->pk = array('studiengang_kz', 'semester');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Service_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_service';
|
||||
$this->pk = 'service_id';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Standort_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_standort';
|
||||
$this->pk = 'standort_id';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Statistik_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_statistik';
|
||||
$this->pk = 'statistik_kurzbz';
|
||||
}
|
||||
}
|
||||
@@ -1,83 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Studiengang_model extends DB_Model
|
||||
{
|
||||
|
||||
public $table = 'public.tbl_studiengang';
|
||||
public $id = 'studiengang_kz';
|
||||
public $order = 'DESC';
|
||||
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
// get all
|
||||
function get_all()
|
||||
{
|
||||
$this->db->order_by($this->id, $this->order);
|
||||
return $this->db->get($this->table)->result();
|
||||
}
|
||||
|
||||
// get data by id
|
||||
function get_by_id($id)
|
||||
{
|
||||
$this->db->where($this->id, $id);
|
||||
return $this->db->get($this->table)->row();
|
||||
}
|
||||
|
||||
// get total rows
|
||||
function total_rows() {
|
||||
$this->db->from($this->table);
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
// get data with limit
|
||||
function index_limit($limit, $start = 0) {
|
||||
$this->db->order_by($this->id, $this->order);
|
||||
$this->db->limit($limit, $start);
|
||||
return $this->db->get($this->table)->result();
|
||||
}
|
||||
|
||||
// get search total rows
|
||||
function search_total_rows($keyword = NULL) {
|
||||
$this->db->like('', $keyword);
|
||||
$this->db->from($this->table);
|
||||
return $this->db->count_all_results();
|
||||
}
|
||||
|
||||
// get search data with limit
|
||||
function search_index_limit($limit, $start = 0, $keyword = NULL) {
|
||||
$this->db->order_by($this->id, $this->order);
|
||||
$this->db->like('', $keyword);
|
||||
$this->db->limit($limit, $start);
|
||||
return $this->db->get($this->table)->result();
|
||||
}
|
||||
|
||||
// insert data
|
||||
function insert($data)
|
||||
{
|
||||
$this->db->insert($this->table, $data);
|
||||
}
|
||||
|
||||
// update data
|
||||
function update($id, $data)
|
||||
{
|
||||
$this->db->where($this->id, $id);
|
||||
$this->db->update($this->table, $data);
|
||||
}
|
||||
|
||||
// delete data
|
||||
function delete($id)
|
||||
{
|
||||
$this->db->where($this->id, $id);
|
||||
$this->db->delete($this->table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_studiengang';
|
||||
$this->pk = 'studiengang_kz';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getAllForBewerbung()
|
||||
{
|
||||
$result = NULL;
|
||||
$allForBewerbungQuery = "SELECT DISTINCT studiengang_kz,
|
||||
typ,
|
||||
organisationseinheittyp_kurzbz,
|
||||
studiengangbezeichnung,
|
||||
standort,
|
||||
studiengangbezeichnung_englisch,
|
||||
lgartcode,
|
||||
tbl_lgartcode.bezeichnung
|
||||
FROM lehre.vw_studienplan LEFT JOIN bis.tbl_lgartcode USING (lgartcode)
|
||||
WHERE onlinebewerbung IS TRUE
|
||||
AND aktiv IS TRUE
|
||||
ORDER BY typ, studiengangbezeichnung, tbl_lgartcode.bezeichnung ASC";
|
||||
|
||||
// Checks if the operation is permitted by the API caller
|
||||
// All the code should be put inside this if statement
|
||||
if(isAllowed($this->getAddonID(), 'course'))
|
||||
{
|
||||
$result = $this->db->query($allForBewerbungQuery);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/* End of file Studiengang_model.php */
|
||||
/* Location: ./application/models/Studiengang_model.php */
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Studiengangstyp_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_studiengangstyp';
|
||||
$this->pk = 'typ';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Studienjahr_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_studienjahr';
|
||||
$this->pk = 'studienjahr_kurzbz';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Studienordnung_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_studienordnung';
|
||||
$this->pk = 'studienordnung_id';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Studienordnungstatus_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_studienordnungstatus';
|
||||
$this->pk = 'status_kurzbz';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
class Studienplan_model extends DB_Model
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getStudienplaene($studiengang_kz)
|
||||
{
|
||||
$result = NULL;
|
||||
$studienplaeneQuery = "SELECT DISTINCT tbl_studienplan.*
|
||||
FROM lehre.tbl_studienplan JOIN lehre.tbl_studienordnung USING(studienordnung_id)
|
||||
WHERE tbl_studienordnung.studiengang_kz = ?";
|
||||
|
||||
// Checks if the operation is permitted by the API caller
|
||||
// All the code should be put inside this if statement
|
||||
if(isAllowed($this->getAddonID(), 'plan'))
|
||||
{
|
||||
$result = $this->db->query($studienplaeneQuery, array($studiengang_kz));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Studienplatz_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_studienplatz';
|
||||
$this->pk = 'studienplatz_id';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Studiensemester_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_studiensemester';
|
||||
$this->pk = 'studiensemester_kurzbz';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user