265 lines
8.2 KiB
PHP
Executable File
265 lines
8.2 KiB
PHP
Executable File
<?php
|
|
session_start();
|
|
include_once 'classes/TestProjektSmarty.class.php';
|
|
require_once("config.inc.php");
|
|
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
|
$smarty = new Smarty();
|
|
require_once "language/german.inc.php";
|
|
|
|
require_once("func_verlauf.php");
|
|
require_once("func_htmlclean.php");
|
|
require_once("func_gutachter_entscheid.php");
|
|
|
|
if(isset($_GET['id'])){
|
|
$_SESSION["ausschuss_edit_id"] = $_GET['id'];
|
|
}
|
|
$id = $_SESSION["ausschuss_edit_id"];
|
|
|
|
$action = $_GET['action'];
|
|
|
|
|
|
if($action == ''){
|
|
|
|
$db = dbconnect();
|
|
|
|
$result = $db->query("SELECT vorname, nachname, mail, beziehung, betreff, beschreibung, vorschlag, nutzen, public, kategorie, hinweis_eigen, hinweis_admin
|
|
FROM imt_user a, imt_vorschlag b
|
|
WHERE a.imtuid=b.imtuid
|
|
AND b.vid = '$id'");
|
|
$row = $result->fetch_array();
|
|
|
|
$result_status = $db->query("SELECT max(STATUS) status
|
|
FROM imt_vorschlag a, imt_verlauf b
|
|
WHERE a.vid = b.vid
|
|
AND a.vid ='$id'
|
|
GROUP BY a.vid
|
|
ORDER BY erfass_dat ASC");
|
|
$row_status = $result_status->fetch_array();
|
|
|
|
switch ($row[beziehung])
|
|
{
|
|
case "P":
|
|
$beziehung = "ProfessorIn";
|
|
break;
|
|
case "L":
|
|
$beziehung = "Lehrbeauftragte/r";
|
|
break;
|
|
case "E":
|
|
$beziehung = "Externe/r";
|
|
break;
|
|
case "S":
|
|
$beziehung = "StudentIn";
|
|
break;
|
|
case "V":
|
|
$beziehung = "Verwaltungsmitarbeiter";
|
|
break;
|
|
default:
|
|
$beziehung = "$row[beziehung]";
|
|
}
|
|
|
|
# $smarty->assign('ausschuss_edit_beziehung', $beziehung);
|
|
$smarty->assign('ausschuss_edit_id', "$id");
|
|
# $smarty->assign('ausschuss_edit_vorname', "$row[vorname]");
|
|
# $smarty->assign('ausschuss_edit_nachname', "$row[nachname]");
|
|
# $smarty->assign('ausschuss_edit_mail', "$row[mail]");
|
|
|
|
$smarty->assign('ausschuss_edit_betreff', "$row[betreff]");
|
|
$smarty->assign('ausschuss_edit_beschreibung', "$row[beschreibung]");
|
|
$smarty->assign('ausschuss_edit_vorschlag', "$row[vorschlag]");
|
|
$smarty->assign('ausschuss_edit_nutzen', "$row[nutzen]");
|
|
|
|
# if($row['public'] == 'Y'){
|
|
# $public = "Ja";
|
|
# }else{
|
|
# $public = "Nein";
|
|
# }
|
|
# $smarty->assign('ausschuss_edit_public', "$public");
|
|
# $smarty->assign('ausschuss_edit_status', "$row[status]");
|
|
# $smarty->assign('ausschuss_edit_hinweis_eigen', "$row[hinweis_eigen]");
|
|
# $smarty->assign('ausschuss_edit_hinweis_admin', "$row[hinweis_admin]");
|
|
|
|
|
|
$result_kat = $db->query("SELECT a.kategorie
|
|
FROM imt_kategorie a, imt_vorschlag b
|
|
WHERE a.kid = b.kategorie
|
|
AND b.vid = '$id'");
|
|
|
|
$row_kat = $result_kat->fetch_array();
|
|
$smarty->assign('ausschuss_edit_kat', "$row_kat[kategorie]");
|
|
|
|
# Offene Gutachter
|
|
$query2 = "SELECT a.imtuid, a.gid, vorname, nachname, bemerkung, date_format(frist_datum, '%d.%m.%Y') frist_dat_form
|
|
FROM imt_gutachter a, imt_user b
|
|
WHERE a.imtuid = b.imtuid
|
|
AND a.vid='$id'
|
|
ORDER BY frist_datum Asc";
|
|
|
|
$result2 = $db->query ($query2)
|
|
or die ("Cannot execute query2");
|
|
|
|
$table_data2 = array();
|
|
|
|
while ($row2 = $result2->fetch_array()){
|
|
# Wenn Verlauf schon gesetzt, dann Auswahlfeld sperren
|
|
# Wenn Frist schon überschritten, dann Auswahlfeld sperren,
|
|
# Wenn akutelles Ausschussmitglied bereits abgestimmt, dann Auswahlfeld sperren
|
|
$disabled = 0;
|
|
|
|
$text = "Ausschuss hat Gutachter $row2[vorname] $row2[nachname]";
|
|
|
|
$result_verlauf = $db->query("SELECT count(*) Anz
|
|
FROM imt_verlauf
|
|
WHERE vid = '$id'
|
|
AND status = '105'
|
|
AND verlauf LIKE '$text%'
|
|
");
|
|
|
|
$row_verlauf = $result_verlauf->fetch_array();
|
|
if($row_verlauf[Anz] > 0){
|
|
$disabled = 1;
|
|
}
|
|
|
|
$result_frist = $db->query("SELECT count(*) Anz
|
|
FROM imt_gutachter a
|
|
WHERE a.gid = '$row2[gid]'
|
|
AND a.frist_datum < date_format( now( ) , '%Y-%m-%d' )
|
|
");
|
|
$row_frist = $result_frist->fetch_array();
|
|
|
|
if($row_frist[Anz] > 0){
|
|
$disabled = 1;
|
|
}
|
|
|
|
$result_erg = $db->query("SELECT ergebnis
|
|
FROM imt_ausschuss_gutachter_erg a
|
|
WHERE a.gid = '$row2[gid]'
|
|
AND a.imtuid = '$uid'
|
|
");
|
|
$row_erg = $result_erg->fetch_array();
|
|
|
|
if($row_erg[ergebnis] != ''){
|
|
$disabled = 1;
|
|
}
|
|
|
|
|
|
gutachter_entscheid($uid, $row2[gid], $id);
|
|
|
|
|
|
array_push($table_data2, array(
|
|
'vorname' => $row2[vorname],
|
|
'nachname' => $row2[nachname],
|
|
'bemerkung' => $row2[bemerkung],
|
|
'imtuid' => $row2[imtuid],
|
|
'ergebnis' => $row_erg[ergebnis],
|
|
'disabled' => $disabled,
|
|
'frist_dat_form' => $row2[frist_dat_form]
|
|
)
|
|
);
|
|
}
|
|
$smarty->assign('table_data2', $table_data2);
|
|
|
|
|
|
|
|
|
|
# Statis
|
|
$query3 = "SELECT date_format(datum, '%d.%m.%Y - %H:%i Uhr') datum1,b.sid, b.status, verlauf
|
|
FROM imt_verlauf a, imt_stati b
|
|
WHERE a.status = b.sid
|
|
AND a.status != 0
|
|
AND a.vid='$id'
|
|
ORDER BY datum DESC";
|
|
|
|
$result3 = $db->query ($query3)
|
|
or die ("Cannot execute query3");
|
|
|
|
$table_data3 = array();
|
|
$verlauf_dup = array("");
|
|
while ($row3 = $result3->fetch_array()){
|
|
$status = $row3[status];
|
|
|
|
if($row3['sid'] == '103'){
|
|
# Da jedes Ausschussmitglied informiert wird, reicht es aus, wenn bei den Statusdetails nur ein Hinweis pro Gutachter genannt wird, nicht 5x pro Person
|
|
# Bei der Meldung "Ausschuss (Bernd Fuchsi) über Gutachter Wolf Wursti informiert. Frist: 25.06.2011" wird der Gutachter "Wolf Wursti"
|
|
# ausgeschnitten und in ein Array gepackt. Wird der gleiche Gutachter mit dem Status 103 nochamls durchgeschleift, wird in den else Bereich verwiesen
|
|
# Im Template werden nur die Statis angezeigt die != "" sind
|
|
$pos1 = strpos ($row3[verlauf], 'Gutachter')+9;
|
|
$status_103 = trim(substr($row3[verlauf], $pos1));
|
|
$pos2 = strpos ($status_103, 'informiert')-1;
|
|
$status = trim(substr($status_103, 0,$pos2));
|
|
|
|
if (!in_array($status, $verlauf_dup)) {
|
|
$verlauf_dup[] = "$status";
|
|
$status = $row3[status];
|
|
}else{
|
|
$status = "";
|
|
}
|
|
|
|
}
|
|
|
|
|
|
if($row3['sid'] == '7' OR $row3['sid'] == '8'){
|
|
$info = '1';
|
|
}else{
|
|
$info = '0';
|
|
}
|
|
|
|
array_push($table_data3, array(
|
|
'datum1' => $row3[datum1],
|
|
'info' => $info,
|
|
'status' => $status
|
|
)
|
|
);
|
|
|
|
|
|
|
|
}
|
|
$smarty->assign('table_data3', $table_data3);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if($action == 'save'){
|
|
|
|
$id = $_SESSION["ausschuss_edit_id"];
|
|
|
|
|
|
$query2 = "SELECT a.imtuid, a.gid, vorname, nachname, bemerkung, date_format(frist_datum, '%d.%m.%Y') frist_dat_form
|
|
FROM imt_gutachter a, imt_user b
|
|
WHERE a.imtuid = b.imtuid
|
|
AND a.vid='$id'
|
|
ORDER BY frist_datum Asc";
|
|
|
|
$result2 = $db->query ($query2)
|
|
or die ("Cannot execute query2");
|
|
$erfass_dat = date("Y-m-d H:i:s");
|
|
|
|
while ($row2 = $result2->fetch_array()){
|
|
$ergebnis = $_POST[$row2['imtuid']];
|
|
|
|
if($ergebnis != ''){
|
|
$sql = $db->query("INSERT INTO imt_ausschuss_gutachter_erg (imtuid, gid, ergebnis, erfass_dat) VALUES ('$uid', '$row2[gid]', '$ergebnis', '$erfass_dat')");
|
|
}
|
|
|
|
|
|
gutachter_entscheid($uid, $row2[gid], $id);
|
|
|
|
}
|
|
echo"
|
|
<script type='text/javascript'>
|
|
<!--
|
|
setTimeout(\"parent.document.location.href='ausschuss_gutachter.php'\", 2000);
|
|
//-->
|
|
</script>
|
|
";
|
|
|
|
}
|
|
|
|
|
|
|
|
$smarty->assign('action', "$action");
|
|
$smarty->display("$template/$templatename");
|
|
?>
|