360 lines
9.8 KiB
PHP
Executable File
360 lines
9.8 KiB
PHP
Executable File
<?php
|
|
include("kurs/datenbankanbindung.php"); // fügt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.php
|
|
$jahrgang=$_COOKIE["jahrgang"];
|
|
$user_admin=$_COOKIE["user_admin"];
|
|
|
|
// Rechteüberprüfung
|
|
$db = dbconnect();
|
|
if ($user_admin == ""){ require("index.php"); exit;} //Wenn man nicht angemeldet ist, darf man nicht auf die Seite
|
|
$result = $db->query("SELECT 1 FROM stan_admin_rechte, stan_admin_rechte_zuord , stan_admin where stan_admin_rechte.stan_admin_rolle = stan_admin_rechte_zuord.stan_admin_rolle AND stan_admin_rechte_zuord.said = stan_admin.said AND stan_admin.user = '$user_admin' AND stan_admin_rechte_zuord.stan_admin_rolle = 'a_puprnt'");
|
|
$row = $result->fetch_array();
|
|
if ($row[0] != 1){ include("kurs/rechte.php"); exit;}
|
|
// Rechteüberprüfung ende
|
|
|
|
|
|
#error_reporting (E_ALL);
|
|
|
|
define('FPDF_FONTPATH','../../stud/prints/font/');
|
|
require('../../stud/prints/as_utf_class.php');
|
|
require_once("../../stud/prints/table_def_zuweis.inc");
|
|
|
|
$pdf=new utfFPDF();
|
|
|
|
$db = dbconnect();
|
|
$res_ansp = $db->query("SELECT wert1 name, wert2 mail FROM parameter WHERE pid='6'");
|
|
$row_ansp = $res_ansp->fetch_array();
|
|
|
|
$res_kontakt = $db->query("SELECT wert1 tel, wert2 fax FROM parameter WHERE pid='5'");
|
|
$row_kontakt = $res_kontakt->fetch_array();
|
|
|
|
$pagecount = $pdf->setSourceFile("briefkopf_blanko.pdf");
|
|
|
|
$tplidx = $pdf->ImportPage(1);
|
|
|
|
$pdf->SetAutoPageBreak(true, 20);
|
|
$pdf->SetTopMargin(0);
|
|
$pdf->SetRightMargin(23);
|
|
$pdf->SetAutoPageBreak(TRUE, 0);
|
|
|
|
$db = dbconnect();
|
|
|
|
$res_v = $db->query("SELECT DATE_FORMAT(beginn, '%d.%m.%Y') beginn, DATE_FORMAT(ende, '%d.%m.%Y') ende FROM stan_sperrzeit WHERE jahrgang='$jahrgang' AND kennung = 'V'");
|
|
$row_v = $res_v->fetch_array();
|
|
|
|
$res_w = $db->query("SELECT DATE_FORMAT(beginn, '%d.%m.%Y') beginn, DATE_FORMAT(ende, '%d.%m.%Y') ende, DATE_FORMAT(ende, '%Y') jahr FROM stan_sperrzeit WHERE jahrgang='$jahrgang' AND kennung = 'W'");
|
|
$row_w = $res_w->fetch_array();
|
|
|
|
$db = dbconnect();
|
|
$query = "SELECT uid, nachname, vorname, postrasse, poort, poplz, stg
|
|
FROM stud
|
|
WHERE stg='V' AND jahrgang='$jahrgang'
|
|
AND uid IN (SELECT uid FROM stan_pu_wunsch)
|
|
";
|
|
|
|
$result = $db->query ($query)
|
|
or die ("Cannot execute query");
|
|
|
|
while ($row = $result->fetch_array())
|
|
{
|
|
|
|
|
|
$pdf->addPage();
|
|
$pdf->useTemplate($tplidx,0,0,0);
|
|
|
|
|
|
$heute_format = date("d.m.Y", mktime(0, 0, 0, date("m"), date("d"), date("Y"))); // ISO-8601 Format wie in der Datenbank: Formatierung für Vergleiche erforderlich
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(56.7);
|
|
$pdf->SetX(117.9);
|
|
$pdf->MultiCell(47, 3, "Ludwigsburg,", 0, 'L');
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(56.7);
|
|
$pdf->SetX(136.1);
|
|
$pdf->MultiCell(47, 3, "$heute_format", 0, 'R');
|
|
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(60.9);
|
|
$pdf->SetX(117.9);
|
|
$pdf->MultiCell(47, 3, "Bearbeiter/in", 0, 'L');
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(60.9);
|
|
$pdf->SetX(136.1);
|
|
$pdf->MultiCell(47, 3, "$row_ansp[name]", 0, 'R');
|
|
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(65.1);
|
|
$pdf->SetX(117.9);
|
|
$pdf->MultiCell(47, 3, "Telefon", 0, 'L');
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(65.1);
|
|
$pdf->SetX(136.1);
|
|
$pdf->MultiCell(47, 3, "$row_kontakt[tel]", 0, 'R');
|
|
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(69.3);
|
|
$pdf->SetX(117.9);
|
|
$pdf->MultiCell(47, 3, "Fax", 0, 'L');
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(69.3);
|
|
$pdf->SetX(136.1);
|
|
$pdf->MultiCell(47, 3, "$row_kontakt[fax]", 0, 'R');
|
|
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(73.5);
|
|
$pdf->SetX(117.9);
|
|
$pdf->MultiCell(47, 3, "e-mail", 0, 'L');
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(73.5);
|
|
$pdf->SetX(136.1);
|
|
$pdf->MultiCell(47, 3, "$row_ansp[mail]", 0, 'R');
|
|
|
|
|
|
|
|
$pdf->SetFont('Times', '', 12);
|
|
$pdf->SetY(59.5);
|
|
$pdf->SetX(23);
|
|
$pdf->Cell(0, 3, "$row[vorname] $row[nachname]", 0, 0, 'L');
|
|
|
|
|
|
$pdf->SetFont('Times', '', 12);
|
|
$pdf->SetY(64.5);
|
|
$pdf->SetX(23);
|
|
$pdf->Cell(0, 3, "$row[postrasse]", 0, 0, 'L');
|
|
|
|
|
|
$pdf->SetFont('Times', 'B', 12);
|
|
$pdf->SetY(73.5);
|
|
$pdf->SetX(23);
|
|
$pdf->Cell(0, 3, "$row[poplz] $row[poort]", 0, 0, 'L');
|
|
|
|
|
|
|
|
|
|
|
|
$pdf->SetFont('Times', 'B', 12);
|
|
$pdf->SetY(91);
|
|
$pdf->SetX(23);
|
|
$pdf->MultiCell(0, 4.5, "Zuweisung zum praxisbegleitenden Unterricht", 0, 'L');
|
|
|
|
|
|
|
|
$res_ort = $db->query("SELECT bezeichnung
|
|
FROM stan_pu_standorte, stan_pu_wunsch
|
|
WHERE stan_pu_standorte.pusoid = stan_pu_wunsch.ort
|
|
AND stan_pu_wunsch.uid = '$row[uid]'
|
|
AND stan_pu_wunsch.prioritaet = '0'
|
|
AND stan_pu_standorte.jahrgang='$jahrgang'
|
|
");
|
|
$row_ort = $res_ort->fetch_array();
|
|
|
|
$pdf->SetFont('Times', '', 12);
|
|
$pdf->SetY(110);
|
|
$pdf->SetX(23);
|
|
|
|
|
|
|
|
$columns = 1; //five columns
|
|
$pdf->SetStyle("t4","times","B",12,"0,0,0");
|
|
|
|
|
|
|
|
//we initialize the table class
|
|
$pdf->Table_Init($columns, true, true);
|
|
|
|
$table_subtype = $table_default_table_type;
|
|
$pdf->Set_Table_Type($table_subtype);
|
|
|
|
|
|
|
|
//TABLE DATA SETTINGS
|
|
$data_subtype = $table_default_data_type;
|
|
|
|
$data_type = Array();//reset the array
|
|
for ($i=0; $i<$columns; $i++) $data_type[$i] = $data_subtype;
|
|
|
|
$pdf->Set_Data_Type($data_type);
|
|
|
|
$ttxt[3] = "Sehr geehrte(r) $row[vorname] $row[nachname],\n\nfür die Zeit vom $row_v[beginn] bis $row_v[ende] werden Sie für den Besuch des praxisbegleitenden Unterrichts dem Standort <t4>$row_ort[bezeichnung]</t4> zugewiesen.\n\nSie erhalten von dem zuständigen PU-Leiter eine Einladung, in der Sie weitere Informationen zum Beginn des Unterrichts und zum Stundenplan finden.\n\nMit freundlichen Grüßen\n\n\n\n$row_ansp[name]";
|
|
|
|
$data[0]['TEXT'] = $ttxt[3];
|
|
$data[0]['T_SIZE'] = 12;
|
|
$data[0]['T_FONT'] = 'times';
|
|
|
|
#$data[0]['COLSPAN'] = 4;
|
|
$data[0]['T_ALIGN'] = "J";
|
|
$data[0]['LN_SIZE'] = 6;
|
|
|
|
|
|
|
|
|
|
$pdf->Draw_Data($data);
|
|
|
|
|
|
$pdf->Draw_Table_Border();
|
|
|
|
}// Ende While
|
|
|
|
|
|
$db = dbconnect();
|
|
$query = "SELECT uid, nachname, vorname, postrasse, poort, poplz, stg
|
|
FROM stud
|
|
WHERE stg='W' AND jahrgang='$jahrgang'
|
|
";
|
|
|
|
$result = $db->query ($query)
|
|
or die ("Cannot execute query");
|
|
|
|
while ($row = $result->fetch_array())
|
|
{
|
|
|
|
|
|
$pdf->addPage();
|
|
$pdf->useTemplate($tplidx,0,0,0);
|
|
|
|
|
|
$heute_format = date("d.m.Y", mktime(0, 0, 0, date("m"), date("d"), date("Y"))); // ISO-8601 Format wie in der Datenbank: Formatierung für Vergleiche erforderlich
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(56.7);
|
|
$pdf->SetX(117.9);
|
|
$pdf->MultiCell(47, 3, "Ludwigsburg,", 0, 'L');
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(56.7);
|
|
$pdf->SetX(136.1);
|
|
$pdf->MultiCell(47, 3, "$heute_format", 0, 'R');
|
|
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(60.9);
|
|
$pdf->SetX(117.9);
|
|
$pdf->MultiCell(47, 3, "Bearbeiter/in", 0, 'L');
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(60.9);
|
|
$pdf->SetX(136.1);
|
|
$pdf->MultiCell(47, 3, "$row_ansp[name]", 0, 'R');
|
|
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(65.1);
|
|
$pdf->SetX(117.9);
|
|
$pdf->MultiCell(47, 3, "Telefon", 0, 'L');
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(65.1);
|
|
$pdf->SetX(136.1);
|
|
$pdf->MultiCell(47, 3, "$row_kontakt[tel]", 0, 'R');
|
|
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(69.3);
|
|
$pdf->SetX(117.9);
|
|
$pdf->MultiCell(47, 3, "Fax", 0, 'L');
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(69.3);
|
|
$pdf->SetX(136.1);
|
|
$pdf->MultiCell(47, 3, "$row_kontakt[fax]", 0, 'R');
|
|
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(73.5);
|
|
$pdf->SetX(117.9);
|
|
$pdf->MultiCell(47, 3, "e-mail", 0, 'L');
|
|
|
|
$pdf->SetFont('Times', '', 10);
|
|
$pdf->SetY(73.5);
|
|
$pdf->SetX(136.1);
|
|
$pdf->MultiCell(47, 3, "$row_ansp[mail]", 0, 'R');
|
|
|
|
|
|
|
|
$pdf->SetFont('Times', '', 12);
|
|
$pdf->SetY(59.5);
|
|
$pdf->SetX(23);
|
|
$pdf->Cell(0, 3, "$row[vorname] $row[nachname]", 0, 0, 'L');
|
|
|
|
|
|
$pdf->SetFont('Times', '', 12);
|
|
$pdf->SetY(64.5);
|
|
$pdf->SetX(23);
|
|
$pdf->Cell(0, 3, "$row[postrasse]", 0, 0, 'L');
|
|
|
|
|
|
$pdf->SetFont('Times', 'B', 12);
|
|
$pdf->SetY(73.5);
|
|
$pdf->SetX(23);
|
|
$pdf->Cell(0, 3, "$row[poplz] $row[poort]", 0, 0, 'L');
|
|
|
|
|
|
|
|
|
|
|
|
$pdf->SetFont('Times', 'B', 12);
|
|
$pdf->SetY(91);
|
|
$pdf->SetX(23);
|
|
$pdf->MultiCell(0, 4.5, "Zuweisung zum praxisbegleitenden Unterricht", 0, 'L');
|
|
|
|
|
|
|
|
$pdf->SetFont('Times', '', 12);
|
|
$pdf->SetY(110);
|
|
$pdf->SetX(23);
|
|
|
|
|
|
|
|
$columns = 1; //five columns
|
|
$pdf->SetStyle("t4","times","B",12,"0,0,0");
|
|
|
|
|
|
|
|
//we initialize the table class
|
|
$pdf->Table_Init($columns, true, true);
|
|
|
|
$table_subtype = $table_default_table_type;
|
|
$pdf->Set_Table_Type($table_subtype);
|
|
|
|
|
|
|
|
//TABLE DATA SETTINGS
|
|
$data_subtype = $table_default_data_type;
|
|
|
|
$data_type = Array();//reset the array
|
|
for ($i=0; $i<$columns; $i++) $data_type[$i] = $data_subtype;
|
|
|
|
$pdf->Set_Data_Type($data_type);
|
|
|
|
$ttxt[3] = "Sehr geehrte(r) $row[vorname] $row[nachname],\n\nfür die Zeit vom $row_w[beginn] bis $row_w[ende] werden Sie für den Besuch des praxisbegleitenden Unterrichts der Fachhochschule Ludwigsburg zugewiesen.\n\nWeitere Informationen zum Stundenplan etc. erhalten Sie zu gegebener Zeit über die Homepage/das Intranet der FH. \n\nEinteilungswünsche bezüglich einer gemeinsamen AG sollten bis <t4>spätestens Mitte Januar $row_w[jahr]</t4> an das Studentensekretariat gerichtet werden (per Email).\n\nMit freundlichen Grüßen\n\n\n\n$row_ansp[name]";
|
|
|
|
$data[0]['TEXT'] = $ttxt[3];
|
|
$data[0]['T_SIZE'] = 12;
|
|
$data[0]['T_FONT'] = 'times';
|
|
|
|
#$data[0]['COLSPAN'] = 4;
|
|
$data[0]['T_ALIGN'] = "J";
|
|
$data[0]['LN_SIZE'] = 6;
|
|
|
|
|
|
|
|
|
|
$pdf->Draw_Data($data);
|
|
|
|
|
|
$pdf->Draw_Table_Border();
|
|
|
|
}// Ende While
|
|
|
|
$pdf->Output("Zuweisung_PU_$jahrgang.pdf","I");
|
|
$pdf->closeParsers();
|
|
?>
|