mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+192
-192
@@ -1,193 +1,193 @@
|
||||
<?php
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/studiensemester.class.php');
|
||||
require_once('../../../include/lehrveranstaltung.class.php');
|
||||
require_once('../../../include/feedback.class.php');
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$conn = pg_pconnect(CONN_STRING))
|
||||
die('Fehler beim oeffnen der Datenbankverbindung');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
if(check_lektor($user, $conn))
|
||||
$is_lector=true;
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body id="inhalt">
|
||||
<?php
|
||||
if(!isset($_GET['lvid']) || !is_numeric($_GET['lvid']))
|
||||
die('Fehler bei der Uebergabe der Parameter');
|
||||
$lvid = $_GET['lvid'];
|
||||
$stsem_obj = new studiensemester($conn);
|
||||
$stsem = $stsem_obj->getaktorNext();
|
||||
if(isset($POST["feedback_message"]))
|
||||
$feedback_message=$POST["feedback_message"];
|
||||
|
||||
// if(isset($feedback_message))
|
||||
// echo $feedback_message;
|
||||
|
||||
?>
|
||||
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<?php
|
||||
echo '<form accept-charset="UTF-8" method="POST" action="feedback.php?lvid='.$lvid.'" enctype="multipart/form-data">';
|
||||
?>
|
||||
<td width="97%">
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<?php
|
||||
$lv_obj = new lehrveranstaltung($conn);
|
||||
if($lv_obj->load($lvid))
|
||||
{
|
||||
$short_name = $lv_obj->bezeichnung;
|
||||
}
|
||||
else
|
||||
die($lv_obj->errormsg);
|
||||
?>
|
||||
<td class='ContentHeader'><font class='ContentHeader'> <?php echo $short_name; ?> - Feedback
|
||||
an:
|
||||
<?php
|
||||
$qry = "SELECT studiensemester_kurzbz FROM lehre.tbl_lehreinheit JOIN public.tbl_studiensemester USING(studiensemester_kurzbz) WHERE lehrveranstaltung_id='$lvid' ORDER BY ende DESC LIMIT 1";
|
||||
$result = pg_query($conn, $qry);
|
||||
$row = pg_fetch_object($result);
|
||||
$qry = "SELECT distinct vorname, nachname, uid FROM campus.vw_mitarbeiter, lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter WHERE uid=mitarbeiter_uid AND tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND lehrveranstaltung_id='$lvid' AND studiensemester_kurzbz='$row->studiensemester_kurzbz'";
|
||||
if(!$result=pg_query($conn, $qry))
|
||||
die('Fehler beim Auslesen der Lektoren');
|
||||
$rows = pg_num_rows($result);
|
||||
$i=0;
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
echo $row->vorname.' '.$row->nachname;
|
||||
$i++;
|
||||
if($i<$rows)
|
||||
echo ', ';
|
||||
}
|
||||
?>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<p><b>Betreff: </b>
|
||||
<?php
|
||||
if(isset($edit_id) && $edit_id != "" && !isset($edit_break))
|
||||
{
|
||||
$fb_obj = new feedback($conn);
|
||||
if($fb_obj->load($edit_id))
|
||||
{
|
||||
echo '<input type="text" name="feedback_subject" value="'.$fb_obj->betreff.'" size="54"><br>';
|
||||
echo '<textarea rows="7" name="feedback_message" cols="47">'.$fb_obj->text.'</textarea><br>';
|
||||
echo '<input type="submit" value="Ändern" name="edit_feedback"> ';
|
||||
echo '<input type="submit" value="Abbrechen" name="edit_break">';
|
||||
}
|
||||
else
|
||||
echo $fb_obj->errormsg.'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<input type="text" name="feedback_subject" size="54"><br>';
|
||||
echo '<textarea rows="7" name="feedback_message" cols="47"></textarea><br>';
|
||||
echo '<input type="submit" value="Abschicken" name="send_feedback">';
|
||||
}
|
||||
?>
|
||||
|
||||
<input type="reset" value="Zurücksetzen" name="reset_message">
|
||||
</p>
|
||||
<?php
|
||||
if(isset($feedback_message) && $feedback_message != "")
|
||||
{
|
||||
if(isset($edit_feedback))
|
||||
{
|
||||
$fb_obj = new feedback($conn);
|
||||
$fb_obj->betreff = htmlentities($feedback_subject);
|
||||
$fb_obj->text = htmlentities($feedback_message);
|
||||
$fb_obj->feedback_id = $edit_id;
|
||||
$fb_obj->datum = date('Y-m-d');
|
||||
$fb_obj->uid = $user;
|
||||
$fb_obj->lehrveranstaltung_id = $lvid;
|
||||
$fb_obj->new = false;
|
||||
|
||||
if($fb_obj->save())
|
||||
echo "<script language=\"JavaScript\">document.location = document.location + \"&message_sent=true\"</script>";
|
||||
else
|
||||
echo $fb_obj->errormsg."<br>";
|
||||
}
|
||||
|
||||
if(!isset($edit_id) && !isset($edit_break) && !isset($edit_feedback))
|
||||
{
|
||||
$fb_obj = new feedback($conn);
|
||||
$fb_obj->betreff = htmlentities($feedback_subject);
|
||||
$fb_obj->text = htmlentities($feedback_message);
|
||||
$fb_obj->datum = date('Y-m-d');
|
||||
$fb_obj->uid = $user;
|
||||
$fb_obj->lehrveranstaltung_id = $lvid;
|
||||
$fb_obj->new = true;
|
||||
|
||||
if($fb_obj->save())
|
||||
echo "<script language=\"JavaScript\">document.location = document.location + \"&message_sent=true\"</script>";
|
||||
else
|
||||
echo $fb_obj->errormsg." save<br>";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($message_sent) && $message_sent == true)
|
||||
{
|
||||
echo 'Die Nachricht wurde erfolgreich eingetragen.<br><br><br>';
|
||||
}
|
||||
|
||||
$fb_obj = new feedback($conn);
|
||||
if($fb_obj->load_feedback($lvid))
|
||||
{
|
||||
echo '<table class="tabcontent">';
|
||||
|
||||
foreach($fb_obj->result as $row)
|
||||
{
|
||||
$sql_query = "SELECT vorname, nachname FROM campus.vw_benutzer WHERE uid='$row->uid'";
|
||||
|
||||
if($result_person = pg_query($conn, $sql_query))
|
||||
{
|
||||
if($row_pers=pg_fetch_object($result_person))
|
||||
{
|
||||
|
||||
echo '<tr>';
|
||||
echo ' <td class="ContentHeader" width="90%"><font class="ContentHeader"><strong> '.$row->betreff.'</font></td>';
|
||||
//echo ' <td class="ContentHeader" width="30%"><font class="ContentHeader"> </font></td>'; //'.$row_pers->vorname.' '.$row_pers->nachname.'
|
||||
echo ' <td class="ContentHeader" align="right"><font class="ContentHeader">'.$row->datum.'</font></td>';
|
||||
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo ' <td class="MarkLine" colspan=2>'.nl2br($row->text).'</td>';
|
||||
//echo ' <td class="MarkLine"> </td>';
|
||||
//echo ' <td class="MarkLine" colspan=2> </td>';
|
||||
//echo ' <td class="MarkLine"> </td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo ' <td> </td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '</table>';
|
||||
}
|
||||
else
|
||||
echo 'Fehler beim laden der Daten '.$fb_obj->errormsg;
|
||||
?>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
<?php
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/studiensemester.class.php');
|
||||
require_once('../../../include/lehrveranstaltung.class.php');
|
||||
require_once('../../../include/feedback.class.php');
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$conn = pg_pconnect(CONN_STRING))
|
||||
die('Fehler beim oeffnen der Datenbankverbindung');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
if(check_lektor($user, $conn))
|
||||
$is_lector=true;
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body id="inhalt">
|
||||
<?php
|
||||
if(!isset($_GET['lvid']) || !is_numeric($_GET['lvid']))
|
||||
die('Fehler bei der Uebergabe der Parameter');
|
||||
$lvid = $_GET['lvid'];
|
||||
$stsem_obj = new studiensemester($conn);
|
||||
$stsem = $stsem_obj->getaktorNext();
|
||||
if(isset($POST["feedback_message"]))
|
||||
$feedback_message=$POST["feedback_message"];
|
||||
|
||||
// if(isset($feedback_message))
|
||||
// echo $feedback_message;
|
||||
|
||||
?>
|
||||
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<td width="3%"> </td>
|
||||
<?php
|
||||
echo '<form accept-charset="UTF-8" method="POST" action="feedback.php?lvid='.$lvid.'" enctype="multipart/form-data">';
|
||||
?>
|
||||
<td width="97%">
|
||||
<table class="tabcontent">
|
||||
<tr>
|
||||
<?php
|
||||
$lv_obj = new lehrveranstaltung($conn);
|
||||
if($lv_obj->load($lvid))
|
||||
{
|
||||
$short_name = $lv_obj->bezeichnung;
|
||||
}
|
||||
else
|
||||
die($lv_obj->errormsg);
|
||||
?>
|
||||
<td class='ContentHeader'><font class='ContentHeader'> <?php echo $short_name; ?> - Feedback
|
||||
an:
|
||||
<?php
|
||||
$qry = "SELECT studiensemester_kurzbz FROM lehre.tbl_lehreinheit JOIN public.tbl_studiensemester USING(studiensemester_kurzbz) WHERE lehrveranstaltung_id='$lvid' ORDER BY ende DESC LIMIT 1";
|
||||
$result = pg_query($conn, $qry);
|
||||
$row = pg_fetch_object($result);
|
||||
$qry = "SELECT distinct vorname, nachname, uid FROM campus.vw_mitarbeiter, lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter WHERE uid=mitarbeiter_uid AND tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND lehrveranstaltung_id='$lvid' AND studiensemester_kurzbz='$row->studiensemester_kurzbz'";
|
||||
if(!$result=pg_query($conn, $qry))
|
||||
die('Fehler beim Auslesen der Lektoren');
|
||||
$rows = pg_num_rows($result);
|
||||
$i=0;
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
echo $row->vorname.' '.$row->nachname;
|
||||
$i++;
|
||||
if($i<$rows)
|
||||
echo ', ';
|
||||
}
|
||||
?>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<p><b>Betreff: </b>
|
||||
<?php
|
||||
if(isset($edit_id) && $edit_id != "" && !isset($edit_break))
|
||||
{
|
||||
$fb_obj = new feedback($conn);
|
||||
if($fb_obj->load($edit_id))
|
||||
{
|
||||
echo '<input type="text" name="feedback_subject" value="'.$fb_obj->betreff.'" size="54"><br>';
|
||||
echo '<textarea rows="7" name="feedback_message" cols="47">'.$fb_obj->text.'</textarea><br>';
|
||||
echo '<input type="submit" value="Ändern" name="edit_feedback"> ';
|
||||
echo '<input type="submit" value="Abbrechen" name="edit_break">';
|
||||
}
|
||||
else
|
||||
echo $fb_obj->errormsg.'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<input type="text" name="feedback_subject" size="54"><br>';
|
||||
echo '<textarea rows="7" name="feedback_message" cols="47"></textarea><br>';
|
||||
echo '<input type="submit" value="Abschicken" name="send_feedback">';
|
||||
}
|
||||
?>
|
||||
|
||||
<input type="reset" value="Zurücksetzen" name="reset_message">
|
||||
</p>
|
||||
<?php
|
||||
if(isset($feedback_message) && $feedback_message != "")
|
||||
{
|
||||
if(isset($edit_feedback))
|
||||
{
|
||||
$fb_obj = new feedback($conn);
|
||||
$fb_obj->betreff = $feedback_subject;
|
||||
$fb_obj->text = $feedback_message;
|
||||
$fb_obj->feedback_id = $edit_id;
|
||||
$fb_obj->datum = date('Y-m-d');
|
||||
$fb_obj->uid = $user;
|
||||
$fb_obj->lehrveranstaltung_id = $lvid;
|
||||
$fb_obj->new = false;
|
||||
|
||||
if($fb_obj->save())
|
||||
echo "<script language=\"JavaScript\">document.location = document.location + \"&message_sent=true\"</script>";
|
||||
else
|
||||
echo $fb_obj->errormsg."<br>";
|
||||
}
|
||||
|
||||
if(!isset($edit_id) && !isset($edit_break) && !isset($edit_feedback))
|
||||
{
|
||||
$fb_obj = new feedback($conn);
|
||||
$fb_obj->betreff = $feedback_subject;
|
||||
$fb_obj->text = $feedback_message;
|
||||
$fb_obj->datum = date('Y-m-d');
|
||||
$fb_obj->uid = $user;
|
||||
$fb_obj->lehrveranstaltung_id = $lvid;
|
||||
$fb_obj->new = true;
|
||||
|
||||
if($fb_obj->save())
|
||||
echo "<script language=\"JavaScript\">document.location = document.location + \"&message_sent=true\"</script>";
|
||||
else
|
||||
echo $fb_obj->errormsg." save<br>";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($message_sent) && $message_sent == true)
|
||||
{
|
||||
echo 'Die Nachricht wurde erfolgreich eingetragen.<br><br><br>';
|
||||
}
|
||||
|
||||
$fb_obj = new feedback($conn);
|
||||
if($fb_obj->load_feedback($lvid))
|
||||
{
|
||||
echo '<table class="tabcontent">';
|
||||
|
||||
foreach($fb_obj->result as $row)
|
||||
{
|
||||
$sql_query = "SELECT vorname, nachname FROM campus.vw_benutzer WHERE uid='$row->uid'";
|
||||
|
||||
if($result_person = pg_query($conn, $sql_query))
|
||||
{
|
||||
if($row_pers=pg_fetch_object($result_person))
|
||||
{
|
||||
|
||||
echo '<tr>';
|
||||
echo ' <td class="ContentHeader" width="90%"><font class="ContentHeader"><strong> '.$row->betreff.'</font></td>';
|
||||
//echo ' <td class="ContentHeader" width="30%"><font class="ContentHeader"> </font></td>'; //'.$row_pers->vorname.' '.$row_pers->nachname.'
|
||||
echo ' <td class="ContentHeader" align="right"><font class="ContentHeader">'.$row->datum.'</font></td>';
|
||||
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo ' <td class="MarkLine" colspan=2>'.nl2br($row->text).'</td>';
|
||||
//echo ' <td class="MarkLine"> </td>';
|
||||
//echo ' <td class="MarkLine" colspan=2> </td>';
|
||||
//echo ' <td class="MarkLine"> </td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo ' <td> </td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '</table>';
|
||||
}
|
||||
else
|
||||
echo 'Fehler beim laden der Daten '.$fb_obj->errormsg;
|
||||
?>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+181
-181
@@ -1,182 +1,182 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009 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 Simane-Sequens <gerald.simane-sequens@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Seite zum Editieren von Testtool-Gebieten
|
||||
*/
|
||||
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/gebiet.class.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
|
||||
if(!$conn = pg_pconnect(CONN_STRING))
|
||||
die('Fehler beim Connecten zur DB');
|
||||
|
||||
$user = get_uid();
|
||||
$rechte = new benutzerberechtigung($conn);
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
echo '
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
';
|
||||
|
||||
if(isset($_GET['gebiet_id']))
|
||||
$gebiet_id=$_GET['gebiet_id'];
|
||||
else
|
||||
$gebiet_id='';
|
||||
|
||||
|
||||
echo '<h1> Gebiet bearbeiten</h1>';
|
||||
|
||||
if(!$rechte->isBerechtigt('admin'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
$gebiet = new gebiet($conn);
|
||||
$gebiet->getAll();
|
||||
|
||||
echo '<a href="index.php?gebiet_id='.$gebiet_id.'" class="Item">Zurück zur Admin Seite</a><br /><br />';
|
||||
|
||||
//Liste der Gebiete anzeigen
|
||||
echo '<form id="gebiet_form" action="'.$_SERVER['PHP_SELF'].'" method="GET">';
|
||||
echo 'Gebiet: <SELECT name="gebiet_id" onchange="document.getElementById(\'gebiet_form\').submit();">';
|
||||
|
||||
foreach ($gebiet->result as $row)
|
||||
{
|
||||
if($gebiet_id=='')
|
||||
$gebiet_id=$row->gebiet_id;
|
||||
|
||||
if($gebiet_id==$row->gebiet_id)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo '<OPTION value="'.$row->gebiet_id.'" '.$selected.'>'.$row->bezeichnung.'</OPTION>';
|
||||
}
|
||||
echo '</SELECT>
|
||||
<input type="submit" value="Bearbeiten">
|
||||
</form>';
|
||||
|
||||
echo '<br /><br />';
|
||||
|
||||
//Speichern der Daten
|
||||
if(isset($_POST['speichern']))
|
||||
{
|
||||
$gebiet = new gebiet($conn);
|
||||
if($gebiet->load($gebiet_id))
|
||||
{
|
||||
$gebiet->kurzbz = $_POST['kurzbz'];
|
||||
$gebiet->bezeichnung = $_POST['bezeichnung'];
|
||||
$gebiet->beschreibung = $_POST['beschreibung'];
|
||||
$gebiet->zeit = $_POST['zeit'];
|
||||
$gebiet->multipleresponse = isset($_POST['multipleresponse']);
|
||||
$gebiet->kategorien = isset($_POST['kategorien']);
|
||||
$gebiet->zufallfrage = isset($_POST['zufallfrage']);
|
||||
$gebiet->zufallvorschlag = isset($_POST['zufallvorschlag']);
|
||||
$gebiet->levelgleichverteilung = isset($_POST['levelgleichverteilung']);
|
||||
$gebiet->maxpunkte = $_POST['maxpunkte'];
|
||||
$gebiet->maxfragen = $_POST['maxfragen'];
|
||||
$gebiet->level_start = $_POST['level_start'];
|
||||
$gebiet->level_sprung_auf = $_POST['level_sprung_auf'];
|
||||
$gebiet->level_sprung_ab = $_POST['level_sprung_ab'];
|
||||
$gebiet->updateamum = date('Y-m-d H:i:s');
|
||||
$gebiet->updatevon = $user;
|
||||
$gebiet->antwortenprozeile = $_POST['antwortenprozeile'];
|
||||
|
||||
if($gebiet->save(false))
|
||||
{
|
||||
echo 'Daten erfolgreich gespeichert';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">Fehler beim Speichern: '.$gebiet->errormsg.'</span>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">Fehler beim Laden des Gebiets</span>';
|
||||
}
|
||||
}
|
||||
|
||||
if($gebiet_id!='')
|
||||
{
|
||||
$gebiet = new gebiet($conn, $gebiet_id);
|
||||
|
||||
echo "<hr />";
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'?gebiet_id='.$gebiet_id.'" method="POST">';
|
||||
echo '<table>';
|
||||
|
||||
echo '<tr>';
|
||||
//Kurzbz
|
||||
echo '<td>Kurzbz</td><td><input type="text" maxlength="10" size="10" name="kurzbz" value="'.htmlentities($gebiet->kurzbz).'"></td>';
|
||||
echo '</tr><tr>';
|
||||
//Bezeichnung
|
||||
echo '<td>Bezeichnung</td><td><input type="text" maxlength="50" name="bezeichnung" value="'.htmlentities($gebiet->bezeichnung).'"></td>';
|
||||
echo '</tr><tr>';
|
||||
//Beschreibung
|
||||
echo '<td>Beschreibung</td><td><textarea name="beschreibung">'.htmlentities($gebiet->beschreibung).'</textarea></td>';
|
||||
echo '</tr><tr>';
|
||||
//Zeit
|
||||
echo '<td>Zeit</td><td><input type="text" name="zeit" size="8" maxlength="8" value="'.htmlentities($gebiet->zeit).'"> hh:mm:ss</td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Multiple Response</td><td><input type="checkbox" name="multipleresponse" '.($gebiet->multipleresponse?'checked="checked"':'').'></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Kategorien</td><td><input type="checkbox" name="kategorien" '.($gebiet->kategorien?'checked="checked"':'').'></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Zufällige Fragereihenfolge</td><td><input type="checkbox" name="zufallfrage" '.($gebiet->zufallfrage?'checked="checked"':'').'></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Zufällige Vorschlagreihenfolge</td><td><input type="checkbox" name="zufallvorschlag" '.($gebiet->zufallvorschlag?'checked="checked"':'').'></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Levelgleichverteilung</td><td><input type="checkbox" name="levelgleichverteilung" '.($gebiet->levelgleichverteilung?'checked="checked"':'').'></td>';
|
||||
echo '</tr><tr>';
|
||||
// empfohlene maximalpunkte berechnen und anzeigen
|
||||
$maximalpunkte = $gebiet->berechneMaximalpunkte($gebiet_id);
|
||||
if($gebiet->maxpunkte!=$maximalpunkte)
|
||||
$hinweis = '<span class="error">empfohlene Maximalpunkteanzahl: '.$maximalpunkte.'</span>';
|
||||
else
|
||||
$hinweis ='';
|
||||
echo '<td>Maximale Punkteanzahl</td><td><input type="text" size="5" maxlength="5" name="maxpunkte" value="'.htmlentities($gebiet->maxpunkte).'">'.$hinweis.'</td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Maximale Fragenanzahl</td><td><input type="text" size="5" maxlength="5" name="maxfragen" value="'.htmlentities($gebiet->maxfragen).'"></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Antworten pro Zeile</td><td><input type="text" size="5" maxlength="5" name="antwortenprozeile" value="'.htmlentities($gebiet->antwortenprozeile).'"></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Start Level</td><td><input type="text" size="5" maxlength="5" name="level_start" value="'.htmlentities($gebiet->level_start).'"></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Richtige Fragen bis Levelaufstieg</td><td><input type="text" size="5" maxlength="5" name="level_sprung_auf" value="'.htmlentities($gebiet->level_sprung_auf).'"></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Falsche Fragen bis Levelabstieg</td><td><input type="text" size="5" maxlength="5" name="level_sprung_ab" value="'.htmlentities($gebiet->level_sprung_ab).'"></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td></td><td><input type="submit" name="speichern" value="Speichern"></td>';
|
||||
echo '</tr></table>';
|
||||
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
echo '</body></html>';
|
||||
<?php
|
||||
/* Copyright (C) 2009 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 Simane-Sequens <gerald.simane-sequens@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Seite zum Editieren von Testtool-Gebieten
|
||||
*/
|
||||
|
||||
require_once('../../config.inc.php');
|
||||
require_once('../../../include/functions.inc.php');
|
||||
require_once('../../../include/gebiet.class.php');
|
||||
require_once('../../../include/benutzerberechtigung.class.php');
|
||||
|
||||
if(!$conn = pg_pconnect(CONN_STRING))
|
||||
die('Fehler beim Connecten zur DB');
|
||||
|
||||
$user = get_uid();
|
||||
$rechte = new benutzerberechtigung($conn);
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
echo '
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
';
|
||||
|
||||
if(isset($_GET['gebiet_id']))
|
||||
$gebiet_id=$_GET['gebiet_id'];
|
||||
else
|
||||
$gebiet_id='';
|
||||
|
||||
|
||||
echo '<h1> Gebiet bearbeiten</h1>';
|
||||
|
||||
if(!$rechte->isBerechtigt('admin'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
$gebiet = new gebiet($conn);
|
||||
$gebiet->getAll();
|
||||
|
||||
echo '<a href="index.php?gebiet_id='.$gebiet_id.'" class="Item">Zurück zur Admin Seite</a><br /><br />';
|
||||
|
||||
//Liste der Gebiete anzeigen
|
||||
echo '<form id="gebiet_form" action="'.$_SERVER['PHP_SELF'].'" method="GET">';
|
||||
echo 'Gebiet: <SELECT name="gebiet_id" onchange="document.getElementById(\'gebiet_form\').submit();">';
|
||||
|
||||
foreach ($gebiet->result as $row)
|
||||
{
|
||||
if($gebiet_id=='')
|
||||
$gebiet_id=$row->gebiet_id;
|
||||
|
||||
if($gebiet_id==$row->gebiet_id)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo '<OPTION value="'.$row->gebiet_id.'" '.$selected.'>'.$row->bezeichnung.'</OPTION>';
|
||||
}
|
||||
echo '</SELECT>
|
||||
<input type="submit" value="Bearbeiten">
|
||||
</form>';
|
||||
|
||||
echo '<br /><br />';
|
||||
|
||||
//Speichern der Daten
|
||||
if(isset($_POST['speichern']))
|
||||
{
|
||||
$gebiet = new gebiet($conn);
|
||||
if($gebiet->load($gebiet_id))
|
||||
{
|
||||
$gebiet->kurzbz = $_POST['kurzbz'];
|
||||
$gebiet->bezeichnung = $_POST['bezeichnung'];
|
||||
$gebiet->beschreibung = $_POST['beschreibung'];
|
||||
$gebiet->zeit = $_POST['zeit'];
|
||||
$gebiet->multipleresponse = isset($_POST['multipleresponse']);
|
||||
$gebiet->kategorien = isset($_POST['kategorien']);
|
||||
$gebiet->zufallfrage = isset($_POST['zufallfrage']);
|
||||
$gebiet->zufallvorschlag = isset($_POST['zufallvorschlag']);
|
||||
$gebiet->levelgleichverteilung = isset($_POST['levelgleichverteilung']);
|
||||
$gebiet->maxpunkte = $_POST['maxpunkte'];
|
||||
$gebiet->maxfragen = $_POST['maxfragen'];
|
||||
$gebiet->level_start = $_POST['level_start'];
|
||||
$gebiet->level_sprung_auf = $_POST['level_sprung_auf'];
|
||||
$gebiet->level_sprung_ab = $_POST['level_sprung_ab'];
|
||||
$gebiet->updateamum = date('Y-m-d H:i:s');
|
||||
$gebiet->updatevon = $user;
|
||||
$gebiet->antwortenprozeile = $_POST['antwortenprozeile'];
|
||||
|
||||
if($gebiet->save(false))
|
||||
{
|
||||
echo 'Daten erfolgreich gespeichert';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">Fehler beim Speichern: '.$gebiet->errormsg.'</span>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">Fehler beim Laden des Gebiets</span>';
|
||||
}
|
||||
}
|
||||
|
||||
if($gebiet_id!='')
|
||||
{
|
||||
$gebiet = new gebiet($conn, $gebiet_id);
|
||||
|
||||
echo "<hr />";
|
||||
echo '<form accept-charset="UTF-8" action="'.$_SERVER['PHP_SELF'].'?gebiet_id='.$gebiet_id.'" method="POST">';
|
||||
echo '<table>';
|
||||
|
||||
echo '<tr>';
|
||||
//Kurzbz
|
||||
echo '<td>Kurzbz</td><td><input type="text" maxlength="10" size="10" name="kurzbz" value="'.$gebiet->kurzbz.'"></td>';
|
||||
echo '</tr><tr>';
|
||||
//Bezeichnung
|
||||
echo '<td>Bezeichnung</td><td><input type="text" maxlength="50" name="bezeichnung" value="'.$gebiet->bezeichnung.'"></td>';
|
||||
echo '</tr><tr>';
|
||||
//Beschreibung
|
||||
echo '<td>Beschreibung</td><td><textarea name="beschreibung">'.$gebiet->beschreibung.'</textarea></td>';
|
||||
echo '</tr><tr>';
|
||||
//Zeit
|
||||
echo '<td>Zeit</td><td><input type="text" name="zeit" size="8" maxlength="8" value="'.$gebiet->zeit.'"> hh:mm:ss</td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Multiple Response</td><td><input type="checkbox" name="multipleresponse" '.($gebiet->multipleresponse?'checked="checked"':'').'></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Kategorien</td><td><input type="checkbox" name="kategorien" '.($gebiet->kategorien?'checked="checked"':'').'></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Zufällige Fragereihenfolge</td><td><input type="checkbox" name="zufallfrage" '.($gebiet->zufallfrage?'checked="checked"':'').'></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Zufällige Vorschlagreihenfolge</td><td><input type="checkbox" name="zufallvorschlag" '.($gebiet->zufallvorschlag?'checked="checked"':'').'></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Levelgleichverteilung</td><td><input type="checkbox" name="levelgleichverteilung" '.($gebiet->levelgleichverteilung?'checked="checked"':'').'></td>';
|
||||
echo '</tr><tr>';
|
||||
// empfohlene maximalpunkte berechnen und anzeigen
|
||||
$maximalpunkte = $gebiet->berechneMaximalpunkte($gebiet_id);
|
||||
if($gebiet->maxpunkte!=$maximalpunkte)
|
||||
$hinweis = '<span class="error">empfohlene Maximalpunkteanzahl: '.$maximalpunkte.'</span>';
|
||||
else
|
||||
$hinweis ='';
|
||||
echo '<td>Maximale Punkteanzahl</td><td><input type="text" size="5" maxlength="5" name="maxpunkte" value="'.$gebiet->maxpunkte.'">'.$hinweis.'</td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Maximale Fragenanzahl</td><td><input type="text" size="5" maxlength="5" name="maxfragen" value="'.$gebiet->maxfragen.'"></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Antworten pro Zeile</td><td><input type="text" size="5" maxlength="5" name="antwortenprozeile" value="'.$gebiet->antwortenprozeile.'"></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Start Level</td><td><input type="text" size="5" maxlength="5" name="level_start" value="'.$gebiet->level_start.'"></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Richtige Fragen bis Levelaufstieg</td><td><input type="text" size="5" maxlength="5" name="level_sprung_auf" value="'.$gebiet->level_sprung_auf.'"></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td>Falsche Fragen bis Levelabstieg</td><td><input type="text" size="5" maxlength="5" name="level_sprung_ab" value="'.$gebiet->level_sprung_ab.'"></td>';
|
||||
echo '</tr><tr>';
|
||||
echo '<td></td><td><input type="submit" name="speichern" value="Speichern"></td>';
|
||||
echo '</tr></table>';
|
||||
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
echo '</body></html>';
|
||||
?>
|
||||
+272
-272
@@ -1,272 +1,272 @@
|
||||
<?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/person.class.php');
|
||||
require_once('../../include/prestudent.class.php');
|
||||
require_once('../../include/pruefling.class.php');
|
||||
require_once('../../include/studiengang.class.php');
|
||||
|
||||
session_start();
|
||||
$reload=false;
|
||||
$reload_parent=false;
|
||||
|
||||
if (isset($_GET['logout']))
|
||||
{
|
||||
if(isset($_SESSION['prestudent_id']))
|
||||
{
|
||||
$reload = true;
|
||||
session_destroy();
|
||||
}
|
||||
}
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$db_conn = pg_pconnect(CONN_STRING))
|
||||
die('Fehler beim Oeffnen der Datenbankverbindung');
|
||||
|
||||
if(isset($_POST['tag']) && isset($_POST['monat']) && isset($_POST['jahr']))
|
||||
{
|
||||
if($_POST['tag']!='' && $_POST['monat']!='' && $_POST['jahr']!='')
|
||||
$gebdatum = $_POST['jahr'].'-'.$_POST['monat'].'-'.$_POST['tag'];
|
||||
else
|
||||
$gebdatum='';
|
||||
}
|
||||
|
||||
if (isset($_POST['prestudent']) && isset($gebdatum))
|
||||
{
|
||||
$ps=new prestudent($db_conn,$_POST['prestudent']);
|
||||
if ($gebdatum==$ps->gebdatum)
|
||||
{
|
||||
$pruefling = new pruefling($db_conn);
|
||||
if($pruefling->getPruefling($ps->prestudent_id))
|
||||
{
|
||||
$studiengang = $pruefling->studiengang_kz;
|
||||
$semester = $pruefling->semester;
|
||||
}
|
||||
else
|
||||
{
|
||||
$studiengang = $ps->studiengang_kz;
|
||||
$ps->getLastStatus($ps->prestudent_id);
|
||||
$semester = $ps->ausbildungssemester;
|
||||
}
|
||||
if($semester=='')
|
||||
$semester=1;
|
||||
|
||||
$_SESSION['prestudent_id']=$_POST['prestudent'];
|
||||
$_SESSION['studiengang_kz']=$studiengang;
|
||||
$_SESSION['nachname']=$ps->nachname;
|
||||
$_SESSION['vorname']=$ps->vorname;
|
||||
$_SESSION['gebdatum']=$ps->gebdatum;
|
||||
$stg_obj = new studiengang($db_conn, $studiengang);
|
||||
$_SESSION['sprache']=$stg_obj->sprache;
|
||||
|
||||
$_SESSION['semester']=$semester;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">Ihr Geburtsdatum stimmt nicht mit unseren Daten überein</span>';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_SESSION['prestudent_id']))
|
||||
$prestudent_id=$_SESSION['prestudent_id'];
|
||||
else
|
||||
{
|
||||
//$prestudent_id=null;
|
||||
$ps=new prestudent($db_conn);
|
||||
$datum=date('Y-m-d');
|
||||
$ps->getPrestudentRT($datum,true);
|
||||
if ($ps->num_rows==0)
|
||||
$ps->getPrestudentRT($datum);
|
||||
}
|
||||
|
||||
if(isset($_GET['type']) && $_GET['type']=='sprachechange' && isset($_GET['sprache']))
|
||||
{
|
||||
$_SESSION['sprache']=$_GET['sprache'];
|
||||
}
|
||||
|
||||
if(isset($_SESSION['prestudent_id']) && !isset($_SESSION['pruefling_id']))
|
||||
{
|
||||
$pruefling = new pruefling($db_conn);
|
||||
|
||||
if(!$pruefling->getPruefling($_SESSION['prestudent_id']))
|
||||
{
|
||||
$pruefling->new = true;
|
||||
|
||||
$pruefling->studiengang_kz = $_SESSION['studiengang_kz'];
|
||||
$pruefling->semester = $_SESSION['semester'];
|
||||
|
||||
$pruefling->idnachweis = '';
|
||||
$pruefling->registriert = date('Y-m-d H:i:s');
|
||||
$pruefling->prestudent_id = $_SESSION['prestudent_id'];
|
||||
if($pruefling->save())
|
||||
{
|
||||
$_SESSION['pruefling_id']=$pruefling->pruefling_id;
|
||||
$reload_parent=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['save']) && isset($_SESSION['prestudent_id']))
|
||||
{
|
||||
$pruefling = new pruefling($db_conn);
|
||||
if($_POST['pruefling_id']!='')
|
||||
if(!$pruefling->load($_POST['pruefling_id']))
|
||||
die('Pruefling wurde nicht gefunden');
|
||||
else
|
||||
$pruefling->new=false;
|
||||
else
|
||||
$pruefling->new=true;
|
||||
|
||||
$pruefling->studiengang_kz = $_SESSION['studiengang_kz'];
|
||||
$pruefling->idnachweis = $_POST['idnachweis'];
|
||||
$pruefling->registriert = date('Y-m-d H:i:s');
|
||||
$pruefling->prestudent_id = $_SESSION['prestudent_id'];
|
||||
$pruefling->semester = $_POST['semester'];
|
||||
if($pruefling->save())
|
||||
{
|
||||
$_SESSION['pruefling_id']=$pruefling->pruefling_id;
|
||||
$_SESSION['semester']=$pruefling->semester;
|
||||
$reload_parent=true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<?php
|
||||
if($reload_parent)
|
||||
echo '<script language="Javascript">parent.menu.location.reload()</script>';
|
||||
if($reload)
|
||||
echo "<script language=\"Javascript\">parent.location.reload();</script>";
|
||||
?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Login</h1>
|
||||
<?php
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
echo '<form method="GET">';
|
||||
echo '<br>Sie sind angemeldet als '.$_SESSION['vorname'].' '.$_SESSION['nachname'];
|
||||
echo ' ('.$_SESSION['gebdatum'].') ID: '.$_SESSION['prestudent_id'];
|
||||
echo ' <INPUT type="submit" value="Logout" name="logout" />';
|
||||
echo '</form>';
|
||||
echo '<br><br>';
|
||||
|
||||
$prestudent = new prestudent($db_conn, $prestudent_id);
|
||||
$stg_obj = new studiengang($db_conn, $prestudent->studiengang_kz);
|
||||
|
||||
$pruefling = new pruefling($db_conn);
|
||||
if($pruefling->getPruefling($prestudent_id))
|
||||
{
|
||||
|
||||
echo '<FORM METHOD="POST">';
|
||||
echo '<input type="hidden" name="pruefling_id" value="'.$pruefling->pruefling_id.'">';
|
||||
echo '<table>';
|
||||
echo '<tr><td>Semester:</td><td><input type="text" name="semester" size="1" maxlength="1" value="'.htmlentities($pruefling->semester).'"></td></tr>';
|
||||
echo '<tr><td>ID Nachweis:</td><td><INPUT type="text" maxsize="50" name="idnachweis" value="'.htmlentities($pruefling->idnachweis).'"></td></tr>';
|
||||
echo '<tr><td></td><td><input type="submit" name="save" value="OK"></td>';
|
||||
echo '</table>';
|
||||
echo '</FORM><br><br>';
|
||||
|
||||
//Wenn die Sprachwahl fuer diesen Studiengang aktiviert ist, dann die Sprachen anzeigen
|
||||
if($stg_obj->testtool_sprachwahl)
|
||||
{
|
||||
//Liste der Sprachen
|
||||
$qry = "SELECT distinct sprache
|
||||
FROM
|
||||
testtool.tbl_pruefling
|
||||
JOIN testtool.tbl_ablauf USING(studiengang_kz)
|
||||
JOIN testtool.tbl_frage USING(gebiet_id)
|
||||
JOIN testtool.tbl_frage_sprache USING(frage_id)
|
||||
WHERE
|
||||
tbl_pruefling.pruefling_id='".addslashes($pruefling->pruefling_id)."'
|
||||
ORDER BY sprache DESC";
|
||||
echo 'Sprache:';
|
||||
if($result = pg_query($db_conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($_SESSION['sprache']==$row->sprache)
|
||||
$selected='style="border:1px solid black;"';
|
||||
else
|
||||
$selected='';
|
||||
echo " <a href='".$_SERVER['PHP_SELF']."?type=sprachechange&sprache=$row->sprache' class='Item' $selected><img src='bild.php?src=flag&sprache=$row->sprache' alt='$row->sprache' title='$row->sprache'/></a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($pruefling->pruefling_id!='')
|
||||
{
|
||||
$_SESSION['pruefling_id']=$pruefling->pruefling_id;
|
||||
echo '<script language="Javascript">parent.menu.location.reload()</script>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Kein Pueflingseintrag vorhanden';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<form method="post">
|
||||
<SELECT name="prestudent">';
|
||||
echo '<OPTION value="13478">Dummy Dieter</OPTION>\n';
|
||||
foreach($ps->result as $prestd)
|
||||
echo '<OPTION value="'.$prestd->prestudent_id.'">'.$prestd->nachname.' '.$prestd->vorname."</OPTION>\n";
|
||||
echo '</SELECT>';
|
||||
echo ' Geburtsdatum: ';
|
||||
//<INPUT type="text" maxlength="10" size="10" name="gebdatum" />(YYYY-MM-TT)';
|
||||
echo ' <SELECT name="tag">';
|
||||
echo '<OPTION value="">Tag</OPTION>';
|
||||
for($i=1;$i<=31;$i++)
|
||||
echo '<OPTION value="'.($i<10?'0':'').$i.'">'.$i.'</OPTION>';
|
||||
echo '</SELECT>';
|
||||
echo ' <SELECT name="monat">';
|
||||
echo '<OPTION value="">Monat</OPTION>';
|
||||
for($i=1;$i<=12;$i++)
|
||||
echo '<OPTION value="'.($i<10?'0':'').$i.'">'.date('F',mktime(0,0,0,$i,1,date('Y'))).'</OPTION>';
|
||||
echo '</SELECT>';
|
||||
echo ' <SELECT name="jahr">';
|
||||
echo '<OPTION value="">Jahr</OPTION>';
|
||||
for($i=date('Y');$i>date('Y')-99;$i--)
|
||||
echo '<OPTION value="'.$i.'">'.$i.'</OPTION>';
|
||||
echo '</SELECT>';
|
||||
echo ' <INPUT type="submit" value="Login" />';
|
||||
echo '</form>';
|
||||
|
||||
echo '<br /><br /><br />
|
||||
<center>
|
||||
<span style="font-size: 1.2em; font-style: italic;">
|
||||
Herzlich Willkommen zum Reihungstest der Fachhochschule Technikum-Wien<br /><br />
|
||||
Bitte warten Sie mit dem Login auf die Anweisung der Aufsichtsperson<br /><br />
|
||||
Wir wünschen Ihnen einen erfolgreichen Start ins Studium
|
||||
</span>
|
||||
</center>';
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?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/person.class.php');
|
||||
require_once('../../include/prestudent.class.php');
|
||||
require_once('../../include/pruefling.class.php');
|
||||
require_once('../../include/studiengang.class.php');
|
||||
|
||||
session_start();
|
||||
$reload=false;
|
||||
$reload_parent=false;
|
||||
|
||||
if (isset($_GET['logout']))
|
||||
{
|
||||
if(isset($_SESSION['prestudent_id']))
|
||||
{
|
||||
$reload = true;
|
||||
session_destroy();
|
||||
}
|
||||
}
|
||||
|
||||
//Connection Herstellen
|
||||
if(!$db_conn = pg_pconnect(CONN_STRING))
|
||||
die('Fehler beim Oeffnen der Datenbankverbindung');
|
||||
|
||||
if(isset($_POST['tag']) && isset($_POST['monat']) && isset($_POST['jahr']))
|
||||
{
|
||||
if($_POST['tag']!='' && $_POST['monat']!='' && $_POST['jahr']!='')
|
||||
$gebdatum = $_POST['jahr'].'-'.$_POST['monat'].'-'.$_POST['tag'];
|
||||
else
|
||||
$gebdatum='';
|
||||
}
|
||||
|
||||
if (isset($_POST['prestudent']) && isset($gebdatum))
|
||||
{
|
||||
$ps=new prestudent($db_conn,$_POST['prestudent']);
|
||||
if ($gebdatum==$ps->gebdatum)
|
||||
{
|
||||
$pruefling = new pruefling($db_conn);
|
||||
if($pruefling->getPruefling($ps->prestudent_id))
|
||||
{
|
||||
$studiengang = $pruefling->studiengang_kz;
|
||||
$semester = $pruefling->semester;
|
||||
}
|
||||
else
|
||||
{
|
||||
$studiengang = $ps->studiengang_kz;
|
||||
$ps->getLastStatus($ps->prestudent_id);
|
||||
$semester = $ps->ausbildungssemester;
|
||||
}
|
||||
if($semester=='')
|
||||
$semester=1;
|
||||
|
||||
$_SESSION['prestudent_id']=$_POST['prestudent'];
|
||||
$_SESSION['studiengang_kz']=$studiengang;
|
||||
$_SESSION['nachname']=$ps->nachname;
|
||||
$_SESSION['vorname']=$ps->vorname;
|
||||
$_SESSION['gebdatum']=$ps->gebdatum;
|
||||
$stg_obj = new studiengang($db_conn, $studiengang);
|
||||
$_SESSION['sprache']=$stg_obj->sprache;
|
||||
|
||||
$_SESSION['semester']=$semester;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<span class="error">Ihr Geburtsdatum stimmt nicht mit unseren Daten überein</span>';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_SESSION['prestudent_id']))
|
||||
$prestudent_id=$_SESSION['prestudent_id'];
|
||||
else
|
||||
{
|
||||
//$prestudent_id=null;
|
||||
$ps=new prestudent($db_conn);
|
||||
$datum=date('Y-m-d');
|
||||
$ps->getPrestudentRT($datum,true);
|
||||
if ($ps->num_rows==0)
|
||||
$ps->getPrestudentRT($datum);
|
||||
}
|
||||
|
||||
if(isset($_GET['type']) && $_GET['type']=='sprachechange' && isset($_GET['sprache']))
|
||||
{
|
||||
$_SESSION['sprache']=$_GET['sprache'];
|
||||
}
|
||||
|
||||
if(isset($_SESSION['prestudent_id']) && !isset($_SESSION['pruefling_id']))
|
||||
{
|
||||
$pruefling = new pruefling($db_conn);
|
||||
|
||||
if(!$pruefling->getPruefling($_SESSION['prestudent_id']))
|
||||
{
|
||||
$pruefling->new = true;
|
||||
|
||||
$pruefling->studiengang_kz = $_SESSION['studiengang_kz'];
|
||||
$pruefling->semester = $_SESSION['semester'];
|
||||
|
||||
$pruefling->idnachweis = '';
|
||||
$pruefling->registriert = date('Y-m-d H:i:s');
|
||||
$pruefling->prestudent_id = $_SESSION['prestudent_id'];
|
||||
if($pruefling->save())
|
||||
{
|
||||
$_SESSION['pruefling_id']=$pruefling->pruefling_id;
|
||||
$reload_parent=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['save']) && isset($_SESSION['prestudent_id']))
|
||||
{
|
||||
$pruefling = new pruefling($db_conn);
|
||||
if($_POST['pruefling_id']!='')
|
||||
if(!$pruefling->load($_POST['pruefling_id']))
|
||||
die('Pruefling wurde nicht gefunden');
|
||||
else
|
||||
$pruefling->new=false;
|
||||
else
|
||||
$pruefling->new=true;
|
||||
|
||||
$pruefling->studiengang_kz = $_SESSION['studiengang_kz'];
|
||||
$pruefling->idnachweis = $_POST['idnachweis'];
|
||||
$pruefling->registriert = date('Y-m-d H:i:s');
|
||||
$pruefling->prestudent_id = $_SESSION['prestudent_id'];
|
||||
$pruefling->semester = $_POST['semester'];
|
||||
if($pruefling->save())
|
||||
{
|
||||
$_SESSION['pruefling_id']=$pruefling->pruefling_id;
|
||||
$_SESSION['semester']=$pruefling->semester;
|
||||
$reload_parent=true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<?php
|
||||
if($reload_parent)
|
||||
echo '<script language="Javascript">parent.menu.location.reload()</script>';
|
||||
if($reload)
|
||||
echo "<script language=\"Javascript\">parent.location.reload();</script>";
|
||||
?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Login</h1>
|
||||
<?php
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
echo '<form method="GET">';
|
||||
echo '<br>Sie sind angemeldet als '.$_SESSION['vorname'].' '.$_SESSION['nachname'];
|
||||
echo ' ('.$_SESSION['gebdatum'].') ID: '.$_SESSION['prestudent_id'];
|
||||
echo ' <INPUT type="submit" value="Logout" name="logout" />';
|
||||
echo '</form>';
|
||||
echo '<br><br>';
|
||||
|
||||
$prestudent = new prestudent($db_conn, $prestudent_id);
|
||||
$stg_obj = new studiengang($db_conn, $prestudent->studiengang_kz);
|
||||
|
||||
$pruefling = new pruefling($db_conn);
|
||||
if($pruefling->getPruefling($prestudent_id))
|
||||
{
|
||||
|
||||
echo '<FORM METHOD="POST">';
|
||||
echo '<input accept-charset="UTF-8" type="hidden" name="pruefling_id" value="'.$pruefling->pruefling_id.'">';
|
||||
echo '<table>';
|
||||
echo '<tr><td>Semester:</td><td><input type="text" name="semester" size="1" maxlength="1" value="'.$pruefling->semester.'"></td></tr>';
|
||||
echo '<tr><td>ID Nachweis:</td><td><INPUT type="text" maxsize="50" name="idnachweis" value="'.$pruefling->idnachweis.'"></td></tr>';
|
||||
echo '<tr><td></td><td><input type="submit" name="save" value="OK"></td>';
|
||||
echo '</table>';
|
||||
echo '</FORM><br><br>';
|
||||
|
||||
//Wenn die Sprachwahl fuer diesen Studiengang aktiviert ist, dann die Sprachen anzeigen
|
||||
if($stg_obj->testtool_sprachwahl)
|
||||
{
|
||||
//Liste der Sprachen
|
||||
$qry = "SELECT distinct sprache
|
||||
FROM
|
||||
testtool.tbl_pruefling
|
||||
JOIN testtool.tbl_ablauf USING(studiengang_kz)
|
||||
JOIN testtool.tbl_frage USING(gebiet_id)
|
||||
JOIN testtool.tbl_frage_sprache USING(frage_id)
|
||||
WHERE
|
||||
tbl_pruefling.pruefling_id='".addslashes($pruefling->pruefling_id)."'
|
||||
ORDER BY sprache DESC";
|
||||
echo 'Sprache:';
|
||||
if($result = pg_query($db_conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($_SESSION['sprache']==$row->sprache)
|
||||
$selected='style="border:1px solid black;"';
|
||||
else
|
||||
$selected='';
|
||||
echo " <a href='".$_SERVER['PHP_SELF']."?type=sprachechange&sprache=$row->sprache' class='Item' $selected><img src='bild.php?src=flag&sprache=$row->sprache' alt='$row->sprache' title='$row->sprache'/></a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($pruefling->pruefling_id!='')
|
||||
{
|
||||
$_SESSION['pruefling_id']=$pruefling->pruefling_id;
|
||||
echo '<script language="Javascript">parent.menu.location.reload()</script>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Kein Pueflingseintrag vorhanden';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<form method="post">
|
||||
<SELECT name="prestudent">';
|
||||
echo '<OPTION value="13478">Dummy Dieter</OPTION>\n';
|
||||
foreach($ps->result as $prestd)
|
||||
echo '<OPTION value="'.$prestd->prestudent_id.'">'.$prestd->nachname.' '.$prestd->vorname."</OPTION>\n";
|
||||
echo '</SELECT>';
|
||||
echo ' Geburtsdatum: ';
|
||||
//<INPUT type="text" maxlength="10" size="10" name="gebdatum" />(YYYY-MM-TT)';
|
||||
echo ' <SELECT name="tag">';
|
||||
echo '<OPTION value="">Tag</OPTION>';
|
||||
for($i=1;$i<=31;$i++)
|
||||
echo '<OPTION value="'.($i<10?'0':'').$i.'">'.$i.'</OPTION>';
|
||||
echo '</SELECT>';
|
||||
echo ' <SELECT name="monat">';
|
||||
echo '<OPTION value="">Monat</OPTION>';
|
||||
for($i=1;$i<=12;$i++)
|
||||
echo '<OPTION value="'.($i<10?'0':'').$i.'">'.date('F',mktime(0,0,0,$i,1,date('Y'))).'</OPTION>';
|
||||
echo '</SELECT>';
|
||||
echo ' <SELECT name="jahr">';
|
||||
echo '<OPTION value="">Jahr</OPTION>';
|
||||
for($i=date('Y');$i>date('Y')-99;$i--)
|
||||
echo '<OPTION value="'.$i.'">'.$i.'</OPTION>';
|
||||
echo '</SELECT>';
|
||||
echo ' <INPUT type="submit" value="Login" />';
|
||||
echo '</form>';
|
||||
|
||||
echo '<br /><br /><br />
|
||||
<center>
|
||||
<span style="font-size: 1.2em; font-style: italic;">
|
||||
Herzlich Willkommen zum Reihungstest der Fachhochschule Technikum-Wien<br /><br />
|
||||
Bitte warten Sie mit dem Login auf die Anweisung der Aufsichtsperson<br /><br />
|
||||
Wir wünschen Ihnen einen erfolgreichen Start ins Studium
|
||||
</span>
|
||||
</center>';
|
||||
}
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -179,7 +179,7 @@ class funktion
|
||||
function checkvars()
|
||||
{
|
||||
//Hochkomma und HTML Tags ersetzen
|
||||
//$this->name = htmlentities($this->name, ENT_QUOTES);
|
||||
//$this->name = $this->name;
|
||||
|
||||
//Maximallaenge pruefen
|
||||
$this->errormsg = 'Die Maximallaenge eines Feldes wurde ueberschritten';
|
||||
|
||||
@@ -163,8 +163,8 @@ class telefonnummer
|
||||
function checkvars()
|
||||
{
|
||||
//Hochkomma und HTML Tags ersetzen
|
||||
//$this->name = htmlentities($this->name, ENT_QUOTES);
|
||||
//$this->nummer = htmlentities($this->nummer, ENT_QUOTES);
|
||||
//$this->name = $this->name;
|
||||
//$this->nummer = $this->nummer;
|
||||
|
||||
//Laenge pruefen
|
||||
$this->errormsg = 'Eine der Gesamtlaengen wurde ueberschritten';
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
/*******************************************************************************
|
||||
* Utility to generate font definition files *
|
||||
* Version: 1.12 *
|
||||
* Date: 2003-12-30 *
|
||||
* *
|
||||
* Version: 1.14 *
|
||||
* Date: 2008-08-03 *
|
||||
* Author: Olivier PLATHEY *
|
||||
*******************************************************************************/
|
||||
|
||||
function ReadMap($enc)
|
||||
@@ -11,25 +13,27 @@ function ReadMap($enc)
|
||||
$file=dirname(__FILE__).'/'.strtolower($enc).'.map';
|
||||
$a=file($file);
|
||||
if(empty($a))
|
||||
die('<B>Error:</B> encoding not found: '.$enc);
|
||||
die('<b>Error:</b> encoding not found: '.$enc);
|
||||
$cc2gn=array();
|
||||
foreach($a as $l)
|
||||
{
|
||||
if($l{0}=='!')
|
||||
if($l[0]=='!')
|
||||
{
|
||||
$e=preg_split('/[ \\t]+/',chop($l));
|
||||
$e=preg_split('/[ \\t]+/',rtrim($l));
|
||||
$cc=hexdec(substr($e[0],1));
|
||||
$gn=$e[2];
|
||||
$cc2gn[$cc]=$gn;
|
||||
}
|
||||
}
|
||||
for($i=0;$i<=255;$i++)
|
||||
{
|
||||
if(!isset($cc2gn[$i]))
|
||||
$cc2gn[$i]='.notdef';
|
||||
}
|
||||
return $cc2gn;
|
||||
}
|
||||
|
||||
function ReadAFM($file,&$map)
|
||||
function ReadAFM($file, &$map)
|
||||
{
|
||||
//Read a font metric file
|
||||
$a=file($file);
|
||||
@@ -47,7 +51,7 @@ function ReadAFM($file,&$map)
|
||||
'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong');
|
||||
foreach($a as $l)
|
||||
{
|
||||
$e=explode(' ',chop($l));
|
||||
$e=explode(' ',rtrim($l));
|
||||
if(count($e)<2)
|
||||
continue;
|
||||
$code=$e[0];
|
||||
@@ -64,8 +68,10 @@ function ReadAFM($file,&$map)
|
||||
{
|
||||
//Fix incorrect glyph name
|
||||
foreach($map as $c=>$n)
|
||||
{
|
||||
if($n==$fix[$gn])
|
||||
$map[$c]=$gn;
|
||||
}
|
||||
}
|
||||
if(empty($map))
|
||||
{
|
||||
@@ -110,14 +116,14 @@ function ReadAFM($file,&$map)
|
||||
{
|
||||
if(!isset($widths['.notdef']))
|
||||
$widths['.notdef']=600;
|
||||
if(!isset($widths['Delta']) and isset($widths['increment']))
|
||||
if(!isset($widths['Delta']) && isset($widths['increment']))
|
||||
$widths['Delta']=$widths['increment'];
|
||||
//Order widths according to map
|
||||
for($i=0;$i<=255;$i++)
|
||||
{
|
||||
if(!isset($widths[$map[$i]]))
|
||||
{
|
||||
echo '<B>Warning:</B> character '.$map[$i].' is missing<BR>';
|
||||
echo '<b>Warning:</b> character '.$map[$i].' is missing<br>';
|
||||
$widths[$i]=$widths['.notdef'];
|
||||
}
|
||||
else
|
||||
@@ -128,7 +134,7 @@ function ReadAFM($file,&$map)
|
||||
return $fm;
|
||||
}
|
||||
|
||||
function MakeFontDescriptor($fm,$symbolic)
|
||||
function MakeFontDescriptor($fm, $symbolic)
|
||||
{
|
||||
//Ascent
|
||||
$asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000);
|
||||
@@ -146,20 +152,20 @@ function MakeFontDescriptor($fm,$symbolic)
|
||||
$fd.=",'CapHeight'=>".$ch;
|
||||
//Flags
|
||||
$flags=0;
|
||||
if(isset($fm['IsFixedPitch']) and $fm['IsFixedPitch'])
|
||||
if(isset($fm['IsFixedPitch']) && $fm['IsFixedPitch'])
|
||||
$flags+=1<<0;
|
||||
if($symbolic)
|
||||
$flags+=1<<2;
|
||||
if(!$symbolic)
|
||||
$flags+=1<<5;
|
||||
if(isset($fm['ItalicAngle']) and $fm['ItalicAngle']!=0)
|
||||
if(isset($fm['ItalicAngle']) && $fm['ItalicAngle']!=0)
|
||||
$flags+=1<<6;
|
||||
$fd.=",'Flags'=>".$flags;
|
||||
//FontBBox
|
||||
if(isset($fm['FontBBox']))
|
||||
$fbb=$fm['FontBBox'];
|
||||
else
|
||||
$fbb=array(0,$des-100,1000,$asc+100);
|
||||
$fbb=array(0,$desc-100,1000,$asc+100);
|
||||
$fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'";
|
||||
//ItalicAngle
|
||||
$ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0);
|
||||
@@ -167,7 +173,7 @@ function MakeFontDescriptor($fm,$symbolic)
|
||||
//StemV
|
||||
if(isset($fm['StdVW']))
|
||||
$stemv=$fm['StdVW'];
|
||||
elseif(isset($fm['Weight']) and eregi('(bold|black)',$fm['Weight']))
|
||||
elseif(isset($fm['Weight']) && preg_match('/bold|black/i',$fm['Weight']))
|
||||
$stemv=120;
|
||||
else
|
||||
$stemv=70;
|
||||
@@ -190,7 +196,7 @@ function MakeWidthArray($fm)
|
||||
$s.="'\\''";
|
||||
elseif(chr($i)=="\\")
|
||||
$s.="'\\\\'";
|
||||
elseif($i>=32 and $i<=126)
|
||||
elseif($i>=32 && $i<=126)
|
||||
$s.="'".chr($i)."'";
|
||||
else
|
||||
$s.="chr($i)";
|
||||
@@ -220,10 +226,10 @@ function MakeFontEncoding($map)
|
||||
$s.='/'.$map[$i].' ';
|
||||
}
|
||||
}
|
||||
return chop($s);
|
||||
return rtrim($s);
|
||||
}
|
||||
|
||||
function SaveToFile($file,$s,$mode='t')
|
||||
function SaveToFile($file, $s, $mode)
|
||||
{
|
||||
$f=fopen($file,'w'.$mode);
|
||||
if(!$f)
|
||||
@@ -249,7 +255,7 @@ function CheckTTF($file)
|
||||
//Check if font license allows embedding
|
||||
$f=fopen($file,'rb');
|
||||
if(!$f)
|
||||
die('<B>Error:</B> Can\'t open '.$file);
|
||||
die('<b>Error:</b> Can\'t open '.$file);
|
||||
//Extract number of tables
|
||||
fseek($f,4,SEEK_CUR);
|
||||
$nb=ReadShort($f);
|
||||
@@ -280,21 +286,23 @@ function CheckTTF($file)
|
||||
$pp=($fsType & 0x04)!=0;
|
||||
$e=($fsType & 0x08)!=0;
|
||||
fclose($f);
|
||||
if($rl and !$pp and !$e)
|
||||
echo '<B>Warning:</B> font license does not allow embedding';
|
||||
if($rl && !$pp && !$e)
|
||||
echo '<b>Warning:</b> font license does not allow embedding';
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* $fontfile: path to TTF file (or empty string if not to be embedded) *
|
||||
* $afmfile: path to AFM file *
|
||||
* $enc: font encoding (or empty string for symbolic fonts) *
|
||||
* $patch: optional patch for encoding *
|
||||
* $type : font type if $fontfile is empty *
|
||||
* fontfile: path to TTF file (or empty string if not to be embedded) *
|
||||
* afmfile: path to AFM file *
|
||||
* enc: font encoding (or empty string for symbolic fonts) *
|
||||
* patch: optional patch for encoding *
|
||||
* type: font type if fontfile is empty *
|
||||
*******************************************************************************/
|
||||
function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueType')
|
||||
function MakeFont($fontfile, $afmfile, $enc='cp1252', $patch=array(), $type='TrueType')
|
||||
{
|
||||
//Generate a font definition file
|
||||
set_magic_quotes_runtime(0);
|
||||
if(get_magic_quotes_runtime())
|
||||
@set_magic_quotes_runtime(0);
|
||||
ini_set('auto_detect_line_endings','1');
|
||||
if($enc)
|
||||
{
|
||||
$map=ReadMap($enc);
|
||||
@@ -304,7 +312,7 @@ function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueTyp
|
||||
else
|
||||
$map=array();
|
||||
if(!file_exists($afmfile))
|
||||
die('<B>Error:</B> AFM file not found: '.$afmfile);
|
||||
die('<b>Error:</b> AFM file not found: '.$afmfile);
|
||||
$fm=ReadAFM($afmfile,$map);
|
||||
if($enc)
|
||||
$diff=MakeFontEncoding($map);
|
||||
@@ -320,12 +328,12 @@ function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueTyp
|
||||
elseif($ext=='pfb')
|
||||
$type='Type1';
|
||||
else
|
||||
die('<B>Error:</B> unrecognized font file extension: '.$ext);
|
||||
die('<b>Error:</b> unrecognized font file extension: '.$ext);
|
||||
}
|
||||
else
|
||||
{
|
||||
if($type!='TrueType' and $type!='Type1')
|
||||
die('<B>Error:</B> incorrect font type: '.$type);
|
||||
if($type!='TrueType' && $type!='Type1')
|
||||
die('<b>Error:</b> incorrect font type: '.$type);
|
||||
}
|
||||
//Start generation
|
||||
$s='<?php'."\n";
|
||||
@@ -347,24 +355,35 @@ function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueTyp
|
||||
{
|
||||
//Embedded font
|
||||
if(!file_exists($fontfile))
|
||||
die('<B>Error:</B> font file not found: '.$fontfile);
|
||||
die('<b>Error:</b> font file not found: '.$fontfile);
|
||||
if($type=='TrueType')
|
||||
CheckTTF($fontfile);
|
||||
$f=fopen($fontfile,'rb');
|
||||
if(!$f)
|
||||
die('<B>Error:</B> Can\'t open '.$fontfile);
|
||||
die('<b>Error:</b> Can\'t open '.$fontfile);
|
||||
$file=fread($f,filesize($fontfile));
|
||||
fclose($f);
|
||||
if($type=='Type1')
|
||||
{
|
||||
//Find first two sections and discard third one
|
||||
$header=(ord($file[0])==128);
|
||||
if($header)
|
||||
{
|
||||
//Strip first binary header
|
||||
$file=substr($file,6);
|
||||
}
|
||||
$pos=strpos($file,'eexec');
|
||||
if(!$pos)
|
||||
die('<B>Error:</B> font file does not seem to be valid Type1');
|
||||
die('<b>Error:</b> font file does not seem to be valid Type1');
|
||||
$size1=$pos+6;
|
||||
if($header && ord($file[$size1])==128)
|
||||
{
|
||||
//Strip second binary header
|
||||
$file=substr($file,0,$size1).substr($file,$size1+6);
|
||||
}
|
||||
$pos=strpos($file,'00000000');
|
||||
if(!$pos)
|
||||
die('<B>Error:</B> font file does not seem to be valid Type1');
|
||||
die('<b>Error:</b> font file does not seem to be valid Type1');
|
||||
$size2=$pos-$size1;
|
||||
$file=substr($file,0,$size1+$size2);
|
||||
}
|
||||
@@ -373,12 +392,12 @@ function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueTyp
|
||||
$cmp=$basename.'.z';
|
||||
SaveToFile($cmp,gzcompress($file),'b');
|
||||
$s.='$file=\''.$cmp."';\n";
|
||||
echo 'Font file compressed ('.$cmp.')<BR>';
|
||||
echo 'Font file compressed ('.$cmp.')<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$s.='$file=\''.basename($fontfile)."';\n";
|
||||
echo '<B>Notice:</B> font file could not be compressed (gzcompress not available)<BR>';
|
||||
echo '<b>Notice:</b> font file could not be compressed (zlib extension not available)<br>';
|
||||
}
|
||||
if($type=='Type1')
|
||||
{
|
||||
@@ -394,7 +413,7 @@ function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueTyp
|
||||
$s.='$file='."'';\n";
|
||||
}
|
||||
$s.="?>\n";
|
||||
SaveToFile($basename.'.php',$s);
|
||||
echo 'Font definition file generated ('.$basename.'.php'.')<BR>';
|
||||
SaveToFile($basename.'.php',$s,'t');
|
||||
echo 'Font definition file generated ('.$basename.'.php'.')<br>';
|
||||
}
|
||||
?>
|
||||
|
||||
+18
-8
@@ -1,11 +1,21 @@
|
||||
BODY {font-family:times new roman,serif}
|
||||
H2 {color:#4000A0}
|
||||
P.demo {text-align:center; margin-top:-10px}
|
||||
A.demo {text-decoration:none; font-weight:bold; color:#0000CC}
|
||||
A.demo:link {text-decoration:none; font-weight:bold; color:#0000CC}
|
||||
A.demo:hover {text-decoration:none; font-weight:bold; color:#0000FF}
|
||||
A.demo:active {text-decoration:none; font-weight:bold; color:#0000FF}
|
||||
.st {font-weight:bold; color:#900000}
|
||||
body {font-family:"Times New Roman",serif}
|
||||
h1 {font:bold 135% Arial,sans-serif; color:#4000A0; margin-bottom:0.9em}
|
||||
h2 {font:bold 95% Arial,sans-serif; color:#900000; margin-top:1.5em; margin-bottom:1em}
|
||||
dl.param dt {text-decoration:underline}
|
||||
dl.param dd {margin-top:1em; margin-bottom:1em}
|
||||
dl.param ul {margin-top:1em; margin-bottom:1em}
|
||||
tt, code, kbd {font-family:"Courier New",Courier,monospace; font-size:82%}
|
||||
div.source {margin-top:1.4em; margin-bottom:1.3em}
|
||||
div.source pre {display:table; border:1px solid #24246A; width:100%; margin:0em; font-family:inherit; font-size:100%}
|
||||
div.source code {display:block; border:1px solid #C5C5EC; background-color:#F0F5FF; padding:6px; color:#000000}
|
||||
div.doc-source {margin-top:1.4em; margin-bottom:1.3em}
|
||||
div.doc-source pre {display:table; width:100%; margin:0em; font-family:inherit; font-size:100%}
|
||||
div.doc-source code {display:block; background-color:#E0E0E0; padding:4px}
|
||||
.kw {color:#000080; font-weight:bold}
|
||||
.str {color:#CC0000}
|
||||
.cmt {color:#008000}
|
||||
p.demo {text-align:center; margin-top:-0.9em}
|
||||
a.demo {text-decoration:none; font-weight:bold; color:#0000CC}
|
||||
a.demo:link {text-decoration:none; font-weight:bold; color:#0000CC}
|
||||
a.demo:hover {text-decoration:none; font-weight:bold; color:#0000FF}
|
||||
a.demo:active {text-decoration:none; font-weight:bold; color:#0000FF}
|
||||
|
||||
+581
-471
File diff suppressed because it is too large
Load Diff
+587
-587
File diff suppressed because it is too large
Load Diff
@@ -135,7 +135,7 @@
|
||||
}
|
||||
|
||||
$htmlstr .= "<br><div class='kopf'>Lehrveranstaltung</div>\n";
|
||||
$htmlstr .= "<form action='lehrveranstaltung_details.php' method='POST'>\n";
|
||||
$htmlstr .= "<form accept-charset='UTF-8' action='lehrveranstaltung_details.php' method='POST'>\n";
|
||||
$htmlstr .= "<input type='hidden' name='lv_id' value='".$lv->lehrveranstaltung_id."'>\n";
|
||||
|
||||
$htmlstr .= "<table class='detail' style='padding-top:10px;'>\n";
|
||||
@@ -145,7 +145,7 @@
|
||||
$htmlstr .= " <td>Kurzbz</td>";
|
||||
$htmlstr .= " <td><input type='text' name='kurzbz' value='$lv->kurzbz'\n</td>";
|
||||
$htmlstr .= " <td>Bezeichnung</td>";
|
||||
$htmlstr .= " <td colspan='3'><input type='text' name='bezeichnung' value='".htmlentities($lv->bezeichnung, ENT_QUOTES)."' size='60' maxlength='128'></td>\n";
|
||||
$htmlstr .= " <td colspan='3'><input type='text' name='bezeichnung' value='".$lv->bezeichnung."' size='60' maxlength='128'></td>\n";
|
||||
|
||||
$htmlstr .= "</tr>";
|
||||
$htmlstr .= "<tr>";
|
||||
@@ -162,7 +162,7 @@
|
||||
}
|
||||
$htmlstr .= " </select></td>\n";
|
||||
$htmlstr .= " <td>Bezeichnung English</td>";
|
||||
$htmlstr .= " <td colspan='3'><input type='text' name='bezeichnung_english' value='".htmlentities($lv->bezeichnung_english, ENT_QUOTES)."' size='60' maxlength='256'></td>\n";
|
||||
$htmlstr .= " <td colspan='3'><input type='text' name='bezeichnung_english' value='".$lv->bezeichnung_english."' size='60' maxlength='256'></td>\n";
|
||||
|
||||
$htmlstr .= "</tr>";
|
||||
$htmlstr .= "<tr>";
|
||||
|
||||
@@ -1,242 +1,242 @@
|
||||
<?php
|
||||
//@version $Id$
|
||||
/* 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 >
|
||||
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*/
|
||||
|
||||
/*
|
||||
Dieses Programm listet nach einem Suchbegriff bestehender Benutzer auf.
|
||||
Fuer jede UserID wird geprueft ob dieser bereits einen Moodle ID besitzt.
|
||||
Bestehende Moodle IDs werden angezeigt, fuer alle anderen wird die moeglichkeit
|
||||
der neuanlage geboten.
|
||||
*/
|
||||
|
||||
// ---------------- Standart Include Dateien einbinden
|
||||
require_once('../config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/globals.inc.php');
|
||||
// ---------------- Moodle Daten Classe
|
||||
require_once('../../include/moodle_user.class.php');
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Variable Initialisieren
|
||||
// ***********************************************************************************************
|
||||
// AusgabeStream
|
||||
$content='';
|
||||
|
||||
// ***********************************************************************************************
|
||||
// POST oder GET Parameter einlesen
|
||||
// ***********************************************************************************************
|
||||
|
||||
// $cUID UserID fuer Moodelaccount anlage
|
||||
$cUID = (isset($_REQUEST['uid'])?trim($_REQUEST['uid']):'');
|
||||
// @$cMdl_user_id Moodleaccount zum loeschen
|
||||
$cMdl_user_id = (isset($_REQUEST['mdl_user_id'])?trim($_REQUEST['mdl_user_id']):'');
|
||||
// @cSearchstr Suchtext in Tabelle Benutzer
|
||||
$cSearchstr = (isset($_REQUEST['searchstr'])?trim($_REQUEST['searchstr']):'');
|
||||
// @cCharset Zeichensatz - Ajax mit UTF-8
|
||||
$cCharset= (isset($_REQUEST['client_encode'])?trim($_REQUEST['client_encode']):'UTF-8');
|
||||
// ***********************************************************************************************
|
||||
// Datenbankverbindungen zu Moodle und Vilesci und Classen
|
||||
// ***********************************************************************************************
|
||||
// DB Connect
|
||||
$conn=@pg_pconnect(CONN_STRING) or die('<div style="text-align:center;"><br />Datenbank zurzeit NICHT Online.<br />Bitte etwas Geduld.<br />Danke</div>');// Datenbankverbindung
|
||||
$conn_moodle = pg_pconnect(CONN_STRING_MOODLE) or die('<div style="text-align:center;"><br />MOODLE Datenbank zurzeit NICHT Online.<br />Bitte etwas Geduld.<br />Danke</div>');
|
||||
// Classen Instanzen
|
||||
$objMoodle = new moodle_user($conn, $conn_moodle);
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Verarbeitung einer Moodle-Account Anlageaktion
|
||||
// ***********************************************************************************************
|
||||
if ($cUID!='') // Bearbeiten User UID Anfrage
|
||||
{
|
||||
// Check ob User nicht bereits angelegt ist
|
||||
if (!$bStatus=$objMoodle->loaduser($cUID))
|
||||
{
|
||||
$objMoodle->errormsg='';
|
||||
// User ist noch nicht in Moodle angelegt => Neuanlage
|
||||
if (!$bStatus=$objMoodle->createUser($cUID))
|
||||
$content.=$objMoodle->errormsg;
|
||||
}
|
||||
}
|
||||
// ***********************************************************************************************
|
||||
// HTML Suchfeld (Teil 1)
|
||||
// ***********************************************************************************************
|
||||
$content.='
|
||||
<form name="search" method="GET" action="'.$_SERVER["PHP_SELF"].'" target="_self">
|
||||
Bitte Suchbegriff eingeben:
|
||||
<input type="text" name="searchstr" size="30" value="'.htmlentities($cSearchstr).'">
|
||||
<input type="submit" value=" suchen ">
|
||||
</form>
|
||||
<hr>';
|
||||
// ***********************************************************************************************
|
||||
// HTML Listenanzeige (Teil 2)
|
||||
// ***********************************************************************************************
|
||||
if($cSearchstr!='' && $cSearchstr!='?' && $cSearchstr!='*')
|
||||
{
|
||||
// SQL Select-String
|
||||
$qry = "SELECT distinct tbl_person.person_id,tbl_person.nachname,tbl_person.vorname,tbl_person.aktiv,tbl_benutzer.uid
|
||||
FROM public.tbl_person
|
||||
LEFT JOIN public.tbl_benutzer ON tbl_benutzer.person_id=tbl_person.person_id
|
||||
WHERE (
|
||||
tbl_person.nachname ~* '".addslashes($cSearchstr)."' OR
|
||||
tbl_person.vorname ~* '".addslashes($cSearchstr)."' OR
|
||||
tbl_benutzer.alias ~* '".addslashes($cSearchstr)."' OR
|
||||
tbl_person.nachname || ' ' || tbl_person.vorname = '".addslashes($cSearchstr)."' OR
|
||||
tbl_person.vorname || ' ' || tbl_person.nachname = '".addslashes($cSearchstr)."' OR
|
||||
tbl_benutzer.uid ~* '".addslashes($cSearchstr)."'
|
||||
)
|
||||
and tbl_benutzer.uid >''
|
||||
and tbl_benutzer.uid IS NOT NULL
|
||||
ORDER BY nachname, vorname;";
|
||||
|
||||
if($result = @pg_query($conn, $qry))
|
||||
{
|
||||
// Header Top mit Anzahl der gelisteten Kurse
|
||||
$content.= '<a name="top">'. @pg_num_rows($result).' Person(en) gefunden</a>';
|
||||
|
||||
$content.='<table style="border: 1px outset #F7F7F7;">';
|
||||
|
||||
// Header Teil Information der Funktion
|
||||
$content.='<tr class="liste" align="center">';
|
||||
$content.='<td colspan="6"><b>Benutzer</b></td>';
|
||||
$content.='</tr>';
|
||||
|
||||
// Headerinformation der Tabellenfelder
|
||||
$content.='<tr class="liste" align="center">';
|
||||
$content.='<th> Nachname </th>';
|
||||
$content.='<th> Vorname </th>';
|
||||
$content.='<th> UserID </th>';
|
||||
$content.='<th> Status </th>';
|
||||
$content.='<th> MoodleAccount </th>';
|
||||
# $content.='<th> Bearbeitung </th>';
|
||||
$content.='</tr>';
|
||||
|
||||
// Alle gefundenen User in einer Schleife anzeigen.
|
||||
$iTmpCounter=0;
|
||||
while($row = @pg_fetch_object($result))
|
||||
{
|
||||
// ZeilenCSS (gerade/ungerade) zur besseren Ansicht
|
||||
$iTmpCounter++;
|
||||
if ($iTmpCounter%2)
|
||||
$showCSS=' style="text-align: left;border: 1px outset #F7F7F7;padding: 1px 5px 1px 5px; background:#FEFFEC" ';
|
||||
else
|
||||
$showCSS=' style="text-align: left;border: 1px outset #F7F7F7;padding: 1px 5px 1px 5px; background:#FCFCFC" ';
|
||||
|
||||
// Listenzeile
|
||||
$content.= '<tr '.$showCSS.'>';
|
||||
$content.= '<td '.$showCSS.'>'.$row->nachname.'</td>';
|
||||
$content.= '<td '.$showCSS.'>'.$row->vorname.'</td>';
|
||||
$content.= '<td '.$showCSS.'>'.$row->uid.'</td>';
|
||||
$content.= '<td '.$showCSS.'>'.(strtoupper($row->aktiv)=='T' || strtoupper($row->aktiv)=='TRUE' ?'aktiv':'deaktiviert').'</td>';
|
||||
$arrMoodleUser=array();
|
||||
$objMoodle->errormsg='';
|
||||
$objMoodle->mdl_user_id='';
|
||||
if (!empty($row->uid))
|
||||
{
|
||||
if (!$boolReadMoodle=$objMoodle->loaduser($row->uid))
|
||||
$objMoodle->mdl_user_id='';
|
||||
}
|
||||
// Es gibt noch keinen Moodle User - Anlage ermoeglichen
|
||||
if (!isset($objMoodle->mdl_user_id) || empty($objMoodle->mdl_user_id))
|
||||
{
|
||||
$content.= '<td style="vertical-align:bottom;cursor: pointer;" onclick="document.work'.$iTmpCounter.'.submit();">';
|
||||
$content.='<form style="display: inline;border:0px;" name="work'.$iTmpCounter.'" method="GET" target="_self" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$content.= '<input style="display:none" type="text" name="uid" value="'.htmlentities($row->uid).'" />';
|
||||
$content.= '<input style="display:none" type="text" name="searchstr" value="'.htmlentities($cSearchstr).'" />';
|
||||
$content.= '<img height="12" src="../../skin/images/table_row_insert.png" border="0" title="MoodleUser anlegen" alt="table_row_insert.png" />';
|
||||
$content.= '<input onclick="this.checked=false;" onblur="this.checked=false;" type="checkbox" value="" style="'.(!stristr($_SERVER['HTTP_USER_AGENT'],'OPERA') && !stristr($_SERVER['HTTP_USER_AGENT'],'Safari')?'display:none;':'').'font-size: 4px;border:0px solid transparent;text-decoration:none; background-color: transparent;" name="check_va_detail_kal'.$iTmpCounter.'" />';
|
||||
$content.= 'anlegen';
|
||||
$content.='</form>';
|
||||
$content.= '</td>';
|
||||
}
|
||||
else // Anzeige bestehende Moodle User ID
|
||||
{
|
||||
$content.= '<td '.$showCSS.'>'.((isset($objMoodle->mdl_user_id) && !empty($objMoodle->mdl_user_id))?$objMoodle->mdl_user_id:'').'</td>';
|
||||
}
|
||||
// Tastatureingabe ermoeglichen
|
||||
$content.= '</tr>';
|
||||
} // Ende Schleife der gefundenen User
|
||||
$content.= '</table>';
|
||||
$content.= '<a href="#top">zum Anfang</a>';
|
||||
} // Ende SQL Result abfrage
|
||||
} // Ende ob Suchanfrage gestellt (Submit) wurde
|
||||
$content='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Moodle - Accountverwaltung</title>
|
||||
<base target="main">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset='.$cCharset.'">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
</head>
|
||||
<body class="background_main">
|
||||
<h2>Moodle - Accountverwaltung</h2>
|
||||
<!-- MoodleAccount Content Start -->
|
||||
'.$content.'
|
||||
<!-- MoodleAccount Content Ende -->
|
||||
</body>
|
||||
</html>';
|
||||
exit($content);
|
||||
#-------------------------------------------------------------------------------------------
|
||||
# Testfunktion zur Anzeige einer übergebenen Variable oder Array, Default ist GLOBALS
|
||||
function Test($arr=constLeer,$lfd=0,$displayShow=true,$onlyRoot=false )
|
||||
{
|
||||
|
||||
$tmpArrayString='';
|
||||
if (!is_array($arr) && !is_object($arr)) return $arr;
|
||||
if (is_array($arr) && count($arr)<1 && $displayShow) return '';
|
||||
if (is_array($arr) && count($arr)<1 && $displayShow) return "<br /><b>function Test (???)</b><br />";
|
||||
|
||||
$lfdnr=$lfd + 1;
|
||||
$tmpAnzeigeStufe='';
|
||||
for ($i=1;$i<$lfdnr;$i++) $tmpAnzeigeStufe.="=";
|
||||
$tmpAnzeigeStufe.="=>";
|
||||
while (list( $tmp_key, $tmp_value ) = each($arr) )
|
||||
{
|
||||
if (!$onlyRoot && (is_array($tmp_value) || is_object($tmp_value)) && count($tmp_value) >0)
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe <b>$tmp_key</b>".Test($tmp_value,$lfdnr);
|
||||
} else if ( (is_array($tmp_value) || is_object($tmp_value)) )
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe <b>$tmp_key -- 0 Records</b>";
|
||||
} else if ($tmp_value!='')
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe $tmp_key :== ".$tmp_value;
|
||||
} else {
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe $tmp_key :-- (is Empty :: $tmp_value)";
|
||||
}
|
||||
}
|
||||
if ($lfd!='') { return $tmpArrayString; }
|
||||
if (!$displayShow) { return $tmpArrayString; }
|
||||
|
||||
$tmpArrayString.="<br />";
|
||||
$tmpArrayString="<br /><hr /><br />******* START *******<br />".$tmpArrayString."<br />******* ENDE *******<br /><hr /><br />";
|
||||
if (defined('Sprache_ISO'))
|
||||
{
|
||||
$tmpArrayString.="<br />Language:: ".Sprache_ISO;
|
||||
}
|
||||
$tmpArrayString.="<br />Server:: ".$_SERVER['PHP_SELF']."<br />";
|
||||
return "$tmpArrayString";
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
//@version $Id$
|
||||
/* 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 >
|
||||
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*/
|
||||
|
||||
/*
|
||||
Dieses Programm listet nach einem Suchbegriff bestehender Benutzer auf.
|
||||
Fuer jede UserID wird geprueft ob dieser bereits einen Moodle ID besitzt.
|
||||
Bestehende Moodle IDs werden angezeigt, fuer alle anderen wird die moeglichkeit
|
||||
der neuanlage geboten.
|
||||
*/
|
||||
|
||||
// ---------------- Standart Include Dateien einbinden
|
||||
require_once('../config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/globals.inc.php');
|
||||
// ---------------- Moodle Daten Classe
|
||||
require_once('../../include/moodle_user.class.php');
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Variable Initialisieren
|
||||
// ***********************************************************************************************
|
||||
// AusgabeStream
|
||||
$content='';
|
||||
|
||||
// ***********************************************************************************************
|
||||
// POST oder GET Parameter einlesen
|
||||
// ***********************************************************************************************
|
||||
|
||||
// $cUID UserID fuer Moodelaccount anlage
|
||||
$cUID = (isset($_REQUEST['uid'])?trim($_REQUEST['uid']):'');
|
||||
// @$cMdl_user_id Moodleaccount zum loeschen
|
||||
$cMdl_user_id = (isset($_REQUEST['mdl_user_id'])?trim($_REQUEST['mdl_user_id']):'');
|
||||
// @cSearchstr Suchtext in Tabelle Benutzer
|
||||
$cSearchstr = (isset($_REQUEST['searchstr'])?trim($_REQUEST['searchstr']):'');
|
||||
// @cCharset Zeichensatz - Ajax mit UTF-8
|
||||
$cCharset= (isset($_REQUEST['client_encode'])?trim($_REQUEST['client_encode']):'UTF-8');
|
||||
// ***********************************************************************************************
|
||||
// Datenbankverbindungen zu Moodle und Vilesci und Classen
|
||||
// ***********************************************************************************************
|
||||
// DB Connect
|
||||
$conn=@pg_pconnect(CONN_STRING) or die('<div style="text-align:center;"><br />Datenbank zurzeit NICHT Online.<br />Bitte etwas Geduld.<br />Danke</div>');// Datenbankverbindung
|
||||
$conn_moodle = pg_pconnect(CONN_STRING_MOODLE) or die('<div style="text-align:center;"><br />MOODLE Datenbank zurzeit NICHT Online.<br />Bitte etwas Geduld.<br />Danke</div>');
|
||||
// Classen Instanzen
|
||||
$objMoodle = new moodle_user($conn, $conn_moodle);
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Verarbeitung einer Moodle-Account Anlageaktion
|
||||
// ***********************************************************************************************
|
||||
if ($cUID!='') // Bearbeiten User UID Anfrage
|
||||
{
|
||||
// Check ob User nicht bereits angelegt ist
|
||||
if (!$bStatus=$objMoodle->loaduser($cUID))
|
||||
{
|
||||
$objMoodle->errormsg='';
|
||||
// User ist noch nicht in Moodle angelegt => Neuanlage
|
||||
if (!$bStatus=$objMoodle->createUser($cUID))
|
||||
$content.=$objMoodle->errormsg;
|
||||
}
|
||||
}
|
||||
// ***********************************************************************************************
|
||||
// HTML Suchfeld (Teil 1)
|
||||
// ***********************************************************************************************
|
||||
$content.='
|
||||
<form accept-charset="UTF-8" name="search" method="GET" action="'.$_SERVER["PHP_SELF"].'" target="_self">
|
||||
Bitte Suchbegriff eingeben:
|
||||
<input type="text" name="searchstr" size="30" value="'.$cSearchstr.'">
|
||||
<input type="submit" value=" suchen ">
|
||||
</form>
|
||||
<hr>';
|
||||
// ***********************************************************************************************
|
||||
// HTML Listenanzeige (Teil 2)
|
||||
// ***********************************************************************************************
|
||||
if($cSearchstr!='' && $cSearchstr!='?' && $cSearchstr!='*')
|
||||
{
|
||||
// SQL Select-String
|
||||
$qry = "SELECT distinct tbl_person.person_id,tbl_person.nachname,tbl_person.vorname,tbl_person.aktiv,tbl_benutzer.uid
|
||||
FROM public.tbl_person
|
||||
LEFT JOIN public.tbl_benutzer ON tbl_benutzer.person_id=tbl_person.person_id
|
||||
WHERE (
|
||||
tbl_person.nachname ~* '".addslashes($cSearchstr)."' OR
|
||||
tbl_person.vorname ~* '".addslashes($cSearchstr)."' OR
|
||||
tbl_benutzer.alias ~* '".addslashes($cSearchstr)."' OR
|
||||
tbl_person.nachname || ' ' || tbl_person.vorname = '".addslashes($cSearchstr)."' OR
|
||||
tbl_person.vorname || ' ' || tbl_person.nachname = '".addslashes($cSearchstr)."' OR
|
||||
tbl_benutzer.uid ~* '".addslashes($cSearchstr)."'
|
||||
)
|
||||
and tbl_benutzer.uid >''
|
||||
and tbl_benutzer.uid IS NOT NULL
|
||||
ORDER BY nachname, vorname;";
|
||||
|
||||
if($result = @pg_query($conn, $qry))
|
||||
{
|
||||
// Header Top mit Anzahl der gelisteten Kurse
|
||||
$content.= '<a name="top">'. @pg_num_rows($result).' Person(en) gefunden</a>';
|
||||
|
||||
$content.='<table style="border: 1px outset #F7F7F7;">';
|
||||
|
||||
// Header Teil Information der Funktion
|
||||
$content.='<tr class="liste" align="center">';
|
||||
$content.='<td colspan="6"><b>Benutzer</b></td>';
|
||||
$content.='</tr>';
|
||||
|
||||
// Headerinformation der Tabellenfelder
|
||||
$content.='<tr class="liste" align="center">';
|
||||
$content.='<th> Nachname </th>';
|
||||
$content.='<th> Vorname </th>';
|
||||
$content.='<th> UserID </th>';
|
||||
$content.='<th> Status </th>';
|
||||
$content.='<th> MoodleAccount </th>';
|
||||
# $content.='<th> Bearbeitung </th>';
|
||||
$content.='</tr>';
|
||||
|
||||
// Alle gefundenen User in einer Schleife anzeigen.
|
||||
$iTmpCounter=0;
|
||||
while($row = @pg_fetch_object($result))
|
||||
{
|
||||
// ZeilenCSS (gerade/ungerade) zur besseren Ansicht
|
||||
$iTmpCounter++;
|
||||
if ($iTmpCounter%2)
|
||||
$showCSS=' style="text-align: left;border: 1px outset #F7F7F7;padding: 1px 5px 1px 5px; background:#FEFFEC" ';
|
||||
else
|
||||
$showCSS=' style="text-align: left;border: 1px outset #F7F7F7;padding: 1px 5px 1px 5px; background:#FCFCFC" ';
|
||||
|
||||
// Listenzeile
|
||||
$content.= '<tr '.$showCSS.'>';
|
||||
$content.= '<td '.$showCSS.'>'.$row->nachname.'</td>';
|
||||
$content.= '<td '.$showCSS.'>'.$row->vorname.'</td>';
|
||||
$content.= '<td '.$showCSS.'>'.$row->uid.'</td>';
|
||||
$content.= '<td '.$showCSS.'>'.(strtoupper($row->aktiv)=='T' || strtoupper($row->aktiv)=='TRUE' ?'aktiv':'deaktiviert').'</td>';
|
||||
$arrMoodleUser=array();
|
||||
$objMoodle->errormsg='';
|
||||
$objMoodle->mdl_user_id='';
|
||||
if (!empty($row->uid))
|
||||
{
|
||||
if (!$boolReadMoodle=$objMoodle->loaduser($row->uid))
|
||||
$objMoodle->mdl_user_id='';
|
||||
}
|
||||
// Es gibt noch keinen Moodle User - Anlage ermoeglichen
|
||||
if (!isset($objMoodle->mdl_user_id) || empty($objMoodle->mdl_user_id))
|
||||
{
|
||||
$content.= '<td style="vertical-align:bottom;cursor: pointer;" onclick="document.work'.$iTmpCounter.'.submit();">';
|
||||
$content.='<form style="display: inline;border:0px;" name="work'.$iTmpCounter.'" method="GET" target="_self" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$content.= '<input style="display:none" type="text" name="uid" value="'.$row->uid.'" />';
|
||||
$content.= '<input style="display:none" type="text" name="searchstr" value="'.$cSearchstr.'" />';
|
||||
$content.= '<img height="12" src="../../skin/images/table_row_insert.png" border="0" title="MoodleUser anlegen" alt="table_row_insert.png" />';
|
||||
$content.= '<input onclick="this.checked=false;" onblur="this.checked=false;" type="checkbox" value="" style="'.(!stristr($_SERVER['HTTP_USER_AGENT'],'OPERA') && !stristr($_SERVER['HTTP_USER_AGENT'],'Safari')?'display:none;':'').'font-size: 4px;border:0px solid transparent;text-decoration:none; background-color: transparent;" name="check_va_detail_kal'.$iTmpCounter.'" />';
|
||||
$content.= 'anlegen';
|
||||
$content.='</form>';
|
||||
$content.= '</td>';
|
||||
}
|
||||
else // Anzeige bestehende Moodle User ID
|
||||
{
|
||||
$content.= '<td '.$showCSS.'>'.((isset($objMoodle->mdl_user_id) && !empty($objMoodle->mdl_user_id))?$objMoodle->mdl_user_id:'').'</td>';
|
||||
}
|
||||
// Tastatureingabe ermoeglichen
|
||||
$content.= '</tr>';
|
||||
} // Ende Schleife der gefundenen User
|
||||
$content.= '</table>';
|
||||
$content.= '<a href="#top">zum Anfang</a>';
|
||||
} // Ende SQL Result abfrage
|
||||
} // Ende ob Suchanfrage gestellt (Submit) wurde
|
||||
$content='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Moodle - Accountverwaltung</title>
|
||||
<base target="main">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset='.$cCharset.'">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
</head>
|
||||
<body class="background_main">
|
||||
<h2>Moodle - Accountverwaltung</h2>
|
||||
<!-- MoodleAccount Content Start -->
|
||||
'.$content.'
|
||||
<!-- MoodleAccount Content Ende -->
|
||||
</body>
|
||||
</html>';
|
||||
exit($content);
|
||||
#-------------------------------------------------------------------------------------------
|
||||
# Testfunktion zur Anzeige einer übergebenen Variable oder Array, Default ist GLOBALS
|
||||
function Test($arr=constLeer,$lfd=0,$displayShow=true,$onlyRoot=false )
|
||||
{
|
||||
|
||||
$tmpArrayString='';
|
||||
if (!is_array($arr) && !is_object($arr)) return $arr;
|
||||
if (is_array($arr) && count($arr)<1 && $displayShow) return '';
|
||||
if (is_array($arr) && count($arr)<1 && $displayShow) return "<br /><b>function Test (???)</b><br />";
|
||||
|
||||
$lfdnr=$lfd + 1;
|
||||
$tmpAnzeigeStufe='';
|
||||
for ($i=1;$i<$lfdnr;$i++) $tmpAnzeigeStufe.="=";
|
||||
$tmpAnzeigeStufe.="=>";
|
||||
while (list( $tmp_key, $tmp_value ) = each($arr) )
|
||||
{
|
||||
if (!$onlyRoot && (is_array($tmp_value) || is_object($tmp_value)) && count($tmp_value) >0)
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe <b>$tmp_key</b>".Test($tmp_value,$lfdnr);
|
||||
} else if ( (is_array($tmp_value) || is_object($tmp_value)) )
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe <b>$tmp_key -- 0 Records</b>";
|
||||
} else if ($tmp_value!='')
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe $tmp_key :== ".$tmp_value;
|
||||
} else {
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe $tmp_key :-- (is Empty :: $tmp_value)";
|
||||
}
|
||||
}
|
||||
if ($lfd!='') { return $tmpArrayString; }
|
||||
if (!$displayShow) { return $tmpArrayString; }
|
||||
|
||||
$tmpArrayString.="<br />";
|
||||
$tmpArrayString="<br /><hr /><br />******* START *******<br />".$tmpArrayString."<br />******* ENDE *******<br /><hr /><br />";
|
||||
if (defined('Sprache_ISO'))
|
||||
{
|
||||
$tmpArrayString.="<br />Language:: ".Sprache_ISO;
|
||||
}
|
||||
$tmpArrayString.="<br />Server:: ".$_SERVER['PHP_SELF']."<br />";
|
||||
return "$tmpArrayString";
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+342
-342
@@ -1,343 +1,343 @@
|
||||
<?php
|
||||
//@version $Id$
|
||||
/* 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 >
|
||||
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*/
|
||||
|
||||
/*
|
||||
* Dieses Programm listet nach Selektinskreterien alle Moodelkurse zu einem Studiengang auf.
|
||||
* Fuer jede MoodleID werden die Anzahl Benotungen, und erfassten sowie angelegte Zusaetze angezeigt.
|
||||
* Jeder der angezeigten Moodle IDs kann geloescht werden nach bestaetigung eines PopUp Fenster.
|
||||
*/
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Include Dateien
|
||||
// ***********************************************************************************************
|
||||
// ---------------- Standart Include Dateien einbinden
|
||||
require_once('../config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/globals.inc.php');
|
||||
// ---------------- Moodle Daten Classe
|
||||
include_once('../../include/moodle_course.class.php');
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Variable Initialisieren
|
||||
// ***********************************************************************************************
|
||||
// AusgabeStream
|
||||
$content='';
|
||||
// Vergleichsdatum Jahr und Monat fuer Studiensemester (Select-Auswahl)
|
||||
$cYYYYMM=date("Ym", mktime(0,0,0,date("m"),date("d"),date("y")));
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// POST oder GET Parameter einlesen
|
||||
// ***********************************************************************************************
|
||||
// @$studiensemester_kurzbz Studiensemester xxJJJJ - xx fuer SS Sommer oder WW Winter
|
||||
$studiensemester_kurzbz=(isset($_REQUEST['studiensemester_kurzbz'])?trim($_REQUEST['studiensemester_kurzbz']):'');
|
||||
// @$studiengang_kz Studiengang
|
||||
$studiengang_kz=(isset($_REQUEST['studiengang_kz'])?trim($_REQUEST['studiengang_kz']):'');
|
||||
// @$semester Semester des Studienganges
|
||||
$semester=(isset($_REQUEST['semester'])?trim($_REQUEST['semester']):'');
|
||||
// @$mdl_course_id Moodle Kurs ID
|
||||
$mdl_course_id= (isset($_REQUEST['mdl_course_id'])?$_REQUEST['mdl_course_id']:'');
|
||||
// @$moodle_id Moodle SubKurs (Unterkat.) ID zu Moodle Kurs ID (mdl_course_id)
|
||||
$moodle_id= (isset($_REQUEST['moodle_id'])?$_REQUEST['moodle_id']:'');
|
||||
// @$bAnzeige Listenanzeige wenn Submitbottom Anzeige gedrueckt wurde
|
||||
$bAnzeige= ($studiensemester_kurzbz!=''?True:False);
|
||||
// @cCharset Zeichensatz - Ajax mit UTF-8
|
||||
$cCharset= (isset($_REQUEST['client_encode'])?trim($_REQUEST['client_encode']):'UTF-8');
|
||||
// @debug_switch Anzeige der xml-rfc Daten moegliche Stufen sind 0,1,2,3
|
||||
$debug_switch= (isset($_REQUEST['debug'])?$_REQUEST['debug']:0);
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Datenbankverbindungen zu Moodle und Vilesci und Classen
|
||||
// ***********************************************************************************************
|
||||
// DB Connect
|
||||
$conn=@pg_pconnect(CONN_STRING) or die('<div style="text-align:center;"><br />Datenbank zurzeit NICHT Online.<br />Bitte etwas Geduld.<br />Danke</div>');// Datenbankverbindung
|
||||
$conn_moodle = pg_pconnect(CONN_STRING_MOODLE) or die('<div style="text-align:center;"><br />MOODLE Datenbank zurzeit NICHT Online.<br />Bitte etwas Geduld.<br />Danke</div>');
|
||||
// Classen Instanzen
|
||||
$objMoodle = new moodle_course($conn, $conn_moodle);
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Verarbeitung einer Moodle-Kurs Loeschaktion
|
||||
// ***********************************************************************************************
|
||||
|
||||
if ($mdl_course_id!='' && $studiensemester_kurzbz!='') // Kurs wird zum bearbeiten (loeschen) freigegeben
|
||||
{
|
||||
include(dirname(__FILE__)."/xmlrpcutils/utils.php");
|
||||
// Aktuellen Moodle Server ermitteln.
|
||||
if (defined('MOODLE_PATH')) // Eintrag MOODLE_PATH in Vilesci config.inc.php. Hostname herausfiltern
|
||||
{
|
||||
$host = str_replace('https://','',str_replace('http://','',str_replace('/moodle','',str_replace('/moodle/','',MOODLE_PATH))));
|
||||
}
|
||||
elseif ($_SERVER["HTTP_HOST"]=="dav.technikum-wien.at" ) // Vilesci config.inc.php nicht erweitert HTTP_HOST pruefen
|
||||
{
|
||||
$host = 'dav.technikum-wien.at';
|
||||
}
|
||||
else // Produktivessystem
|
||||
{
|
||||
$host = 'cis.technikum-wien.at';
|
||||
}
|
||||
|
||||
// Variable Daten Initialisieren
|
||||
$uri = "/moodle/xmlrpc/xmlrpc.php";
|
||||
$method = "DeleteCourseByID";
|
||||
$args['CourseID']="$mdl_course_id";
|
||||
$port=$_SERVER["SERVER_PORT"];
|
||||
if ($debug_switch)
|
||||
{
|
||||
$content.="<br />Host:$host , Port:$port , Uri:$uri , Method:$method <br />";
|
||||
}
|
||||
$callspec = array(
|
||||
'method' => $method,
|
||||
'host' => $host,
|
||||
'port' => $port,
|
||||
'uri' => $uri,
|
||||
'user' => (isset($_SERVER["PHP_AUTH_USER"])?$_SERVER["PHP_AUTH_USER"]:""),
|
||||
'pass' => (isset($_SERVER["PHP_AUTH_PW"])?$_SERVER["PHP_AUTH_PW"]:""),
|
||||
'secure' =>false,
|
||||
'debug' => $debug_switch,
|
||||
'args' => $args);
|
||||
$result = xu_rpc_http_concise($callspec);
|
||||
// Return Information
|
||||
// $result[0] = Status true/false
|
||||
// $result[1] = Informationstext
|
||||
// $result[2] = Ausgabetext von Moodle
|
||||
if (!is_array($result)) // Server wurde nicht erreicht.
|
||||
{
|
||||
$content.="Fehler xmlrpc call $result";
|
||||
}
|
||||
else if ($result[0]==1) // Methodenaufruf erfolgreich
|
||||
{
|
||||
#$content.=(isset($result[1])?$result[1]:"Moodel-Kurs gelöscht ");
|
||||
$qry = "DELETE FROM lehre.tbl_moodle WHERE mdl_course_id='".addslashes($mdl_course_id)."' ";
|
||||
if ($moodle_id!='')
|
||||
$qry.= " and moodle_id='".addslashes($moodle_id)."'";
|
||||
if(!pg_query($conn, $qry))
|
||||
$content.="<p>Moodlekurs $mdl_course_id wurde NICHT gelöscht in Lehre.</p>";
|
||||
$content.="<h3>Moodlekurs $mdl_course_id wurde gelöscht.</h3>";
|
||||
}
|
||||
else // Result = 0 ein Fehler im RFC wurde festgestellt
|
||||
{
|
||||
$content.=(isset($result[1])?$result[1]:"Fehler beim Kurs löschen ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// HTML Auswahlfelder (Teil 1)
|
||||
// ***********************************************************************************************
|
||||
// FormName erzeugen
|
||||
$cFormName='searchMoodleCurse'.$studiensemester_kurzbz.$studiengang_kz.$semester;
|
||||
$content.='
|
||||
<form name="'.$cFormName.'" method="GET">
|
||||
<table><tr>';
|
||||
|
||||
// Studiensemester public.tbl_studiensemester_kurzbz
|
||||
$content.='<td>Studiensemester</td><td><select onchange="document.'.$cFormName.'.submit();" name="studiensemester_kurzbz">';
|
||||
$sql_query = "SELECT studiensemester_kurzbz,to_char(start,'YYYYMM') as \"startYYYYMM\",to_char(ende,'YYYYMM') as \"endeYYYYMM\" FROM public.tbl_studiensemester order by start; ";
|
||||
if ($result = @pg_query($conn, $sql_query))
|
||||
{
|
||||
while ($row = @pg_fetch_object($result))
|
||||
{
|
||||
// Gibt es noch keinen POST/GET Parameterwert den aktuellen Studiensemesterwert nehmen zum Positionieren in der Selektliste
|
||||
if (empty($studiensemester_kurzbz) && $cYYYYMM>=$row->startYYYYMM && $cYYYYMM<=$row->endeYYYYMM)
|
||||
$studiensemester_kurzbz=$row->studiensemester_kurzbz;
|
||||
|
||||
$content.='<option value="'.$row->studiensemester_kurzbz.'" '.(("$studiensemester_kurzbz"=="$row->studiensemester_kurzbz")?' selected="selected" ':'').'> '.$row->studiensemester_kurzbz.' </option>';
|
||||
}
|
||||
}
|
||||
$content.='</select></td>';
|
||||
|
||||
// Studiengang public.tbl_studiengang_kz
|
||||
$content.='<td>Studiengang</td><td><select onchange="document.'.$cFormName.'.submit();" name="studiengang_kz"><option value=""> Alle </option>';
|
||||
$sql_query = "SELECT studiengang_kz, UPPER(typ::varchar(1) || kurzbz) as kurzkz,kurzbzlang FROM public.tbl_studiengang where public.tbl_studiengang.moodle='t' ORDER BY kurzkz,kurzbzlang;";
|
||||
if ($result = @pg_query($conn, $sql_query))
|
||||
{
|
||||
while($row=@pg_fetch_object($result))
|
||||
{
|
||||
$content.='<option value="'.$row->studiengang_kz.'" '.(("$studiengang_kz"=="$row->studiengang_kz")?' selected="selected" ':'').'> '.$row->kurzkz.'-'.$row->kurzbzlang.' </option>';
|
||||
}
|
||||
}
|
||||
$content.='</select></td>';
|
||||
|
||||
// Semster public.tbl_studiengang_kz - max Semester des Selektierten Studiengangs
|
||||
$content.='<td>Semster</td><td><select onchange="document.'.$cFormName.'.submit();" name="semester"><option value=""> Alle </option>';
|
||||
if ($studiengang_kz!='')
|
||||
{
|
||||
$sql_query = "SELECT max_semester FROM public.tbl_studiengang where studiengang_kz='".addslashes($studiengang_kz)."' OFFSET 0 LIMIT 1 ;";
|
||||
$result = @pg_query($conn, $sql_query);
|
||||
if ($row = @pg_fetch_object($result))
|
||||
{
|
||||
for($i=0;$i<=$row->max_semester;$i++)
|
||||
{
|
||||
$content.='<option value="'.($i).'" '.(("$semester"=="$i")?' selected="selected" ':'').'> '.($i).' </option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$content.='</select></td>';
|
||||
$content.='
|
||||
<td><input name="anzeige" type="submit" value=" anzeigen "><input style="display:none" type="text" name="debug" value="'.htmlentities($debug_switch).'" /></td>
|
||||
</tr></table>
|
||||
</form>
|
||||
<hr>';
|
||||
|
||||
// ***********************************************************************************************
|
||||
// HTML Listenanzeige (Teil 2)
|
||||
// ***********************************************************************************************
|
||||
|
||||
// Bedingung zur Listenanzeige : Anzeige und Datengefunden
|
||||
if ($bAnzeige && $objMoodle && $objMoodle->getAllVariant('',$studiensemester_kurzbz,$studiengang_kz,$semester,true))
|
||||
{
|
||||
// Header Top mit Anzahl der gelisteten Kurse
|
||||
$content.= '<a name="top">'. count($objMoodle->result).' Kurs(e) gefunden</a>';
|
||||
|
||||
$content.='<table style="font-size:medium;border: 1px outset #F7F7F7;">';
|
||||
// Header Teil Information der Funktion
|
||||
$content.='<tr class="liste" align="center">';
|
||||
$content.='<th colspan="6">Moodlekurs</th>';
|
||||
$content.='<td colspan="2">Anzahl</td>';
|
||||
$content.='<td>Kurs</td>';
|
||||
$content.='</tr>';
|
||||
|
||||
// Headerinformation der Tabellenfelder
|
||||
$content.='<tr class="liste" align="center">';
|
||||
$content.='<th> Lehrveranstaltung </th>';
|
||||
$content.='<th> Kurzbz. </th>';
|
||||
$content.='<th> LV Id </th>';
|
||||
$content.='<th> StudiengangKz </th>';
|
||||
$content.='<th> Kursbezeichnung </th>';
|
||||
$content.='<th> ID </th>';
|
||||
$content.='<td> Benotungen </td>';
|
||||
$content.='<td title="Aktivitäten und Lehrmaterial"> Aktivitäten </td>';
|
||||
$content.='<td> Bearbeiten </td>';
|
||||
$content.='</tr>';
|
||||
|
||||
|
||||
// Alle Moodlekurse in einer Schleife anzeigen.
|
||||
for($i=0;$i<count($objMoodle->result);$i++)
|
||||
{
|
||||
// ZeilenCSS (gerade/ungerade) zur besseren Ansicht
|
||||
if ($i%2)
|
||||
$showCSS=' style="text-align: left;border: 1px outset #F7F7F7;padding: 1px 5px 1px 5px; background:#FEFFEC" ';
|
||||
else
|
||||
$showCSS=' style="text-align: left;border: 1px outset #F7F7F7;padding: 1px 5px 1px 5px; background:#FCFCFC" ';
|
||||
|
||||
// Listenzeile
|
||||
$content.='<tr '.$showCSS.' align="center">';
|
||||
$content.='<td '.$showCSS.'>'.$objMoodle->result[$i]->lehrveranstaltung_bezeichnung.'</td>';
|
||||
$content.='<td '.$showCSS.'>'.$objMoodle->result[$i]->lehrveranstaltung_kurzbz.'</td>';
|
||||
$content.='<td '.$showCSS.' title="Semester '.$objMoodle->result[$i]->lehrveranstaltung_semester.'">'.$objMoodle->result[$i]->lehrveranstaltung_id.'</td>';
|
||||
$content.='<td "'.$showCSS.'>'.$objMoodle->result[$i]->lehrveranstaltung_studiengang_kz.'</td>';
|
||||
$content.='<td '.$showCSS.'>'.$objMoodle->result[$i]->mdl_shortname.'</td>';
|
||||
$content.='<td '.$showCSS.' title="mdl_course_id:'.$objMoodle->result[$i]->mdl_course_id.'">'.$objMoodle->result[$i]->mdl_course_id.'</td>';
|
||||
|
||||
// Anzahl Benotungen
|
||||
$content.='<td title="Benotungen" '.$showCSS.'>'.$objMoodle->result[$i]->mdl_benotungen.'</td>';
|
||||
// Anzahl Aktivitaeten und Lehrmaterial
|
||||
$content.='<td title="Resourcen:'.$objMoodle->result[$i]->mdl_resource.', Quiz:'.$objMoodle->result[$i]->mdl_quiz.', Chat:'.$objMoodle->result[$i]->mdl_chat.', Forum:'.$objMoodle->result[$i]->mdl_forum.', Choice:'.$objMoodle->result[$i]->mdl_choice.'" '.$showCSS.'>'.($objMoodle->result[$i]->mdl_resource+$objMoodle->result[$i]->mdl_quiz+$objMoodle->result[$i]->mdl_chat + $objMoodle->result[$i]->mdl_forum + $objMoodle->result[$i]->mdl_choice ).'</td>';
|
||||
|
||||
// Bearbeitung Submit
|
||||
$content.= '<td style="cursor: pointer;" onclick="if (!window.confirm(\'Löschen Moodlekurs '.$objMoodle->result[$i]->mdl_course_id.', '.$objMoodle->result[$i]->lehrveranstaltung_bezeichnung.' ? \')) {return false;}; document.'.$cFormName.'_'.$i.'.submit();">';
|
||||
$content.='<form style="display: inline;border:0px;" name="'.$cFormName.'_'.$i.'" method="GET" target="_self" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$content.= '<input style="display:none" type="text" name="mdl_course_id" value="'.htmlentities($objMoodle->result[$i]->mdl_course_id).'" />';
|
||||
$content.= '<input style="display:none" type="text" name="studiensemester_kurzbz" value="'.htmlentities($studiensemester_kurzbz).'" />';
|
||||
$content.= '<input style="display:none" type="text" name="studiengang_kz" value="'.htmlentities($studiengang_kz).'" />';
|
||||
$content.= '<input style="display:none" type="text" name="semester" value="'.htmlentities($semester).'" />';
|
||||
$content.= '<input style="display:none" type="text" name="debug" value="'.htmlentities($debug_switch).'" />';
|
||||
$content.= '<img height="15" src="../../skin/images/table_row_delete.png" border="0" title="MoodleKurs entfernen" alt="table_row_delete.png" />';
|
||||
$content.= '<input onclick="this.checked=false;" onblur="this.checked=false;" type="checkbox" value="" style="'.(!stristr($_SERVER['HTTP_USER_AGENT'],'OPERA') && !stristr($_SERVER['HTTP_USER_AGENT'],'Safari')?'display:none;':'').'font-size: 4px;border:0px solid transparent;text-decoration:none; background-color: transparent;" name="check_va_detail_kal'.$i.'" />';
|
||||
$content.= 'entfernen';
|
||||
$content.='</form>';
|
||||
$content.= '</td>';
|
||||
$content.='</tr>';
|
||||
} // Ende Moodlekurse in einer Schleife anzeigen.
|
||||
$content.= '</table>';
|
||||
$content.= '<a href="#top">zum Anfang</a>';
|
||||
} // Ende IF Bedingung Anzeige + Datengefunden
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// HTML Header und Foot zum Content (Ausgabestring) hinzufuegen, und Anzeigen
|
||||
// ***********************************************************************************************
|
||||
$content='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Moodle - Kursverwaltung</title>
|
||||
<base target="main">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset='.$cCharset.'">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
</head>
|
||||
<body class="background_main">
|
||||
<h2>Moodle - Kursverwaltung</h2>
|
||||
<!-- MoodleKurs Content Start -->
|
||||
'.$content.'
|
||||
<!-- MoodleKurs Content Ende -->
|
||||
</body>
|
||||
</html>';
|
||||
exit($content);
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------------------
|
||||
# Testfunktion zur Anzeige einer übergebenen Variable oder Array, Default ist GLOBALS
|
||||
function Test($arr=constLeer,$lfd=0,$displayShow=true,$onlyRoot=false )
|
||||
{
|
||||
|
||||
$tmpArrayString='';
|
||||
if (!is_array($arr) && !is_object($arr)) return $arr;
|
||||
if (is_array($arr) && count($arr)<1 && $displayShow) return '';
|
||||
if (is_array($arr) && count($arr)<1 && $displayShow) return "<br /><b>function Test (???)</b><br />";
|
||||
|
||||
$lfdnr=$lfd + 1;
|
||||
$tmpAnzeigeStufe='';
|
||||
for ($i=1;$i<$lfdnr;$i++) $tmpAnzeigeStufe.="=";
|
||||
$tmpAnzeigeStufe.="=>";
|
||||
while (list( $tmp_key, $tmp_value ) = each($arr) )
|
||||
{
|
||||
if (!$onlyRoot && (is_array($tmp_value) || is_object($tmp_value)) && count($tmp_value) >0)
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe <b>$tmp_key</b>".Test($tmp_value,$lfdnr);
|
||||
} else if ( (is_array($tmp_value) || is_object($tmp_value)) )
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe <b>$tmp_key -- 0 Records</b>";
|
||||
} else if ($tmp_value!='')
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe $tmp_key :== ".$tmp_value;
|
||||
} else {
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe $tmp_key :-- (is Empty :: $tmp_value)";
|
||||
}
|
||||
}
|
||||
if ($lfd!='') { return $tmpArrayString; }
|
||||
if (!$displayShow) { return $tmpArrayString; }
|
||||
|
||||
$tmpArrayString.="<br />";
|
||||
$tmpArrayString="<br /><hr /><br />******* START *******<br />".$tmpArrayString."<br />******* ENDE *******<br /><hr /><br />";
|
||||
$tmpArrayString.="<br />Server:: ".$_SERVER['PHP_SELF']."<br />";
|
||||
return "$tmpArrayString";
|
||||
|
||||
|
||||
}
|
||||
<?php
|
||||
//@version $Id$
|
||||
/* 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 >
|
||||
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*/
|
||||
|
||||
/*
|
||||
* Dieses Programm listet nach Selektinskreterien alle Moodelkurse zu einem Studiengang auf.
|
||||
* Fuer jede MoodleID werden die Anzahl Benotungen, und erfassten sowie angelegte Zusaetze angezeigt.
|
||||
* Jeder der angezeigten Moodle IDs kann geloescht werden nach bestaetigung eines PopUp Fenster.
|
||||
*/
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Include Dateien
|
||||
// ***********************************************************************************************
|
||||
// ---------------- Standart Include Dateien einbinden
|
||||
require_once('../config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/globals.inc.php');
|
||||
// ---------------- Moodle Daten Classe
|
||||
include_once('../../include/moodle_course.class.php');
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Variable Initialisieren
|
||||
// ***********************************************************************************************
|
||||
// AusgabeStream
|
||||
$content='';
|
||||
// Vergleichsdatum Jahr und Monat fuer Studiensemester (Select-Auswahl)
|
||||
$cYYYYMM=date("Ym", mktime(0,0,0,date("m"),date("d"),date("y")));
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// POST oder GET Parameter einlesen
|
||||
// ***********************************************************************************************
|
||||
// @$studiensemester_kurzbz Studiensemester xxJJJJ - xx fuer SS Sommer oder WW Winter
|
||||
$studiensemester_kurzbz=(isset($_REQUEST['studiensemester_kurzbz'])?trim($_REQUEST['studiensemester_kurzbz']):'');
|
||||
// @$studiengang_kz Studiengang
|
||||
$studiengang_kz=(isset($_REQUEST['studiengang_kz'])?trim($_REQUEST['studiengang_kz']):'');
|
||||
// @$semester Semester des Studienganges
|
||||
$semester=(isset($_REQUEST['semester'])?trim($_REQUEST['semester']):'');
|
||||
// @$mdl_course_id Moodle Kurs ID
|
||||
$mdl_course_id= (isset($_REQUEST['mdl_course_id'])?$_REQUEST['mdl_course_id']:'');
|
||||
// @$moodle_id Moodle SubKurs (Unterkat.) ID zu Moodle Kurs ID (mdl_course_id)
|
||||
$moodle_id= (isset($_REQUEST['moodle_id'])?$_REQUEST['moodle_id']:'');
|
||||
// @$bAnzeige Listenanzeige wenn Submitbottom Anzeige gedrueckt wurde
|
||||
$bAnzeige= ($studiensemester_kurzbz!=''?True:False);
|
||||
// @cCharset Zeichensatz - Ajax mit UTF-8
|
||||
$cCharset= (isset($_REQUEST['client_encode'])?trim($_REQUEST['client_encode']):'UTF-8');
|
||||
// @debug_switch Anzeige der xml-rfc Daten moegliche Stufen sind 0,1,2,3
|
||||
$debug_switch= (isset($_REQUEST['debug'])?$_REQUEST['debug']:0);
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Datenbankverbindungen zu Moodle und Vilesci und Classen
|
||||
// ***********************************************************************************************
|
||||
// DB Connect
|
||||
$conn=@pg_pconnect(CONN_STRING) or die('<div style="text-align:center;"><br />Datenbank zurzeit NICHT Online.<br />Bitte etwas Geduld.<br />Danke</div>');// Datenbankverbindung
|
||||
$conn_moodle = pg_pconnect(CONN_STRING_MOODLE) or die('<div style="text-align:center;"><br />MOODLE Datenbank zurzeit NICHT Online.<br />Bitte etwas Geduld.<br />Danke</div>');
|
||||
// Classen Instanzen
|
||||
$objMoodle = new moodle_course($conn, $conn_moodle);
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// Verarbeitung einer Moodle-Kurs Loeschaktion
|
||||
// ***********************************************************************************************
|
||||
|
||||
if ($mdl_course_id!='' && $studiensemester_kurzbz!='') // Kurs wird zum bearbeiten (loeschen) freigegeben
|
||||
{
|
||||
include(dirname(__FILE__)."/xmlrpcutils/utils.php");
|
||||
// Aktuellen Moodle Server ermitteln.
|
||||
if (defined('MOODLE_PATH')) // Eintrag MOODLE_PATH in Vilesci config.inc.php. Hostname herausfiltern
|
||||
{
|
||||
$host = str_replace('https://','',str_replace('http://','',str_replace('/moodle','',str_replace('/moodle/','',MOODLE_PATH))));
|
||||
}
|
||||
elseif ($_SERVER["HTTP_HOST"]=="dav.technikum-wien.at" ) // Vilesci config.inc.php nicht erweitert HTTP_HOST pruefen
|
||||
{
|
||||
$host = 'dav.technikum-wien.at';
|
||||
}
|
||||
else // Produktivessystem
|
||||
{
|
||||
$host = 'cis.technikum-wien.at';
|
||||
}
|
||||
|
||||
// Variable Daten Initialisieren
|
||||
$uri = "/moodle/xmlrpc/xmlrpc.php";
|
||||
$method = "DeleteCourseByID";
|
||||
$args['CourseID']="$mdl_course_id";
|
||||
$port=$_SERVER["SERVER_PORT"];
|
||||
if ($debug_switch)
|
||||
{
|
||||
$content.="<br />Host:$host , Port:$port , Uri:$uri , Method:$method <br />";
|
||||
}
|
||||
$callspec = array(
|
||||
'method' => $method,
|
||||
'host' => $host,
|
||||
'port' => $port,
|
||||
'uri' => $uri,
|
||||
'user' => (isset($_SERVER["PHP_AUTH_USER"])?$_SERVER["PHP_AUTH_USER"]:""),
|
||||
'pass' => (isset($_SERVER["PHP_AUTH_PW"])?$_SERVER["PHP_AUTH_PW"]:""),
|
||||
'secure' =>false,
|
||||
'debug' => $debug_switch,
|
||||
'args' => $args);
|
||||
$result = xu_rpc_http_concise($callspec);
|
||||
// Return Information
|
||||
// $result[0] = Status true/false
|
||||
// $result[1] = Informationstext
|
||||
// $result[2] = Ausgabetext von Moodle
|
||||
if (!is_array($result)) // Server wurde nicht erreicht.
|
||||
{
|
||||
$content.="Fehler xmlrpc call $result";
|
||||
}
|
||||
else if ($result[0]==1) // Methodenaufruf erfolgreich
|
||||
{
|
||||
#$content.=(isset($result[1])?$result[1]:"Moodel-Kurs gelöscht ");
|
||||
$qry = "DELETE FROM lehre.tbl_moodle WHERE mdl_course_id='".addslashes($mdl_course_id)."' ";
|
||||
if ($moodle_id!='')
|
||||
$qry.= " and moodle_id='".addslashes($moodle_id)."'";
|
||||
if(!pg_query($conn, $qry))
|
||||
$content.="<p>Moodlekurs $mdl_course_id wurde NICHT gelöscht in Lehre.</p>";
|
||||
$content.="<h3>Moodlekurs $mdl_course_id wurde gelöscht.</h3>";
|
||||
}
|
||||
else // Result = 0 ein Fehler im RFC wurde festgestellt
|
||||
{
|
||||
$content.=(isset($result[1])?$result[1]:"Fehler beim Kurs löschen ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// HTML Auswahlfelder (Teil 1)
|
||||
// ***********************************************************************************************
|
||||
// FormName erzeugen
|
||||
$cFormName='searchMoodleCurse'.$studiensemester_kurzbz.$studiengang_kz.$semester;
|
||||
$content.='
|
||||
<form accept-charset="UTF-8" name="'.$cFormName.'" method="GET">
|
||||
<table><tr>';
|
||||
|
||||
// Studiensemester public.tbl_studiensemester_kurzbz
|
||||
$content.='<td>Studiensemester</td><td><select onchange="document.'.$cFormName.'.submit();" name="studiensemester_kurzbz">';
|
||||
$sql_query = "SELECT studiensemester_kurzbz,to_char(start,'YYYYMM') as \"startYYYYMM\",to_char(ende,'YYYYMM') as \"endeYYYYMM\" FROM public.tbl_studiensemester order by start; ";
|
||||
if ($result = @pg_query($conn, $sql_query))
|
||||
{
|
||||
while ($row = @pg_fetch_object($result))
|
||||
{
|
||||
// Gibt es noch keinen POST/GET Parameterwert den aktuellen Studiensemesterwert nehmen zum Positionieren in der Selektliste
|
||||
if (empty($studiensemester_kurzbz) && $cYYYYMM>=$row->startYYYYMM && $cYYYYMM<=$row->endeYYYYMM)
|
||||
$studiensemester_kurzbz=$row->studiensemester_kurzbz;
|
||||
|
||||
$content.='<option value="'.$row->studiensemester_kurzbz.'" '.(("$studiensemester_kurzbz"=="$row->studiensemester_kurzbz")?' selected="selected" ':'').'> '.$row->studiensemester_kurzbz.' </option>';
|
||||
}
|
||||
}
|
||||
$content.='</select></td>';
|
||||
|
||||
// Studiengang public.tbl_studiengang_kz
|
||||
$content.='<td>Studiengang</td><td><select onchange="document.'.$cFormName.'.submit();" name="studiengang_kz"><option value=""> Alle </option>';
|
||||
$sql_query = "SELECT studiengang_kz, UPPER(typ::varchar(1) || kurzbz) as kurzkz,kurzbzlang FROM public.tbl_studiengang where public.tbl_studiengang.moodle='t' ORDER BY kurzkz,kurzbzlang;";
|
||||
if ($result = @pg_query($conn, $sql_query))
|
||||
{
|
||||
while($row=@pg_fetch_object($result))
|
||||
{
|
||||
$content.='<option value="'.$row->studiengang_kz.'" '.(("$studiengang_kz"=="$row->studiengang_kz")?' selected="selected" ':'').'> '.$row->kurzkz.'-'.$row->kurzbzlang.' </option>';
|
||||
}
|
||||
}
|
||||
$content.='</select></td>';
|
||||
|
||||
// Semster public.tbl_studiengang_kz - max Semester des Selektierten Studiengangs
|
||||
$content.='<td>Semster</td><td><select onchange="document.'.$cFormName.'.submit();" name="semester"><option value=""> Alle </option>';
|
||||
if ($studiengang_kz!='')
|
||||
{
|
||||
$sql_query = "SELECT max_semester FROM public.tbl_studiengang where studiengang_kz='".addslashes($studiengang_kz)."' OFFSET 0 LIMIT 1 ;";
|
||||
$result = @pg_query($conn, $sql_query);
|
||||
if ($row = @pg_fetch_object($result))
|
||||
{
|
||||
for($i=0;$i<=$row->max_semester;$i++)
|
||||
{
|
||||
$content.='<option value="'.($i).'" '.(("$semester"=="$i")?' selected="selected" ':'').'> '.($i).' </option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$content.='</select></td>';
|
||||
$content.='
|
||||
<td><input name="anzeige" type="submit" value=" anzeigen "><input style="display:none" type="text" name="debug" value="'.$debug_switch.'" /></td>
|
||||
</tr></table>
|
||||
</form>
|
||||
<hr>';
|
||||
|
||||
// ***********************************************************************************************
|
||||
// HTML Listenanzeige (Teil 2)
|
||||
// ***********************************************************************************************
|
||||
|
||||
// Bedingung zur Listenanzeige : Anzeige und Datengefunden
|
||||
if ($bAnzeige && $objMoodle && $objMoodle->getAllVariant('',$studiensemester_kurzbz,$studiengang_kz,$semester,true))
|
||||
{
|
||||
// Header Top mit Anzahl der gelisteten Kurse
|
||||
$content.= '<a name="top">'. count($objMoodle->result).' Kurs(e) gefunden</a>';
|
||||
|
||||
$content.='<table style="font-size:medium;border: 1px outset #F7F7F7;">';
|
||||
// Header Teil Information der Funktion
|
||||
$content.='<tr class="liste" align="center">';
|
||||
$content.='<th colspan="6">Moodlekurs</th>';
|
||||
$content.='<td colspan="2">Anzahl</td>';
|
||||
$content.='<td>Kurs</td>';
|
||||
$content.='</tr>';
|
||||
|
||||
// Headerinformation der Tabellenfelder
|
||||
$content.='<tr class="liste" align="center">';
|
||||
$content.='<th> Lehrveranstaltung </th>';
|
||||
$content.='<th> Kurzbz. </th>';
|
||||
$content.='<th> LV Id </th>';
|
||||
$content.='<th> StudiengangKz </th>';
|
||||
$content.='<th> Kursbezeichnung </th>';
|
||||
$content.='<th> ID </th>';
|
||||
$content.='<td> Benotungen </td>';
|
||||
$content.='<td title="Aktivitäten und Lehrmaterial"> Aktivitäten </td>';
|
||||
$content.='<td> Bearbeiten </td>';
|
||||
$content.='</tr>';
|
||||
|
||||
|
||||
// Alle Moodlekurse in einer Schleife anzeigen.
|
||||
for($i=0;$i<count($objMoodle->result);$i++)
|
||||
{
|
||||
// ZeilenCSS (gerade/ungerade) zur besseren Ansicht
|
||||
if ($i%2)
|
||||
$showCSS=' style="text-align: left;border: 1px outset #F7F7F7;padding: 1px 5px 1px 5px; background:#FEFFEC" ';
|
||||
else
|
||||
$showCSS=' style="text-align: left;border: 1px outset #F7F7F7;padding: 1px 5px 1px 5px; background:#FCFCFC" ';
|
||||
|
||||
// Listenzeile
|
||||
$content.='<tr '.$showCSS.' align="center">';
|
||||
$content.='<td '.$showCSS.'>'.$objMoodle->result[$i]->lehrveranstaltung_bezeichnung.'</td>';
|
||||
$content.='<td '.$showCSS.'>'.$objMoodle->result[$i]->lehrveranstaltung_kurzbz.'</td>';
|
||||
$content.='<td '.$showCSS.' title="Semester '.$objMoodle->result[$i]->lehrveranstaltung_semester.'">'.$objMoodle->result[$i]->lehrveranstaltung_id.'</td>';
|
||||
$content.='<td "'.$showCSS.'>'.$objMoodle->result[$i]->lehrveranstaltung_studiengang_kz.'</td>';
|
||||
$content.='<td '.$showCSS.'>'.$objMoodle->result[$i]->mdl_shortname.'</td>';
|
||||
$content.='<td '.$showCSS.' title="mdl_course_id:'.$objMoodle->result[$i]->mdl_course_id.'">'.$objMoodle->result[$i]->mdl_course_id.'</td>';
|
||||
|
||||
// Anzahl Benotungen
|
||||
$content.='<td title="Benotungen" '.$showCSS.'>'.$objMoodle->result[$i]->mdl_benotungen.'</td>';
|
||||
// Anzahl Aktivitaeten und Lehrmaterial
|
||||
$content.='<td title="Resourcen:'.$objMoodle->result[$i]->mdl_resource.', Quiz:'.$objMoodle->result[$i]->mdl_quiz.', Chat:'.$objMoodle->result[$i]->mdl_chat.', Forum:'.$objMoodle->result[$i]->mdl_forum.', Choice:'.$objMoodle->result[$i]->mdl_choice.'" '.$showCSS.'>'.($objMoodle->result[$i]->mdl_resource+$objMoodle->result[$i]->mdl_quiz+$objMoodle->result[$i]->mdl_chat + $objMoodle->result[$i]->mdl_forum + $objMoodle->result[$i]->mdl_choice ).'</td>';
|
||||
|
||||
// Bearbeitung Submit
|
||||
$content.= '<td style="cursor: pointer;" onclick="if (!window.confirm(\'Löschen Moodlekurs '.$objMoodle->result[$i]->mdl_course_id.', '.$objMoodle->result[$i]->lehrveranstaltung_bezeichnung.' ? \')) {return false;}; document.'.$cFormName.'_'.$i.'.submit();">';
|
||||
$content.='<form style="display: inline;border:0px;" name="'.$cFormName.'_'.$i.'" method="GET" target="_self" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$content.= '<input style="display:none" type="text" name="mdl_course_id" value="'.htmlentities($objMoodle->result[$i]->mdl_course_id).'" />';
|
||||
$content.= '<input style="display:none" type="text" name="studiensemester_kurzbz" value="'.htmlentities($studiensemester_kurzbz).'" />';
|
||||
$content.= '<input style="display:none" type="text" name="studiengang_kz" value="'.htmlentities($studiengang_kz).'" />';
|
||||
$content.= '<input style="display:none" type="text" name="semester" value="'.htmlentities($semester).'" />';
|
||||
$content.= '<input style="display:none" type="text" name="debug" value="'.htmlentities($debug_switch).'" />';
|
||||
$content.= '<img height="15" src="../../skin/images/table_row_delete.png" border="0" title="MoodleKurs entfernen" alt="table_row_delete.png" />';
|
||||
$content.= '<input onclick="this.checked=false;" onblur="this.checked=false;" type="checkbox" value="" style="'.(!stristr($_SERVER['HTTP_USER_AGENT'],'OPERA') && !stristr($_SERVER['HTTP_USER_AGENT'],'Safari')?'display:none;':'').'font-size: 4px;border:0px solid transparent;text-decoration:none; background-color: transparent;" name="check_va_detail_kal'.$i.'" />';
|
||||
$content.= 'entfernen';
|
||||
$content.='</form>';
|
||||
$content.= '</td>';
|
||||
$content.='</tr>';
|
||||
} // Ende Moodlekurse in einer Schleife anzeigen.
|
||||
$content.= '</table>';
|
||||
$content.= '<a href="#top">zum Anfang</a>';
|
||||
} // Ende IF Bedingung Anzeige + Datengefunden
|
||||
|
||||
|
||||
// ***********************************************************************************************
|
||||
// HTML Header und Foot zum Content (Ausgabestring) hinzufuegen, und Anzeigen
|
||||
// ***********************************************************************************************
|
||||
$content='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Moodle - Kursverwaltung</title>
|
||||
<base target="main">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset='.$cCharset.'">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
</head>
|
||||
<body class="background_main">
|
||||
<h2>Moodle - Kursverwaltung</h2>
|
||||
<!-- MoodleKurs Content Start -->
|
||||
'.$content.'
|
||||
<!-- MoodleKurs Content Ende -->
|
||||
</body>
|
||||
</html>';
|
||||
exit($content);
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------------------
|
||||
# Testfunktion zur Anzeige einer übergebenen Variable oder Array, Default ist GLOBALS
|
||||
function Test($arr=constLeer,$lfd=0,$displayShow=true,$onlyRoot=false )
|
||||
{
|
||||
|
||||
$tmpArrayString='';
|
||||
if (!is_array($arr) && !is_object($arr)) return $arr;
|
||||
if (is_array($arr) && count($arr)<1 && $displayShow) return '';
|
||||
if (is_array($arr) && count($arr)<1 && $displayShow) return "<br /><b>function Test (???)</b><br />";
|
||||
|
||||
$lfdnr=$lfd + 1;
|
||||
$tmpAnzeigeStufe='';
|
||||
for ($i=1;$i<$lfdnr;$i++) $tmpAnzeigeStufe.="=";
|
||||
$tmpAnzeigeStufe.="=>";
|
||||
while (list( $tmp_key, $tmp_value ) = each($arr) )
|
||||
{
|
||||
if (!$onlyRoot && (is_array($tmp_value) || is_object($tmp_value)) && count($tmp_value) >0)
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe <b>$tmp_key</b>".Test($tmp_value,$lfdnr);
|
||||
} else if ( (is_array($tmp_value) || is_object($tmp_value)) )
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe <b>$tmp_key -- 0 Records</b>";
|
||||
} else if ($tmp_value!='')
|
||||
{
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe $tmp_key :== ".$tmp_value;
|
||||
} else {
|
||||
$tmpArrayString.="<br />$tmpAnzeigeStufe $tmp_key :-- (is Empty :: $tmp_value)";
|
||||
}
|
||||
}
|
||||
if ($lfd!='') { return $tmpArrayString; }
|
||||
if (!$displayShow) { return $tmpArrayString; }
|
||||
|
||||
$tmpArrayString.="<br />";
|
||||
$tmpArrayString="<br /><hr /><br />******* START *******<br />".$tmpArrayString."<br />******* ENDE *******<br /><hr /><br />";
|
||||
$tmpArrayString.="<br />Server:: ".$_SERVER['PHP_SELF']."<br />";
|
||||
return "$tmpArrayString";
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
+179
-179
@@ -1,180 +1,180 @@
|
||||
<?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/studiengang.class.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/betriebsmittelperson.class.php');
|
||||
|
||||
if(!$conn=pg_pconnect(CONN_STRING))
|
||||
die("Konnte Verbindung zur Datenbank nicht herstellen");
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
//Berechtigung pruefen
|
||||
$rechte = new benutzerberechtigung($conn);
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('admin',0) && !$rechte->isBerechtigt('support'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
echo '<html>
|
||||
<head>
|
||||
<title>Betriebsmittel</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<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>
|
||||
<script language="Javascript">
|
||||
function confdel()
|
||||
{
|
||||
return confirm("Wollen Sie diesen Eintrag wirklich loeschen");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="Background_main">
|
||||
<h2>Betriebsmittel</h2>
|
||||
';
|
||||
|
||||
$search = (isset($_REQUEST['search'])?$_REQUEST['search']:'');
|
||||
|
||||
//Loeschen eines Datensatzes
|
||||
if(isset($_GET['type']) && $_GET['type']=='delete')
|
||||
{
|
||||
if(isset($_GET['betriebsmittel_id']) && is_numeric($_GET['betriebsmittel_id'])
|
||||
&& isset($_GET['person_id']) && is_numeric($_GET['person_id']))
|
||||
{
|
||||
$bmp = new betriebsmittelperson($conn);
|
||||
if($bmp->delete($_GET['betriebsmittel_id'], $_GET['person_id']))
|
||||
echo '<b>Datensatz wurde geloescht</b>';
|
||||
else
|
||||
echo '<b>Fehler beim Loeschen des Datensatzes: '.$bmp->errormsg.'</b>';
|
||||
}
|
||||
else
|
||||
{
|
||||
die('Fehlerhafte Parameteruebergabe');
|
||||
}
|
||||
}
|
||||
|
||||
echo '<table width="100%"><tr><td>
|
||||
<form method="POST">
|
||||
Nummer/Uid: <input type="text" name="search" value="'.htmlentities($search).'">
|
||||
<input type="submit" value="Suchen" name="suche">
|
||||
</form></td><td align="right"><a href="betriebsmitteldetail.php" target="detail">NEU</a></td></tr></table><br><br>';
|
||||
|
||||
if($search!='')
|
||||
{
|
||||
//Suche in Datenbank
|
||||
$qry = "SELECT distinct tbl_betriebsmittelperson.*, tbl_betriebsmittel.*, tbl_person.*, tbl_betriebsmittelperson.updateamum as updateamum, tbl_betriebsmittelperson.updatevon as updatevon FROM
|
||||
public.tbl_betriebsmittelperson
|
||||
JOIN public.tbl_betriebsmittel USING(betriebsmittel_id)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
LEFT JOIN public.tbl_benutzer USING(person_id)
|
||||
WHERE nummer='".addslashes($search)."' OR uid='".addslashes($search)."'";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
echo "<b>Datenbank Result</b><br><table class='liste table-autosort:2 table-stripeclass:alternate table-autostripe'>
|
||||
<thead>
|
||||
<tr class='liste'>";
|
||||
echo "<th class='table-sortable:default'>Nummer</th>
|
||||
<th class='table-sortable:default'>Typ</th>
|
||||
<th class='table-sortable:default'>Kaution</th>
|
||||
<th class='table-sortable:default'>Ausgegeben</th>
|
||||
<th class='table-sortable:default'>Retour</th>
|
||||
<th class='table-sortable:default'>Vorname</th>
|
||||
<th class='table-sortable:default'>Nachname</th>
|
||||
<th class='table-sortable:default'>UID</th>
|
||||
<th class='table-sortable:default'>UpdateAmUm</th>
|
||||
<th class='table-sortable:default'>UpdateVon</th>
|
||||
<th class='table-sortable:default' colspan='2'>Aktion</th>";
|
||||
echo '</tr></thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
echo "<tr>";
|
||||
echo "<td>$row->nummer</td>";
|
||||
echo "<td>$row->betriebsmitteltyp</td>";
|
||||
echo "<td>$row->kaution</td>";
|
||||
echo "<td>$row->ausgegebenam</td>";
|
||||
echo "<td>$row->retouram</td>";
|
||||
echo "<td>$row->vorname</td>";
|
||||
echo "<td>$row->nachname</td>";
|
||||
echo "<td>";
|
||||
//Alle UIDs zu dieser Person suchen
|
||||
$qry_uid = "SELECT uid FROM public.tbl_benutzer WHERE person_id='$row->person_id'";
|
||||
if($result_uid = pg_query($conn, $qry_uid))
|
||||
{
|
||||
while($row_uid = pg_fetch_object($result_uid))
|
||||
{
|
||||
echo "<a href='personen_details.php?uid=$row_uid->uid' target='_top'>$row_uid->uid</a><br>";
|
||||
}
|
||||
}
|
||||
echo "</td>";
|
||||
echo "<td>$row->updateamum</td>";
|
||||
echo "<td>$row->updatevon</td>";
|
||||
echo "<td><a href='betriebsmitteldetail.php?betriebsmittel_id=$row->betriebsmittel_id&person_id=$row->person_id' target='detail'>edit</a></td>";
|
||||
echo "<td><a href='".$_SERVER['PHP_SELF']."?search=$search&type=delete&betriebsmittel_id=$row->betriebsmittel_id&person_id=$row->person_id' onclick='return confdel()'>delete</a></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
}
|
||||
|
||||
//Suche im LDAP
|
||||
|
||||
// LDAP Verbindung herstellen
|
||||
$ds=ldap_connect(LDAP_SERVER);
|
||||
|
||||
if ($ds)
|
||||
$r=ldap_bind($ds); // this is an "anonymous" bind, typically
|
||||
else
|
||||
echo "<h4>Unable to connect to LDAP server</h4>";
|
||||
|
||||
if(is_numeric($search))
|
||||
$sr=ldap_search($ds, "ou=People, dc=technikum-wien, dc=at", "departmentNumber=".$search);
|
||||
else
|
||||
$sr=ldap_search($ds, "ou=People, dc=technikum-wien, dc=at", "uid=".$search);
|
||||
|
||||
$info = ldap_get_entries($ds, $sr);
|
||||
|
||||
echo "<br><b>LDAP Result</b><br><table class='liste table-autosort:2 table-stripeclass:alternate table-autostripe'>
|
||||
<thead>
|
||||
<tr class='liste'>";
|
||||
echo "<th class='table-sortable:default'>Kartennummer</th>
|
||||
<th class='table-sortable:default'>UID</th>
|
||||
<th class='table-sortable:default'>Name</th>";
|
||||
echo '</tr></thead>';
|
||||
echo '<tbody>';
|
||||
//Kartennummer
|
||||
echo '<tr><td>'.(isset($info[0]['departmentnumber'][0])?$info[0]['departmentnumber'][0]:'').'</td>';
|
||||
//UID
|
||||
echo '<td>'.(isset($info[0]['uid'][0])?$info[0]['uid'][0]:'').'</td>';
|
||||
//Gesamter Name
|
||||
echo '<td>'.(isset($info[0]['cn'][0])?$info[0]['cn'][0]:'').'</td></tr>';
|
||||
echo '</tbody></table>';
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
<?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/studiengang.class.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/betriebsmittelperson.class.php');
|
||||
|
||||
if(!$conn=pg_pconnect(CONN_STRING))
|
||||
die("Konnte Verbindung zur Datenbank nicht herstellen");
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
//Berechtigung pruefen
|
||||
$rechte = new benutzerberechtigung($conn);
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('admin',0) && !$rechte->isBerechtigt('support'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
echo '<html>
|
||||
<head>
|
||||
<title>Betriebsmittel</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<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>
|
||||
<script language="Javascript">
|
||||
function confdel()
|
||||
{
|
||||
return confirm("Wollen Sie diesen Eintrag wirklich loeschen");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="Background_main">
|
||||
<h2>Betriebsmittel</h2>
|
||||
';
|
||||
|
||||
$search = (isset($_REQUEST['search'])?$_REQUEST['search']:'');
|
||||
|
||||
//Loeschen eines Datensatzes
|
||||
if(isset($_GET['type']) && $_GET['type']=='delete')
|
||||
{
|
||||
if(isset($_GET['betriebsmittel_id']) && is_numeric($_GET['betriebsmittel_id'])
|
||||
&& isset($_GET['person_id']) && is_numeric($_GET['person_id']))
|
||||
{
|
||||
$bmp = new betriebsmittelperson($conn);
|
||||
if($bmp->delete($_GET['betriebsmittel_id'], $_GET['person_id']))
|
||||
echo '<b>Datensatz wurde geloescht</b>';
|
||||
else
|
||||
echo '<b>Fehler beim Loeschen des Datensatzes: '.$bmp->errormsg.'</b>';
|
||||
}
|
||||
else
|
||||
{
|
||||
die('Fehlerhafte Parameteruebergabe');
|
||||
}
|
||||
}
|
||||
|
||||
echo '<table width="100%"><tr><td>
|
||||
<form method="POST" enctype="multipart/form-data" accept-charset="UTF-8" action="'. $_SERVER['PHP_SELF'].'">
|
||||
Nummer/Uid: <input type="text" name="search" value="'.$search.'">
|
||||
<input type="submit" value="Suchen" name="suche">
|
||||
</form></td><td align="right"><a href="betriebsmitteldetail.php" target="detail">NEU</a></td></tr></table><br><br>';
|
||||
|
||||
if($search!='')
|
||||
{
|
||||
//Suche in Datenbank
|
||||
$qry = "SELECT distinct tbl_betriebsmittelperson.*, tbl_betriebsmittel.*, tbl_person.*, tbl_betriebsmittelperson.updateamum as updateamum, tbl_betriebsmittelperson.updatevon as updatevon FROM
|
||||
public.tbl_betriebsmittelperson
|
||||
JOIN public.tbl_betriebsmittel USING(betriebsmittel_id)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
LEFT JOIN public.tbl_benutzer USING(person_id)
|
||||
WHERE nummer='".addslashes($search)."' OR uid='".addslashes($search)."'";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
echo "<b>Datenbank Result</b><br><table class='liste table-autosort:2 table-stripeclass:alternate table-autostripe'>
|
||||
<thead>
|
||||
<tr class='liste'>";
|
||||
echo "<th class='table-sortable:default'>Nummer</th>
|
||||
<th class='table-sortable:default'>Typ</th>
|
||||
<th class='table-sortable:default'>Kaution</th>
|
||||
<th class='table-sortable:default'>Ausgegeben</th>
|
||||
<th class='table-sortable:default'>Retour</th>
|
||||
<th class='table-sortable:default'>Vorname</th>
|
||||
<th class='table-sortable:default'>Nachname</th>
|
||||
<th class='table-sortable:default'>UID</th>
|
||||
<th class='table-sortable:default'>UpdateAmUm</th>
|
||||
<th class='table-sortable:default'>UpdateVon</th>
|
||||
<th class='table-sortable:default' colspan='2'>Aktion</th>";
|
||||
echo '</tr></thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
echo "<tr>";
|
||||
echo "<td>$row->nummer</td>";
|
||||
echo "<td>$row->betriebsmitteltyp</td>";
|
||||
echo "<td>$row->kaution</td>";
|
||||
echo "<td>$row->ausgegebenam</td>";
|
||||
echo "<td>$row->retouram</td>";
|
||||
echo "<td>$row->vorname</td>";
|
||||
echo "<td>$row->nachname</td>";
|
||||
echo "<td>";
|
||||
//Alle UIDs zu dieser Person suchen
|
||||
$qry_uid = "SELECT uid FROM public.tbl_benutzer WHERE person_id='$row->person_id'";
|
||||
if($result_uid = pg_query($conn, $qry_uid))
|
||||
{
|
||||
while($row_uid = pg_fetch_object($result_uid))
|
||||
{
|
||||
echo "<a href='personen_details.php?uid=$row_uid->uid' target='_top'>$row_uid->uid</a><br>";
|
||||
}
|
||||
}
|
||||
echo "</td>";
|
||||
echo "<td>$row->updateamum</td>";
|
||||
echo "<td>$row->updatevon</td>";
|
||||
echo "<td><a href='betriebsmitteldetail.php?betriebsmittel_id=$row->betriebsmittel_id&person_id=$row->person_id' target='detail'>edit</a></td>";
|
||||
echo "<td><a href='".$_SERVER['PHP_SELF']."?search=$search&type=delete&betriebsmittel_id=$row->betriebsmittel_id&person_id=$row->person_id' onclick='return confdel()'>delete</a></td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
}
|
||||
|
||||
//Suche im LDAP
|
||||
|
||||
// LDAP Verbindung herstellen
|
||||
$ds=ldap_connect(LDAP_SERVER);
|
||||
|
||||
if ($ds)
|
||||
$r=ldap_bind($ds); // this is an "anonymous" bind, typically
|
||||
else
|
||||
echo "<h4>Unable to connect to LDAP server</h4>";
|
||||
|
||||
if(is_numeric($search))
|
||||
$sr=ldap_search($ds, "ou=People, dc=technikum-wien, dc=at", "departmentNumber=".$search);
|
||||
else
|
||||
$sr=ldap_search($ds, "ou=People, dc=technikum-wien, dc=at", "uid=".$search);
|
||||
|
||||
$info = ldap_get_entries($ds, $sr);
|
||||
|
||||
echo "<br><b>LDAP Result</b><br><table class='liste table-autosort:2 table-stripeclass:alternate table-autostripe'>
|
||||
<thead>
|
||||
<tr class='liste'>";
|
||||
echo "<th class='table-sortable:default'>Kartennummer</th>
|
||||
<th class='table-sortable:default'>UID</th>
|
||||
<th class='table-sortable:default'>Name</th>";
|
||||
echo '</tr></thead>';
|
||||
echo '<tbody>';
|
||||
//Kartennummer
|
||||
echo '<tr><td>'.(isset($info[0]['departmentnumber'][0])?$info[0]['departmentnumber'][0]:'').'</td>';
|
||||
//UID
|
||||
echo '<td>'.(isset($info[0]['uid'][0])?$info[0]['uid'][0]:'').'</td>';
|
||||
//Gesamter Name
|
||||
echo '<td>'.(isset($info[0]['cn'][0])?$info[0]['cn'][0]:'').'</td></tr>';
|
||||
echo '</tbody></table>';
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,254 +1,254 @@
|
||||
<?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/studiengang.class.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/betriebsmittelperson.class.php');
|
||||
require_once('../../include/betriebsmittel.class.php');
|
||||
require_once('../../include/datum.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();
|
||||
|
||||
echo '<html>
|
||||
<head>
|
||||
<title>Betriebsmittel Details</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
</head>
|
||||
<body class="Background_main">
|
||||
<h2>Details</h2>
|
||||
';
|
||||
|
||||
|
||||
if(!$rechte->isBerechtigt('admin', 0, 'suid') && !$rechte->isBerechtigt('support', null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
$betriebsmittel_id = (isset($_GET['betriebsmittel_id'])?$_GET['betriebsmittel_id']:'');
|
||||
$person_id = (isset($_REQUEST['person_id'])?$_REQUEST['person_id']:'');
|
||||
$error = false;
|
||||
|
||||
//Speichern der Daten
|
||||
if(isset($_POST['save']))
|
||||
{
|
||||
$bm = new betriebsmittel($conn);
|
||||
|
||||
//Nachschauen ob dieses Betriebsmittel schon existiert
|
||||
if($bm->getBetriebsmittel($_POST['betriebsmitteltyp'],$_POST['nummerold']))
|
||||
{
|
||||
if(count($bm->result)>0)
|
||||
{
|
||||
//Wenn ein Eintrag gefunden wurde, dann wird die Beschreibung aktualisiert
|
||||
if($bm->load($bm->result[0]->betriebsmittel_id))
|
||||
{
|
||||
$bm->beschreibung = $_POST['beschreibung'];
|
||||
$bm->nummer = $_POST['nummer'];
|
||||
$bm->updatevon = $user;
|
||||
$bm->updateamum = date('Y-m-d H:i:s');
|
||||
|
||||
if(!$bm->save(false))
|
||||
{
|
||||
$return = false;
|
||||
$error = true;
|
||||
echo 'Fehler beim Speichern des Betriebsmittels';
|
||||
}
|
||||
else
|
||||
{
|
||||
$betriebsmittel_id = $bm->betriebsmittel_id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$return = false;
|
||||
$error = true;
|
||||
echo 'Gefundener Eintrag konnte nicht geladen werden!?!?';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Wenn kein Eintrag gefunden wurde, dann wird ein neuer Eintrag angelegt
|
||||
$bm->betriebsmitteltyp = $_POST['betriebsmitteltyp'];
|
||||
$bm->nummer = $_POST['nummer'];
|
||||
$bm->beschreibung = $_POST['beschreibung'];
|
||||
$bm->reservieren = false;
|
||||
$bm->ort_kurzbz = null;
|
||||
$bm->insertamum = date('Y-m-d H:i:s');
|
||||
$bm->insertvon = $user;
|
||||
|
||||
if($bm->save(true))
|
||||
{
|
||||
$betriebsmittel_id = $bm->betriebsmittel_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = true;
|
||||
$return = false;
|
||||
echo 'Fehler beim Anlegen des Betriebsmittels';
|
||||
}
|
||||
}
|
||||
|
||||
//Zuordnung Betriebsmittel-Person anlegen
|
||||
$bmp = new betriebsmittelperson($conn);
|
||||
if($_POST['new']=='true')
|
||||
{
|
||||
if($bmp->load($betriebsmittel_id, $_POST['person_id']))
|
||||
{
|
||||
$bmp->updateamum = date('Y-m-d H:i:s');
|
||||
$bmp->updatevon = $user;
|
||||
$bmp->new = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = true;
|
||||
$return = false;
|
||||
echo 'Fehler beim Laden der Betriebmittelperson Zuordnung';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$bmp->insertamum = date('Y-m-d H:i:s');
|
||||
$bmp->insertvon = $user;
|
||||
$bmp->new = true;
|
||||
}
|
||||
|
||||
if(!$error)
|
||||
{
|
||||
$bmp->person_id = $_POST['person_id'];
|
||||
$bmp->betriebsmittel_id=$betriebsmittel_id;
|
||||
$bmp->anmerkung = $_POST['anmerkung'];
|
||||
$bmp->kaution = trim(str_replace(',','.',$_POST['kaution']));
|
||||
$bmp->ausgegebenam = $_POST['ausgegebenam'];
|
||||
$bmp->retouram = $_POST['retouram'];
|
||||
|
||||
if($bmp->save())
|
||||
{
|
||||
echo 'Daten wurden erfolgreich gespeichert';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $bmp->errormsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Fehler:'.$bm->errormsg;
|
||||
}
|
||||
}
|
||||
|
||||
$bm = new betriebsmittelperson($conn);
|
||||
|
||||
//Laden der Daten
|
||||
$new = 'false';
|
||||
if($betriebsmittel_id!='' && $person_id!='')
|
||||
{
|
||||
if(!$bm->load($betriebsmittel_id, $person_id))
|
||||
die('betriebsmittel konnte nicht geladen werden');
|
||||
else
|
||||
$new ='true';
|
||||
}
|
||||
else
|
||||
{
|
||||
$bm->kaution = '0.0';
|
||||
$bm->ausgegebenam = date('Y-m-d');
|
||||
$bm->betriebsmitteltyp = 'Zutrittskarte';
|
||||
}
|
||||
|
||||
$nummer = $bm->nummer;
|
||||
$beschreibung = $bm->beschreibung;
|
||||
$betriebsmitteltyp =$bm->betriebsmitteltyp;
|
||||
$kaution = $bm->kaution;
|
||||
$anmerkung = $bm->anmerkung;
|
||||
$ausgegebenam = ($bm->ausgegebenam!=''?date('d.m.Y', $datum_obj->mktime_fromdate($bm->ausgegebenam)):'');
|
||||
$retouram = ($bm->retouram!=''?date('d.m.Y', $datum_obj->mktime_fromdate($bm->retouram)):'');
|
||||
|
||||
|
||||
//Formular
|
||||
echo '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?betriebsmittel_id='.$betriebsmittel_id.'&person_id='.$person_id.'">';
|
||||
echo '<input type="hidden" name="new" value="'.$new.'">';
|
||||
echo '<table><tr><td valign="top">';
|
||||
echo '<table>';
|
||||
//Person
|
||||
echo '<tr><td>Person</td><td><SELECT name="person_id">';
|
||||
$qry = "SELECT distinct tbl_person.* FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) ORDER BY nachname, vorname";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($person_id == $row->person_id)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo '<option value="'.$row->person_id.'" '.$selected.'>'.$row->nachname.' '.$row->vorname.' '.$row->titelpre.' '.$row->titelpost.'</option>';
|
||||
}
|
||||
}
|
||||
echo '</SELECT></td></tr>';
|
||||
//TYP
|
||||
echo '<tr><td>Typ</td><td><SELECT name="betriebsmitteltyp">';
|
||||
$qry = "SELECT * FROM public.tbl_betriebsmitteltyp ORDER BY betriebsmitteltyp";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($row->betriebsmitteltyp==$betriebsmitteltyp)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo "<option value='$row->betriebsmitteltyp' $selected>$row->betriebsmitteltyp</option>";
|
||||
}
|
||||
}
|
||||
echo '</SELECT></td></tr>';
|
||||
//</table></td><td valign="top"><table>';
|
||||
//Nummer
|
||||
echo '<tr><td>Nummer</td><td><input type="text" name="nummer" value="'.htmlentities($nummer).'"><input type="hidden" name="nummerold" value="'.htmlentities($nummer).'"></td></tr>';
|
||||
//Beschreibung
|
||||
echo '<tr><td>Beschreibung</td><td><textarea name="beschreibung">'.htmlentities($beschreibung).'</textarea></td></tr>';
|
||||
echo '</table>';
|
||||
echo '</td><td valign="top">';
|
||||
//Kaution
|
||||
echo '<table><tr><td>Kaution</td><td><input type="text" name="kaution" value="'.htmlentities($kaution).'"></td></tr>';
|
||||
//Anmerkung
|
||||
echo '<tr><td>Anmerkung</td><td><textarea name="anmerkung">'.htmlentities($anmerkung).'</textarea></td></tr>';
|
||||
//echo '</table></td><td valign="top"><table>';
|
||||
//Ausgegeben am
|
||||
echo '<tr><td>Ausgegeben am</td><td><input type="text" name="ausgegebenam" value="'.htmlentities($ausgegebenam).'"></td></tr>';
|
||||
//Retour am
|
||||
echo '<tr><td>Retour am</td><td><input type="text" name="retouram" value="'.htmlentities($retouram).'"></td></tr>';
|
||||
echo '</table>';
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td></td><td></td><td></td><td align="right"><input type="submit" name="save" value="Speichern"></td></tr>';
|
||||
echo '</table>';
|
||||
echo '</form>';
|
||||
?>
|
||||
</body>
|
||||
<?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/studiengang.class.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/betriebsmittelperson.class.php');
|
||||
require_once('../../include/betriebsmittel.class.php');
|
||||
require_once('../../include/datum.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();
|
||||
|
||||
echo '<html>
|
||||
<head>
|
||||
<title>Betriebsmittel Details</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
</head>
|
||||
<body class="Background_main">
|
||||
<h2>Details</h2>
|
||||
';
|
||||
|
||||
|
||||
if(!$rechte->isBerechtigt('admin', 0, 'suid') && !$rechte->isBerechtigt('support', null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
$betriebsmittel_id = (isset($_GET['betriebsmittel_id'])?$_GET['betriebsmittel_id']:'');
|
||||
$person_id = (isset($_REQUEST['person_id'])?$_REQUEST['person_id']:'');
|
||||
$error = false;
|
||||
|
||||
//Speichern der Daten
|
||||
if(isset($_POST['save']))
|
||||
{
|
||||
$bm = new betriebsmittel($conn);
|
||||
|
||||
//Nachschauen ob dieses Betriebsmittel schon existiert
|
||||
if($bm->getBetriebsmittel($_POST['betriebsmitteltyp'],$_POST['nummerold']))
|
||||
{
|
||||
if(count($bm->result)>0)
|
||||
{
|
||||
//Wenn ein Eintrag gefunden wurde, dann wird die Beschreibung aktualisiert
|
||||
if($bm->load($bm->result[0]->betriebsmittel_id))
|
||||
{
|
||||
$bm->beschreibung = $_POST['beschreibung'];
|
||||
$bm->nummer = $_POST['nummer'];
|
||||
$bm->updatevon = $user;
|
||||
$bm->updateamum = date('Y-m-d H:i:s');
|
||||
|
||||
if(!$bm->save(false))
|
||||
{
|
||||
$return = false;
|
||||
$error = true;
|
||||
echo 'Fehler beim Speichern des Betriebsmittels';
|
||||
}
|
||||
else
|
||||
{
|
||||
$betriebsmittel_id = $bm->betriebsmittel_id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$return = false;
|
||||
$error = true;
|
||||
echo 'Gefundener Eintrag konnte nicht geladen werden!?!?';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Wenn kein Eintrag gefunden wurde, dann wird ein neuer Eintrag angelegt
|
||||
$bm->betriebsmitteltyp = $_POST['betriebsmitteltyp'];
|
||||
$bm->nummer = $_POST['nummer'];
|
||||
$bm->beschreibung = $_POST['beschreibung'];
|
||||
$bm->reservieren = false;
|
||||
$bm->ort_kurzbz = null;
|
||||
$bm->insertamum = date('Y-m-d H:i:s');
|
||||
$bm->insertvon = $user;
|
||||
|
||||
if($bm->save(true))
|
||||
{
|
||||
$betriebsmittel_id = $bm->betriebsmittel_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = true;
|
||||
$return = false;
|
||||
echo 'Fehler beim Anlegen des Betriebsmittels';
|
||||
}
|
||||
}
|
||||
|
||||
//Zuordnung Betriebsmittel-Person anlegen
|
||||
$bmp = new betriebsmittelperson($conn);
|
||||
if($_POST['new']=='true')
|
||||
{
|
||||
if($bmp->load($betriebsmittel_id, $_POST['person_id']))
|
||||
{
|
||||
$bmp->updateamum = date('Y-m-d H:i:s');
|
||||
$bmp->updatevon = $user;
|
||||
$bmp->new = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = true;
|
||||
$return = false;
|
||||
echo 'Fehler beim Laden der Betriebmittelperson Zuordnung';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$bmp->insertamum = date('Y-m-d H:i:s');
|
||||
$bmp->insertvon = $user;
|
||||
$bmp->new = true;
|
||||
}
|
||||
|
||||
if(!$error)
|
||||
{
|
||||
$bmp->person_id = $_POST['person_id'];
|
||||
$bmp->betriebsmittel_id=$betriebsmittel_id;
|
||||
$bmp->anmerkung = $_POST['anmerkung'];
|
||||
$bmp->kaution = trim(str_replace(',','.',$_POST['kaution']));
|
||||
$bmp->ausgegebenam = $_POST['ausgegebenam'];
|
||||
$bmp->retouram = $_POST['retouram'];
|
||||
|
||||
if($bmp->save())
|
||||
{
|
||||
echo 'Daten wurden erfolgreich gespeichert';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $bmp->errormsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'Fehler:'.$bm->errormsg;
|
||||
}
|
||||
}
|
||||
|
||||
$bm = new betriebsmittelperson($conn);
|
||||
|
||||
//Laden der Daten
|
||||
$new = 'false';
|
||||
if($betriebsmittel_id!='' && $person_id!='')
|
||||
{
|
||||
if(!$bm->load($betriebsmittel_id, $person_id))
|
||||
die('betriebsmittel konnte nicht geladen werden');
|
||||
else
|
||||
$new ='true';
|
||||
}
|
||||
else
|
||||
{
|
||||
$bm->kaution = '0.0';
|
||||
$bm->ausgegebenam = date('Y-m-d');
|
||||
$bm->betriebsmitteltyp = 'Zutrittskarte';
|
||||
}
|
||||
|
||||
$nummer = $bm->nummer;
|
||||
$beschreibung = $bm->beschreibung;
|
||||
$betriebsmitteltyp =$bm->betriebsmitteltyp;
|
||||
$kaution = $bm->kaution;
|
||||
$anmerkung = $bm->anmerkung;
|
||||
$ausgegebenam = ($bm->ausgegebenam!=''?date('d.m.Y', $datum_obj->mktime_fromdate($bm->ausgegebenam)):'');
|
||||
$retouram = ($bm->retouram!=''?date('d.m.Y', $datum_obj->mktime_fromdate($bm->retouram)):'');
|
||||
|
||||
|
||||
//Formular
|
||||
echo '<form accept-charset="UTF-8" method="POST" action="'.$_SERVER['PHP_SELF'].'?betriebsmittel_id='.$betriebsmittel_id.'&person_id='.$person_id.'">';
|
||||
echo '<input type="hidden" name="new" value="'.$new.'">';
|
||||
echo '<table><tr><td valign="top">';
|
||||
echo '<table>';
|
||||
//Person
|
||||
echo '<tr><td>Person</td><td><SELECT name="person_id">';
|
||||
$qry = "SELECT distinct tbl_person.* FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) ORDER BY nachname, vorname";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($person_id == $row->person_id)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo '<option value="'.$row->person_id.'" '.$selected.'>'.$row->nachname.' '.$row->vorname.' '.$row->titelpre.' '.$row->titelpost.'</option>';
|
||||
}
|
||||
}
|
||||
echo '</SELECT></td></tr>';
|
||||
//TYP
|
||||
echo '<tr><td>Typ</td><td><SELECT name="betriebsmitteltyp">';
|
||||
$qry = "SELECT * FROM public.tbl_betriebsmitteltyp ORDER BY betriebsmitteltyp";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($row->betriebsmitteltyp==$betriebsmitteltyp)
|
||||
$selected = 'selected';
|
||||
else
|
||||
$selected = '';
|
||||
|
||||
echo "<option value='$row->betriebsmitteltyp' $selected>$row->betriebsmitteltyp</option>";
|
||||
}
|
||||
}
|
||||
echo '</SELECT></td></tr>';
|
||||
//</table></td><td valign="top"><table>';
|
||||
//Nummer
|
||||
echo '<tr><td>Nummer</td><td><input type="text" name="nummer" value="'.$nummer.'"><input type="hidden" name="nummerold" value="'.$nummer.'"></td></tr>';
|
||||
//Beschreibung
|
||||
echo '<tr><td>Beschreibung</td><td><textarea name="beschreibung">'.$beschreibung.'</textarea></td></tr>';
|
||||
echo '</table>';
|
||||
echo '</td><td valign="top">';
|
||||
//Kaution
|
||||
echo '<table><tr><td>Kaution</td><td><input type="text" name="kaution" value="'.$kaution.'"></td></tr>';
|
||||
//Anmerkung
|
||||
echo '<tr><td>Anmerkung</td><td><textarea name="anmerkung">'.$anmerkung.'</textarea></td></tr>';
|
||||
//echo '</table></td><td valign="top"><table>';
|
||||
//Ausgegeben am
|
||||
echo '<tr><td>Ausgegeben am</td><td><input type="text" name="ausgegebenam" value="'.$ausgegebenam.'"></td></tr>';
|
||||
//Retour am
|
||||
echo '<tr><td>Retour am</td><td><input type="text" name="retouram" value="'.$retouram.'"></td></tr>';
|
||||
echo '</table>';
|
||||
echo '</td></tr>';
|
||||
echo '<tr><td></td><td></td><td></td><td align="right"><input type="submit" name="save" value="Speichern"></td></tr>';
|
||||
echo '</table>';
|
||||
echo '</form>';
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -249,7 +249,7 @@ echo $errormsg.'<br>';
|
||||
|
||||
// *** ADRESSEN ***
|
||||
echo "<h3>Adressen:</h3>";
|
||||
echo "<form action='".$_SERVER['PHP_SELF']."?person_id=$person_id' method='POST' />";
|
||||
echo "<form accept-charset='UTF-8' action='".$_SERVER['PHP_SELF']."?person_id=$person_id' method='POST' />";
|
||||
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_id);
|
||||
@@ -303,10 +303,10 @@ else
|
||||
}
|
||||
echo "<input type='hidden' name='adresse_id' value='".$adresse_id."' />";
|
||||
echo '<tr class="liste1">';
|
||||
echo "<td><input type='text' name='strasse' value='".htmlentities($strasse)."' /></td>";
|
||||
echo "<td><input type='text' name='plz' size='4' value='".htmlentities($plz)."' /></td>";
|
||||
echo "<td><input type='text' name='ort' value='".htmlentities($ort)."' /></td>";
|
||||
echo "<td><input type='text' name='gemeinde' value='".htmlentities($gemeinde)."' /></td>";
|
||||
echo "<td><input type='text' name='strasse' value='".$strasse."' /></td>";
|
||||
echo "<td><input type='text' name='plz' size='4' value='".$plz."' /></td>";
|
||||
echo "<td><input type='text' name='ort' value='".$ort."' /></td>";
|
||||
echo "<td><input type='text' name='gemeinde' value='".$gemeinde."' /></td>";
|
||||
echo "<td><SELECT name='nation'>";
|
||||
foreach ($nation_arr as $code=>$kurzbz)
|
||||
{
|
||||
@@ -408,9 +408,9 @@ else
|
||||
}
|
||||
echo "</SELECT></td>";
|
||||
|
||||
echo "<td><input type='text' name='kontakt' value='".htmlentities($kontakt)."' /></td>";
|
||||
echo "<td><input type='text' name='kontakt' value='".$kontakt."' /></td>";
|
||||
echo "<td><input type='checkbox' name='zustellung' ".($zustellung?'checked':'')." /></td>";
|
||||
echo "<td><input type='text' name='anmerkung' value='".htmlentities($anmerkung)."' /></td>";
|
||||
echo "<td><input type='text' name='anmerkung' value='".$anmerkung."' /></td>";
|
||||
echo "<td><SELECT name='firma'>";
|
||||
echo "<OPTION value=''>-- keine Auswahl --</OPTION>";
|
||||
foreach ($firma_arr as $id=>$kurzbz)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,286 +1,286 @@
|
||||
<?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');
|
||||
require_once('../../include/firma.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=UTF-8">
|
||||
<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>";
|
||||
$firma=new firma($conn);
|
||||
if($row->firma_id!='')
|
||||
$firma->load($row->firma_id);
|
||||
echo "<td>".$firma->name."</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>AufmerksamDurch</th>
|
||||
<th>Kontaktmedium (Woher)</th>
|
||||
<th>Studiengänge</th>
|
||||
<th>Schule</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>".$row->aufmerksamdurch_kurzbz."</td>";
|
||||
echo "<td>".$row->kontaktmedium_kurzbz."</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 '<td>';
|
||||
$firma = new firma($conn);
|
||||
$firma->load($row->firma_id);
|
||||
echo $firma->name;
|
||||
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->status_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>';
|
||||
<?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');
|
||||
require_once('../../include/firma.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=UTF-8">
|
||||
<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>";
|
||||
$firma=new firma($conn);
|
||||
if($row->firma_id!='')
|
||||
$firma->load($row->firma_id);
|
||||
echo "<td>".$firma->name."</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>AufmerksamDurch</th>
|
||||
<th>Kontaktmedium (Woher)</th>
|
||||
<th>Studiengänge</th>
|
||||
<th>Schule</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='".$row->anmerkung."'>".CutString($row->anmerkung, 50)."</td>";
|
||||
echo "<td>".$row->aufmerksamdurch_kurzbz."</td>";
|
||||
echo "<td>".$row->kontaktmedium_kurzbz."</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 '<td>';
|
||||
$firma = new firma($conn);
|
||||
$firma->load($row->firma_id);
|
||||
echo $firma->name;
|
||||
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->status_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>';
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,456 +1,456 @@
|
||||
<?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/datum.class.php');
|
||||
require_once('../../include/prestudent.class.php');
|
||||
require_once('../../include/studiensemester.class.php');
|
||||
require_once('../../include/log.class.php');
|
||||
require_once('../../include/mail.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();
|
||||
$stsem = new studiensemester($conn);
|
||||
$stsem_aktuell = $stsem->getaktorNext();
|
||||
|
||||
if(isset($_GET['studiengang_kz']))
|
||||
$studiengang_kz = $_GET['studiengang_kz'];
|
||||
else
|
||||
$studiengang_kz = '';
|
||||
|
||||
if(isset($_GET['studiensemester_kurzbz']))
|
||||
$studiensemester_kurzbz = $_GET['studiensemester_kurzbz'];
|
||||
else
|
||||
$studiensemester_kurzbz = '-1'; //$stsem_aktuell;
|
||||
|
||||
if(isset($_GET['bool_nichtfreigegeben']))
|
||||
$bool_nichtfreigegeben = true;
|
||||
else
|
||||
$bool_nichtfreigegeben = null;
|
||||
|
||||
if(isset($_GET['bool_uebernommen']))
|
||||
$bool_uebernommen = true;
|
||||
else
|
||||
$bool_uebernommen = null;
|
||||
|
||||
if(isset($_GET['bool_absage']))
|
||||
$bool_absage = true;
|
||||
else
|
||||
$bool_absage = false;
|
||||
|
||||
if(isset($_GET['filter']))
|
||||
$filter = $_GET['filter'];
|
||||
else
|
||||
$filter = '';
|
||||
|
||||
//Wenn auf Anzeigen geklickt wird, das Suchfeld nicht beruecksichtigen
|
||||
if(isset($_GET['anzeigen']))
|
||||
$filter='';
|
||||
|
||||
if(isset($_GET['kontaktmedium']))
|
||||
{
|
||||
$kontaktmedium = $_GET['kontaktmedium'];
|
||||
if($kontaktmedium=='')
|
||||
$kontaktmedium=null;
|
||||
}
|
||||
else
|
||||
$kontaktmedium = null;
|
||||
if(isset($_GET['erfassungsdatum_bis']) && $_GET['erfassungsdatum_bis']!='')
|
||||
$erfassungsdatum_bis = $_GET['erfassungsdatum_bis'];
|
||||
else
|
||||
$erfassungsdatum_bis=null;
|
||||
|
||||
if(isset($_GET['erfassungsdatum_von']) && $_GET['erfassungsdatum_von']!='')
|
||||
$erfassungsdatum_von = $_GET['erfassungsdatum_von'];
|
||||
else
|
||||
$erfassungsdatum_von=null;
|
||||
|
||||
//Doctype muss strict sein da sonst im IE der DIV nicht am oberen Rand fixiert ist
|
||||
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>PreInteressenten</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<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>
|
||||
<script language="Javascript">
|
||||
<!--
|
||||
function confdel()
|
||||
{
|
||||
if(confirm("Wollen Sie diesen Eintrag wirklich loeschen?"))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function sorttable()
|
||||
{
|
||||
//Meister IE braucht ein Timeout sonst sortiert er nicht
|
||||
window.setTimeout("Table.sort(document.getElementById(\'mytab\'),\'asc\')",10);
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
</head>
|
||||
<body class="Background_main" style="margin-top:0px; padding-top:0px;" onload="sorttable()" >
|
||||
<div style="position: fixed; background-color: white; width: 99%; padding-top:5px;">
|
||||
<h2>PreInteressenten</h2>
|
||||
';
|
||||
|
||||
if(!$rechte->isBerechtigt('admin', null, 'suid') &&
|
||||
!$rechte->isBerechtigt('preinteressent', null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
//DROP DOWNs anzeigen
|
||||
echo "<table width='100%'><tr><td><form action='".$_SERVER['PHP_SELF']."' method='GET'>";
|
||||
echo '<table><tr><td>Studiensemester: <SELECT name="studiensemester_kurzbz">';
|
||||
$stsem = new studiensemester($conn);
|
||||
$stsem->getAll();
|
||||
echo "<option value='-1' ".($studiensemester_kurzbz=='-1'?'selected':'').">-- alle --</option>";
|
||||
echo "<option value='' ".($studiensemester_kurzbz==''?'selected':'').">-- offen --</option>";
|
||||
foreach ($stsem->studiensemester as $row)
|
||||
{
|
||||
if($row->studiensemester_kurzbz==$studiensemester_kurzbz)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo "<option value='$row->studiensemester_kurzbz' $selected>$row->studiensemester_kurzbz</option>";
|
||||
}
|
||||
echo '</SELECT>';
|
||||
|
||||
echo ' Studiengang: <SELECT name="studiengang_kz">';
|
||||
echo "<option value=''>-- Alle --</option>";
|
||||
$stg = new studiengang($conn);
|
||||
$stg->getAll('typ, kurzbz');
|
||||
foreach ($stg->result as $row)
|
||||
{
|
||||
if($row->studiengang_kz==$studiengang_kz)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo "<option value='$row->studiengang_kz' $selected>$row->kuerzel</option>";
|
||||
}
|
||||
echo '</SELECT></td><td>';
|
||||
echo '<input type="checkbox" name="bool_nichtfreigegeben" '.($bool_nichtfreigegeben?'checked':'').'> nicht freigegeben';
|
||||
echo '<input type="checkbox" name="bool_absage" '.($bool_absage?'checked':'').'> Absage<br>';
|
||||
echo '<input type="checkbox" name="bool_uebernommen" '.($bool_uebernommen?'checked':'').'> freigegeben aber nicht übernommen</td><td>';
|
||||
echo ' <input type="submit" name="anzeigen" value="Anzeigen"></td></tr>';
|
||||
echo '<tr><td>Kontaktmedium: <SELECT name="kontaktmedium">';
|
||||
$qry="SELECT * FROM public.tbl_kontaktmedium ORDER BY beschreibung";
|
||||
echo "<option value='' >-- Alle --</option>";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($row->kontaktmedium_kurzbz==$kontaktmedium)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
echo "<option value='$row->kontaktmedium_kurzbz' $selected>$row->beschreibung</option>";
|
||||
}
|
||||
}
|
||||
echo '</SELECT></td><td>';
|
||||
echo 'Erf. von <input type="text" size="10" maxlength="10" name="erfassungsdatum_von" value="'.$erfassungsdatum_von.'">';
|
||||
echo 'Erf. bis <input type="text" size="10" maxlength="10" name="erfassungsdatum_bis" value="'.$erfassungsdatum_bis.'">';
|
||||
echo '</td></tr>';
|
||||
echo '</table>';
|
||||
//echo '</form>';
|
||||
echo '</td><td>';
|
||||
//echo "<form action='".$_SERVER['PHP_SELF']."' method='GET'>";
|
||||
echo "<input type='text' value='".htmlentities($filter,ENT_QUOTES)."' name='filter'> ";
|
||||
echo "<input type='submit' size='10' name='suchen' value='Suchen'>";
|
||||
echo '</form></td>';
|
||||
echo '<td align="right"><a href="preinteressent_anlegen.php" target="_blank">neuen Preinteressenten anlegen</a></td></tr></table>';
|
||||
|
||||
//FREIGEBEN / LOESCHEN
|
||||
if(isset($_GET['action']))
|
||||
{
|
||||
if($_GET['action']=='freigabe')
|
||||
{
|
||||
$preinteressent = new preinteressent($conn);
|
||||
$preinteressent->load($_GET['id']);
|
||||
|
||||
if($preinteressent->studiensemester_kurzbz!='')
|
||||
{
|
||||
$errormsg = '';
|
||||
$anzahl_freigegeben=0;
|
||||
$anzahl_fehler=0;
|
||||
$qry = "SELECT * FROM public.tbl_preinteressentstudiengang
|
||||
WHERE preinteressent_id='".addslashes($_GET['id'])."'
|
||||
AND prioritaet = (SELECT max(prioritaet)
|
||||
FROM public.tbl_preinteressentstudiengang
|
||||
WHERE preinteressent_id='".addslashes($_GET['id'])."')
|
||||
AND freigabedatum is null";
|
||||
//Zuordnungen holen die noch nicht freigegeben wurden und die hoechste Prioritaet haben
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
//Nur diejenigen nehmen die noch nicht als Prestudent vorhanden sind
|
||||
$qry = "SELECT count(*) as anzahl FROM public.tbl_preinteressent JOIN public.tbl_prestudent USING(person_id) WHERE preinteressent_id='$row->preinteressent_id' AND studiengang_kz='$row->studiengang_kz'";
|
||||
if($result_std = pg_query($conn, $qry))
|
||||
{
|
||||
if($row_std = pg_fetch_object($result_std))
|
||||
{
|
||||
if($row_std->anzahl==0)
|
||||
{
|
||||
$preinteressent = new preinteressent($conn);
|
||||
$preinteressent->loadZuordnung($row->preinteressent_id, $row->studiengang_kz);
|
||||
|
||||
$preinteressent->freigabedatum = date('Y-m-d H:i:s');
|
||||
$preinteressent->updateamum = date('Y-m-d H:i:s');
|
||||
$preinteressent->updatevon = $user;
|
||||
|
||||
if($preinteressent->saveZuordnung(false))
|
||||
{
|
||||
//MAIL an Assistenz verschicken
|
||||
$qry_person = "SELECT vorname, nachname
|
||||
FROM public.tbl_person JOIN public.tbl_preinteressent USING(person_id)
|
||||
WHERE preinteressent_id='$row->preinteressent_id'";
|
||||
$name='';
|
||||
if($result_person = pg_query($conn, $qry_person))
|
||||
if($row_person = pg_fetch_object($result_person))
|
||||
$name = $row_person->nachname.' '.$row_person->vorname;
|
||||
$stg_obj = new studiengang($conn);
|
||||
$stg_obj->load($row->studiengang_kz);
|
||||
$to = $stg_obj->email;
|
||||
//$to = 'oesi@technikum-wien.at';
|
||||
$message = "Dies ist eine automatische Mail! $stg_obj->email\n\n".
|
||||
"Der Preinteressent $name wurde zur Übernahme freigegeben. \nSie können diesen ".
|
||||
"im FAS unter 'Extras->Preinteressenten übernehmen' oder unter folgendem Link\n\n".
|
||||
APP_ROOT."vilesci/personen/preinteressent_uebernahme.php?studiengang_kz=$row->studiengang_kz \n".
|
||||
"ins FAS übertragen";
|
||||
$mail = new mail($to, 'vilesci@'.DOMAIN, 'Preinteressent Freigabe', $message);
|
||||
if($mail->send())
|
||||
echo "<br><b>Freigabemail wurde an $to versendet</b>";
|
||||
else
|
||||
echo "<br><b>Fehler beim Versenden des Freigabemails an $to</b>";
|
||||
|
||||
$anzahl_freigegeben++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$anzahl_fehler++;
|
||||
$errormsg.="<br>Fehler bei der Freigabe von ".$studiengang->kuerzel_arr[$row->studiengang_kz].": $preinteressent->errormsg";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "<br><b>Es wurden $anzahl_freigegeben Studiengänge freigegeben<br>";
|
||||
echo "<script language='Javascript'>
|
||||
parent.preinteressent_detail.location.href = \"preinteressent_detail.php?id=".$_GET['id']."&selection=\"+parent.preinteressent_detail.selection;
|
||||
</script>";
|
||||
if($anzahl_fehler>0)
|
||||
echo "Es sind $anzahl_fehler Fehler aufgetreten: $errormsg";
|
||||
echo '</b>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<b>Es können nur Preinteressenten freigegeben werden, bei denen ein Studiensemester angegeben wurde</b>';
|
||||
}
|
||||
}
|
||||
elseif($_GET['action']=='loeschen')
|
||||
{
|
||||
//Loeschen eines Preinteressenten
|
||||
$preinteressent = new preinteressent($conn);
|
||||
if($preinteressent->load($_GET['id']))
|
||||
{
|
||||
if($preinteressent->delete($preinteressent->preinteressent_id))
|
||||
{
|
||||
echo '<br><b>Datensatz wurde geloescht</b>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><b>Fehler beim Löschen: $preinteressent->errormsg</b>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><b>Fehler beim Laden des Datensatzes. Daten wurden NICHT gelöscht</b>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Datum pruefen
|
||||
if($erfassungsdatum_bis!='' && !$datum_obj->formatDatum($erfassungsdatum_bis))
|
||||
die('Erf.bis Datum ist ungueltig');
|
||||
if($erfassungsdatum_von!='' && !$datum_obj->formatDatum($erfassungsdatum_von))
|
||||
die('Erf.von Datum ist ungueltig');
|
||||
|
||||
$preinteressent = new preinteressent($conn);
|
||||
//if($filter=='')
|
||||
if($datum_obj->formatDatum($filter, 'Y-m-d', true))
|
||||
$filter = $datum_obj->formatDatum($filter, 'Y-m-d', true);
|
||||
$preinteressent->loadPreinteressenten($studiengang_kz, ($studiensemester_kurzbz!='-1'?$studiensemester_kurzbz:null), $filter, $bool_nichtfreigegeben, $bool_uebernommen, $kontaktmedium, $bool_absage, $erfassungsdatum_von, $erfassungsdatum_bis);
|
||||
/*else
|
||||
{
|
||||
//Falls im Filter-Feld ein Datum steht dann wird dieses umformatiert
|
||||
if($datum_obj->formatDatum($filter, 'Y-m-d'))
|
||||
$filter = $datum_obj->formatDatum($filter, 'Y-m-d');
|
||||
$preinteressent->loadPreinteressenten(null, null, $filter);
|
||||
}*/
|
||||
$stg_obj = new studiengang($conn);
|
||||
$stg_obj->getAll('typ, kurzbz', false);
|
||||
|
||||
function CutString($strVal, $limit)
|
||||
{
|
||||
if(strlen($strVal) > $limit+3)
|
||||
{
|
||||
return substr($strVal, 0, $limit) . "...";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $strVal;
|
||||
}
|
||||
}
|
||||
echo 'Anzahl: '.count($preinteressent->result);
|
||||
echo '</div>'; // Fixiertes Div mit den Filtern
|
||||
echo '<br><br><br><br><br><br><br>';
|
||||
|
||||
//TABELLE ANZEIGEN
|
||||
echo '<br>';
|
||||
echo "<table id='mytab' class='liste table-autosort:4 table-stripeclass:alternate table-autostripe' style='font-size:15px;'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='table-sortable:numeric'>ID</th>
|
||||
<th class='table-sortable:default'>Nachname</th>
|
||||
<th class='table-sortable:default'>Vorname</th>
|
||||
<th class='table-sortable:default'>StSem</th>
|
||||
<th class='table-sortable:default'>Erf.datum</th>
|
||||
<th class='table-sortable:default'>G</th>
|
||||
<th class='table-sortable:default'>E-Mail</th>
|
||||
<th class='table-sortable:default'>Status</th>
|
||||
<th class='table-sortable:default'>Freigabe</th>
|
||||
<th class='table-sortable:default'>Übernahme</th>
|
||||
<th class='table-sortable:default'>Anmerkung</th>
|
||||
<th>Aktion</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>";
|
||||
|
||||
foreach ($preinteressent->result as $row)
|
||||
{
|
||||
echo '<tr>';
|
||||
$person = new person($conn);
|
||||
$person->load($row->person_id);
|
||||
echo "<td>$person->person_id</td>";
|
||||
echo "<td>$person->nachname</td>";
|
||||
echo "<td>$person->vorname</td>";
|
||||
//echo "<td>".$datum_obj->convertISODate($person->gebdatum)."</td>";
|
||||
echo "<td>$row->studiensemester_kurzbz</td>";
|
||||
echo "<td><span style='display: none'>$row->erfassungsdatum</span>".$datum_obj->formatDatum($row->erfassungsdatum,'d.m.Y')."</td>";
|
||||
|
||||
echo "<td>$person->geschlecht</td>";
|
||||
//EMail
|
||||
$qry = "SELECT kontakt FROM public.tbl_kontakt WHERE person_id='$person->person_id' AND kontakttyp='email'
|
||||
ORDER BY zustellung DESC LIMIT 1";
|
||||
echo '<td>';
|
||||
if($result_mail = pg_query($conn, $qry))
|
||||
{
|
||||
if($row_mail = pg_fetch_object($result_mail))
|
||||
{
|
||||
echo '<a href="mailto:'.$row_mail->kontakt.'" class="Item">'.$row_mail->kontakt.'</a>';
|
||||
}
|
||||
}
|
||||
echo '</td>';
|
||||
//Status
|
||||
$status='';
|
||||
$prestudent = new prestudent($conn);
|
||||
if($prestudent->getPrestudenten($row->person_id))
|
||||
{
|
||||
foreach ($prestudent->result as $prestd)
|
||||
{
|
||||
if($status!='')
|
||||
$status.=', ';
|
||||
$prestudent1 = new prestudent($conn);
|
||||
$prestudent1->getLastStatus($prestd->prestudent_id);
|
||||
$status.= $prestudent1->status_kurzbz.' ('.$stg_obj->kuerzel_arr[$prestd->studiengang_kz].')';
|
||||
}
|
||||
}
|
||||
if($status=='')
|
||||
$status='Preinteressent';
|
||||
echo "<td>$status</td>";
|
||||
|
||||
//Zuordnungen laden und freigegebene Eintraege farblich markieren
|
||||
$freigaben = new preinteressent($conn);
|
||||
$freigaben->loadZuordnungen($row->preinteressent_id);
|
||||
$freigabe='';
|
||||
$uebernahme='';
|
||||
foreach ($freigaben->result as $row_freigaben)
|
||||
{
|
||||
//auch jene als freigegeben anzeigen die schon im studiengang angelegt sind
|
||||
//obwohl der preinteressent nicht freigegeben wurde. (bewerbung direkt beim studiengang)
|
||||
$qry = "SELECT prestudent_id FROM public.tbl_prestudent WHERE person_id='$row->person_id' AND studiengang_kz='$row_freigaben->studiengang_kz'";
|
||||
$result_chkstg = pg_query($conn, $qry);
|
||||
|
||||
if($row_freigaben->freigabedatum!='' || pg_num_rows($result_chkstg)>0)
|
||||
$freigabe.="<font color='#009900'>";
|
||||
else
|
||||
$freigabe.="<font color='#FF0000'>";
|
||||
$freigabe.=$stg_obj->kuerzel_arr[$row_freigaben->studiengang_kz]."($row_freigaben->prioritaet)";
|
||||
$freigabe.='</font> ';
|
||||
|
||||
if($row_freigaben->freigabedatum!='')
|
||||
{
|
||||
if($row_freigaben->uebernahmedatum!='')
|
||||
$uebernahme.="<font color='#009900'>";
|
||||
else
|
||||
$uebernahme.="<font color='#FF0000'>";
|
||||
$uebernahme.=$stg_obj->kuerzel_arr[$row_freigaben->studiengang_kz];
|
||||
$uebernahme.='</font> ';
|
||||
}
|
||||
}
|
||||
|
||||
echo "<td>$freigabe</td>";
|
||||
echo "<td>$uebernahme</td>";
|
||||
echo "<td title='".htmlentities($row->anmerkung,ENT_QUOTES)."'>".htmlentities(CutString($row->anmerkung, 20),ENT_QUOTES)."</td>";
|
||||
echo '<td>';
|
||||
echo " <input style='padding:0px;' type='button' onclick=\"window.open('personendetails.php?id=$row->person_id','_blank')\" value='Gesamtübersicht' title='Zeigt die Details dieser Person an'>";
|
||||
echo " <input style='padding:0px;' type='button' onclick='parent.preinteressent_detail.location.href = \"preinteressent_detail.php?id=$row->preinteressent_id&selection=\"+parent.preinteressent_detail.selection; return false;' value='Bearbeiten' title='Zeigt die Details dieser Person an'>";
|
||||
echo " <input style='padding:0px;' type='button' onclick=\"window.location.href='".$_SERVER['PHP_SELF']."?id=$row->preinteressent_id&action=freigabe&studiensemester_kurzbz=$studiensemester_kurzbz&studiengang_kz=$studiengang_kz&filter=$filter'\" value='Freigeben' title='Gibt alle Studiengänge mit der höchsten Priorität frei'>";
|
||||
echo " <input style='padding:0px;' type='button' onclick=\"if(confdel()) {window.location.href='".$_SERVER['PHP_SELF']."?id=$row->preinteressent_id&action=loeschen&studiensemester_kurzbz=$studiensemester_kurzbz&studiengang_kz=$studiengang_kz&filter=$filter'}\" value='Löschen' title='Löscht diesen Preinteressenten'>";
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</tbody></table><br>';
|
||||
|
||||
echo '</body>';
|
||||
echo '</html>';
|
||||
<?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/datum.class.php');
|
||||
require_once('../../include/prestudent.class.php');
|
||||
require_once('../../include/studiensemester.class.php');
|
||||
require_once('../../include/log.class.php');
|
||||
require_once('../../include/mail.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();
|
||||
$stsem = new studiensemester($conn);
|
||||
$stsem_aktuell = $stsem->getaktorNext();
|
||||
|
||||
if(isset($_GET['studiengang_kz']))
|
||||
$studiengang_kz = $_GET['studiengang_kz'];
|
||||
else
|
||||
$studiengang_kz = '';
|
||||
|
||||
if(isset($_GET['studiensemester_kurzbz']))
|
||||
$studiensemester_kurzbz = $_GET['studiensemester_kurzbz'];
|
||||
else
|
||||
$studiensemester_kurzbz = '-1'; //$stsem_aktuell;
|
||||
|
||||
if(isset($_GET['bool_nichtfreigegeben']))
|
||||
$bool_nichtfreigegeben = true;
|
||||
else
|
||||
$bool_nichtfreigegeben = null;
|
||||
|
||||
if(isset($_GET['bool_uebernommen']))
|
||||
$bool_uebernommen = true;
|
||||
else
|
||||
$bool_uebernommen = null;
|
||||
|
||||
if(isset($_GET['bool_absage']))
|
||||
$bool_absage = true;
|
||||
else
|
||||
$bool_absage = false;
|
||||
|
||||
if(isset($_GET['filter']))
|
||||
$filter = $_GET['filter'];
|
||||
else
|
||||
$filter = '';
|
||||
|
||||
//Wenn auf Anzeigen geklickt wird, das Suchfeld nicht beruecksichtigen
|
||||
if(isset($_GET['anzeigen']))
|
||||
$filter='';
|
||||
|
||||
if(isset($_GET['kontaktmedium']))
|
||||
{
|
||||
$kontaktmedium = $_GET['kontaktmedium'];
|
||||
if($kontaktmedium=='')
|
||||
$kontaktmedium=null;
|
||||
}
|
||||
else
|
||||
$kontaktmedium = null;
|
||||
if(isset($_GET['erfassungsdatum_bis']) && $_GET['erfassungsdatum_bis']!='')
|
||||
$erfassungsdatum_bis = $_GET['erfassungsdatum_bis'];
|
||||
else
|
||||
$erfassungsdatum_bis=null;
|
||||
|
||||
if(isset($_GET['erfassungsdatum_von']) && $_GET['erfassungsdatum_von']!='')
|
||||
$erfassungsdatum_von = $_GET['erfassungsdatum_von'];
|
||||
else
|
||||
$erfassungsdatum_von=null;
|
||||
|
||||
//Doctype muss strict sein da sonst im IE der DIV nicht am oberen Rand fixiert ist
|
||||
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>PreInteressenten</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<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>
|
||||
<script language="Javascript">
|
||||
<!--
|
||||
function confdel()
|
||||
{
|
||||
if(confirm("Wollen Sie diesen Eintrag wirklich loeschen?"))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function sorttable()
|
||||
{
|
||||
//Meister IE braucht ein Timeout sonst sortiert er nicht
|
||||
window.setTimeout("Table.sort(document.getElementById(\'mytab\'),\'asc\')",10);
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
</head>
|
||||
<body class="Background_main" style="margin-top:0px; padding-top:0px;" onload="sorttable()" >
|
||||
<div style="position: fixed; background-color: white; width: 99%; padding-top:5px;">
|
||||
<h2>PreInteressenten</h2>
|
||||
';
|
||||
|
||||
if(!$rechte->isBerechtigt('admin', null, 'suid') &&
|
||||
!$rechte->isBerechtigt('preinteressent', null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
//DROP DOWNs anzeigen
|
||||
echo "<table width='100%'><tr><td><form action='".$_SERVER['PHP_SELF']."' method='GET'>";
|
||||
echo '<table><tr><td>Studiensemester: <SELECT name="studiensemester_kurzbz">';
|
||||
$stsem = new studiensemester($conn);
|
||||
$stsem->getAll();
|
||||
echo "<option value='-1' ".($studiensemester_kurzbz=='-1'?'selected':'').">-- alle --</option>";
|
||||
echo "<option value='' ".($studiensemester_kurzbz==''?'selected':'').">-- offen --</option>";
|
||||
foreach ($stsem->studiensemester as $row)
|
||||
{
|
||||
if($row->studiensemester_kurzbz==$studiensemester_kurzbz)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo "<option value='$row->studiensemester_kurzbz' $selected>$row->studiensemester_kurzbz</option>";
|
||||
}
|
||||
echo '</SELECT>';
|
||||
|
||||
echo ' Studiengang: <SELECT name="studiengang_kz">';
|
||||
echo "<option value=''>-- Alle --</option>";
|
||||
$stg = new studiengang($conn);
|
||||
$stg->getAll('typ, kurzbz');
|
||||
foreach ($stg->result as $row)
|
||||
{
|
||||
if($row->studiengang_kz==$studiengang_kz)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo "<option value='$row->studiengang_kz' $selected>$row->kuerzel</option>";
|
||||
}
|
||||
echo '</SELECT></td><td>';
|
||||
echo '<input type="checkbox" name="bool_nichtfreigegeben" '.($bool_nichtfreigegeben?'checked':'').'> nicht freigegeben';
|
||||
echo '<input type="checkbox" name="bool_absage" '.($bool_absage?'checked':'').'> Absage<br>';
|
||||
echo '<input type="checkbox" name="bool_uebernommen" '.($bool_uebernommen?'checked':'').'> freigegeben aber nicht übernommen</td><td>';
|
||||
echo ' <input type="submit" name="anzeigen" value="Anzeigen"></td></tr>';
|
||||
echo '<tr><td>Kontaktmedium: <SELECT name="kontaktmedium">';
|
||||
$qry="SELECT * FROM public.tbl_kontaktmedium ORDER BY beschreibung";
|
||||
echo "<option value='' >-- Alle --</option>";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($row->kontaktmedium_kurzbz==$kontaktmedium)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
echo "<option value='$row->kontaktmedium_kurzbz' $selected>$row->beschreibung</option>";
|
||||
}
|
||||
}
|
||||
echo '</SELECT></td><td>';
|
||||
echo 'Erf. von <input type="text" size="10" maxlength="10" name="erfassungsdatum_von" value="'.$erfassungsdatum_von.'">';
|
||||
echo 'Erf. bis <input type="text" size="10" maxlength="10" name="erfassungsdatum_bis" value="'.$erfassungsdatum_bis.'">';
|
||||
echo '</td></tr>';
|
||||
echo '</table>';
|
||||
//echo '</form>';
|
||||
echo '</td><td>';
|
||||
//echo "<form action='".$_SERVER['PHP_SELF']."' method='GET'>";
|
||||
echo "<input type='text' value='".$filter."' name='filter'> ";
|
||||
echo "<input type='submit' size='10' name='suchen' value='Suchen'>";
|
||||
echo '</form></td>';
|
||||
echo '<td align="right"><a href="preinteressent_anlegen.php" target="_blank">neuen Preinteressenten anlegen</a></td></tr></table>';
|
||||
|
||||
//FREIGEBEN / LOESCHEN
|
||||
if(isset($_GET['action']))
|
||||
{
|
||||
if($_GET['action']=='freigabe')
|
||||
{
|
||||
$preinteressent = new preinteressent($conn);
|
||||
$preinteressent->load($_GET['id']);
|
||||
|
||||
if($preinteressent->studiensemester_kurzbz!='')
|
||||
{
|
||||
$errormsg = '';
|
||||
$anzahl_freigegeben=0;
|
||||
$anzahl_fehler=0;
|
||||
$qry = "SELECT * FROM public.tbl_preinteressentstudiengang
|
||||
WHERE preinteressent_id='".addslashes($_GET['id'])."'
|
||||
AND prioritaet = (SELECT max(prioritaet)
|
||||
FROM public.tbl_preinteressentstudiengang
|
||||
WHERE preinteressent_id='".addslashes($_GET['id'])."')
|
||||
AND freigabedatum is null";
|
||||
//Zuordnungen holen die noch nicht freigegeben wurden und die hoechste Prioritaet haben
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
//Nur diejenigen nehmen die noch nicht als Prestudent vorhanden sind
|
||||
$qry = "SELECT count(*) as anzahl FROM public.tbl_preinteressent JOIN public.tbl_prestudent USING(person_id) WHERE preinteressent_id='$row->preinteressent_id' AND studiengang_kz='$row->studiengang_kz'";
|
||||
if($result_std = pg_query($conn, $qry))
|
||||
{
|
||||
if($row_std = pg_fetch_object($result_std))
|
||||
{
|
||||
if($row_std->anzahl==0)
|
||||
{
|
||||
$preinteressent = new preinteressent($conn);
|
||||
$preinteressent->loadZuordnung($row->preinteressent_id, $row->studiengang_kz);
|
||||
|
||||
$preinteressent->freigabedatum = date('Y-m-d H:i:s');
|
||||
$preinteressent->updateamum = date('Y-m-d H:i:s');
|
||||
$preinteressent->updatevon = $user;
|
||||
|
||||
if($preinteressent->saveZuordnung(false))
|
||||
{
|
||||
//MAIL an Assistenz verschicken
|
||||
$qry_person = "SELECT vorname, nachname
|
||||
FROM public.tbl_person JOIN public.tbl_preinteressent USING(person_id)
|
||||
WHERE preinteressent_id='$row->preinteressent_id'";
|
||||
$name='';
|
||||
if($result_person = pg_query($conn, $qry_person))
|
||||
if($row_person = pg_fetch_object($result_person))
|
||||
$name = $row_person->nachname.' '.$row_person->vorname;
|
||||
$stg_obj = new studiengang($conn);
|
||||
$stg_obj->load($row->studiengang_kz);
|
||||
$to = $stg_obj->email;
|
||||
//$to = 'oesi@technikum-wien.at';
|
||||
$message = "Dies ist eine automatische Mail! $stg_obj->email\n\n".
|
||||
"Der Preinteressent $name wurde zur Übernahme freigegeben. \nSie können diesen ".
|
||||
"im FAS unter 'Extras->Preinteressenten übernehmen' oder unter folgendem Link\n\n".
|
||||
APP_ROOT."vilesci/personen/preinteressent_uebernahme.php?studiengang_kz=$row->studiengang_kz \n".
|
||||
"ins FAS übertragen";
|
||||
$mail = new mail($to, 'vilesci@'.DOMAIN, 'Preinteressent Freigabe', $message);
|
||||
if($mail->send())
|
||||
echo "<br><b>Freigabemail wurde an $to versendet</b>";
|
||||
else
|
||||
echo "<br><b>Fehler beim Versenden des Freigabemails an $to</b>";
|
||||
|
||||
$anzahl_freigegeben++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$anzahl_fehler++;
|
||||
$errormsg.="<br>Fehler bei der Freigabe von ".$studiengang->kuerzel_arr[$row->studiengang_kz].": $preinteressent->errormsg";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "<br><b>Es wurden $anzahl_freigegeben Studiengänge freigegeben<br>";
|
||||
echo "<script language='Javascript'>
|
||||
parent.preinteressent_detail.location.href = \"preinteressent_detail.php?id=".$_GET['id']."&selection=\"+parent.preinteressent_detail.selection;
|
||||
</script>";
|
||||
if($anzahl_fehler>0)
|
||||
echo "Es sind $anzahl_fehler Fehler aufgetreten: $errormsg";
|
||||
echo '</b>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<b>Es können nur Preinteressenten freigegeben werden, bei denen ein Studiensemester angegeben wurde</b>';
|
||||
}
|
||||
}
|
||||
elseif($_GET['action']=='loeschen')
|
||||
{
|
||||
//Loeschen eines Preinteressenten
|
||||
$preinteressent = new preinteressent($conn);
|
||||
if($preinteressent->load($_GET['id']))
|
||||
{
|
||||
if($preinteressent->delete($preinteressent->preinteressent_id))
|
||||
{
|
||||
echo '<br><b>Datensatz wurde geloescht</b>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><b>Fehler beim Löschen: $preinteressent->errormsg</b>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br><b>Fehler beim Laden des Datensatzes. Daten wurden NICHT gelöscht</b>";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Datum pruefen
|
||||
if($erfassungsdatum_bis!='' && !$datum_obj->formatDatum($erfassungsdatum_bis))
|
||||
die('Erf.bis Datum ist ungueltig');
|
||||
if($erfassungsdatum_von!='' && !$datum_obj->formatDatum($erfassungsdatum_von))
|
||||
die('Erf.von Datum ist ungueltig');
|
||||
|
||||
$preinteressent = new preinteressent($conn);
|
||||
//if($filter=='')
|
||||
if($datum_obj->formatDatum($filter, 'Y-m-d', true))
|
||||
$filter = $datum_obj->formatDatum($filter, 'Y-m-d', true);
|
||||
$preinteressent->loadPreinteressenten($studiengang_kz, ($studiensemester_kurzbz!='-1'?$studiensemester_kurzbz:null), $filter, $bool_nichtfreigegeben, $bool_uebernommen, $kontaktmedium, $bool_absage, $erfassungsdatum_von, $erfassungsdatum_bis);
|
||||
/*else
|
||||
{
|
||||
//Falls im Filter-Feld ein Datum steht dann wird dieses umformatiert
|
||||
if($datum_obj->formatDatum($filter, 'Y-m-d'))
|
||||
$filter = $datum_obj->formatDatum($filter, 'Y-m-d');
|
||||
$preinteressent->loadPreinteressenten(null, null, $filter);
|
||||
}*/
|
||||
$stg_obj = new studiengang($conn);
|
||||
$stg_obj->getAll('typ, kurzbz', false);
|
||||
|
||||
function CutString($strVal, $limit)
|
||||
{
|
||||
if(strlen($strVal) > $limit+3)
|
||||
{
|
||||
return substr($strVal, 0, $limit) . "...";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $strVal;
|
||||
}
|
||||
}
|
||||
echo 'Anzahl: '.count($preinteressent->result);
|
||||
echo '</div>'; // Fixiertes Div mit den Filtern
|
||||
echo '<br><br><br><br><br><br><br>';
|
||||
|
||||
//TABELLE ANZEIGEN
|
||||
echo '<br>';
|
||||
echo "<table id='mytab' class='liste table-autosort:4 table-stripeclass:alternate table-autostripe' style='font-size:15px;'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='table-sortable:numeric'>ID</th>
|
||||
<th class='table-sortable:default'>Nachname</th>
|
||||
<th class='table-sortable:default'>Vorname</th>
|
||||
<th class='table-sortable:default'>StSem</th>
|
||||
<th class='table-sortable:default'>Erf.datum</th>
|
||||
<th class='table-sortable:default'>G</th>
|
||||
<th class='table-sortable:default'>E-Mail</th>
|
||||
<th class='table-sortable:default'>Status</th>
|
||||
<th class='table-sortable:default'>Freigabe</th>
|
||||
<th class='table-sortable:default'>Übernahme</th>
|
||||
<th class='table-sortable:default'>Anmerkung</th>
|
||||
<th>Aktion</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>";
|
||||
|
||||
foreach ($preinteressent->result as $row)
|
||||
{
|
||||
echo '<tr>';
|
||||
$person = new person($conn);
|
||||
$person->load($row->person_id);
|
||||
echo "<td>$person->person_id</td>";
|
||||
echo "<td>$person->nachname</td>";
|
||||
echo "<td>$person->vorname</td>";
|
||||
//echo "<td>".$datum_obj->convertISODate($person->gebdatum)."</td>";
|
||||
echo "<td>$row->studiensemester_kurzbz</td>";
|
||||
echo "<td><span style='display: none'>$row->erfassungsdatum</span>".$datum_obj->formatDatum($row->erfassungsdatum,'d.m.Y')."</td>";
|
||||
|
||||
echo "<td>$person->geschlecht</td>";
|
||||
//EMail
|
||||
$qry = "SELECT kontakt FROM public.tbl_kontakt WHERE person_id='$person->person_id' AND kontakttyp='email'
|
||||
ORDER BY zustellung DESC LIMIT 1";
|
||||
echo '<td>';
|
||||
if($result_mail = pg_query($conn, $qry))
|
||||
{
|
||||
if($row_mail = pg_fetch_object($result_mail))
|
||||
{
|
||||
echo '<a href="mailto:'.$row_mail->kontakt.'" class="Item">'.$row_mail->kontakt.'</a>';
|
||||
}
|
||||
}
|
||||
echo '</td>';
|
||||
//Status
|
||||
$status='';
|
||||
$prestudent = new prestudent($conn);
|
||||
if($prestudent->getPrestudenten($row->person_id))
|
||||
{
|
||||
foreach ($prestudent->result as $prestd)
|
||||
{
|
||||
if($status!='')
|
||||
$status.=', ';
|
||||
$prestudent1 = new prestudent($conn);
|
||||
$prestudent1->getLastStatus($prestd->prestudent_id);
|
||||
$status.= $prestudent1->status_kurzbz.' ('.$stg_obj->kuerzel_arr[$prestd->studiengang_kz].')';
|
||||
}
|
||||
}
|
||||
if($status=='')
|
||||
$status='Preinteressent';
|
||||
echo "<td>$status</td>";
|
||||
|
||||
//Zuordnungen laden und freigegebene Eintraege farblich markieren
|
||||
$freigaben = new preinteressent($conn);
|
||||
$freigaben->loadZuordnungen($row->preinteressent_id);
|
||||
$freigabe='';
|
||||
$uebernahme='';
|
||||
foreach ($freigaben->result as $row_freigaben)
|
||||
{
|
||||
//auch jene als freigegeben anzeigen die schon im studiengang angelegt sind
|
||||
//obwohl der preinteressent nicht freigegeben wurde. (bewerbung direkt beim studiengang)
|
||||
$qry = "SELECT prestudent_id FROM public.tbl_prestudent WHERE person_id='$row->person_id' AND studiengang_kz='$row_freigaben->studiengang_kz'";
|
||||
$result_chkstg = pg_query($conn, $qry);
|
||||
|
||||
if($row_freigaben->freigabedatum!='' || pg_num_rows($result_chkstg)>0)
|
||||
$freigabe.="<font color='#009900'>";
|
||||
else
|
||||
$freigabe.="<font color='#FF0000'>";
|
||||
$freigabe.=$stg_obj->kuerzel_arr[$row_freigaben->studiengang_kz]."($row_freigaben->prioritaet)";
|
||||
$freigabe.='</font> ';
|
||||
|
||||
if($row_freigaben->freigabedatum!='')
|
||||
{
|
||||
if($row_freigaben->uebernahmedatum!='')
|
||||
$uebernahme.="<font color='#009900'>";
|
||||
else
|
||||
$uebernahme.="<font color='#FF0000'>";
|
||||
$uebernahme.=$stg_obj->kuerzel_arr[$row_freigaben->studiengang_kz];
|
||||
$uebernahme.='</font> ';
|
||||
}
|
||||
}
|
||||
|
||||
echo "<td>$freigabe</td>";
|
||||
echo "<td>$uebernahme</td>";
|
||||
echo "<td title='".$row->anmerkung."'>".CutString($row->anmerkung, 20)."</td>";
|
||||
echo '<td>';
|
||||
echo " <input style='padding:0px;' type='button' onclick=\"window.open('personendetails.php?id=$row->person_id','_blank')\" value='Gesamtübersicht' title='Zeigt die Details dieser Person an'>";
|
||||
echo " <input style='padding:0px;' type='button' onclick='parent.preinteressent_detail.location.href = \"preinteressent_detail.php?id=$row->preinteressent_id&selection=\"+parent.preinteressent_detail.selection; return false;' value='Bearbeiten' title='Zeigt die Details dieser Person an'>";
|
||||
echo " <input style='padding:0px;' type='button' onclick=\"window.location.href='".$_SERVER['PHP_SELF']."?id=$row->preinteressent_id&action=freigabe&studiensemester_kurzbz=$studiensemester_kurzbz&studiengang_kz=$studiengang_kz&filter=$filter'\" value='Freigeben' title='Gibt alle Studiengänge mit der höchsten Priorität frei'>";
|
||||
echo " <input style='padding:0px;' type='button' onclick=\"if(confdel()) {window.location.href='".$_SERVER['PHP_SELF']."?id=$row->preinteressent_id&action=loeschen&studiensemester_kurzbz=$studiensemester_kurzbz&studiengang_kz=$studiengang_kz&filter=$filter'}\" value='Löschen' title='Löscht diesen Preinteressenten'>";
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</tbody></table><br>';
|
||||
|
||||
echo '</body>';
|
||||
echo '</html>';
|
||||
?>
|
||||
@@ -139,7 +139,7 @@
|
||||
$zs->mitarbeiter_uid=$_REQUEST['uid'];
|
||||
}
|
||||
$htmlstr .= "<br><div class='kopf'>Zeitsperre ".(!isset($zs->zeitsperre_id)?'':$zs->zeitsperre_id)."</div>\n";
|
||||
$htmlstr .= "<form action='resturlaub_details.php' method='POST'>\n";
|
||||
$htmlstr .= "<form accept-charset='UTF-8' action='resturlaub_details.php' method='POST'>\n";
|
||||
$htmlstr .= "<input type='hidden' name='zeitsperre_id' value='".$zs->zeitsperre_id."'>\n";
|
||||
$htmlstr .= "<input type='hidden' name='uid' value='".$zs->mitarbeiter_uid."'>\n";
|
||||
$htmlstr .= "<table class='detail' style='padding-top:10px;'>\n";
|
||||
@@ -159,7 +159,7 @@
|
||||
}
|
||||
$htmlstr .= " </select></td>";
|
||||
$htmlstr .= " <td>Bezeichnung</td>";
|
||||
$htmlstr .= " <td colspan='3'><input type='text' name='bezeichnung' value='".htmlentities($zs->bezeichnung, ENT_QUOTES)."' size='32' maxlength='32'></td>\n";
|
||||
$htmlstr .= " <td colspan='3'><input type='text' name='bezeichnung' value='".$zs->bezeichnung."' size='32' maxlength='32'></td>\n";
|
||||
$htmlstr .= " </select></td>";
|
||||
$htmlstr .= "</tr>";
|
||||
$htmlstr .= "<tr>";
|
||||
|
||||
@@ -1,326 +1,326 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009 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 Simane-Sequens <gerald.simane-sequens@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* Seite zur Verwaltung der Urlaubs- und Zeitausgleichstage der Mitarbeiter
|
||||
*/
|
||||
|
||||
require_once('../config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/zeitsperre.class.php');
|
||||
require_once('../../include/person.class.php');
|
||||
require_once('../../include/benutzer.class.php');
|
||||
require_once('../../include/mitarbeiter.class.php');
|
||||
require_once('../../include/datum.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
|
||||
if(!$conn = @pg_pconnect(CONN_STRING))
|
||||
die('Verbindung zur Datenbank fehlgeschlagen');
|
||||
|
||||
$user = get_uid();
|
||||
$datum = new datum();
|
||||
|
||||
$uid = (isset($_GET['uid'])?$_GET['uid']:'');
|
||||
$zeitsperre_id=(isset($_REQUEST['zeitsperre_id'])?$_REQUEST['zeitsperre_id']:'');
|
||||
$action = (isset($_GET['action'])?$_GET['action']:'');
|
||||
|
||||
$zeitsperretyp_kurzbz=(isset($_POST['zeitsperretyp_kurzbz'])?$_POST['zeitsperretyp_kurzbz']:'');
|
||||
$bezeichnung=(isset($_POST['bezeichnung'])?$_POST['bezeichnung']:'');
|
||||
$vondatum=(isset($_POST['von'])?$_POST['von']:'');
|
||||
$vonstunde=(isset($_POST['vonstunde'])?$_POST['vonstunde']:'');
|
||||
$bisdatum=(isset($_POST['bis'])?$_POST['bis']:'');
|
||||
$bisstunde=(isset($_POST['bisstunde'])?$_POST['bisstunde']:'');
|
||||
$vertretung_uid=(isset($_POST['vertretung_uid'])?$_POST['vertretung_uid']:'');
|
||||
$erreichbarkeit_kurzbz=(isset($_POST['erreichbarkeit_kurzbz'])?$_POST['erreichbarkeit_kurzbz']:'');
|
||||
|
||||
$errormsg='';
|
||||
$message='';
|
||||
$error=false;
|
||||
|
||||
//Kopfzeile
|
||||
echo '<html>
|
||||
<head>
|
||||
<title>Urlaubsverwaltung</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<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>
|
||||
<script language="Javascript">
|
||||
function confdel(val)
|
||||
{
|
||||
return confirm("Wollen Sie diesen Eintrag wirklich loeschen: "+val);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="Background_main">
|
||||
<h2>Urlaubsverwaltung</h2>
|
||||
';
|
||||
|
||||
//Rechte Pruefen
|
||||
$rechte = new benutzerberechtigung($conn);
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('admin'))
|
||||
die('Sie haben keine Berechtigung für diese Seite');
|
||||
|
||||
//Formular zur Eingabe der UID
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'" mehtod="GET">';
|
||||
echo 'Zeitsperren des Mitarbeiters mit der UID <input type="text" name="uid" value="'.htmlentities($uid, ENT_QUOTES).'">';
|
||||
echo '<input type="submit" name="submit" value="Anzeigen">';
|
||||
echo '</form>';
|
||||
|
||||
//Loeschen von Zeitsperren
|
||||
if($action=='delete')
|
||||
{
|
||||
if($zeitsperre_id!='' && is_numeric($zeitsperre_id))
|
||||
{
|
||||
$zeitsperre = new zeitsperre($conn);
|
||||
if($zeitsperre->delete($zeitsperre_id))
|
||||
$message='Zeitsperre wurde geloescht';
|
||||
else
|
||||
$errormsg='Fehler beim Loeschen der Zeitsperre';
|
||||
}
|
||||
else
|
||||
$errormsg='Zeitsperre_id ist ungueltig';
|
||||
}
|
||||
|
||||
if(isset($_POST['save']))
|
||||
{
|
||||
//Speichern der Daten
|
||||
$zeitsperre = new zeitsperre($conn);
|
||||
|
||||
if($zeitsperre_id!='')
|
||||
{
|
||||
if(!$zeitsperre->load($zeitsperre_id))
|
||||
{
|
||||
$errormsg='Zeitsperre konnte nicht geladen werden';
|
||||
$error=true;
|
||||
}
|
||||
$zeitsperre->new = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$zeitsperre->insertamum=date('Y-m-d H:i:s');
|
||||
$zeitsperre->insertvon = $user;
|
||||
$zeitsperre->new=true;
|
||||
$zeitsperre->mitarbeiter_uid=$uid;
|
||||
}
|
||||
|
||||
if(!$error)
|
||||
{
|
||||
$zeitsperre->zeitsperretyp_kurzbz=$zeitsperretyp_kurzbz;
|
||||
$zeitsperre->bezeichnung = $bezeichnung;
|
||||
$zeitsperre->vondatum = $vondatum;
|
||||
$zeitsperre->vonstunde = $vonstunde;
|
||||
$zeitsperre->bisdatum = $bisdatum;
|
||||
$zeitsperre->bisstunde = $bisstunde;
|
||||
$zeitsperre->vertretung_uid = $vertretung_uid;
|
||||
$zeitsperre->erreichbarkeit_kurzbz = $erreichbarkeit_kurzbz;
|
||||
$zeitsperre->updateamum = date('Y-m-d H:i:s');
|
||||
$zeitsperre->udpatevon = $user;
|
||||
|
||||
if($zeitsperre->save())
|
||||
{
|
||||
$message = 'Daten wurden erfolgreich gespeichert';
|
||||
}
|
||||
else
|
||||
{
|
||||
$errormsg = "Fehler beim Speichern der Daten: $zeitsperre->errormsg";
|
||||
}
|
||||
}
|
||||
}
|
||||
//Statusmeldungen ausgeben
|
||||
if($errormsg!='')
|
||||
echo "<br><div class='inserterror'>$errormsg</div><br>";
|
||||
if($message!='')
|
||||
echo "<br><div class='insertok'>$message</div><br>";
|
||||
|
||||
//Zeitsperren des Mitarbeiters anzeigen
|
||||
if($uid!='')
|
||||
{
|
||||
$mitarbeiter = new mitarbeiter($conn);
|
||||
if(!$mitarbeiter->load($uid))
|
||||
die('Mitarbeiter wurde nicht gefunden');
|
||||
|
||||
$zeitsperre = new zeitsperre($conn);
|
||||
|
||||
$zeitsperre->getzeitsperren($uid);
|
||||
echo '<h3>Zeitsperren von <b>'.$mitarbeiter->titelpre.' '.$mitarbeiter->vorname.' '.$mitarbeiter->nachname.' '.$mitarbeiter->titelpost.'</b></h3>';
|
||||
echo "<table class='liste table-autosort:2 table-stripeclass:alternate table-autostripe'>";
|
||||
echo '
|
||||
<thead>
|
||||
<tr class="liste">
|
||||
<th>ID</th>
|
||||
<th>Typ</th>
|
||||
<th>Bezeichnung</th>
|
||||
<th>Von</th>
|
||||
<th>Bis</th>
|
||||
<th>edit</th>
|
||||
<th>delete</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
foreach ($zeitsperre->result as $row)
|
||||
{
|
||||
echo '<tr>';
|
||||
echo "<td>$row->zeitsperre_id</td>";
|
||||
echo "<td>$row->zeitsperretyp_kurzbz</td>";
|
||||
echo "<td>$row->bezeichnung</td>";
|
||||
echo "<td>".$datum->formatDatum($row->vondatum,'d.m.Y')." ".($row->vonstunde!=''?'(Stunde '.$row->vonstunde.')':'')."</td>";
|
||||
echo "<td>".$datum->formatDatum($row->bisdatum,'d.m.Y')." ".($row->bisstunde!=''?'(Stunde '.$row->bisstunde.')':'')."</td>";
|
||||
echo "<td align='center'><a href='".$_SERVER['PHP_SELF']."?action=edit&uid=$uid&zeitsperre_id=$row->zeitsperre_id'><img src='../../skin/images/application_form_edit.png' alt='bearbeiten' title='bearbeiten' /></a></td>";
|
||||
echo "<td align='center'><a href='".$_SERVER['PHP_SELF']."?action=delete&uid=$uid&zeitsperre_id=$row->zeitsperre_id' onclick='return confdel(\"$row->zeitsperretyp_kurzbz von ".$datum->formatDatum($row->vondatum,'d.m.Y')." bis ".$datum->formatDatum($row->bisdatum,'d.m.Y')."\")'><img src='../../skin/images/application_form_delete.png' alt='loeschen' title='loeschen'/></a></td>";
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</tbody></table>';
|
||||
|
||||
|
||||
//Editieren und Neu anlegen von Zeitsperren
|
||||
$zeitsperre = new zeitsperre($conn);
|
||||
echo '<br><br>';
|
||||
if($action=='edit')
|
||||
{
|
||||
if(!$zeitsperre->load($zeitsperre_id))
|
||||
die('Zeitsperre wurde nicht gefunden');
|
||||
if($zeitsperre->mitarbeiter_uid!=$uid)
|
||||
die('Zeitsperre und Mitarbeiter passen nicht zusammen');
|
||||
echo "<h3>Bearbeiten der Zeitsperre $zeitsperre->zeitsperre_id:</h3>";
|
||||
}
|
||||
else
|
||||
echo "<h3>Neue Zeitsperre:</h3>";
|
||||
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'?uid='.$uid.'" method="POST">';
|
||||
echo '<input type="hidden" name="zeitsperre_id" value="'.$zeitsperre->zeitsperre_id.'">';
|
||||
echo '<table>';
|
||||
echo '<tr>';
|
||||
echo '<td>Typ</td><td><SELECT name="zeitsperretyp_kurzbz">';
|
||||
$qry = "SELECT * FROM campus.tbl_zeitsperretyp ORDER BY beschreibung";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
echo '<OPTION value="'.$row->zeitsperretyp_kurzbz.'" '.($row->zeitsperretyp_kurzbz==$zeitsperre->zeitsperretyp_kurzbz?'selected':'').'>'.$row->beschreibung.'</OPTION>';
|
||||
}
|
||||
}
|
||||
echo '</SELECT></td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo '<td>Bezeichnung:</td><td><input type="text" name="bezeichnung" value="'.$zeitsperre->bezeichnung.'"></td>';
|
||||
|
||||
echo '</tr><tr>';
|
||||
$qry = "SELECT * FROM lehre.tbl_stunde ORDER BY stunde";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
$std_arr[$row->stunde]="$row->stunde (".date('H:i',strtotime($row->beginn)).' - '.date('H:i',strtotime($row->ende))." Uhr)";
|
||||
}
|
||||
}
|
||||
|
||||
echo '<td>Von</td><td><input type="text" name="von" value="'.$datum->formatDatum($zeitsperre->vondatum,'d.m.Y').'">';
|
||||
echo 'Stunde (inklusive)';
|
||||
echo '<SELECT name="vonstunde">';
|
||||
if($zeitsperre->vonstunde=='')
|
||||
echo "<OPTION value='' selectd>*</OPTION>\n";
|
||||
else
|
||||
echo "<OPTION value=''>*</OPTION>\n";
|
||||
|
||||
foreach ($std_arr as $std=>$val)
|
||||
{
|
||||
if($std==$zeitsperre->vonstunde)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
echo "<OPTION value='$std' $selected>$val</OPTION>";
|
||||
}
|
||||
echo '</SELECT></td>';
|
||||
echo '</tr><tr>';
|
||||
|
||||
echo '<td>Bis</td><td><input type="text" name="bis" value="'.$datum->formatDatum($zeitsperre->bisdatum,'d.m.Y').'">';
|
||||
echo 'Stunde (inklusive)';
|
||||
echo '<SELECT name="bisstunde">';
|
||||
if($zeitsperre->bisstunde=='')
|
||||
echo "<OPTION value='' selectd>*</OPTION>\n";
|
||||
else
|
||||
echo "<OPTION value=''>*</OPTION>\n";
|
||||
|
||||
foreach ($std_arr as $std=>$val)
|
||||
{
|
||||
if($std==$zeitsperre->bisstunde)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
echo "<OPTION value='$std' $selected>$val</OPTION>";
|
||||
}
|
||||
echo '</SELECT></td>';
|
||||
echo '</tr><tr>';
|
||||
|
||||
echo '<td>Erreichbarkeit</td>';
|
||||
$qry = "SELECT * FROM campus.tbl_erreichbarkeit";
|
||||
$erreichbarkeit_arr=array();
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
$erreichbarkeit_arr[$row->erreichbarkeit_kurzbz]=$row->beschreibung;
|
||||
}
|
||||
}
|
||||
echo "<td><SELECT name='erreichbarkeit'>";
|
||||
foreach ($erreichbarkeit_arr as $erreichbarkeit_key=>$erreichbarkeit_beschreibung)
|
||||
{
|
||||
if($zeitsperre->erreichbarkeit_kurzbz == $erreichbarkeit_key)+
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo "<OPTION value='$erreichbarkeit_key' ".$selected.">$erreichbarkeit_beschreibung</OPTION>\n";
|
||||
}
|
||||
|
||||
echo '</SELECT></td>';
|
||||
echo '</tr><tr>';
|
||||
|
||||
echo '<td>Vertretung</td>';
|
||||
echo "<td><SELECT name='vertretung_uid' id='vertretung_uid'>";
|
||||
//dropdown fuer vertretung
|
||||
$qry = "SELECT * FROM campus.vw_mitarbeiter WHERE uid not LIKE '\\\_%' ORDER BY nachname, vorname";
|
||||
|
||||
echo "<OPTION value=''>-- Auswahl --</OPTION>\n";
|
||||
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($zeitsperre->vertretung_uid == $row->uid)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
echo "<OPTION value='$row->uid' ".$selected.">$row->nachname $row->vorname ($row->uid)</OPTION>\n";
|
||||
}
|
||||
}
|
||||
echo '</SELECT></td>';
|
||||
echo '</tr><tr><td></td><td>';
|
||||
echo '<input type="submit" value="Speichern" name="save">';
|
||||
echo '</td></tr></table>';
|
||||
echo '</form>';
|
||||
}
|
||||
<?php
|
||||
/* Copyright (C) 2009 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 Simane-Sequens <gerald.simane-sequens@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* Seite zur Verwaltung der Urlaubs- und Zeitausgleichstage der Mitarbeiter
|
||||
*/
|
||||
|
||||
require_once('../config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/zeitsperre.class.php');
|
||||
require_once('../../include/person.class.php');
|
||||
require_once('../../include/benutzer.class.php');
|
||||
require_once('../../include/mitarbeiter.class.php');
|
||||
require_once('../../include/datum.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
|
||||
if(!$conn = @pg_pconnect(CONN_STRING))
|
||||
die('Verbindung zur Datenbank fehlgeschlagen');
|
||||
|
||||
$user = get_uid();
|
||||
$datum = new datum();
|
||||
|
||||
$uid = (isset($_GET['uid'])?$_GET['uid']:'');
|
||||
$zeitsperre_id=(isset($_REQUEST['zeitsperre_id'])?$_REQUEST['zeitsperre_id']:'');
|
||||
$action = (isset($_GET['action'])?$_GET['action']:'');
|
||||
|
||||
$zeitsperretyp_kurzbz=(isset($_POST['zeitsperretyp_kurzbz'])?$_POST['zeitsperretyp_kurzbz']:'');
|
||||
$bezeichnung=(isset($_POST['bezeichnung'])?$_POST['bezeichnung']:'');
|
||||
$vondatum=(isset($_POST['von'])?$_POST['von']:'');
|
||||
$vonstunde=(isset($_POST['vonstunde'])?$_POST['vonstunde']:'');
|
||||
$bisdatum=(isset($_POST['bis'])?$_POST['bis']:'');
|
||||
$bisstunde=(isset($_POST['bisstunde'])?$_POST['bisstunde']:'');
|
||||
$vertretung_uid=(isset($_POST['vertretung_uid'])?$_POST['vertretung_uid']:'');
|
||||
$erreichbarkeit_kurzbz=(isset($_POST['erreichbarkeit_kurzbz'])?$_POST['erreichbarkeit_kurzbz']:'');
|
||||
|
||||
$errormsg='';
|
||||
$message='';
|
||||
$error=false;
|
||||
|
||||
//Kopfzeile
|
||||
echo '<html>
|
||||
<head>
|
||||
<title>Urlaubsverwaltung</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<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>
|
||||
<script language="Javascript">
|
||||
function confdel(val)
|
||||
{
|
||||
return confirm("Wollen Sie diesen Eintrag wirklich loeschen: "+val);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="Background_main">
|
||||
<h2>Urlaubsverwaltung</h2>
|
||||
';
|
||||
|
||||
//Rechte Pruefen
|
||||
$rechte = new benutzerberechtigung($conn);
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('admin'))
|
||||
die('Sie haben keine Berechtigung für diese Seite');
|
||||
|
||||
//Formular zur Eingabe der UID
|
||||
echo '<form accept-charset="UTF-8" action="'.$_SERVER['PHP_SELF'].'" mehtod="GET">';
|
||||
echo 'Zeitsperren des Mitarbeiters mit der UID <input type="text" name="uid" value="'.$uid.'">';
|
||||
echo '<input type="submit" name="submit" value="Anzeigen">';
|
||||
echo '</form>';
|
||||
|
||||
//Loeschen von Zeitsperren
|
||||
if($action=='delete')
|
||||
{
|
||||
if($zeitsperre_id!='' && is_numeric($zeitsperre_id))
|
||||
{
|
||||
$zeitsperre = new zeitsperre($conn);
|
||||
if($zeitsperre->delete($zeitsperre_id))
|
||||
$message='Zeitsperre wurde geloescht';
|
||||
else
|
||||
$errormsg='Fehler beim Loeschen der Zeitsperre';
|
||||
}
|
||||
else
|
||||
$errormsg='Zeitsperre_id ist ungueltig';
|
||||
}
|
||||
|
||||
if(isset($_POST['save']))
|
||||
{
|
||||
//Speichern der Daten
|
||||
$zeitsperre = new zeitsperre($conn);
|
||||
|
||||
if($zeitsperre_id!='')
|
||||
{
|
||||
if(!$zeitsperre->load($zeitsperre_id))
|
||||
{
|
||||
$errormsg='Zeitsperre konnte nicht geladen werden';
|
||||
$error=true;
|
||||
}
|
||||
$zeitsperre->new = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$zeitsperre->insertamum=date('Y-m-d H:i:s');
|
||||
$zeitsperre->insertvon = $user;
|
||||
$zeitsperre->new=true;
|
||||
$zeitsperre->mitarbeiter_uid=$uid;
|
||||
}
|
||||
|
||||
if(!$error)
|
||||
{
|
||||
$zeitsperre->zeitsperretyp_kurzbz=$zeitsperretyp_kurzbz;
|
||||
$zeitsperre->bezeichnung = $bezeichnung;
|
||||
$zeitsperre->vondatum = $vondatum;
|
||||
$zeitsperre->vonstunde = $vonstunde;
|
||||
$zeitsperre->bisdatum = $bisdatum;
|
||||
$zeitsperre->bisstunde = $bisstunde;
|
||||
$zeitsperre->vertretung_uid = $vertretung_uid;
|
||||
$zeitsperre->erreichbarkeit_kurzbz = $erreichbarkeit_kurzbz;
|
||||
$zeitsperre->updateamum = date('Y-m-d H:i:s');
|
||||
$zeitsperre->udpatevon = $user;
|
||||
|
||||
if($zeitsperre->save())
|
||||
{
|
||||
$message = 'Daten wurden erfolgreich gespeichert';
|
||||
}
|
||||
else
|
||||
{
|
||||
$errormsg = "Fehler beim Speichern der Daten: $zeitsperre->errormsg";
|
||||
}
|
||||
}
|
||||
}
|
||||
//Statusmeldungen ausgeben
|
||||
if($errormsg!='')
|
||||
echo "<br><div class='inserterror'>$errormsg</div><br>";
|
||||
if($message!='')
|
||||
echo "<br><div class='insertok'>$message</div><br>";
|
||||
|
||||
//Zeitsperren des Mitarbeiters anzeigen
|
||||
if($uid!='')
|
||||
{
|
||||
$mitarbeiter = new mitarbeiter($conn);
|
||||
if(!$mitarbeiter->load($uid))
|
||||
die('Mitarbeiter wurde nicht gefunden');
|
||||
|
||||
$zeitsperre = new zeitsperre($conn);
|
||||
|
||||
$zeitsperre->getzeitsperren($uid);
|
||||
echo '<h3>Zeitsperren von <b>'.$mitarbeiter->titelpre.' '.$mitarbeiter->vorname.' '.$mitarbeiter->nachname.' '.$mitarbeiter->titelpost.'</b></h3>';
|
||||
echo "<table class='liste table-autosort:2 table-stripeclass:alternate table-autostripe'>";
|
||||
echo '
|
||||
<thead>
|
||||
<tr class="liste">
|
||||
<th>ID</th>
|
||||
<th>Typ</th>
|
||||
<th>Bezeichnung</th>
|
||||
<th>Von</th>
|
||||
<th>Bis</th>
|
||||
<th>edit</th>
|
||||
<th>delete</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
foreach ($zeitsperre->result as $row)
|
||||
{
|
||||
echo '<tr>';
|
||||
echo "<td>$row->zeitsperre_id</td>";
|
||||
echo "<td>$row->zeitsperretyp_kurzbz</td>";
|
||||
echo "<td>$row->bezeichnung</td>";
|
||||
echo "<td>".$datum->formatDatum($row->vondatum,'d.m.Y')." ".($row->vonstunde!=''?'(Stunde '.$row->vonstunde.')':'')."</td>";
|
||||
echo "<td>".$datum->formatDatum($row->bisdatum,'d.m.Y')." ".($row->bisstunde!=''?'(Stunde '.$row->bisstunde.')':'')."</td>";
|
||||
echo "<td align='center'><a href='".$_SERVER['PHP_SELF']."?action=edit&uid=$uid&zeitsperre_id=$row->zeitsperre_id'><img src='../../skin/images/application_form_edit.png' alt='bearbeiten' title='bearbeiten' /></a></td>";
|
||||
echo "<td align='center'><a href='".$_SERVER['PHP_SELF']."?action=delete&uid=$uid&zeitsperre_id=$row->zeitsperre_id' onclick='return confdel(\"$row->zeitsperretyp_kurzbz von ".$datum->formatDatum($row->vondatum,'d.m.Y')." bis ".$datum->formatDatum($row->bisdatum,'d.m.Y')."\")'><img src='../../skin/images/application_form_delete.png' alt='loeschen' title='loeschen'/></a></td>";
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</tbody></table>';
|
||||
|
||||
|
||||
//Editieren und Neu anlegen von Zeitsperren
|
||||
$zeitsperre = new zeitsperre($conn);
|
||||
echo '<br><br>';
|
||||
if($action=='edit')
|
||||
{
|
||||
if(!$zeitsperre->load($zeitsperre_id))
|
||||
die('Zeitsperre wurde nicht gefunden');
|
||||
if($zeitsperre->mitarbeiter_uid!=$uid)
|
||||
die('Zeitsperre und Mitarbeiter passen nicht zusammen');
|
||||
echo "<h3>Bearbeiten der Zeitsperre $zeitsperre->zeitsperre_id:</h3>";
|
||||
}
|
||||
else
|
||||
echo "<h3>Neue Zeitsperre:</h3>";
|
||||
|
||||
echo '<form accept-charset="UTF-8" action="'.$_SERVER['PHP_SELF'].'?uid='.$uid.'" method="POST">';
|
||||
echo '<input type="hidden" name="zeitsperre_id" value="'.$zeitsperre->zeitsperre_id.'">';
|
||||
echo '<table>';
|
||||
echo '<tr>';
|
||||
echo '<td>Typ</td><td><SELECT name="zeitsperretyp_kurzbz">';
|
||||
$qry = "SELECT * FROM campus.tbl_zeitsperretyp ORDER BY beschreibung";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
echo '<OPTION value="'.$row->zeitsperretyp_kurzbz.'" '.($row->zeitsperretyp_kurzbz==$zeitsperre->zeitsperretyp_kurzbz?'selected':'').'>'.$row->beschreibung.'</OPTION>';
|
||||
}
|
||||
}
|
||||
echo '</SELECT></td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo '<td>Bezeichnung:</td><td><input type="text" name="bezeichnung" value="'.$zeitsperre->bezeichnung.'"></td>';
|
||||
|
||||
echo '</tr><tr>';
|
||||
$qry = "SELECT * FROM lehre.tbl_stunde ORDER BY stunde";
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
$std_arr[$row->stunde]="$row->stunde (".date('H:i',strtotime($row->beginn)).' - '.date('H:i',strtotime($row->ende))." Uhr)";
|
||||
}
|
||||
}
|
||||
|
||||
echo '<td>Von</td><td><input type="text" name="von" value="'.$datum->formatDatum($zeitsperre->vondatum,'d.m.Y').'">';
|
||||
echo 'Stunde (inklusive)';
|
||||
echo '<SELECT name="vonstunde">';
|
||||
if($zeitsperre->vonstunde=='')
|
||||
echo "<OPTION value='' selectd>*</OPTION>\n";
|
||||
else
|
||||
echo "<OPTION value=''>*</OPTION>\n";
|
||||
|
||||
foreach ($std_arr as $std=>$val)
|
||||
{
|
||||
if($std==$zeitsperre->vonstunde)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
echo "<OPTION value='$std' $selected>$val</OPTION>";
|
||||
}
|
||||
echo '</SELECT></td>';
|
||||
echo '</tr><tr>';
|
||||
|
||||
echo '<td>Bis</td><td><input type="text" name="bis" value="'.$datum->formatDatum($zeitsperre->bisdatum,'d.m.Y').'">';
|
||||
echo 'Stunde (inklusive)';
|
||||
echo '<SELECT name="bisstunde">';
|
||||
if($zeitsperre->bisstunde=='')
|
||||
echo "<OPTION value='' selectd>*</OPTION>\n";
|
||||
else
|
||||
echo "<OPTION value=''>*</OPTION>\n";
|
||||
|
||||
foreach ($std_arr as $std=>$val)
|
||||
{
|
||||
if($std==$zeitsperre->bisstunde)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
echo "<OPTION value='$std' $selected>$val</OPTION>";
|
||||
}
|
||||
echo '</SELECT></td>';
|
||||
echo '</tr><tr>';
|
||||
|
||||
echo '<td>Erreichbarkeit</td>';
|
||||
$qry = "SELECT * FROM campus.tbl_erreichbarkeit";
|
||||
$erreichbarkeit_arr=array();
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
$erreichbarkeit_arr[$row->erreichbarkeit_kurzbz]=$row->beschreibung;
|
||||
}
|
||||
}
|
||||
echo "<td><SELECT name='erreichbarkeit'>";
|
||||
foreach ($erreichbarkeit_arr as $erreichbarkeit_key=>$erreichbarkeit_beschreibung)
|
||||
{
|
||||
if($zeitsperre->erreichbarkeit_kurzbz == $erreichbarkeit_key)+
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo "<OPTION value='$erreichbarkeit_key' ".$selected.">$erreichbarkeit_beschreibung</OPTION>\n";
|
||||
}
|
||||
|
||||
echo '</SELECT></td>';
|
||||
echo '</tr><tr>';
|
||||
|
||||
echo '<td>Vertretung</td>';
|
||||
echo "<td><SELECT name='vertretung_uid' id='vertretung_uid'>";
|
||||
//dropdown fuer vertretung
|
||||
$qry = "SELECT * FROM campus.vw_mitarbeiter WHERE uid not LIKE '\\\_%' ORDER BY nachname, vorname";
|
||||
|
||||
echo "<OPTION value=''>-- Auswahl --</OPTION>\n";
|
||||
|
||||
if($result = pg_query($conn, $qry))
|
||||
{
|
||||
while($row = pg_fetch_object($result))
|
||||
{
|
||||
if($zeitsperre->vertretung_uid == $row->uid)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
echo "<OPTION value='$row->uid' ".$selected.">$row->nachname $row->vorname ($row->uid)</OPTION>\n";
|
||||
}
|
||||
}
|
||||
echo '</SELECT></td>';
|
||||
echo '</tr><tr><td></td><td>';
|
||||
echo '<input type="submit" value="Speichern" name="save">';
|
||||
echo '</td></tr></table>';
|
||||
echo '</form>';
|
||||
}
|
||||
?>
|
||||
@@ -239,7 +239,7 @@ function confdel()
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td>Name: </td>";
|
||||
echo " <td colspan='3'><input type='text' name='name' value='".htmlentities($firma->name)."' size='80' maxlength='128' /></td>\n";
|
||||
echo " <td colspan='3'><input type='text' name='name' value='".$firma->name."' size='80' maxlength='128' /></td>\n";
|
||||
echo " <td>Typ: </td>";
|
||||
echo " <td><select name='typ'>\n";
|
||||
|
||||
@@ -289,7 +289,7 @@ function confdel()
|
||||
|
||||
// Formular fuer die Adressdaten
|
||||
//echo "<h3>Adressen:</h3>";
|
||||
echo "<form action='".$_SERVER['PHP_SELF']."?firma_id=$firma_id' method='POST' />";
|
||||
echo "<form accept-charset='UTF-8' action='".$_SERVER['PHP_SELF']."?firma_id=$firma_id' method='POST' />";
|
||||
echo "<table class='liste'><tr><th>STRASSE</th><th>PLZ</th><th>ORT</th><th>GEMEINDE</th><th>NATION</th><th>TYP</th><th><font size='0'>Heimatadr.</font></th><th><font size='0'>Zustelladr.</font></th></tr>";
|
||||
$adresse_obj = new adresse($conn);
|
||||
$adresse_obj->load_firma($firma_id);
|
||||
@@ -302,7 +302,7 @@ function confdel()
|
||||
echo "<td>$row->plz</td>";
|
||||
echo "<td>$row->ort</td>";
|
||||
echo "<td>$row->gemeinde</td>";
|
||||
echo "<td>".$nation_arr[$row->nation]."</td>";
|
||||
echo "<td>".(isset($nation_arr[$row->nation])?$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>";
|
||||
@@ -345,10 +345,10 @@ function confdel()
|
||||
|
||||
echo "<input type='hidden' name='adresse_id' value='".$adresse_id."' />";
|
||||
echo '<tr class="liste1">';
|
||||
echo "<td><input type='text' name='strasse' value='".htmlentities($strasse)."' /></td>";
|
||||
echo "<td><input type='text' name='plz' size='4' value='".htmlentities($plz)."' /></td>";
|
||||
echo "<td><input type='text' name='ort' value='".htmlentities($ort)."' /></td>";
|
||||
echo "<td><input type='text' name='gemeinde' value='".htmlentities($gemeinde)."' /></td>";
|
||||
echo "<td><input type='text' name='strasse' value='".$strasse."' /></td>";
|
||||
echo "<td><input type='text' name='plz' size='4' value='".$plz."' /></td>";
|
||||
echo "<td><input type='text' name='ort' value='".$ort."' /></td>";
|
||||
echo "<td><input type='text' name='gemeinde' value='".$gemeinde."' /></td>";
|
||||
echo "<td><SELECT name='nation'>";
|
||||
foreach ($nation_arr as $code=>$kurzbz)
|
||||
{
|
||||
|
||||
@@ -1,127 +1,127 @@
|
||||
<?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> and
|
||||
* Gerald Raab <gerald.raab@technikum-wien.at>.
|
||||
*/
|
||||
|
||||
require_once('../config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/firma.class.php');
|
||||
|
||||
if (!$conn = pg_pconnect(CONN_STRING))
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
$filter = (isset($_GET['filter'])?$_GET['filter']:'');
|
||||
$firmentypfilter = (isset($_GET['firmentypfilter'])?$_GET['firmentypfilter']:'');
|
||||
|
||||
$htmlstr = "";
|
||||
|
||||
if($filter=='')
|
||||
$sql_query = "SELECT * FROM public.tbl_firma WHERE true";
|
||||
else
|
||||
$sql_query = "SELECT * FROM public.tbl_firma WHERE lower(name) like lower('%$filter%') OR lower(adresse) like lower('%$filter%') OR lower(anmerkung) like lower('%$filter%')";
|
||||
if($firmentypfilter!='')
|
||||
$sql_query.=" AND firmentyp_kurzbz='".addslashes($firmentypfilter)."'";
|
||||
//echo $sql_query;
|
||||
if(!$erg=pg_query($conn, $sql_query))
|
||||
{
|
||||
$errormsg='Fehler beim Laden der Firma';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
$htmlstr .= "</form><table id='t1' class='liste table-autosort:1 table-stripeclass:alternate table-autostripe'>\n";
|
||||
$htmlstr .= " <thead><tr class='liste'>\n";
|
||||
$htmlstr .= " <th class='table-sortable:numeric'>ID</th><th class='table-sortable:default'>Name</th><th class='table-sortable:default'>Adresse</th><th class='table-sortable:default'>Email</th><th class='table-sortable:default'>Telefon</th><th class='table-sortable:default'>Fax</th><th class='table-sortable:default'>Anmerkung</th><th class='table-sortable:default'>Typ</th><th class='table-sortable:default'>Schule</th>";
|
||||
$htmlstr .= " </tr></thead><tbody>\n";
|
||||
$i = 0;
|
||||
while($row=pg_fetch_object($erg))
|
||||
{
|
||||
//$htmlstr .= " <tr class='liste". ($i%2) ."'>\n";
|
||||
$htmlstr .= " <tr>\n";
|
||||
$htmlstr .= " <td><a href='firma_details.php?firma_id=".$row->firma_id."' target='detail_firma'>".$row->firma_id."</a></td>\n";
|
||||
$htmlstr .= " <td><a href='firma_details.php?firma_id=".$row->firma_id."' target='detail_firma'>".$row->name."</a></td>\n";
|
||||
$htmlstr .= " <td>$row->adresse</td>\n";
|
||||
$htmlstr .= " <td>$row->email</td>\n";
|
||||
$htmlstr .= " <td>$row->telefon</td>\n";
|
||||
$htmlstr .= " <td>$row->fax</td>\n";
|
||||
$htmlstr .= " <td title='".htmlentities($row->anmerkung, ENT_QUOTES)."'>".(strlen($row->anmerkung)>30?substr($row->anmerkung,0,27).'...':$row->anmerkung)."</td>\n";
|
||||
$htmlstr .= " <td>$row->firmentyp_kurzbz</td>\n";
|
||||
$htmlstr .= " <td>".($row->schule=='t'?'Ja':'Nein')."</td>\n";
|
||||
$htmlstr .= " </tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$htmlstr .= "</tbody></table>\n";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>Firma Uebersicht</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<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>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
var firmentypfilter='<?php echo htmlentities($firmentypfilter)?>';
|
||||
var filter = '<?php echo htmlentities($filter)?>';
|
||||
-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="background_main">
|
||||
<h2>Firmen - Übersicht</h2>
|
||||
|
||||
<?php
|
||||
echo '<table width="100%"><tr><td>';
|
||||
echo '<h3>Übersicht</h3>';
|
||||
echo '</td><td align="right">';
|
||||
echo "<input type='button' onclick='parent.detail_firma.location=\"firma_details.php?neu=true\"' value='Neue Firma anlegen'/>";
|
||||
echo '</td></tr></table>';
|
||||
//Suche
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="GET">';
|
||||
echo '<input type="text" name="filter" value="'.$filter.'">';
|
||||
echo 'Typ: <SELECT name="firmentypfilter">
|
||||
<option value="">-- Alle --</option>';
|
||||
$firma = new firma($conn);
|
||||
$firma->getFirmenTypen();
|
||||
foreach ($firma->result as $row)
|
||||
{
|
||||
if($row->firmentyp_kurzbz==$firmentypfilter)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
echo "<option value='$row->firmentyp_kurzbz' $selected>$row->firmentyp_kurzbz</option>";
|
||||
}
|
||||
echo '</SELECT>';
|
||||
echo '<input type="submit" value="Suchen">';
|
||||
echo '</form>';
|
||||
|
||||
echo $htmlstr;
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?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> and
|
||||
* Gerald Raab <gerald.raab@technikum-wien.at>.
|
||||
*/
|
||||
|
||||
require_once('../config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/firma.class.php');
|
||||
|
||||
if (!$conn = pg_pconnect(CONN_STRING))
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
$filter = (isset($_GET['filter'])?$_GET['filter']:'');
|
||||
$firmentypfilter = (isset($_GET['firmentypfilter'])?$_GET['firmentypfilter']:'');
|
||||
|
||||
$htmlstr = "";
|
||||
|
||||
if($filter=='')
|
||||
$sql_query = "SELECT * FROM public.tbl_firma WHERE true";
|
||||
else
|
||||
$sql_query = "SELECT * FROM public.tbl_firma WHERE lower(name) like lower('%$filter%') OR lower(adresse) like lower('%$filter%') OR lower(anmerkung) like lower('%$filter%')";
|
||||
if($firmentypfilter!='')
|
||||
$sql_query.=" AND firmentyp_kurzbz='".addslashes($firmentypfilter)."'";
|
||||
//echo $sql_query;
|
||||
if(!$erg=pg_query($conn, $sql_query))
|
||||
{
|
||||
$errormsg='Fehler beim Laden der Firma';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
$htmlstr .= "</form><table id='t1' class='liste table-autosort:1 table-stripeclass:alternate table-autostripe'>\n";
|
||||
$htmlstr .= " <thead><tr class='liste'>\n";
|
||||
$htmlstr .= " <th class='table-sortable:numeric'>ID</th><th class='table-sortable:default'>Name</th><th class='table-sortable:default'>Adresse</th><th class='table-sortable:default'>Email</th><th class='table-sortable:default'>Telefon</th><th class='table-sortable:default'>Fax</th><th class='table-sortable:default'>Anmerkung</th><th class='table-sortable:default'>Typ</th><th class='table-sortable:default'>Schule</th>";
|
||||
$htmlstr .= " </tr></thead><tbody>\n";
|
||||
$i = 0;
|
||||
while($row=pg_fetch_object($erg))
|
||||
{
|
||||
//$htmlstr .= " <tr class='liste". ($i%2) ."'>\n";
|
||||
$htmlstr .= " <tr>\n";
|
||||
$htmlstr .= " <td><a href='firma_details.php?firma_id=".$row->firma_id."' target='detail_firma'>".$row->firma_id."</a></td>\n";
|
||||
$htmlstr .= " <td><a href='firma_details.php?firma_id=".$row->firma_id."' target='detail_firma'>".$row->name."</a></td>\n";
|
||||
$htmlstr .= " <td>$row->adresse</td>\n";
|
||||
$htmlstr .= " <td>$row->email</td>\n";
|
||||
$htmlstr .= " <td>$row->telefon</td>\n";
|
||||
$htmlstr .= " <td>$row->fax</td>\n";
|
||||
$htmlstr .= " <td title='".$row->anmerkung."'>".(strlen($row->anmerkung)>30?substr($row->anmerkung,0,27).'...':$row->anmerkung)."</td>\n";
|
||||
$htmlstr .= " <td>$row->firmentyp_kurzbz</td>\n";
|
||||
$htmlstr .= " <td>".($row->schule=='t'?'Ja':'Nein')."</td>\n";
|
||||
$htmlstr .= " </tr>\n";
|
||||
$i++;
|
||||
}
|
||||
$htmlstr .= "</tbody></table>\n";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>Firma Uebersicht</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<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>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
var firmentypfilter='<?php echo $firmentypfilter; ?>';
|
||||
var filter = '<?php echo $filter; ?>';
|
||||
-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="background_main">
|
||||
<h2>Firmen - Übersicht</h2>
|
||||
|
||||
<?php
|
||||
echo '<table width="100%"><tr><td>';
|
||||
echo '<h3>Übersicht</h3>';
|
||||
echo '</td><td align="right">';
|
||||
echo "<input type='button' onclick='parent.detail_firma.location=\"firma_details.php?neu=true\"' value='Neue Firma anlegen'/>";
|
||||
echo '</td></tr></table>';
|
||||
//Suche
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="GET">';
|
||||
echo '<input type="text" name="filter" value="'.$filter.'">';
|
||||
echo 'Typ: <SELECT name="firmentypfilter">
|
||||
<option value="">-- Alle --</option>';
|
||||
$firma = new firma($conn);
|
||||
$firma->getFirmenTypen();
|
||||
foreach ($firma->result as $row)
|
||||
{
|
||||
if($row->firmentyp_kurzbz==$firmentypfilter)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
echo "<option value='$row->firmentyp_kurzbz' $selected>$row->firmentyp_kurzbz</option>";
|
||||
}
|
||||
echo '</SELECT>';
|
||||
echo '<input type="submit" value="Suchen">';
|
||||
echo '</form>';
|
||||
|
||||
echo $htmlstr;
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -73,7 +73,7 @@ $stud = new studiengang($conn);
|
||||
if(!$stud->getAll('typ, kurzbzlang'))
|
||||
echo 'Fehler beim Laden der Studiengaenge:'.$stud->errormsg;
|
||||
|
||||
echo '<form name="frm_studiengang" action="'.$_SERVER['PHP_SELF'].'" method="GET">';
|
||||
echo '<form accept-charset="UTF-8" name="frm_studiengang" action="'.$_SERVER['PHP_SELF'].'" method="GET">';
|
||||
echo 'Studiengang: <SELECT name="studiengang_kz" onchange="document.frm_studiengang.submit()">';
|
||||
|
||||
foreach($stud->result as $row)
|
||||
|
||||
Reference in New Issue
Block a user