schwerpunktthemen/admin/unangemeldet.php
2023-02-27 11:44:33 +01:00

137 lines
7.5 KiB
PHP
Executable File

<?php
$user_admin=$_COOKIE["user_admin"];
$jahrgang=$_COOKIE["jahrgang"];
# Änderungen für März Jahrgänge
$semester=$_COOKIE["semester"];
if($semester == 30){
$sem_klartext = 'Frühjahr';
$ag_von = 30;
$ag_bis = 39;
}else{
$sem_klartext = 'Herbst';
$ag_von = 0;
$ag_bis = 29;
}
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
// 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 spt_admin_rechte, spt_admin_rechte_zuord , spt_admin where spt_admin_rechte.spt_admin_rolle = spt_admin_rechte_zuord.spt_admin_rolle AND spt_admin_rechte_zuord.faid = spt_admin.faid AND spt_admin.user = '$user_admin' AND spt_admin_rechte_zuord.spt_admin_rolle = 'a_unangem'");
$row = $result->fetch_array();
if ($row[0] != 1){ include("kurs/rechte.php"); exit;}
// Rechte&uuml;berpr&uuml;fung ende
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>Vertiefungsbereich unbelegt</title>
</head>
<body>
<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" 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\">Unangemeldete Studenten - $sem_klartext JG $jahrgang</font><br>
<font class=\"sh\">Sortiert nach Studiengang, Nachname</font><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>
<table border=\"0\" cellpadding=\"4\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#E7E8ED\" width=\"100%\" id=\"AutoNumber1\">
<tr>
<td width=\"60%\" 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=\"left\"><b>Name</b></p>
</td>
<td width=\"20%\" 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>AG</b>
</td>
<td width=\"20%\" 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>Studiengang</b>
</td>
</tr>";
$db = dbconnect();
# Bei Umstellung auf Semester angepasst: 02.12.2016
# $query = "SELECT Nachname, Vorname, AG, Jahrgang, stg, trim(stgText) stgText
# FROM stud
# LEFT JOIN spt_wunsch USING ( uid )
# WHERE spt_wunsch.uid IS NULL
# AND stud.Jahrgang=\"$jahrgang\"
# AND stud.stg =\"S\"
# AND stud.durchgefallen!='Y'
# AND stud.hs = 'L'
# ORDER BY stgText, Nachname ASC";
$query = "SELECT Nachname, Vorname, AG, Jahrgang
FROM stud a
WHERE uid NOT IN (SELECT uid f
FROM spt_wunsch b, spt_kurs c
WHERE b.id=c.id
and c.semester='$semester')
AND a.jahrgang='$jahrgang'
AND a.durchgefallen != 'Y'
AND a.stg='S'
and a.ag >= $ag_von
and a.ag <= $ag_bis
AND hs = 'L'
ORDER BY Nachname ASC";
$result = $db->query($query)
or die ("Cannot execute query");
while ($row = $result->fetch_array()){
echo "
<tr>
<td width=\"80%\" 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=\"left\">
$row[Nachname], $row[Vorname]
</td>
<td width=\"20%\" 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\">
$row[AG]/$row[Jahrgang]
</td>
<td width=\"20%\" 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\">
$row[stgText]
</td>
</tr>";
}
echo "
</table>
<p align='center'>
<a href='mail_unangemeldet.php'><img src=\"../images/mail2.png\" border='0'></a>
</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>
</body>
</html>";
?>