diff --git a/cis/private/info/ersthelfer.php b/cis/private/info/ersthelfer.php index 18c86293b..6441f5439 100644 --- a/cis/private/info/ersthelfer.php +++ b/cis/private/info/ersthelfer.php @@ -60,7 +60,7 @@ if(check_lektor($user)) { $("#t1").tablesorter( { - sortList: [[2,0]], + sortList: [[0,0],[1,0]], widgets: ["zebra"] }); $("#t2").tablesorter( @@ -103,40 +103,62 @@ if(check_lektor($user)) ='now()' OR datum_bis IS NULL) - AND campus.vw_mitarbeiter.aktiv=TRUE - AND standort_id IS NOT NULL - ORDER BY standort_id, nachname, vorname"; + $sql_query = " SELECT uid, + vorname, + nachname, + COALESCE(( + SELECT tbl_kontakt.kontakt || ' - ' || telefonklappe + FROM PUBLIC.tbl_mitarbeiter + LEFT JOIN PUBLIC.tbl_kontakt USING (standort_id) + WHERE mitarbeiter_uid = vw_mitarbeiter.uid + AND ( + tbl_kontakt.kontakttyp = 'telefon' + OR tbl_kontakt.kontakttyp IS NULL + ) limit 1 + ), '-') AS telefonklappe, + COALESCE(( + SELECT planbezeichnung + FROM PUBLIC.tbl_mitarbeiter + LEFT JOIN PUBLIC.tbl_ort USING (ort_kurzbz) + WHERE mitarbeiter_uid = vw_mitarbeiter.uid + ), '-') AS ort_kurzbz, + beschreibung + FROM campus.vw_mitarbeiter + JOIN PUBLIC.tbl_benutzerfunktion USING (uid) + JOIN PUBLIC.tbl_funktion USING (funktion_kurzbz) + WHERE funktion_kurzbz = 'ersthelfer' + AND ( + datum_von <= 'now()' + OR datum_von IS NULL + ) + AND ( + datum_bis >= 'now()' + OR datum_bis IS NULL + ) + AND campus.vw_mitarbeiter.aktiv = TRUE + ORDER BY nachname, + vorname"; $result = $db->db_query($sql_query); if ($db->db_num_rows($result) > 0) { - $count = 0; - echo ' - - + '; while($row = $db->db_fetch_object($result)) - {$count++; + { echo ' - + - - + '; } @@ -211,7 +233,7 @@ if(check_lektor($user)) - + @@ -253,7 +275,7 @@ if(check_lektor($user)) - + '; }
'.$p->t("global/vorname").' '.$p->t("global/nachname").''.$p->t("global/vorname").' '.$p->t("lvplan/raum").' '.$p->t("global/telefonnummer").'
'.$count.''.$row->nachname.' '.$row->vorname.''.$row->nachname.' '.$row->ort_kurzbz.'01/333 40 77 - '.$row->telefonklappe.''.$row->telefonklappe.'
'.$row->nachname.''.$row->nachname.' '.$row->vorname.' ('.$row->beschreibung.') '.$row->kontakt.''.$row->nachname.''.$row->nachname.' '.$row->vorname.'