From 88c288026539a57df853fba59c39d49668814265 Mon Sep 17 00:00:00 2001 From: Nikolaus Krondraf Date: Tue, 9 Dec 2014 07:43:27 +0000 Subject: [PATCH] =?UTF-8?q?angezeigte=20Buchungen=20k=C3=B6nnen=20gefilter?= =?UTF-8?q?t=20werden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/profile/mitarbeiter_buchung.php | 27 ++++++++++++++++++--- include/buchung.class.php | 13 ++++++++-- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/cis/private/profile/mitarbeiter_buchung.php b/cis/private/profile/mitarbeiter_buchung.php index 9f849f44a..a6c954bc8 100644 --- a/cis/private/profile/mitarbeiter_buchung.php +++ b/cis/private/profile/mitarbeiter_buchung.php @@ -51,10 +51,12 @@ $p = new phrasen(getSprache()); // Beginn und Ende des aktuellen Semesters ermitteln $studiensemester->getTimestamp($studiensemester->getakt()); -isset($_GET['von']) ? $von = $_GET['von'] : $von = $studiensemester->begin->start; -isset($_GET['bis']) ? $bis = $_GET['bis'] : $bis = $studiensemester->ende->ende; +!empty($_GET['von']) ? $von = $_GET['von'] : $von = date('d.m.Y', $studiensemester->begin->start); +!empty($_GET['bis']) ? $bis = $_GET['bis'] : $bis = date('d.m.Y', $studiensemester->ende->ende); -$buchung->getBuchungPerson($benutzer->person_id); +$options['von'] = $datum->formatDatum($von); +$options['bis'] = $datum->formatDatum($bis); +$buchung->getBuchungPerson($benutzer->person_id, $options); // Ausgabe ?> @@ -72,8 +74,11 @@ $buchung->getBuchungPerson($benutzer->person_id); { $("#t1").tablesorter( { + sortList: [[0,0]], widgets: ["zebra"] }); + + $("#von, #bis").datepicker($.datepicker.regional["de"]); }); --> @@ -81,6 +86,12 @@ $buchung->getBuchungPerson($benutzer->person_id);

t('buchungen/titel'); ?>

+
+ von + bis + +
+ @@ -90,19 +101,27 @@ $buchung->getBuchungPerson($benutzer->person_id); + result as $row) { echo ''; echo ''; echo ''; - echo ''; + echo ''; echo ''; echo ''; $summe += $row->betrag; } ?> + + + + + + +
t('buchungen/buchgstyp'); ?>
' . $datum->formatDatum($row->buchungsdatum, 'd.m.Y') . '' . $row->buchungstext . '' . $row->betrag . '' . str_replace('.', ',', $row->betrag) . '' . $row->buchungstyp_kurzbz . '
Summe
\ No newline at end of file diff --git a/include/buchung.class.php b/include/buchung.class.php index cc9b0c5a0..498b6ee9c 100644 --- a/include/buchung.class.php +++ b/include/buchung.class.php @@ -395,15 +395,24 @@ class buchung extends basis_db * @param person_id ID der Person * @return true wenn ok, false im Fehlerfall */ - public function getBuchungPerson($person_id) + public function getBuchungPerson($person_id, $options = null) { + // Filter für Query aufbereiten + $filter = ""; + if(!empty($options['von'])) + $filter .= " AND buchungsdatum >= " . $this->db_add_param($options['von']) . " "; + + if(!empty($options['bis'])) + $filter .= " AND buchungsdatum <= " . $this->db_add_param($options['bis']) . " "; + $qry = "SELECT tbl_buchung.* FROM wawi.tbl_buchung JOIN wawi.tbl_konto USING(konto_id) WHERE - tbl_konto.person_id=".$this->db_add_param($person_id, FHC_INTEGER)." + tbl_konto.person_id=".$this->db_add_param($person_id, FHC_INTEGER). + $filter ." ORDER BY buchungsdatum"; if($result = $this->db_query($qry))