mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 09:22:22 +00:00
added parameters aktiv, lehre, offiziell, positiv to getByPerson method of Zeugnisnote_model.php
This commit is contained in:
@@ -17,23 +17,55 @@ class Zeugnisnote_model extends DB_Model
|
||||
* Gets Pruefungen of a person for a Studiensemester.
|
||||
* @param int $person_id
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @param bool $aktiv
|
||||
* @param bool $lehre
|
||||
* @param bool $offiziell
|
||||
* @param bool $positiv
|
||||
* @return object
|
||||
*/
|
||||
public function getByPerson($person_id, $studiensemester_kurzbz)
|
||||
public function getByPerson($person_id, $studiensemester_kurzbz, $aktiv = true, $lehre = null, $offiziell = null, $positiv = null)
|
||||
{
|
||||
$params = array($person_id, $studiensemester_kurzbz);
|
||||
|
||||
$qry = '
|
||||
SELECT note.*, pers.matr_nr, lv.ects, stg.studiengang_kz, prst.prestudent_id, stg.erhalter_kz,
|
||||
SELECT zgnisnote.*, pers.matr_nr, lv.ects, stg.studiengang_kz, prst.prestudent_id, stg.erhalter_kz,
|
||||
UPPER(stg.typ||stg.kurzbz) AS studiengang, stg.bezeichnung AS studiengang_bezeichnung
|
||||
FROM public.tbl_person pers
|
||||
JOIN public.tbl_prestudent prst USING (person_id)
|
||||
JOIN public.tbl_student USING (prestudent_id)
|
||||
JOIN lehre.tbl_zeugnisnote note USING (student_uid)
|
||||
JOIN lehre.tbl_zeugnisnote zgnisnote USING (student_uid)
|
||||
JOIN lehre.tbl_note note ON zgnisnote.note = note.note
|
||||
JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang stg ON prst.studiengang_kz = stg.studiengang_kz
|
||||
WHERE pers.person_id = ?
|
||||
AND note.studiensemester_kurzbz = ?
|
||||
ORDER BY note.benotungsdatum';
|
||||
AND zgnisnote.studiensemester_kurzbz = ?';
|
||||
|
||||
return $this->execQuery($qry, array($person_id, $studiensemester_kurzbz));
|
||||
if (isset($aktiv))
|
||||
{
|
||||
$qry .= ' AND note.aktiv = ?';
|
||||
$params[] = $aktiv;
|
||||
}
|
||||
|
||||
if (isset($lehre))
|
||||
{
|
||||
$qry .= ' AND note.lehre = ?';
|
||||
$params[] = $lehre;
|
||||
}
|
||||
|
||||
if (isset($offiziell))
|
||||
{
|
||||
$qry .= ' AND note.offiziell = ?';
|
||||
$params[] = $offiziell;
|
||||
}
|
||||
|
||||
if (isset($positiv))
|
||||
{
|
||||
$qry .= ' AND note.positiv = ?';
|
||||
$params[] = $positiv;
|
||||
}
|
||||
|
||||
$qry .= ' ORDER BY zgnisnote.benotungsdatum';
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user