From 82c8ca7f80a279159420cc0111def0943072a5ad Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 20 Jul 2020 16:50:29 +0200 Subject: [PATCH] Adapted logic to display Pruefungsprotokolle of certain time period Signed-off-by: Cris --- application/controllers/lehre/Pruefungsprotokoll.php | 9 ++++++++- .../views/lehre/pruefungsprotokollUebersichtData.php | 9 +++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/application/controllers/lehre/Pruefungsprotokoll.php b/application/controllers/lehre/Pruefungsprotokoll.php index 594d3a9e1..d9793ef06 100644 --- a/application/controllers/lehre/Pruefungsprotokoll.php +++ b/application/controllers/lehre/Pruefungsprotokoll.php @@ -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); } /** diff --git a/application/views/lehre/pruefungsprotokollUebersichtData.php b/application/views/lehre/pruefungsprotokollUebersichtData.php index d7bf3c9d0..dd247c2eb 100644 --- a/application/views/lehre/pruefungsprotokollUebersichtData.php +++ b/application/views/lehre/pruefungsprotokollUebersichtData.php @@ -1,5 +1,6 @@ ='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 ";