This commit is contained in:
Andreas Österreicher
2008-06-02 08:38:32 +00:00
parent 95b13e51c3
commit e2b47000b3
9 changed files with 419 additions and 333 deletions
+1 -323
View File
@@ -98,327 +98,5 @@ function getmax($val1,$val2)
}
//***************************************************************************************************************************************************
//PDF erzeugen
$pdf = new PDF('P','pt');
$pdf->Open();
$pdf->AddPage();
$pdf->AliasNbPages();
$pdf->SetFillColor(111,111,111);
$pdf->SetXY(30,40);
$stgobj=new studiengang($conn);
$stgobj->load($stg);
//Logo
$pdf->Image("../../../skin/images/tw_logo_02.jpg","430","55","120","35","jpg","");
//$pdf->Image("../../../skin/images/tw_logo_02.jpg","400","30","116","43","jpg","");
$lvobj = new lehrveranstaltung($conn, $lvid);
$pdf->SetFont('Arial','',16);
$pdf->MultiCell(0,20,'Anwesenheitsliste '.$lvobj->bezeichnung,0,'L',0);
$pdf->SetFont('Arial','',10);
$pdf->SetFillColor(190,190,190);
//Bei langen Namen muss der Gruppenname etwas weiter unten angezeigt werden da er
//sonst von der zweiten Zeile des Titels ueberschrieben wird.
if(strlen($lvobj->bezeichnung)>50)
$pdf->SetXY(30,75);
else
$pdf->SetXY(30,60);
//$stsem_obj = new studiensemester($conn);
//$stsem = $stsem_obj->getaktorNext();
$qry = "SELECT distinct on(kuerzel, semester, verband, gruppe, gruppe_kurzbz) UPPER(stg_typ::varchar(1) || stg_kurzbz) as kuerzel, semester, verband, gruppe, gruppe_kurzbz from campus.vw_lehreinheit WHERE lehrveranstaltung_id='".addslashes($lvid)."' AND studiensemester_kurzbz='".addslashes($stsem)."'";
if($lehreinheit_id!='')
$qry.=" AND lehreinheit_id='".addslashes($lehreinheit_id)."'";
$gruppen='';
if($result = pg_query($conn, $qry))
{
while($row = pg_fetch_object($result))
{
if($gruppen!='')
$gruppen.=', ';
if($row->gruppe_kurzbz=='')
$gruppen.=trim($row->kuerzel.'-'.$row->semester.$row->verband.$row->gruppe);
else
$gruppen.=$row->gruppe_kurzbz;
}
}
$pdf->MultiCell(0,20,'Gruppe: '.$gruppen.' Studiensemester: '.$stsem);
$maxY=$pdf->GetY();
$maxY=getmax($maxY,$pdf->GetY());
$pdf->SetFont('Arial','B',12);
$pdf->SetXY(30,90);
$pdf->MultiCell(0,20,'Monat _________');
//Anfang Tabelle
$pdf->SetFont('Arial','',8);
$lineheight=12;
//Datum
$maxY=$pdf->GetY()+10;
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(280,$lineheight,'Datum',1,'L',0);
$maxX +=280;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
//Anzahl der abgehaltenen Stunden
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(280,$lineheight,'Anzahl der abgehaltenen Stunden',1,'L',0);
$maxX +=280;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
//Lektoren
$pdf->SetFont('Arial','B',10);
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(520,$lineheight+2,'Lektoren',1,'L',1);
//Schleife aller lektoren
$qry = "SELECT
distinct vorname, nachname
FROM campus.vw_benutzer, lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter
WHERE
uid=mitarbeiter_uid AND
tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND
lehrveranstaltung_id='".addslashes($lvid)."' AND
studiensemester_kurzbz='$stsem' ";
if($lehreinheit_id!='')
$qry.=" AND tbl_lehreinheit.lehreinheit_id='".addslashes($lehreinheit_id)."'";
$qry.=" ORDER BY nachname, vorname;";
if($result = pg_query($conn,$qry))
{
while($row=pg_fetch_object($result))
{
$pdf->SetFont('Arial','',8);
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(280,$lineheight,"$row->vorname $row->nachname",1,'L',0);
$maxX +=280;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
}
}
//Studenten
$pdf->SetFont('Arial','B',10);
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(520,$lineheight+2,'Studenten',1,'L',1);
$maxY=$pdf->GetY();
$pdf->tablewidths = array(20,140,60,60,40,40,40,40,40,40); //Spaltenbreiten setzen
$pdf->SetLeftMargin(30);
$pdf->SetTopMargin(100); // Auch in der Funktion Header umstellen!!!
$aligns = array('R','L','C','C','L','L','L','L','L','L'); //Ausrichtung der Tabellen festlegen
$pdf->SetFont('Arial','',8);
$pdf->SetXY(30,$maxY);
$inhalt[]=array(' ','Hörer/Name','Kennzeichen','Gruppe','','','','','',''); //Spaltenueberschriften
//Studenten holen
$pdf->SetFont('Arial','',8);
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(20,$lineheight,'',1,'R',0);
$maxX +=20;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(130,$lineheight,'Hörer/Name',1,'L',0);
$maxX +=130;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(65,$lineheight,'Kennzeichen',1,'C',0);
$maxX +=65;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(65,$lineheight,'Gruppe',1,'C',0);
$maxX +=65;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$qry = "SELECT
distinct vorname, nachname, matrikelnr,
tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, tbl_studentlehrverband.gruppe,
(SELECT rolle_kurzbz FROM public.tbl_prestudentrolle WHERE prestudent_id=tbl_student.prestudent_id ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1) as status
FROM
campus.vw_student_lehrveranstaltung JOIN public.tbl_benutzer USING(uid)
JOIN public.tbl_person USING(person_id) JOIN public.tbl_student ON(uid=student_uid)
LEFT JOIN public.tbl_studentlehrverband USING(student_uid)
WHERE
lehrveranstaltung_id='".addslashes($lvid)."' AND
vw_student_lehrveranstaltung.studiensemester_kurzbz='".addslashes($stsem)."' AND
tbl_studentlehrverband.studiensemester_kurzbz='".addslashes($stsem)."'";
if($lehreinheit_id!='')
$qry.=" AND lehreinheit_id='".addslashes($lehreinheit_id)."'";
$qry.=' ORDER BY nachname, vorname';
if($result = pg_query($conn, $qry))
{
$i=0;
while($elem = pg_fetch_object($result))
{
//Abbrecher und Unterbrecher nicht anzeigen
if($elem->status!='Abbrecher' && $elem->status!='Unterbrecher')
{
$i++;
if($i%2)
$pdf->SetFillColor(190,190,190);
else
$pdf->SetFillColor(255,255,255);
$pdf->SetFont('Arial','',8);
$maxY=$pdf->GetY();
if($maxY>770)
{
$pdf->AddPage();
$maxY=$pdf->GetY();
}
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(20,$lineheight,$i,1,'R',1);
$maxX +=20;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Courier','B',8);
$pdf->MultiCell(130,$lineheight,$elem->nachname,1,'L',1);
$pdf->SetFont('Arial','',8);
$pdf->SetXY($maxX+strlen($elem->nachname)*5+1,$maxY);
if($elem->status=='Incoming')
$inc=' (i)';
else
$inc='';
$pdf->MultiCell(130,$lineheight,$elem->vorname.$inc,0,'L',0);
$maxX +=130;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Arial','',8);
$pdf->MultiCell(65,$lineheight,trim($elem->matrikelnr),1,'C',1);
$maxX +=65;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(65,$lineheight,$elem->semester.$elem->verband.$elem->gruppe,1,'C',1);
$maxX +=65;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$inhalt[]=array($i,$elem->nachname.' '.$elem->vorname,trim($elem->matrikelnr),$elem->semester.$elem->verband.$elem->gruppe,'','','','','','');
}
}
}
//Fussnote
$maxY=$pdf->GetY()+5;
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Arial','',8);
$pdf->MultiCell(520,$lineheight,'(i) ... Incoming',0,'L',0);
//FHStg
$maxY=$pdf->GetY()+5;
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(520,$lineheight,'Fachhochschulstudiengang ('.strtoupper($stgobj->typ).') '.$stgobj->bezeichnung,0,'L',0);
//FHStg
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Arial','',8);
$pdf->MultiCell(520,$lineheight,'Fehlt ein Student länger als 2 Wochen, bitte um einen deutlichen Vermerk auf der Anwesenheitsliste. Die Anwesenheitsliste bitte am Ende des Monats im Sekretariat abgeben! Bitte achten Sie darauf, dass Sie nur VOLLSTÄNDIG AUSGEFÜLLTE LISTEN abgeben!',0,'L',0);
$pdf->Output('anwesenheitsliste.pdf','I');
require_once('../../../include/'.EXT_FKT_PATH.'/anwesenheitsliste.inc.php');
?>
@@ -81,6 +81,25 @@ if($stsem=='')
$note = $_REQUEST["note"];
if(!$rechte->isBerechtigt('admin',0) &&
!$rechte->isBerechtigt('admin',$lv_obj->studiengang_kz) &&
!$rechte->isBerechtigt('lehre',$lv_obj->studiengang_kz))
{
$qry = "SELECT lehreinheit_id FROM lehre.tbl_lehrveranstaltung JOIN lehre.tbl_lehreinheit USING(lehrveranstaltung_id)
JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
WHERE tbl_lehrveranstaltung.lehrveranstaltung_id='".addslashes($lvid)."' AND
tbl_lehreinheit.studiensemester_kurzbz='".addslashes($stsem)."' AND tbl_lehreinheitmitarbeiter.mitarbeiter_uid='".addslashes($user)."'";
if($result = pg_query($conn, $qry))
{
if(pg_num_rows($result)==0)
die('Sie haben keine Berechtigung für diese Seite');
}
else
{
die('Fehler beim Pruefen der Rechte');
}
}
// lvgesamtnote für studenten speichern
if (isset($_REQUEST["submit"]) && ($_REQUEST["student_uid"] != '') && ((($note>0) && ($note < 6)) || ($note == 7) || ($note==8)) ){
@@ -370,6 +370,25 @@ foreach($stsem_obj->studiensemester as $studiensemester)
}
$stsem_content.= "</SELECT>\n";
if(!$rechte->isBerechtigt('admin',0) &&
!$rechte->isBerechtigt('admin',$lv_obj->studiengang_kz) &&
!$rechte->isBerechtigt('lehre',$lv_obj->studiengang_kz))
{
$qry = "SELECT lehreinheit_id FROM lehre.tbl_lehrveranstaltung JOIN lehre.tbl_lehreinheit USING(lehrveranstaltung_id)
JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
WHERE tbl_lehrveranstaltung.lehrveranstaltung_id='".addslashes($lvid)."' AND
tbl_lehreinheit.studiensemester_kurzbz='".addslashes($stsem)."' AND tbl_lehreinheitmitarbeiter.mitarbeiter_uid='".addslashes($user)."'";
if($result = pg_query($conn, $qry))
{
if(pg_num_rows($result)==0)
die('Sie haben keine Berechtigung für diese Seite');
}
else
{
die('Fehler beim Pruefen der Rechte');
}
}
//Lehreinheiten laden
/*
if($rechte->isBerechtigt('admin',0) || $rechte->isBerechtigt('admin',$lv_obj->studiengang_kz) || $rechte->isBerechtigt('lehre',$lv_obj->studiengang_kz))
@@ -570,7 +589,7 @@ if (isset($_REQUEST["freigabe"]) and ($_REQUEST["freigabe"] == 1))
$adressen = $sg->email.", ".$user."@".DOMAIN;
$freigeber = "<b>".strtoupper($user)."</b>";
//mail($adressen,"Notenfreigabe ".$lv->bezeichnung,"<html><body><b>".$lv->bezeichnung." - ".$stsem."</b> (".$lv->semester.". Sem.) <br><br>Benutzer ".$freigeber." hat die LV-Noten f&uuml;r folgende Studenten freigegeben:<br><br>".$studlist."<br>Mail wurde verschickt an: ".$adressen."</body></html>","From: vilesci@".DOMAIN."\nContent-Type: text/html\n");
mail($adressen,"Notenfreigabe ".$lv->bezeichnung,"<html><body><b>".$lv->bezeichnung." - ".$stsem."</b> (".$lv->semester.". Sem.) <br><br>Benutzer ".$freigeber." hat die LV-Noten f&uuml;r folgende Studenten freigegeben:<br><br>".$studlist."<br>Mail wurde verschickt an: ".$adressen."</body></html>","From: vilesci@".DOMAIN."\nContent-Type: text/html\n");
}
}
else
+1 -1
View File
@@ -28,7 +28,7 @@
//Connection Herstellen
if(!$sql_conn = pg_pconnect(CONN_STRING))
die('Fehler beim oeffnen der Datenbankverbindung');
die('Fehler beim Oeffnen der Datenbankverbindung');
$cutlength=10;
// Variablen setzen
+1 -1
View File
@@ -150,5 +150,5 @@ if ($num_rows_repl>0)
echo '</table>';
}
?>
<P>Fehler und Feedback bitte an <A class="Item" href="mailto:lvplan@<?php echo DOMAIN;?>">LV-Koordinationsstelle</A>.</P>
<P>Fehler und Feedback bitte an <A class="Item" href="mailto:<?php echo MAIL_LVPLAN;?>">LV-Koordinationsstelle</A>.</P>
</body></html>
+27 -3
View File
@@ -1,4 +1,25 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once('../config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/studiengang.class.php');
@@ -79,7 +100,10 @@
</table><br><br>
<strong><font class="error">Hinweis: </font></strong>Diese Verteiler d&uuml;rfen nur f&uuml;r Fachhochschul-relevante Zwecke verwendet werden!
<br>
<strong><font class="error">Info: </font></strong>Infos bez&uuml;glich <a class="Item" href="../cisdocs/Mailverteiler.pdf" target="_blank">Berechtigungskonzept</a> Mailverteiler, <a class="Item" href="../cisdocs/bedienung_mailverteiler.pdf" target="_blank">Bedienungsanleitung</a> Mailverteiler
<?php
if(MAILVERTEILER_SPERRE)
echo '<strong><font class="error">Info: </font></strong>Infos bez&uuml;glich <a class="Item" href="../cisdocs/Mailverteiler.pdf" target="_blank">Berechtigungskonzept</a> Mailverteiler, <a class="Item" href="../cisdocs/bedienung_mailverteiler.pdf" target="_blank">Bedienungsanleitung</a> Mailverteiler';
?>
<br>
<?php
$stg_obj = new studiengang($conn);
@@ -114,7 +138,7 @@
// display the open-link only when its a closed dispatcher and if the user has status lector
// if dispatcher has attribute aktiv=true no opening action is needed
echo "<td width=\"20\">";
if(!$row1->aktiv)
if(!$row1->aktiv && MAILVERTEILER_SPERRE)
{
if($is_lector)
{
@@ -164,7 +188,7 @@
echo "<tr><td width=\"390\" >&#8226; Alle Studenten dieses Studiengangs</td>";
// ffe, 20060508: Display the opening link for department dispatchers only for students of the particular department
if($is_lector || $std_obj->studiengang_kz==$row->studiengang_kz)
if($is_lector || $std_obj->studiengang_kz==$row->studiengang_kz || !MAILVERTEILER_SPERRE)
{
echo " <td width=\"20\">";
echo '<a href="#" onClick="javascript:window.open(\'open_grp.php?grp='.strtolower($row->kuerzel).'_std&desc=Alle Studenten von '.strtolower($row->kuerzel).'\',\'_blank\',\'width=600,height=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes, resizable=1\');return false;" class="Item"><img src="../../skin/images/open.gif" title="Verteiler &ouml;ffnen"></a></td>';
+2 -2
View File
@@ -373,11 +373,11 @@
$verband=strtolower($verband);
if($i % 2 == 0)
{
echo " <td align=\"center\" class='tdwrap'>&nbsp;<a class='Item' href='mailto:$kurzbz$row->semester$verband$gruppe@".DOMAIN."'>$kurzbz$row->semester$verband$gruppe@".DOMAIN."</td>";
echo " <td align=\"center\" class='tdwrap'>&nbsp;<a class='Item' href='mailto:".trim($kurzbz.$row->semester.$verband.$gruppe)."@".DOMAIN."'>".trim($kurzbz.$row->semester.$verband.$gruppe)."@".DOMAIN."</td>";
}
else
{
echo " <td align=\"center\" class=\"MarkLine\" class='tdwrap'>&nbsp;<a class='Item' href='mailto:$kurzbz$row->semester$verband$gruppe@".DOMAIN."'>$kurzbz$row->semester$verband$gruppe@".DOMAIN."</td>";
echo " <td align=\"center\" class=\"MarkLine\" class='tdwrap'>&nbsp;<a class='Item' href='mailto:".trim($kurzbz.$row->semester.$verband.$gruppe)."@".DOMAIN."'>".trim($kurzbz.$row->semester.$verband.$gruppe)."@".DOMAIN."</td>";
}
}
else
+346
View File
@@ -0,0 +1,346 @@
<?php
/* Copyright (C) 2008 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
//PDF fuer die Anwesenheitsliste auf CIS
//PDF erzeugen
$pdf = new PDF('P','pt');
$pdf->Open();
$pdf->AddPage();
$pdf->AliasNbPages();
$pdf->SetFillColor(111,111,111);
$pdf->SetXY(30,40);
$stgobj=new studiengang($conn);
$stgobj->load($stg);
//Logo
$pdf->Image("../../../skin/images/tw_logo_02.jpg","430","55","120","35","jpg","");
//$pdf->Image("../../../skin/images/tw_logo_02.jpg","400","30","116","43","jpg","");
$lvobj = new lehrveranstaltung($conn, $lvid);
$pdf->SetFont('Arial','',16);
$pdf->MultiCell(0,20,'Anwesenheitsliste '.$lvobj->bezeichnung,0,'L',0);
$pdf->SetFont('Arial','',10);
$pdf->SetFillColor(190,190,190);
//Bei langen Namen muss der Gruppenname etwas weiter unten angezeigt werden da er
//sonst von der zweiten Zeile des Titels ueberschrieben wird.
if(strlen($lvobj->bezeichnung)>50)
$pdf->SetXY(30,75);
else
$pdf->SetXY(30,60);
//$stsem_obj = new studiensemester($conn);
//$stsem = $stsem_obj->getaktorNext();
$qry = "SELECT distinct on(kuerzel, semester, verband, gruppe, gruppe_kurzbz) UPPER(stg_typ::varchar(1) || stg_kurzbz) as kuerzel, semester, verband, gruppe, gruppe_kurzbz from campus.vw_lehreinheit WHERE lehrveranstaltung_id='".addslashes($lvid)."' AND studiensemester_kurzbz='".addslashes($stsem)."'";
if($lehreinheit_id!='')
$qry.=" AND lehreinheit_id='".addslashes($lehreinheit_id)."'";
$gruppen='';
if($result = pg_query($conn, $qry))
{
while($row = pg_fetch_object($result))
{
if($gruppen!='')
$gruppen.=', ';
if($row->gruppe_kurzbz=='')
$gruppen.=trim($row->kuerzel.'-'.$row->semester.$row->verband.$row->gruppe);
else
$gruppen.=$row->gruppe_kurzbz;
}
}
$pdf->MultiCell(0,20,'Gruppe: '.$gruppen.' Studiensemester: '.$stsem);
$maxY=$pdf->GetY();
$maxY=getmax($maxY,$pdf->GetY());
$pdf->SetFont('Arial','B',12);
$pdf->SetXY(30,90);
$pdf->MultiCell(0,20,'Monat _________');
//Anfang Tabelle
$pdf->SetFont('Arial','',8);
$lineheight=12;
//Datum
$maxY=$pdf->GetY()+10;
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(280,$lineheight,'Datum',1,'L',0);
$maxX +=280;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
//Anzahl der abgehaltenen Stunden
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(280,$lineheight,'Anzahl der abgehaltenen Stunden',1,'L',0);
$maxX +=280;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
//Lektoren
$pdf->SetFont('Arial','B',10);
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(520,$lineheight+2,'Lektoren',1,'L',1);
//Schleife aller lektoren
$qry = "SELECT
distinct vorname, nachname
FROM campus.vw_benutzer, lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter
WHERE
uid=mitarbeiter_uid AND
tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND
lehrveranstaltung_id='".addslashes($lvid)."' AND
studiensemester_kurzbz='$stsem' ";
if($lehreinheit_id!='')
$qry.=" AND tbl_lehreinheit.lehreinheit_id='".addslashes($lehreinheit_id)."'";
$qry.=" ORDER BY nachname, vorname;";
if($result = pg_query($conn,$qry))
{
while($row=pg_fetch_object($result))
{
$pdf->SetFont('Arial','',8);
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(280,$lineheight,"$row->vorname $row->nachname",1,'L',0);
$maxX +=280;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
}
}
//Studenten
$pdf->SetFont('Arial','B',10);
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(520,$lineheight+2,'Studenten',1,'L',1);
$maxY=$pdf->GetY();
$pdf->tablewidths = array(20,140,60,60,40,40,40,40,40,40); //Spaltenbreiten setzen
$pdf->SetLeftMargin(30);
$pdf->SetTopMargin(100); // Auch in der Funktion Header umstellen!!!
$aligns = array('R','L','C','C','L','L','L','L','L','L'); //Ausrichtung der Tabellen festlegen
$pdf->SetFont('Arial','',8);
$pdf->SetXY(30,$maxY);
$inhalt[]=array(' ','Hörer/Name','Kennzeichen','Gruppe','','','','','',''); //Spaltenueberschriften
//Studenten holen
$pdf->SetFont('Arial','',8);
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(20,$lineheight,'',1,'R',0);
$maxX +=20;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(130,$lineheight,'Hörer/Name',1,'L',0);
$maxX +=130;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(65,$lineheight,'Kennzeichen',1,'C',0);
$maxX +=65;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(65,$lineheight,'Gruppe',1,'C',0);
$maxX +=65;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',0);
$qry = "SELECT
distinct vorname, nachname, matrikelnr,
tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, tbl_studentlehrverband.gruppe,
(SELECT rolle_kurzbz FROM public.tbl_prestudentrolle WHERE prestudent_id=tbl_student.prestudent_id ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1) as status
FROM
campus.vw_student_lehrveranstaltung JOIN public.tbl_benutzer USING(uid)
JOIN public.tbl_person USING(person_id) JOIN public.tbl_student ON(uid=student_uid)
LEFT JOIN public.tbl_studentlehrverband USING(student_uid)
WHERE
lehrveranstaltung_id='".addslashes($lvid)."' AND
vw_student_lehrveranstaltung.studiensemester_kurzbz='".addslashes($stsem)."' AND
tbl_studentlehrverband.studiensemester_kurzbz='".addslashes($stsem)."'";
if($lehreinheit_id!='')
$qry.=" AND lehreinheit_id='".addslashes($lehreinheit_id)."'";
$qry.=' ORDER BY nachname, vorname';
if($result = pg_query($conn, $qry))
{
$i=0;
while($elem = pg_fetch_object($result))
{
//Abbrecher und Unterbrecher nicht anzeigen
if($elem->status!='Abbrecher' && $elem->status!='Unterbrecher')
{
$i++;
if($i%2)
$pdf->SetFillColor(190,190,190);
else
$pdf->SetFillColor(255,255,255);
$pdf->SetFont('Arial','',8);
$maxY=$pdf->GetY();
if($maxY>770)
{
$pdf->AddPage();
$maxY=$pdf->GetY();
}
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(20,$lineheight,$i,1,'R',1);
$maxX +=20;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Courier','B',8);
$pdf->MultiCell(130,$lineheight,$elem->nachname,1,'L',1);
$pdf->SetFont('Arial','',8);
$pdf->SetXY($maxX+strlen($elem->nachname)*5+1,$maxY);
if($elem->status=='Incoming')
$inc=' (i)';
else
$inc='';
$pdf->MultiCell(130,$lineheight,$elem->vorname.$inc,0,'L',0);
$maxX +=130;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Arial','',8);
$pdf->MultiCell(65,$lineheight,trim($elem->matrikelnr),1,'C',1);
$maxX +=65;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(65,$lineheight,$elem->semester.$elem->verband.$elem->gruppe,1,'C',1);
$maxX +=65;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$maxX +=40;
$pdf->SetXY($maxX,$maxY);
$pdf->MultiCell(40,$lineheight,'',1,'L',1);
$inhalt[]=array($i,$elem->nachname.' '.$elem->vorname,trim($elem->matrikelnr),$elem->semester.$elem->verband.$elem->gruppe,'','','','','','');
}
}
}
//Fussnote
$maxY=$pdf->GetY()+5;
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Arial','',8);
$pdf->MultiCell(520,$lineheight,'(i) ... Incoming',0,'L',0);
//FHStg
$maxY=$pdf->GetY()+5;
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(520,$lineheight,'Fachhochschulstudiengang ('.strtoupper($stgobj->typ).') '.$stgobj->bezeichnung,0,'L',0);
//FHStg
$maxY=$pdf->GetY();
$maxX=30;
$pdf->SetXY($maxX,$maxY);
$pdf->SetFont('Arial','',8);
$pdf->MultiCell(520,$lineheight,'Fehlt ein Student länger als 2 Wochen, bitte um einen deutlichen Vermerk auf der Anwesenheitsliste. Die Anwesenheitsliste bitte am Ende des Monats im Sekretariat abgeben! Bitte achten Sie darauf, dass Sie nur VOLLSTÄNDIG AUSGEFÜLLTE LISTEN abgeben!',0,'L',0);
$pdf->Output('anwesenheitsliste.pdf','I');
?>
+2 -2
View File
@@ -41,10 +41,10 @@
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap"><a class="Item" target="_blank" href="http://www.technikum-wien.at/service/intern"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;Newsletter</a></td>
</tr>
<tr>
<!-- <tr>
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap"><a class="Item" target="content" href="private/lehre/pinboard.php?fachbereich_kurzbz=Senat"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;Senatsbeschl&uuml;sse</a></td>
</tr>
</tr>-->
<tr>
<td class="tdwidth10" nowrap>&nbsp;</td>
<td class="tdwrap"><a class="Item" target="_blank" href="http://www.technikum-wien.at/service/termine/"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;Veranstaltungen</a></td>