Adapted logic to display Pruefungsprotokolle of certain time period

Signed-off-by: Cris <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2020-07-20 16:50:29 +02:00
parent 618644d41f
commit 82c8ca7f80
2 changed files with 15 additions and 3 deletions
@@ -51,7 +51,14 @@ class Pruefungsprotokoll extends Auth_Controller
public function index()
{
$this->load->library('WidgetLib');
$this->load->view('lehre/pruefungsprotokollUebersicht.php');
// Protokolle anzeigen seit heute / letzte Woche / alle
$period = $this->input->post('period');
$period = (!is_null($period)) ? $period : 'today';
$data = array('period' => $period);
$this->load->view('lehre/pruefungsprotokollUebersicht.php', $data);
}
/**
@@ -1,5 +1,6 @@
<?php
$UID = getAuthUID();
$PERIOD = $period; // filter Pruefungsprotokolle for given period
$query = "
SELECT
@@ -14,10 +15,14 @@ FROM
JOIN public.tbl_benutzer ON(student_uid=uid)
JOIN public.tbl_person USING(person_id)
JOIN public.tbl_studiengang ON(tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz)
JOIN public.tbl_studiengangstyp USING(typ);
JOIN public.tbl_studiengangstyp USING(typ)
WHERE
vorsitz='".$UID."'
AND datum>='2020-05-27'
AND (
'". $PERIOD. "' = 'today' AND datum = NOW()::date OR
'". $PERIOD. "' = 'lastWeek' AND datum = (NOW() - interval '1 week')::date OR
'". $PERIOD. "' = 'all' AND datum >= '2020-05-27'
)
ORDER BY datum, nachname, vorname
";