mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-27 00:49:28 +00:00
Component Status: Tabelle
This commit is contained in:
@@ -157,9 +157,19 @@ class Prestudent extends FHC_Controller
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
$this->outputJson(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function getHistoryPrestudent($prestudent_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$result = $this->PrestudentModel->getHistoryPrestudent($prestudent_id);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function getBezeichnungZgv()
|
||||
|
||||
@@ -701,7 +701,7 @@ class Prestudent_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets history of all prestudents, person given
|
||||
* Gets history of all prestudents, person_id given
|
||||
* @param int $person_id
|
||||
* @return object
|
||||
*/
|
||||
@@ -726,4 +726,48 @@ class Prestudent_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, array($person_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets history of prestudent, prestudent_id given
|
||||
* @param int $prestudent_id
|
||||
* @return object
|
||||
*/
|
||||
public function getHistoryPrestudent($prestudent_id)
|
||||
{
|
||||
$query = "
|
||||
SELECT
|
||||
ps.status_kurzbz,
|
||||
ps.studiensemester_kurzbz,
|
||||
ps.ausbildungssemester,
|
||||
CASE WHEN ps.status_kurzbz = 'Student' THEN CONCAT(lv.semester, lv.verband, lv.gruppe) END AS lehrverband,
|
||||
ps.datum,
|
||||
TO_CHAR(ps.datum::timestamp, 'DD.MM.YYYY') AS format_datum,
|
||||
sp.bezeichnung,
|
||||
ps.bestaetigtam,
|
||||
TO_CHAR(ps.bestaetigtam::timestamp, 'DD.MM.YYYY') AS format_bestaetigtam,
|
||||
ps.bewerbung_abgeschicktamum,
|
||||
TO_CHAR(ps.bewerbung_abgeschicktamum::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS format_bewerbung_abgeschicktamum,
|
||||
stg.statusgrund_kurzbz,
|
||||
ps.orgform_kurzbz,
|
||||
ps.prestudent_id,
|
||||
sp.studienplan_id,
|
||||
ps.anmerkung,
|
||||
ps.bestaetigtvon,
|
||||
ps.insertamum,
|
||||
ps.insertvon,
|
||||
ps.updateamum,
|
||||
ps.updatevon
|
||||
FROM public.tbl_prestudentstatus ps
|
||||
JOIN public.tbl_student st USING (prestudent_id)
|
||||
JOIN public.tbl_studentlehrverband lv ON (st.student_uid = lv.student_uid)
|
||||
JOIN public.tbl_studiengang sg ON (lv.studiengang_kz = sg.studiengang_kz)
|
||||
LEFT JOIN lehre.tbl_studienplan sp USING (studienplan_id)
|
||||
LEFT JOIN public.tbl_status_grund stg USING (statusgrund_id)
|
||||
WHERE prestudent_id = ?
|
||||
and lv.studiensemester_kurzbz = ps.studiensemester_kurzbz
|
||||
ORDER BY datum DESC
|
||||
";
|
||||
|
||||
return $this->execQuery($query, array($prestudent_id));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user