Files
FHC-Core/vilesci/personen/personendetails.php
T
Andreas Österreicher 0531b099c4 - Mail Klasse
- neue config Konstante MAIL_DEBUG
- Import hat jetzt einen Link zu den personendetails.php
- Bewerberstatistik kann per Parameter mail an tw_sek und tw_stgl versendet werden
- Neues Zeugnis 
- In der Reihungstestadministration kann der Stg des Dummys geändert werden.
2008-12-09 16:07:52 +00:00

262 lines
8.4 KiB
PHP

<?php
/* Copyright (C) 2007 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>,
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and
* Gerald Raab <gerald.raab@technikum-wien.at>.
*/
require_once('../config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/benutzerberechtigung.class.php');
require_once('../../include/studiengang.class.php');
require_once('../../include/preinteressent.class.php');
require_once('../../include/person.class.php');
require_once('../../include/prestudent.class.php');
require_once('../../include/datum.class.php');
require_once('../../include/kontakt.class.php');
require_once('../../include/adresse.class.php');
require_once('../../include/nation.class.php');
if(!$conn=pg_pconnect(CONN_STRING))
die("Konnte Verbindung zur Datenbank nicht herstellen");
$user = get_uid();
$rechte = new benutzerberechtigung($conn);
$rechte->getBerechtigungen($user);
$datum_obj = new datum();
$studiengang = new studiengang($conn);
$studiengang->getAll('typ, kurzbz', false);
echo '<html>
<head>
<title>PreInteressenten</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15">
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
<link rel="stylesheet" href="../../include/js/tablesort/table.css" type="text/css">
<script src="../../include/js/tablesort/table.js" type="text/javascript"></script>
</head>
<body class="Background_main">
';
if(!$rechte->isBerechtigt('admin') &&
!$rechte->isBerechtigt('preinteressent') &&
!$rechte->isBerechtigt('assistenz'))
die('Sie haben keine Berechtigung fuer diese Seite');
if(isset($_GET['id']) && is_numeric($_GET['id']))
$id = $_GET['id'];
else
die('der Parameter id mit der Person_id muss uebergeben werden');
$person = new person($conn);
if(!$person->load($id))
die('Person wurde nicht gefunden');
//PERSON
echo '<h2>Person</h2>';
echo "ID: $person->person_id<br>";
echo "Name: $person->titelpre $person->nachname $person->vorname $person->titelpost<br>";
echo "Geburtsdatum: ".$datum_obj->formatDatum($person->gebdatum,'d.m.Y')."<br>";
echo "Geschlecht: ".$person->geschlecht."<br>";
$kontakt = new kontakt($conn);
$kontakt->load_pers($person->person_id);
echo '<h3>Kontaktdaten</h3>';
echo '<table class="liste table-autosort:0 table-stripeclass:alternate table-autostripe">
<thead>
<tr>
<th>Typ</th>
<th>Kontakt</th>
<th>Zustellung</th>
<th>Anmerkung</th>
</tr>
</thead>
<tbody>';
foreach ($kontakt->result as $row)
{
echo '<tr>';
echo "<td>$row->kontakttyp</td>";
echo "<td>$row->kontakt</td>";
echo "<td>".($row->zustellung?'Ja':'Nein')."</td>";
echo "<td>$row->anmerkung</td>";
echo '<tr>';
}
echo '</tbody></table>';
//Nationen laden
$nation_arr = array();
$nation = new nation($conn);
$nation->getAll();
$nation_arr['']='';
foreach($nation->nation as $row)
$nation_arr[$row->code]=$row->kurztext;
$adresstyp_arr = array('h'=>'Hauptwohnsitz','n'=>'Nebenwohnsitz','f'=>'Firma');
// *** ADRESSEN ***
echo "<h3>Adressen:</h3>";
echo "<table class='liste'><tr><th>Strasse</th><th>Plz</th><th>Ort</th><th>Gemeinde</th><th>Nation</th><th>Typ</th><th>Heimat</th><th>Zustellung</th><th>Firma</th></tr>";
$adresse_obj = new adresse($conn);
$adresse_obj->load_pers($person->person_id);
foreach ($adresse_obj->result as $row)
{
echo '<tr class="liste1">';
echo "<td>$row->strasse</td>";
echo "<td>$row->plz</td>";
echo "<td>$row->ort</td>";
echo "<td>$row->gemeinde</td>";
echo "<td>".$nation_arr[$row->nation]."</td>";
echo "<td>".$adresstyp_arr[$row->typ]."</td>";
echo "<td>".($row->heimatadresse?'Ja':'Nein')."</td>";
echo "<td>".($row->zustelladresse?'Ja':'Nein')."</td>";
echo "<td>".($row->firma_id!=''?$firma_arr[$row->firma_id]:'')."</td>";
}
echo '</table>';
//PREINTERESSENT
function CutString($strVal, $limit)
{
if(strlen($strVal) > $limit+3)
{
return substr($strVal, 0, $limit) . "...";
}
else
{
return $strVal;
}
}
$preinteressent = new preinteressent($conn);
$preinteressent->getPreinteressenten($person->person_id);
if(count($preinteressent->result)>0)
{
echo '<br><h2>Preinteressent</h2>';
echo '<table class="liste table-autosort:0 table-stripeclass:alternate table-autostripe"><thead><tr><th>ID</th><th>Studiensemester</th><th>Erfassungsdatum</th><th>Anmerkung</th><th>Studiengänge</th></tr></thead><tbody>';
foreach ($preinteressent->result as $row)
{
echo '<tr>';
echo "<td>$row->preinteressent_id</td>";
echo "<td>$row->studiensemester_kurzbz</td>";
echo "<td>".$datum_obj->formatDatum($row->erfassungsdatum, 'd.m.Y')."</td>";
echo "<td title='".htmlentities($row->anmerkung,ENT_QUOTES)."'>".htmlentities(CutString($row->anmerkung, 50),ENT_QUOTES)."</td>";
echo '<td>';
$preinteressent1 = new preinteressent($conn);
$preinteressent1->loadZuordnungen($row->preinteressent_id);
$stgs='';
foreach ($preinteressent1->result as $row_zuordnung)
{
if($stgs!='')
$stgs.=', ';
$stgs.= $studiengang->kuerzel_arr[$row_zuordnung->studiengang_kz]."(".$preinteressent1->prioritaet_arr[$row_zuordnung->prioritaet].")";
}
echo $stgs;
echo '</td>';
echo '</tr>';
}
echo '</tbody></table>';
}
$prestudent = new prestudent($conn);
$prestudent->getPrestudenten($person->person_id);
if(count($prestudent->result)>0)
{
echo '<br><h2>Pre-/Studenten</h2>';
echo '<table class="liste table-autosort:0 table-stripeclass:alternate table-autostripe">
<thead>
<tr>
<th>ID</th>
<th>Studiengang</th>
<th>Reihungstest</th>
<th>UID</th>
<th>Gruppe</th>
<th>Status</th>
</tr>
</thead><tbody>';
foreach ($prestudent->result as $row)
{
echo '<tr>';
echo "<td>$row->prestudent_id</td>";
echo "<td>".$studiengang->kuerzel_arr[$row->studiengang_kz]."</td>";
echo "<td>".($row->reihungstestangetreten?'Ja':'Nein')."</td>";
$uid='';
$gruppe='';
$qry ="SELECT * FROM public.tbl_student WHERE prestudent_id='$row->prestudent_id'";
if($result = pg_query($conn, $qry))
{
if(pg_num_rows($result)>1)
{
$uid='ACHTUNG: Es gibt mehrere Studenteneinträge die auf diesen Prestudenten zeigen!';
}
else
{
if($row_std = pg_fetch_object($result))
{
$uid = $row_std->student_uid;
$gruppe = $row_std->semester.$row_std->verband.$row_std->gruppe;
}
}
}
echo "<td>$uid</td>";
echo "<td>$gruppe</td>";
$prestudent1 = new prestudent($conn);
$prestudent1->getLastStatus($row->prestudent_id);
echo "<td>$prestudent1->rolle_kurzbz ".($prestudent1->ausbildungssemester!=''?"($prestudent1->ausbildungssemester. Semester)":'')."</td>";
echo '</tr>';
}
echo '</tbody></table>';
}
$qry = "SELECT * FROM campus.vw_mitarbeiter WHERE person_id='$person->person_id'";
if($result = pg_query($conn, $qry))
{
if(pg_num_rows($result)>0)
{
echo '<br><h2>Mitarbeiter</h2>';
echo '<table class="liste table-autosort:0 table-stripeclass:alternate table-autostripe">
<thead>
<tr>
<th>UID</th>
<th>Kurzbz</th>
<th>Lektor</th>
<th>Fixangestellt</th>
<th>Telefonklappe</th>
</tr>
</thead><tbody>';
while($row = pg_fetch_object($result))
{
echo "<tr>";
echo "<td>$row->uid</td>";
echo "<td>$row->kurzbz</td>";
echo "<td>".($row->lektor=='t'?'Ja':'Nein')."</td>";
echo "<td>".($row->fixangestellt=='t'?'Ja':'Nein')."</td>";
echo "<td>$row->telefonklappe</td>";
echo "</tr>";
}
echo '</tbody></table>';
}
}
echo '</body>';
echo '</html>';
?>