proseminar/admin/registrierung.php
2023-04-25 13:12:50 +02:00

623 lines
24 KiB
PHP
Executable File

<?php
$user_admin=$_COOKIE["user_admin"];
include("kurs/datenbankanbindung.php"); // f&uuml;gt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.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 pros_admin_rechte, pros_admin_rechte_zuord , pros_admin where pros_admin_rechte.pros_admin_rolle = pros_admin_rechte_zuord.pros_admin_rolle AND pros_admin_rechte_zuord.faid = pros_admin.faid AND pros_admin.user = '$user_admin' AND pros_admin_rechte_zuord.pros_admin_rolle = 'a_studanl'");
$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>Studenten anlegen</title>
</head>
<body onload=\"if(document.regist)document.regist.uid.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=\"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=\"98%\" background=\"../images/box_top.gif\" valign=\"top\">
<img height=\"10\" src=\"../images/blank.gif\" width=\"1\"><br>
<font class=\"hd\">Studenten anlegen</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=register"; echo" method=\"POST\" name=\"regist\">
<table border=\"0\" cellpadding=\"7\" cellspacing=\"0\" style=\"border-width:0; border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\" id=\"AutoNumber1\" height=\"142\">
<tr>
<td width=\"40%\">
<b>Matrikelnr*:</b><br>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name=\"mtknr\" size=\"6\">
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Vorname*:</b>
</td>
<td width=\"60%\">
<input type=\"text\" name=\"Vorname\" size=\"40\">
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Nachname*:</b>
</td>
<td width=\"60%\">
<input type=\"text\" name=\"Nachname\" size=\"40\">
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Stra&szlig;e:</b>
</td>
<td width=\"60%\">
<input type=\"text\" name=\"Strasse\" size=\"40\">
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Postleitzahl:</b>
</td>
<td width=\"60%\">
<input type=\"text\" name=\"PLZ\" size=\"5\">
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Ort:</b>
</td>
<td width=\"60%\">
<input type=\"text\" name=\"Ort\" size=\"40\">
</td>
</tr>
<tr>
<td width=\"40%\" valign=\"top\">
<b>Studienzweig*:</b><br>
</td>
<td width=\"60%\" align=\"left\">
<select size=\"4\" name=\"zweig\">
<option value=\"F\">Finanzverwaltung &nbsp;&nbsp;&nbsp;</option>
<option value=\"R\">Rentenversicherung &nbsp;&nbsp;&nbsp;</option>
<option value=\"I\">Innenverwaltung &nbsp;&nbsp;&nbsp;</option>
<option value=\"S\">Steuerverwaltung &nbsp;&nbsp;&nbsp;</option>
</select>
</td>
</tr>
<tr>
<td width=\"40%\">
<b>AG*:</b><br> <font size=\"1\">
(Bsp: C / 03)</font>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name=\"AG\" size=\"1\"> /
<input type=\"text\" name=\"Jahrgang\" size=\"2\">
</td>
</tr>
<tr>
<td width=\"40%\">
<b>Mailadresse*:</b><br>
</td>
<td width=\"60%\" align=\"left\">
<input type=\"text\" name=\"mail\" size=\"40\">
</td>
</tr>
<tr>
<td colspan=\"2\">
* = Pflichtfelder
</td>
</tr>
<tr>
<td width=\"40%\">
&nbsp;
</td>
<td width=\"60%\">
&nbsp;
</td>
</tr>
</table>
&nbsp; <input type=\"submit\" value=\"Abschicken\" name=\"B1\" size=\"20\">
<input type=\"reset\" value=\"Zur&uuml;cksetzen\" name=\"B2\" size=\"20\">
</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 "register":
if ($_POST[mtknr] == "" or $_POST[Vorname] == "" or $_POST[Nachname] == "" or $_POST[zweig] == "" or $_POST[AG] == "" or $_POST[Jahrgang] == "" or $_POST[mail] == "" ){
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 m&uuml;ssen mindestens die Pflichtfelder ausgef&uuml;llt werden!</b>
<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><br>
</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 If
$db = dbconnect();
$result = $db->query("SELECT uid FROM stud where mtknr=\"". $_POST['mtknr']."\"");
$row = $result->fetch_array();
if ($_POST[mtknr] == $row[uid]){
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>Doppelerfassung</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\">Doppelerfassung</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 Matrikelnr ist im System bereits vorhanden!</b>
<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><br>
</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['zweig']== 'F'){ $stgtext ='Finanzverwaltung';}
if ($_POST['zweig']== 'R'){ $stgtext ='Rentenversicherung';}
if ($_POST['zweig']== 'I'){ $stgtext ='Innenverwaltung';}
if ($_POST['zweig']== 'S'){ $stgtext ='Steuerverwaltung';}
$passwd = md5($_POST['uid']);
//$passwd= mysqli_escape_string($db,$passwd);
$sql = $db->query("INSERT INTO stud ( uid
, nachname
, vorname
, mtknr
, pokfz
, poplz
, poOrt
, poStrasse
, stg
, stgText
, AG
, Jahrgang
, PWD
, mail
)
VALUES
( \"". $_POST['mtknr']."\"
, \"". $_POST['Nachname']."\"
, \"". $_POST['Vorname']."\"
, \"". $_POST['mtknr']."\"
, NULL
, \"". $_POST['PLZ']."\"
, \"". $_POST['Ort']."\"
, \"". $_POST['Strasse']."\"
, \"". $_POST['zweig']."\"
, '$stgtext'
, \"". $_POST['AG']."\"
, \"". $_POST['Jahrgang']."\"
, \"$passwd\"
, \"". $_POST['mail']."\"
)
");
if ($sql)
{
// Nachricht an Student &uuml;ber Registrierung und Passwort: Hinzugef&uuml;gt 19.09.2006
$empfaenger = "$_POST[mail]";
$betreff = "Registrierung Kurssystem";
$text = "
<html>
<head>
<title>Registrierung</title>
</head>
<body>
<font face='Arial' size='2'>
Guten Tag $_POST[Vorname] $_POST[Nachname]!<br><br>
Sie wurden im Kurssystem der Hochschule Ludwigsburg registriert.<br>
Nachfolgend finden Sie Ihre registrierten Daten:
<br>
<br>
<table>
<tr>
<td valign='top'>
<font face='Arial' size='2'>
Vorname:
</font>
</td>
<td valign='top'>
<font face='Arial' size='2'>
<b>$_POST[Vorname]</b>
</font>
</td>
</tr>
<tr>
<td valign='top'>
<font face='Arial' size='2'>
Nachname:
</font>
</td>
<td valign='top'>
<font face='Arial' size='2'>
<b>$_POST[Nachname]</b>
</font>
</td>
</tr>
<tr>
<td valign='top'>
<font face='Arial' size='2'>
Stra&szlig;e:
</font>
</td>
<td valign='top'>
<font face='Arial' size='2'>
<b>$_POST[Strasse]</b>
</font>
</td>
</tr>
<tr>
<td valign='top'>
<font face='Arial' size='2'>
PLZ / Ort:
</font>
</td>
<td valign='top'>
<font face='Arial' size='2'>
<b>$_POST[PLZ] $_POST[Ort]</b>
</font>
</td>
</tr>
<tr>
<td valign='top'>
<font face='Arial' size='2'>
Studienzweig:
</font>
</td>
<td valign='top'>
<font face='Arial' size='2'>
<b>$stgtext</b>
</font>
</td>
</tr>
<tr>
<td valign='top'>
<font face='Arial' size='2'>
AG:
</font>
</td>
<td valign='top'>
<font face='Arial' size='2'>
<b>$_POST[AG]/$_POST[Jahrgang]</b>
</font>
</td>
</tr>
<tr>
<td valign='top'>
<font face='Arial' size='2'>
&nbsp;
</font>
</td>
<td valign='top'>
<font face='Arial' size='2'>
&nbsp;
</font>
</td>
</tr>
<tr>
<td valign='top'>
<font face='Arial' size='2'>
Benutzerkennung:
</font>
</td>
<td valign='top'>
<font face='Arial' size='2'>
<b>$_POST[uid]</b>
</font>
</td>
</tr>
<tr>
<td valign='top'>
<font face='Arial' size='2'>
Passwort:
</font>
</td>
<td valign='top'>
<font face='Arial' size='2'>
<b>$_POST[uid]</b>
</font>
</td>
</tr>
</table>
<br>
Bitte beachten Sie, dass zwischen Gro&szlig;- und<br>
Kleinschreibung unterschieden wird.
<p>
&Auml;ndern Sie bitte zu Ihrer eigenen Sicherheit das<br>
Passwort nach dem ersten Login.
<p>
Link zum Anmeldesystem: <a href=\"https://www.fh-ludwigsburg.de/kurs\">Kurssystem</a><br>
Dort k&ouml;nnen Sie Ihre Adressdaten &auml;ndern.<br>
Halten Sie diese Daten bis zum Ende Ihres Studiums aktuell.
<p>
Diese Mail wurde automatisch generiert!<br>
Antworten Sie daher nicht auf diese Mail<br>
<br>
Vielen Dank
</body>
</html>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=utf-8\r\n";
$return = @mail($empfaenger, $betreff, $text, $headers);
// ENDE Nachricht an Student &uuml;ber Registrierung und Passwort
if($return){
$status = "";
}else{
$status = "nicht";
}
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>Einbindung</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\">Einbindung</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\">Der Student wurde eingebunden und <b>$status</b> per Mail informiert!<br>
Das Passwort ist gleich der Benutzerkennung
<p align=\"center\"><a href=\"registrierung.php\">
<img border=\"0\" src=\"../images/zurueck.gif\" width=\"77\" height=\"22\"></a><br>
<p>
<p>
<p>
<p>
<p><br>
</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>";
}else{
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>Einbindung</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\">Einbindung</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 ist ein Fehler bei der Erfassung aufgetreten!</b>
<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><br>
</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
?>