334 lines
12 KiB
PHP
Executable File
334 lines
12 KiB
PHP
Executable File
<?php
|
|
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_mail_einstell.php");
|
|
|
|
$imtuid_alt = $_GET["imtuid"];
|
|
$isid = $_GET["isid"];
|
|
|
|
if(isset($imtuid_alt)){
|
|
$_SESSION["sitzung_vertretung_imtuid_alt"] = $imtuid_alt;
|
|
}
|
|
|
|
if(isset($isid)){
|
|
$_SESSION["sitzung_vertretung_isid"] = $isid;
|
|
}
|
|
|
|
$action = $_GET['action'];
|
|
if($action == ''){
|
|
|
|
if($_GET['error'] == 1){
|
|
$smarty->assign('sitzung_vertretung_pflichtfelder', "1");
|
|
$smarty->assign('sitzung_vertretung_error_text', "Es ist zu einem Fehler gekommen. Bitte treffen Sie eine Auswahl.");
|
|
}
|
|
|
|
# Erweiterung auf Personenschafe Vertretung 27.04.2016 Tabelle c
|
|
$query1 = "SELECT a.imtuid, vorname, nachname
|
|
FROM imt_user a, imt_rollen_user_zuord b, imt_ausschuss_vertreter c
|
|
WHERE a.imtuid = b.imtuid
|
|
AND b.roid= 5
|
|
AND a.imtuid = c.imtuid_vertreter
|
|
AND c.imtuid_mitglied=$imtuid_alt
|
|
AND a.imtuid NOT IN (SELECT imtuid FROM imt_sitzungen_abfrage WHERE isid='$isid')
|
|
ORDER BY nachname ASC";
|
|
|
|
$result1 = $db->query ($query1)
|
|
or die ("Cannot execute query");
|
|
|
|
$table_data1 = array();
|
|
|
|
|
|
while ($row1 = $result1->fetch_array()){
|
|
|
|
array_push($table_data1, array(
|
|
'imtuid' => $row1[imtuid],
|
|
'vorname' => $row1[vorname],
|
|
'nachname' => $row1[nachname]
|
|
)
|
|
);
|
|
}
|
|
$smarty->assign('table_data1', $table_data1);
|
|
}
|
|
|
|
if($action == 'step1'){
|
|
|
|
if(isset($_POST["auswahl"])){
|
|
$imtuid_neu = $_POST["auswahl"];
|
|
$_SESSION["sitzung_vertretung_imtuid_neu"] = $imtuid_neu;
|
|
}
|
|
|
|
|
|
if($_SESSION["sitzung_vertretung_imtuid_neu"] == ''){
|
|
$fehler = 1;
|
|
echo "<meta http-equiv=\"refresh\" content=\"0; URL=".$_SERVER['PHP_SELF']."?error=1\">";
|
|
}
|
|
|
|
if(!isset($fehler)){
|
|
$imtuid_alt = $_SESSION["sitzung_vertretung_imtuid_alt"];
|
|
$imtuid_neu = $_SESSION["sitzung_vertretung_imtuid_neu"];
|
|
$isid = $_SESSION["sitzung_vertretung_isid"];
|
|
|
|
# Alle Ausschussmitglieder anschreiben: RoId 4
|
|
$result = $db->query ("SELECT a.imtuid, vorname, nachname, mail, akivierungscode
|
|
FROM imt_user a, imt_rollen_user_zuord b
|
|
WHERE a.imtuid=b.imtuid
|
|
AND a.imtuid='$imtuid_neu'
|
|
AND b.roid='5'") or die ("Cannot execute query");
|
|
$row = $result->fetch_array();
|
|
|
|
$result1 = $db->query ("SELECT date_format(datum, '%d.%m.%Y') datum_form
|
|
, date_format(datum, '%H:%i') uhr_form
|
|
, raum
|
|
, beschreibung
|
|
FROM imt_sitzungen
|
|
WHERE isid = '$isid'
|
|
") or die ("Cannot execute query2");
|
|
$row1 = $result1->fetch_array();
|
|
|
|
$sql1 = $db->query("UPDATE imt_sitzungen_abfrage
|
|
SET status_vertretung = 'WV'
|
|
,vertretung = '$imtuid_neu'
|
|
WHERE isid='$isid'
|
|
AND imtuid='$imtuid_alt'
|
|
");
|
|
|
|
$sql2 = $db->query("INSERT INTO imt_sitzungen_abfrage ( isid
|
|
, imtuid
|
|
, ergebnis
|
|
, status_vertretung
|
|
, vertretung
|
|
)
|
|
VALUES
|
|
( '$isid'
|
|
, '$imtuid_neu'
|
|
, 'NA'
|
|
, 'VT'
|
|
, '$imtuid_alt'
|
|
)
|
|
");
|
|
|
|
|
|
|
|
$ausschuss_vorname = str_replace (array("ä", "ö", "ü", "ß", "Ä", "Ö", "Ü"), array("ä", "ö", "ü", "ß", "Ä", "Ö", "Ü"), $row['vorname']);
|
|
$ausschuss_nachname = str_replace (array("ä", "ö", "ü", "ß", "Ä", "Ö", "Ü"), array("ä", "ö", "ü", "ß", "Ä", "Ö", "Ü"), $row['nachname']);
|
|
|
|
$empfaenger = "$imtuid_neu";
|
|
$betreff = "Vertretung in Ausschusssitzung";
|
|
$text = "
|
|
<html>
|
|
<style type='text/css'>
|
|
.zusage:link, .zusage:visited {
|
|
background: #7CFC00;
|
|
color: black;
|
|
font-weight:bold;
|
|
display: block;
|
|
line-height: 60px;
|
|
text-decoration: none;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
position: relative;
|
|
text-align: center;
|
|
outline; 1px;
|
|
width: 140px;
|
|
}
|
|
.zusage:active, .zusage:hover {
|
|
background-color: #3CB371;
|
|
color: #FFFFFF;
|
|
font-weight:bold;
|
|
text-decoration: none;
|
|
display: block;
|
|
line-height: 60px;
|
|
text-decoration: none;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
position: relative;
|
|
text-align: center;
|
|
width: 140px;
|
|
}
|
|
.absage:link, .absage:visited {
|
|
background: #FF0000;
|
|
color: black;
|
|
font-weight:bold;
|
|
display: block;
|
|
line-height: 60px;
|
|
text-decoration: none;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
position: relative;
|
|
text-align: center;
|
|
outline; 1px;
|
|
width: 140px;
|
|
}
|
|
.absage:active, .absage:hover {
|
|
background-color: #8B0000;
|
|
color: #FFFFFF;
|
|
font-weight:bold;
|
|
text-decoration: none;
|
|
display: block;
|
|
line-height: 60px;
|
|
text-decoration: none;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
position: relative;
|
|
text-align: center;
|
|
width: 140px;
|
|
}
|
|
</style>
|
|
<head>
|
|
<title>Vertretung in Ausschusssitzung</title>
|
|
</head>
|
|
<body>
|
|
<font face='Arial' size='2'>
|
|
Guten Tag $ausschuss_vorname $ausschuss_nachname!
|
|
<br /><br />
|
|
In regelmäßigen Abständen finden Ausschusssitzungen statt, um über Vorschläge des
|
|
Ideenmanagements zu beraten.<br>
|
|
Sie wurden als Vertreter ausgewählt.<br>Der folgende Termin wurde festgelegt:
|
|
<br />
|
|
<br />
|
|
<table>
|
|
<tr>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
<b>Datum:</b>
|
|
</font>
|
|
</td>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
$row1[datum_form]
|
|
</font>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
<b>Uhrzeit:</b>
|
|
</font>
|
|
</td>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
$row1[uhr_form] Uhr
|
|
</font>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
<b>Raum:</b>
|
|
</font>
|
|
</td>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
$row1[raum]
|
|
</font>
|
|
</td>
|
|
</tr>
|
|
";
|
|
|
|
if($row1[beschreibung]!= ""){
|
|
$text .= "
|
|
<tr>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
<b>Bemerkung:</b>
|
|
</font>
|
|
</td>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
$row1[beschreibung]
|
|
</font>
|
|
</td>
|
|
</tr>";
|
|
}
|
|
|
|
$text .="
|
|
<tr>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
<b>Vorschläge:</b>
|
|
</font>
|
|
</td>
|
|
<td valign='top'>
|
|
<font face='Arial' size='2'>
|
|
<table width='100%'>
|
|
<tr>
|
|
<td width='30%' valign='top'>
|
|
<font face='Arial' size='2'><b>ID</b></font
|
|
</td>
|
|
<td width='70%' valign='top'>
|
|
<font face='Arial' size='2'><b>Betreff</b></font
|
|
</td>
|
|
</tr>
|
|
";
|
|
|
|
|
|
$query3 = "SELECT b.vid, b.betreff
|
|
FROM imt_sitzungen_vorschlag a, imt_vorschlag b
|
|
WHERE a.vid = b.vid
|
|
AND a.isid='$isid'
|
|
";
|
|
$result3 = $db->query ($query3)
|
|
or die ("Cannot execute query3");
|
|
|
|
|
|
while ($row3 = $result3->fetch_array()){
|
|
$text .="
|
|
<tr>
|
|
<td width='30%'>
|
|
<font face='Arial' size='2'>$row3[vid]</font
|
|
</td>
|
|
<td width='70%'>
|
|
<font face='Arial' size='2'>$row3[betreff]</font>
|
|
</td>
|
|
</tr>
|
|
";
|
|
}
|
|
$text .="
|
|
</table>
|
|
</font>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
Bitte teilen Sie uns über die Abstimmungslinks mit, ob der Termin möglich ist:
|
|
<table >
|
|
<tr>
|
|
<td>
|
|
<a href='https://www.hs-ludwigsburg.de/kurs/ideenmanagement/status_termin.php?id1=$row[imtuid]&id2=Y&id4=$isid' class='zusage'>Termin zusagen</a>
|
|
</td>
|
|
<td>
|
|
|
|
</td>
|
|
|
|
<td >
|
|
<a href='https://www.hs-ludwigsburg.de/kurs/ideenmanagement/status_termin.php?id1=$row[imtuid]&id2=N&id4=$isid' class='absage'>Termin absagen</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br />
|
|
Melden Sie sich am System an und wechseln Sie auf das Register \"Ausschuss\".
|
|
<p>
|
|
Klicken Sie hier um zum <a href='https://www.hs-ludwigsburg.de/kurs/ideenmanagement'>Ideenmanagement</a> zu gelangen.
|
|
<p>
|
|
Diese Mail wurde automatisch generiert!<br />
|
|
Antworten Sie daher nicht auf diese Mail.<br />
|
|
<br />
|
|
Vielen Dank!
|
|
</body>
|
|
</html>";
|
|
|
|
|
|
mail_einstell($vid, $uid, $empfaenger, NULL, NULL, $betreff, $text, 0, NULL);
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$smarty->assign('action', "$action");
|
|
$smarty->display("$template/$templatename");
|
|
|
|
?>
|