fachprojekt/admin/fachprojekt_bearbeiten.php
2023-04-14 11:56:50 +02:00

624 lines
32 KiB
PHP
Executable File

<?php
$user_admin=$_COOKIE["user_admin"];
$jahrgang=$_COOKIE["jahrgang"];
if ($jahrgang == ""){ require("jahrgang.php"); exit;} //Wenn man kein Jahrgang ausgew&auml;hlt hat wird die Jahrgangsauswahlseite geladen
include("kurs/datenbankanbindung.php"); // f&uuml;gt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.php
require("FCKeditor/fckeditor.php") ;
// Rechte&uuml;berpr&uuml;fung
$db = dbconnect();
if ($user_admin == ""){ require("index.php"); exit;} //Wenn man nicht angemeldet ist, darf man nicht auf die Seite
$result = $db->query("SELECT 1 FROM fach_admin_rechte, fach_admin_rechte_zuord , fach_admin where fach_admin_rechte.fach_admin_rolle = fach_admin_rechte_zuord.fach_admin_rolle AND fach_admin_rechte_zuord.faid = fach_admin.faid AND fach_admin.user = '$user_admin' AND fach_admin_rechte_zuord.fach_admin_rolle = 'a_prsbearb'");
$row = $result->fetch_array();
if ($row[0] != 1){ include("kurs/rechte.php"); exit;}
// Rechte&uuml;berpr&uuml;fung ende
if (isset($_GET['action']))
$action = $_GET['action'];
else
$action = "";
switch($action){
default:
echo"
<html>
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
<link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
<title>Fachprojekte bearbeiten</title>
</head>
<body>
<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
<tr>
<td>
<div align=\"center\">
<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"0\">
<tr>
<td align=\"left\" width=\"1%\" width=\"10\" background=\"../images/box_e1.gif\">
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
<td align=\"left\" width=\"98%\" background=\"../images/box_top.gif\" valign=\"top\" colspan=\"2\">
<img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
<font class=\"hd\">Fachprojekt bearbeiten</font><br>
<img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
<td align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
</tr>
<tr>
<td width=\"1%\" background=\"../images/box_l.gif\">
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
<td colspan=\"2\">
<form action="; echo $_SERVER['PHP_SELF'] . "?action=bearbeiten"; echo" method=\"POST\" name=\"PSN_bearb\">
<table border=\"0\" cellpadding=\"4\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#E7E8ED\" width=\"100%\">
<tr>
<td width=\"8%\" rowspan=\"2\" style=\"border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px\">
<p align=\"center\"><b>Nr.</b></p>
</td>
<td width=\"56%\" rowspan=\"2\" style=\"border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px\">
<b>
<p>Bezeichnung</p>
</b></td>
<td width=\"24%\" style=\"border-top-color: #111111; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium; border-right-style:none; border-right-width:medium\">
<b>
<p align=\"center\">Teilnehmer</p>
</b></td>
<td width=\"12%\" align=\"center\" rowspan=\"2\" style=\"border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px\">
<b>Auswahl</b></td>
</tr>
<tr>
<td width=\"24%\" style=\"border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px\">
<p align=\"center\"><b>Ist / Max </b></p>
</td>
</tr>";
$db = dbconnect();
$query = "SELECT id, FPRNr, Bezeichnung, bemerkung, TN_max FROM fachprojekt where Jahr=\"$jahrgang\" order by FPRNr asc";
$result = $db->query($query)
or die ("Cannot execute query");
while ($row = $result->fetch_array()){
if ( $res=$db->query("SELECT count(fach_wunsch.uid) from fach_wunsch left join stud using (uid) where fach_wunsch.id=$row[id] and fach_wunsch.Prioritaet=\"0\" and stud.durchgefallen !=\"Y\" order by fach_wunsch.uid") ){
if ( $row1=$res->fetch_array() ) {
$result_ist=$row1[0];
} else $result_ist=0;
} else $result_ist=0;
echo "
<tr>
<td width=\"8%\" style=\"border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px\">
<p align=\"center\">$row[FPRNr]</p>
</td>
<td width=\"56%\" style=\"border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px\">
<p>$row[Bezeichnung]<span class=\"bemerkung\"><br>
$row[bemerkung]</span></p>
</td>
<td width=\"24%\" style=\"border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px\">
<p align=\"center\">$result_ist&nbsp;&nbsp; /&nbsp;&nbsp;
$row[TN_max]</p>
</td>
<td width=\"12%\" align=\"center\" style=\"border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px\">
<p>
<input type=\"radio\" value=\"$row[id]\" name=\"aus_bearb\" size=\"20\">
</td>
</tr>";
}
echo "
</table>
<br>
<input type=\"submit\" value=\"Abschicken\" name=\"B1\" size=\"20\"></p>
</form>
</td>
<td width=\"1%\" background=\"../images/box_r.gif\">
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
</tr>
<tr>
<td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
<td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>";
break;
case "bearbeiten":
$db = dbconnect();
$sel_fach = $db->query("SELECT * FROM fachprojekt where id='$_POST[aus_bearb]'");
$fach = $sel_fach->fetch_array();
setcookie("ck_fachbearbeiten", $_POST['aus_bearb']);
echo "
<html>
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
<link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
<title>Fachprojekt bearbeiten</title>
</head>
<body onload=\"if(document.fach_erf)document.fach_erf.FPR_Nr.focus();return false;\">
<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
<tr>
<td>
<div align=\"center\">
<table cellspacing=\"0\" cellpadding=\"0\" width=\"650\" border=\"0\">
<tr>
<td width=\"10\" background=\"../images/box_e1.gif\">
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
<td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_top.gif\" valign=\"top\">
<img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
<font class=\"hd\">Fachprojekt bearbeiten</font><br>
<img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></font></td>
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
</tr>
<tr>
<td width=\"1%\" background=\"../images/box_l.gif\">
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
<td>
<form action="; echo $_SERVER['PHP_SELF'] . "?action=bearbeiten1"; echo" method=\"POST\" name=\"fach_erf\">
<table border=\"0\" cellpadding=\"4\" cellspacing=\"0\" style=\"border-width:0; border-collapse: collapse\" bordercolor=\"#111111\" width=\"102%\" id=\"AutoNumber1\" height=\"18\">
<tr>
<td width=\"40%\">
<b>PSN Nr*:</b>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name='FPR_Nr' value='$fach[FPRNr]' size=\"3\">
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Bezeichnung*:</b>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name='Bezeichnung' value='$fach[Bezeichnung]' size=\"40\">
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Ansprechpartner:</b>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name='Ansprechpartner' value='$fach[Ansprechpart]' size=\"40\">
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Minimale Teilnehmer:</b>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name='min_t' value='$fach[TN_min]' size=\"2\">
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Maximale Teilnehmer*:</b>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name='max_t' value='$fach[TN_max]' size=\"2\">
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Jahrgang*:</b>
<font size=\"1\">(z.B. 03)</font>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name='jahr' value='$fach[Jahr]' size=\"2\"><font size=\"1\"> 2-stellige Jahresangabe!</font>
</td>
</tr>
<tr>
<td width=\"40%\" valign=\"top\">
<b>zugelassene Zweige*:</b>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"checkbox\"";
$db = dbconnect();
$result1 = $db->query("SELECT id, zweig FROM fachprojekt where zweig like \"%I%\" and id=\"". $_POST['aus_bearb']."\"");
$row1 = $result1->fetch_array();
if ($row1[0] >= 1) echo " checked"; echo "
name=\"I\" value=\"I\"> Innenverwaltung</td>
</tr>
<tr>
<td width=\"40%\">
&nbsp;</td>
<td width=\"60%\" align=\"left\">
<input type=\"checkbox\"";
$db = dbconnect();
$result3 = $db->query("SELECT id, zweig FROM fachprojekt where zweig like \"%R%\" and id=\"". $_POST['aus_bearb']."\"");
$row3 = $result3->fetch_array();
if ($row3[0] >= 1) echo " checked"; echo "
name=\"R\" value=\"R\"> Rentenversicherung</td>
</tr>
<tr>
<td width=\"40%\">
&nbsp;</td>
<td width=\"60%\" align=\"left\">
<input type=\"checkbox\"";
$db = dbconnect();
$result4 = $db->query("SELECT id, zweig FROM fachprojekt where zweig like \"%F%\" and id=\"". $_POST['aus_bearb']."\"");
$row4 = $result4->fetch_array();
if ($row4[0] >= 1) echo " checked"; echo "
name=\"F\" value=\"F\"> Allgemeine Finanzverwaltung</td>
</tr>
<tr>
<td width=\"40%\">
&nbsp;</td>
<td width=\"60%\" align=\"left\">
<input type=\"checkbox\"";
$db = dbconnect();
$result5 = $db->query("SELECT id, zweig FROM fachprojekt where zweig like \"%S%\" and id=\"". $_POST['aus_bearb']."\"");
$row5 = $result5->fetch_array();
if ($row5[0] >= 1) echo " checked"; echo "
name=\"S\" value=\"S\"> Steuerverwaltung</td>
</tr>
<tr>
<tr>
<td width=\"40%\">
<b>Anzahl der Gruppen:</b>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name='gruppen' value='$fach[gruppen]' size=\"55\">
</td>
</tr>
<tr>
<td width=\"40%\" valign=\"top\">
<b>Dozent*:</b><br>
<font size=\"1\">(Strg-Taste f&uuml;r Mehrfachauswahl)</font>
</td>
<td width=\"60%\" align=\"left\">
";
$db = dbconnect();
$query = "SELECT doz_nr, doz_name, doz_vorname, doz_titel FROM doz order by doz_name";
$result = $db->query ($query)
or die ("Cannot execute query");
echo "<select size=\"4\" name=\"Dozent[]\" multiple>"; // In Dozent[] werden die ausgew&auml;hlen Values gespeichert: Bsp. [1], [3], [4]
while ($row = $result->fetch_array()){
$result4 = $db->query("SELECT doz_nr FROM fach_doz where doz_nr=\"$row[doz_nr]\" and id=\"". $_POST['aus_bearb']."\"");
$row4 = $result4->fetch_array();
echo "<option value=\"".$row['doz_nr']."\"";
if ($row[0] == $row4[0]) echo " selected"; echo ">
".$row['doz_name'].",&nbsp;".$row['doz_vorname'].",&nbsp;&nbsp;&nbsp;".$row['doz_titel']."&nbsp;&nbsp;&nbsp;</option>\n";
}
echo "</select>";
echo "
</select><br>
<a href=\"doz_anleg.php\">Dozent erfassen</a>
</td>
</tr>
<tr>
<td width=\"40%\" valign='top'>
<b>Termine / Zeitraum:</b>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name='termine' value='$fach[termine]' size=\"55\"><br>";
if($fach['termin_ausserhalb'] == 'X'){
$status= 'checked';
}
if($fach['reisekosten'] == 'X'){
$status1= 'checked';
}
echo"
<table>
<tr>
<td><input type=\"checkbox\" name=\"termin_ausserhalb\" $status value=\"X\"></td><td>Die Veranstaltungstermine werden möglicherweise außerhalb der Hochschule Ludwigsburg stattfinden.</td>
</tr>
<tr>
<td><input type=\"checkbox\" name=\"reisekosten\" $status1 value=\"X\"></td><td>Reisekosten können erstattet werden.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Inhaltsbeschreibung:</b>
</td>
<td width=\"60%\" align=\"left\">";
$oFCKeditor = new FCKeditor('kurzbeschreibung') ;
$oFCKeditor->BasePath = './FCKeditor/';
#$oFCKeditor->Value = 'Default text in editor';
$oFCKeditor->ToolbarSet = 'Basic';
$oFCKeditor->Value = $fach['beschreibung'];
$oFCKeditor->Width = '100%' ;
$oFCKeditor->Height = '150' ;
$oFCKeditor->Create() ;
echo"
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Bemerkung:</b>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name='bemerkung' value='$fach[bemerkung]' size=\"55\">
</td>
</tr>
<tr>
<td width=\"40%\">
* = Pflichtfelder
</td>
<td width=\"60%\" align=\"left\">
&nbsp;
</td>
</tr>
<tr>
<td width=\"40%\">
&nbsp;
</td>
<td width=\"60%\" align=\"left\">
&nbsp;
</td>
</tr>
</table>
&nbsp; <input type=\"submit\" value=\"Abschicken\" name=\"B1\">
<input type=\"reset\" value=\"Zur&uuml;cksetzen\" name=\"B2\"></form>
</td>
<td width=\"1%\" background=\"../images/box_r.gif\">
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
</tr>
<tr>
<td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
<td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>
";
break;
case "bearbeiten1":
if ($_POST['I'] == "" and $_POST['R'] == "" and $_POST['F'] == "" and $_POST['S'] == ""){ // mind. 1 Zweig muss angegeben werden. Getrennt durch and
echo "
<html>
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
<link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
<title>Eingabefehler</title>
</head>
<body>
<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
<tr>
<td>
<div align=\"center\">
<table cellspacing=\"0\" cellpadding=\"0\" width=\"550\" border=\"0\">
<tr>
<td width=\"10\" background=\"../images/box_e1.gif\">
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
<td nowrap=\"nowrap\" align=\"left\" width=\"3%\" background=\"../images/box_top.gif\" valign=\"top\"></td>
<td width=\"95%\" background=\"../images/box_top.gif\">
<img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
<span class=\"sh\">Eingabefehler</span><br>
<img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
</tr>
<tr>
<td width=\"1%\" background=\"../images/box_l.gif\">
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
<td colspan=\"2\"><br>
<p align=\"center\"><b>Es muss mindestens 1 Zweig ausgef&uuml;llt werden</b>
</p>
<p align=\"center\"><a href=\"javascript:history.back()\">
<img border=\"0\" src=\"../images/zurueck.gif\" width=\"77\" height=\"22\"></a><br>
</p>
<p></p>
<p></p>
<p></p>
<p></p>
<p><br>
</p>
</td>
<td width=\"1%\" background=\"../images/box_r.gif\">
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
</tr>
<tr>
<td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
<td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>";
exit;
}
if ($_POST['FPR_Nr'] == ""or $_POST['Bezeichnung'] == "" or $_POST['max_t'] == "" or $_POST['Dozent'] == "" or $_POST['jahr'] == ""){
echo"
<html>
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
<link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
<title>Eingabefehler</title>
</head>
<body>
<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
<tr>
<td>
<div align=\"center\">
<table cellspacing=\"0\" cellpadding=\"0\" width=\"550\" border=\"0\">
<tr>
<td width=\"10\" background=\"../images/box_e1.gif\">
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
<td nowrap=\"nowrap\" align=\"left\" width=\"3%\" background=\"../images/box_top.gif\" valign=\"top\"></td>
<td width=\"95%\" background=\"../images/box_top.gif\">
<img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
<span class=\"sh\">Eingabefehler</span><br>
<img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
</tr>
<tr>
<td width=\"1%\" background=\"../images/box_l.gif\">
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
<td colspan=\"2\"><br>
<p align=\"center\"><b>Die Pflichtfelder m&uuml;ssen mindestens ausgef&uuml;llt werden</b>
</p>
<p align=\"center\"><a href=\"javascript:history.back()\">
<img border=\"0\" src=\"../images/zurueck.gif\" width=\"77\" height=\"22\"></a><br>
</p>
<p></p>
<p></p>
<p></p>
<p></p>
<p><br>
</p>
</td>
<td width=\"1%\" background=\"../images/box_r.gif\">
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
</tr>
<tr>
<td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
<td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>";
exit;
} // Ende wenn Pflichtfelder nicht ausgef&uuml;llt wurden
$db = dbconnect();
$ck_fachbearbeiten = $_COOKIE["ck_fachbearbeiten"];
$gruppen = $_POST['gruppen'];
$kurzbeschreibung = mysqli_escape_string($db, stripslashes( $_POST['kurzbeschreibung'] ));
$termine = $_POST['termine'];
$termin_ausserhalb = $_POST['termin_ausserhalb'];
$reisekosten = $_POST['reisekosten'];
$zweig = "$_POST[I]$_POST[R]$_POST[F]$_POST[S]";
$sql1 = "UPDATE fachprojekt
SET FPRNr = '$_POST[FPR_Nr]'
,Bezeichnung = '$_POST[Bezeichnung]'
,Ansprechpart = '$_POST[Ansprechpartner]'
,TN_min = '$_POST[min_t]'
,TN_max = '$_POST[max_t]'
,Jahr = '$_POST[jahr]'
,Zweig= '$zweig'
,gruppen = '$gruppen'
,beschreibung = '$kurzbeschreibung'
,termine = '$termine'
,termin_ausserhalb = '$termin_ausserhalb'
,reisekosten = '$reisekosten'
,bemerkung = '$_POST[bemerkung]'
WHERE id = '$ck_fachbearbeiten'
";
$db->query($sql1);
$sql_del = $db->query("Delete from fach_doz where id = '$ck_fachbearbeiten'"); //vorhandene Dozenten in der Prosem.-Zuordnung l&ouml;schen
$sql_id = $db->query("select id from fachprojekt where FPRNr='$_POST[FPR_Nr]' and Jahr = '$_POST[jahr]'");
$id = $sql_id->fetch_array();
$Dozent = $_POST['Dozent']; // Vom Formular gesendetes Objekt in Variable schreiben
for ($i=0;$i<sizeof($Dozent);$i++) { // Schleife, der die Dozenten aufaddiert bis alle ausgew&auml;hlen abgearbeitet sind.
$sql = "INSERT INTO fach_doz ( id , doz_nr )VALUES ( '$id[id]', '$Dozent[$i]' )";
$db->query($sql);
}
echo "
<meta http-equiv=\"refresh\" content=\"2; URL=fachprojekt_bearbeiten.php\">
<html>
<head>
<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
<link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
<title>Aktualisierung</title>
</head>
<body>
<table border=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellpadding=\"0\" height=\"100%\" id=\"table1\">
<tr>
<td>
<div align=\"center\">
<table cellspacing=\"0\" cellpadding=\"0\" width=\"550\" border=\"0\">
<tr>
<td width=\"10\" background=\"../images/box_e1.gif\">
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
<td nowrap=\"nowrap\" align=\"left\" width=\"3%\" background=\"../images/box_top.gif\" valign=\"top\"></td>
<td width=\"95%\" background=\"../images/box_top.gif\">
<img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
<span class=\"sh\">Aktualisierung</span><br>
<img height=\"5\" src=\"../images/blank.gif\" width=\"1\"></td>
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e2.gif\">
<img height=\"40\" src=\"../images/blank.gif\" width=\"22\"></td>
</tr>
<tr>
<td width=\"1%\" background=\"../images/box_l.gif\">
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
<td colspan=\"2\"><br>
<p align=\"center\"><b>Fachprojekt wurde aktualisiert!</b>
</p>
<p></p>
<p><br>
</p>
</td>
<td width=\"1%\" background=\"../images/box_r.gif\">
<img height=\"1\" src=\"../images/blank.gif\" width=\"22\"></td>
</tr>
<tr>
<td nowrap=\"nowrap\" align=\"left\" width=\"1%\" background=\"../images/box_e3.gif\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"></td>
<td nowrap=\"nowrap\" align=\"left\" width=\"98%\" background=\"../images/box_bottom.gif\" colspan=\"2\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"8\"></td>
<td nowrap=\"nowrap\" align=\"right\" width=\"1%\" background=\"../images/box_e4.gif\">
<img height=\"16\" src=\"../images/blank.gif\" width=\"22\"> </td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</body>
</html>
";
} //Ende Action Abfrage
?>