Kompetenz/admin/kompetenzbescheinigung_admin.php
2023-03-01 16:54:46 +01:00

241 lines
13 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
// 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 sozkom_admin_rechte, sozkom_admin_rechte_zuord , sozkom_admin where sozkom_admin_rechte.sozkom_admin_rolle = sozkom_admin_rechte_zuord.sozkom_admin_rolle AND sozkom_admin_rechte_zuord.faid = sozkom_admin.faid AND sozkom_admin.user = '$user_admin' AND sozkom_admin_rechte_zuord.sozkom_admin_rolle = 'a_sozkombesch'");
$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>Ausgabe Adressliste f&uuml;r Word</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\">Soziale Kompetenzbescheinigung</font>
<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=ausgabe"; echo" method=\"POST\" name=\"PSN_bearb\">
<table border=\"0\" cellpadding=\"4\" cellspacing=\"0\" ausgabe=\"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>FPRNr</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\"></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>verf&uuml;gbare<br>Kompetenzscheine </b></p>
</td>
</tr>";
$db = dbconnect();
$query = "SELECT id, FPRNr, Bezeichnung, bemerkung FROM sozkom_kompetenz 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(sozkom_wunsch.uid)
FROM sozkom_wunsch left join stud using (uid)
WHERE sozkom_wunsch.id=$row[id]
AND sozkom_wunsch.Prioritaet=\"0\"
AND stud.durchgefallen !=\"Y\"
") ){
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</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=\"ausw_ausg\" 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 "ausgabe":
$db = dbconnect();
$sel_fach = $db->query("SELECT Bezeichnung FROM sozkom_kompetenz where id=\"". $_POST['ausw_ausg']."\""); // ausw_ausg = sozkom_kompetenz.id
$fach = $sel_fach->fetch_array();
$abfrage = "SELECT stud.uid, Vorname, Nachname, AG, Jahrgang
FROM sozkom_wunsch left join stud using (uid)
WHERE sozkom_wunsch.id=\"". $_POST['ausw_ausg']."\"
AND sozkom_wunsch.Prioritaet=\"0\"
AND stud.durchgefallen !=\"Y\"
";
setcookie ("ck_SozkomID", $_POST['ausw_ausg']);
echo "
<html>
<head>
<meta http-equiv=\"Content-Language\" content=\"de\">
<link rel=\"stylesheet\" href=\"../styles_pc.css\" type=\"text/css\">
<title>Ausgabe</title>
<style type='text/css'>
.nextprev:link, .nextprev:visited {
background-color: #D6DFF7;
color: black;
font-weight:bold;
text-decoration: none;
width: 99%;
display: block;
font-size: 8pt;
text-align: center;
padding: 1px;
}
.nextprev:active, .nextprev:hover {
background-color: #6487DC;
color: #FFFFFF;
font-weight:bold;
text-decoration: none;
width: 99%;
display: block;
font-size: 8pt;
text-align: center;
padding: 1px;
}
</style>
</head>
<body>
<span class=\"uberschrift\">Soziale Kompetenzbescheinigung</Span><br>
<b>Soziale Kompetenz: $fach[Bezeichnung]</b></p>
<p>&nbsp;</p>
<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" collapse bordercolor=\"#111111\" width=\"614\" id=\"AutoNumber1\" style=\"border-collapse: collapse\">
<tr>
<td width=\"33%\" class=\"contentfarbe\" style=\"padding-left:4; padding-right:4; padding-top:1; padding-bottom:1; border-left-style:solid; border-left-width:1; border-right-width:1; border-top-width:1; border-bottom-width:1\" height=\"20\">
<p style=\"margin-left: 6; margin-top:4; margin-bottom:4\"><b>Vorname</b></p>
</td>
<td width=\"33%\" class=\"contentfarbe\" style=\"padding-left:4; padding-right:4; padding-top:1; padding-bottom:1; border-left-style:solid; border-left-width:1; border-right-width:1; border-top-width:1; border-bottom-width:1\" height=\"20\">
<p style=\"margin-left: 6; margin-top:4; margin-bottom:4\"><b>Nachname</b></p>
</td>
<td width=\"33%\" align=\"left\" class=\"contentfarbe\" style=\"padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1; border-left-style:none; border-left-width:medium; border-top-width:1; border-bottom-width:1\" height=\"20\">
<p style=\"margin-top: 4; margin-bottom: 4\"><b>AG</b></p>
</td>
</tr>
<tr>";
$db = dbconnect();
$sql = $db->query($abfrage); // $result= Alle Studenten, die das ausgew&auml;hlte fachprojekt belegt haben
while ($res_ausg = $sql->fetch_array()){
$sel_daten = $db->query("SELECT Thema, Note FROM sozkom_ergebnis where uid=\"$res_ausg[uid]\" and id=\"". $_POST['ausw_ausg']."\""); // ausw_ausg = fachprojekt.id
$daten = $sel_daten->fetch_array();
echo "
<td width=\"33%\" style=\"padding-left:4; padding-right:4; padding-top:1; padding-bottom:1; border-left-style:none; border-left-width:medium\" height=\"21\">
<p style=\"margin-left: 6; margin-top: 4; margin-bottom: 4\">$res_ausg[Vorname]
</td>
<td width=\"33%\" style=\"padding-left:4; padding-right:4; padding-top:1; padding-bottom:1; border-left-style:none; border-left-width:medium\" height=\"21\">
<p style=\"margin-left: 6; margin-top: 4; margin-bottom: 4\">$res_ausg[Nachname]
</td>
<td width=\"33%\" align=\"left\" style=\"padding-left:4; padding-right:4; padding-top:1; padding-bottom:1; border-left-style:none; border-left-width:medium\" height=\"21\">
<p style=\"margin-top: 4; margin-bottom: 4\">$res_ausg[AG]/$res_ausg[Jahrgang]
</td>
</tr>";
$notenwort = "";
}
echo"
</table>
<br>
<table valign='middle' style='border-top: 2px solid #6487DC; border-bottom: 2px solid #6487DC;' width='100%' align='center' border='0' cellpadding='0' cellspacing='0'>
<tbody><tr>
<td valign='middle' width='100%' height='30px' class='nextprev'>
<a target='_top' href='kompetenzscheine/seminarscheine.php' class='nextprev'><font size='3'>&nbsp;</font>PDF-Drucken<font size='3'>&nbsp;</font></a>
</td>
</tr>
</tbody>
</table>
</body>
</html>";
} //Ende Action Abfrage
?>