Merge pull request #7 from iridos/develop

Develop
This commit is contained in:
iridos 2024-01-11 15:33:17 +01:00 committed by GitHub
commit ce214d5ccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 176 additions and 156 deletions

View File

@ -53,14 +53,21 @@ while ($zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC)) {
<div style="width: 100%;">
<table class="commontable">
<th><button name="BackHelferdaten" value="1" onclick="window.location.href = 'index.php';"><b>&larrhk;</b></button> &nbsp; <b>Admin HelferDB</b>
<th>
<button name="BackHelferdaten" value="1" onclick="window.location.href = 'index.php';">
<b>&larrhk;</b>
</button> &nbsp;
<b>Admin HelferDB</b>
</th>
<tr>
<tr onclick="window.location.href='AdminDienste.php';">
<td>
<a class="fallbacklink" href='AdminDienste.php'><img src="Bilder/PfeilRechts.jpeg" style="width:30px;height:30px;"><b> Dienste und Schichten verwalten</b></a>
<a class="fallbacklink" href='AdminDienste.php'>
<img src="Bilder/PfeilRechts.jpeg" style="width:30px;height:30px;">
<b> Dienste und Schichten verwalten</b>
</a>
</td>
</tr>
<tr onclick="window.location.href='CreateHelfer.php';"> <td>
@ -72,11 +79,17 @@ while ($zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC)) {
</td> </tr>
<tr onclick="window.location.href='AdminHelferUebersicht.php';">
<td>
<a class="fallbacklink" href='AdminHelferUebersicht.php'><img src="Bilder/PfeilRechts.jpeg" style="width:30px;height:30px;"><b>Helfer&uuml;bersicht (und als Admin &auml;ndern)</b></a>
<a class="fallbacklink" href='AdminHelferUebersicht.php'>
<img src="Bilder/PfeilRechts.jpeg" style="width:30px;height:30px;">
<b>Helfer als Admin &auml;ndern</b>
</a>
</td>
</tr>
<th><b>Helfer als Admin &auml;ndern:<b> <form style="display:inline-block;" method=post><select style="height:33px;width:350px;font-size:20" name="AliasHelferID" id="AliasHelferID" onchange="submit()">
<th>
<b>Helfer als Admin &auml;ndern:<b>
<form style="display:inline-block;" method=post>
<select style="height:33px;width:350px;font-size:20" name="AliasHelferID" id="AliasHelferID" onchange="submit()">
<?php
$db_erg = HelferListe($db_link);
while ($zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC)) {
@ -98,13 +111,25 @@ while ($zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC)) {
- inner table for indent-->
<tr onclick="window.location.href='AdminUserdaten.php';">
<!--td class="invis"></td-->
<td><img src="Bilder/dot.png" width="30px" height="2px"><img src="Bilder/PfeilRechts.jpeg" style="width:30px;height:30px;"><b> Helferdaten &auml;ndern</b></td>
<td>
<img src="Bilder/dot.png" width="30px" height="2px">
<img src="Bilder/PfeilRechts.jpeg" style="width:30px;height:30px;">
<b> Helferdaten &auml;ndern</b>
</td>
</tr>
<tr onclick="window.location.href='AdminMeineSchichten.php';">
<td><img src="Bilder/dot.png" width="30px" height="2px"><img src="Bilder/PfeilRechts.jpeg" style="width:30px;height:30px;"><b> Schichten Anzeigen/Löschen</b></td>
<td>
<img src="Bilder/dot.png" width="30px" height="2px">
<img src="Bilder/PfeilRechts.jpeg" style="width:30px;height:30px;">
<b>Schichten Anzeigen/Löschen</b>
</td>
</tr>
<tr onclick="window.location.href='AdminAlleSchichten.php';">
<td><img src="Bilder/dot.png" width="30px" height="2px"><img src="Bilder/PfeilRechts.jpeg" style="width:30px;height:30px;"><b> Schichten Hinzufügen</b></td>
<td>
<img src="Bilder/dot.png" width="30px" height="2px">
<img src="Bilder/PfeilRechts.jpeg" style="width:30px;height:30px;">
<b> Schichten Hinzufügen</b>
</td>
</tr>
<!--</table></td> </tr> inner table for indent end-->
<!--<tr><th>Weiteres</th></tr>-->
@ -115,8 +140,12 @@ while ($zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC)) {
<td > <img src="Bilder/More.jpeg" style="width:30px;height:30px;"> <b>Ausdrucke</b> </td>
</tr>
</table>
<p> <img src="Bilder/Info.jpeg" width="25px" height="25px"> Dienst: z.B. Badgekontrolle Eingang A. Schicht: ein Dienst zu einer bestimmten Zeit zB 9-12 Uhr
<p>
<img src="Bilder/Info.jpeg" width="25px" height="25px">
Dienst: z.B. Badgekontrolle Eingang A. Schicht: ein Dienst zu einer bestimmten Zeit zB 9-12 Uhr
</p>
<button class=back name="BackHelferdaten" value="1" onclick="window.location.href = 'index.php';"><b>&larrhk;</b></button>
<button class=back name="BackHelferdaten" value="1" onclick="window.location.href = 'index.php';">
<b>&larrhk;</b>
</button>
</body>
</html>

View File

@ -17,10 +17,10 @@ if ($AdminStatus != 1) {
<head>
<title>Helfer Drop am See Alle Schichten</title>
<link rel="stylesheet" href="css/style_desktop.css" media="screen and (min-width:781px)"/>
<link rel="stylesheet" href="css/style_mobile.css" media="screen and (max-width:780px)"/>
<meta name="viewport" content="width=480" />
<script src="js/jquery-3.7.1.min.js" type="text/javascript"></script>
<script src="js/helferdb.js" type="text/javascript"></script>
<script> collapse_table_rows();
@ -140,18 +140,13 @@ while ($zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC)) {
///////////////////////////////////////////////////////////
if (isset($_POST['plusschicht'])) {
$messages = [];
$SchichtId = $_POST['plusschicht'];
// Eingaben überprüfen:
// if(!preg_match('/^[a-zA-Z]+[a-zA-Z0-9._]+$/', $HelferName)) {
// $messages[] = 'Bitte prüfen Sie die eingegebenen Namen';
// }
$SchichtID = $_POST['plusschicht'];
// Nutzer hat hier zuletzt etwas geändert und wir klappen das deshalb auf,
// indem wir unten target=active setzen
$_SESSION["SchichtIdAktiv"] = $SchichtID;
if (empty($messages)) {
// Helfer Schicht zuweisen
$db_erg = HelferSchichtZuweisen($db_link, $AliasHelferID, $SchichtId, $AdminID);
$db_erg = HelferSchichtZuweisen($db_link, $AliasHelferID, $SchichtID, $AdminID);
// Erfolg vermelden und Skript beenden, damit Formular nicht erneut ausgegeben wird
$HelferName = '';
@ -197,7 +192,7 @@ if (isset($_POST['minusschicht'])) {
$db_erg = SchichtenSummeEinesHelfers($db_link, $AliasHelferID);
$zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC);
echo '<table id="customers"><tr class="header"><th onclick="window.location.href=\'AdminMeineSchichten.php\'">';
echo '<table class="commontable"><tr class="header"><th onclick="window.location.href=\'AdminMeineSchichten.php\'">';
echo " Dienstplan von $HelferName (Zusammenfassung)<br>";
echo $zeile['Anzahl'];
echo " Schichten insgesamt ";
@ -266,7 +261,7 @@ if ($addschicht != '0') {
//echo "<p><button name='addschicht' value='0'><b>&larrhk;</b></button></p>";
echo '<table id="customers">';
echo '<table class="commontable">';
echo "<thead>";
echo "<tr>";
echo "</tr><th colspan='7'>" . "Alle Schichten der Con (" . $iBelegteSchichtenCount . "/" . $iAlleSchichtenCount . ")</th></tr>";
@ -333,7 +328,7 @@ if ($addschicht != '0') {
//print_r($MeineDienste);
echo '</table>';
echo '<table id="customers">';
echo '<table class="commontable collapsible">';
while ($zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC)) {
if ($dienstsort == '1') {
@ -385,6 +380,9 @@ if ($addschicht != '0') {
$rowstyle = 'style="dummy:' . $zeile['SchichtID'] . '"';
$regtext = '';
}
if ($_SESSION["SchichtIdAktiv"] == $zeile['SchichtID']) {
$rowstyle = $rowstyle . " target='active' "; // dont collapse when the user did something
}
echo '<tr ' . $rowstyle . 'onclick="window.location.href=\'DetailsSchichten.php?InfoAlleSchichtID=' . $zeile['SchichtID'] . '#Info\';" >';
@ -399,7 +397,7 @@ if ($addschicht != '0') {
echo "" . $zeile['Soll'] . "</td>";
// buttons sind in der selben Zelle
echo "<td width='30px'>" . "<button width='20px' name='plusschicht' value='" . $zeile['SchichtID'] . "'>+</button>" . "";
echo "" . "&nbsp;&nbsp;<button width='120px' name='minusschicht' value='" . $zeile['SchichtID'] . "'>&ndash;</button> $regtext" . "</td>";
echo "&nbsp;&nbsp;<button width='120px' name='minusschicht' value='" . $zeile['SchichtID'] . "'>&ndash;</button> $regtext" . "</td>";
//echo "<td>$regtext</td>";
echo "</tr>\n";
}

View File

@ -71,7 +71,7 @@ echo "<br><br><table class='commontable' style='page-break-before:always'>";
<th><button name="BackHelferdaten" value="1" onclick="window.location.href = 'Admin.php';"><b>&larrhk;</b></button> &nbsp; <b>&Uuml;bersicht Helfer und Ihre Schichten</b></th>
</tr>
</table>
<table class="commontable">
<table class="commontable collapsible">
<?php
$db_erg = AlleHelferSchichtenUebersicht($db_link);
$dauer = 0;

View File

@ -103,7 +103,7 @@ if (isset($_GET['ZeitBereich'])) {
?>
<form method="post" action="AlleSchichten.php#Info">
<form method="post" action="AlleSchichten.php">
<?php
@ -112,24 +112,17 @@ if (isset($_GET['ZeitBereich'])) {
///////////////////////////////////////////////////////////
if (isset($_POST['plusschicht'])) {
$messages = [];
$SchichtId = $_POST['plusschicht'];
// Eingaben überprüfen:
// if(!preg_match('/^[a-zA-Z]+[a-zA-Z0-9._]+$/', $HelferName)) {
// $messages[] = 'Bitte prüfen Sie die eingegebenen Namen';
// }
$SchichtID = $_POST['plusschicht'];
// Nutzer hat hier zuletzt etwas geändert und wir klappen das deshalb auf,
// indem wir unten target=active setzen
$_SESSION["SchichtIdAktiv"] = $SchichtID;
if (empty($messages)) {
// Helfer Schicht zuweisen
$db_erg = HelferSchichtZuweisen($db_link, $HelferID, $SchichtId);
$db_erg = HelferSchichtZuweisen($db_link, $HelferID, $SchichtID);
// Erfolg vermelden und Skript beenden, damit Formular nicht erneut ausgegeben wird
$HelferName = '';
$HelferEmail = '';
$HelferHandy = '';
//die('<div class="Helfer wurde angelegt.</div>');
} else {
// Fehlermeldungen ausgeben:
echo '<div class="error"><ul>';
@ -145,6 +138,8 @@ if (isset($_POST['minusschicht'])) {
$messages = [];
$SchichtID = $_POST['minusschicht'];
// Nutzer hat hier zuletzt etwas geaenndert und wir klappen das deshalb auf:
$_SESSION["SchichtIdAktiv"] = $SchichtID;
if (empty($messages)) {
// Helfer aus Schicht entfernen
@ -169,6 +164,7 @@ if (isset($_POST['minusschicht'])) {
$db_erg = SchichtenSummeEinesHelfers($db_link, $HelferID);
$zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC);
//"Mein Dienstplan"
echo '<table class="commontable"><tr class="header"><th onclick="window.location.href=\'MeineSchichten.php\'">';
echo '<img src="Bilder/PfeilRechts2.png" style="width:30px;height:30px;align:middle;">' . " Mein Dienstplan (";
echo $zeile['Anzahl'];
@ -206,7 +202,6 @@ if ($addschicht == '0') {
echo "<button name='addschicht' value='2'>Dienste</button></p>";
}
//echo "InfoAlleSchichtID ".$InfoAlleSchichtID;
if ($addschicht != '0') {
//$db_erg = AlleSchichten($db_link,$dienstsort);
@ -237,21 +232,11 @@ if ($addschicht != '0') {
$iBelegteSchichtenCount = AlleBelegteSchichtenCount($db_link);
echo "<button type='button' onclick='expand_all_table_rows();'>Alles Ausklappen</button>";
//echo "<p><button name='addschicht' value='0'><b>&larrhk;</b></button></p>";
echo '<table id="customers">';
// "Alle Schichten der Con"
echo '<table class="commontable">';
echo "<tr class='header'>";
echo "<th colspan='7'>" . "Alle Schichten der Con (" . $iBelegteSchichtenCount . "/" . $iAlleSchichtenCount . ")</th></tr>";
echo "<th colspan='7'>Alle Schichten der Con (" . $iBelegteSchichtenCount . "/" . $iAlleSchichtenCount . ")</th></tr>";
/*
if ($dienstsort=='1')
{
echo "<th>". "Dienst" . "</th>";
}
else
{
echo "<th>". "Von" . "</th>";
}
*/
echo "<tr class='header'>"; // Zeitbereich tr
if ($ZeitBereich == 1) {
echo "<th style='width:100px; background-color:#0000FF' onclick='window.location.href=\"AlleSchichten.php?ZeitBereich=1\"'>" . "Alle" . "</th>";
@ -298,7 +283,8 @@ if ($addschicht != '0') {
//print_r($MeineDienste);
echo '</table>';
echo '<table id="customers">';
// Tabelle mit allen Diensten und Schichten
echo '<table class="commontable collapsible">';
while ($zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC)) {
if ($dienstsort == '1') {
$Tag = $zeile['Tag'];
@ -313,7 +299,8 @@ if ($addschicht != '0') {
$Was = $zeile['Was'];
if ($Was != $OldWas) {
echo "<tr class='header'><th colspan='7' style='width:100%'>";
// + in <span> becomes - when rows are opened
echo "<tr class='header'><th colspan='7' style='width:100%'><span>+</span> ";
echo $Was;
echo "</th>";
/*
@ -349,6 +336,9 @@ if ($addschicht != '0') {
$rowstyle = 'dbinfo="SchichtID:' . $zeile['SchichtID'] . ';helferlvl:' . $HelferLevel . '" ';
$regtext = '';
}
if ($_SESSION["SchichtIdAktiv"] == $zeile['SchichtID']) {
$rowstyle = $rowstyle . " target='active' "; // dont collapse when the user did something
}
echo '<tr ' . $rowstyle . 'onclick="window.location.href=\'DetailsSchichten.php?InfoAlleSchichtID=' . $zeile['SchichtID'] . '#Info\';" >';
@ -363,8 +353,7 @@ if ($addschicht != '0') {
echo "" . $zeile['Soll'] . "</td>";
// buttons sind in der selben Zelle
echo "<td width='30px'>" . "<button width='20px' name='plusschicht' value='" . $zeile['SchichtID'] . "'>+</button>" . "";
echo "" . "&nbsp;&nbsp;<button width='120px' name='minusschicht' value='" . $zeile['SchichtID'] . "'>&ndash;</button> $regtext" . "</td>";
//echo "<td>$regtext</td>";
echo "&nbsp;&nbsp;<button width='120px' name='minusschicht' value='" . $zeile['SchichtID'] . "'>&ndash;</button> $regtext" . "</td>";
echo "</tr>\n";
}
echo "</table>";

View File

@ -62,7 +62,7 @@ while ($zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC)) {
</tr>
<tr onclick="window.location.href='TeilnehmerSchichtenAusdruck.php';">
<td > <img src="Bilder/More.jpeg" style="width:30px;height:30px;"> <b>Ausdruck Schichten(I)</b> </td> </tr>
<tr onclick="window.location.href='TeilnehmerSchichtenAusdruck.php';">
<tr onclick="window.location.href='TeilnehmerSchichtenAusdruck2.php';">
<td > <img src="Bilder/More.jpeg" style="width:30px;height:30px;"> <b>Ausdruck Schichten(II)</b> </td> </tr>
</table>
<button class=back name="BackHelferdaten" value="1" onclick="window.location.href = 'Admin.php';"><b>&larrhk;</b></button>

View File

@ -39,10 +39,9 @@ $db_link = mysqli_connect (
if(isset($_GET['InfoAlleSchichtID']))
{
if (isset($_GET['InfoAlleSchichtID'])) {
$InfoAlleSchichtID = $_GET['InfoAlleSchichtID'];
UNSET($InfoMeineSchichtID);
unset($InfoMeineSchichtID);
//echo "<b>". $SchichtID . "</b><br>";
$zeile = DetailSchicht($db_link, $InfoAlleSchichtID);
@ -63,23 +62,19 @@ if(isset($_GET['InfoAlleSchichtID']))
$x = 0;
while ($zeile = mysqli_fetch_array( $db_erg, MYSQLI_ASSOC))
{
while ($zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC)) {
$MitHelferID[$x] = $zeile['HelferID'];
$MitHelfer[$x] = $zeile['Name'];
$MitHelferHandy[$x] = $zeile['Handy'];
$x++;
}
}
$HelferID = $_SESSION["HelferID"];
$AdminID = $_SESSION["AdminID"];
if(isset($_POST['HelferID']))
{
if (isset($_POST['HelferID'])) {
$HelferID = $_POST['HelferID'];
}
if (isset($_POST['ShowHelfer'])) {
@ -145,8 +140,7 @@ echo '<table id="customers">';
echo "<b>Helfer der Schicht:</b><br>";
$x = 0;
$arrayLength = count($MitHelfer);
while ($x<$arrayLength)
{
while ($x < $arrayLength) {
echo "ID:" . $MitHelferID[$x] . ", ";
echo $MitHelfer[$x] . ", ";
echo $MitHelferHandy[$x] . "<br>";

View File

@ -94,7 +94,6 @@ if (isset($_GET['ZeitBereich'])) {
?>
<!--form method="post" action="AlleSchichtenAusdruck.php#Info"-->
<?php
@ -176,7 +175,8 @@ $iBelegteSchichtenCount = AlleBelegteSchichtenCount($db_link);
//echo "<p><button name='addschicht' value='0'><b>&larrhk;</b></button></p>";
echo '<table class="commontable">';
echo "<tr class='header'>";
echo "<th colspan='7'>" . "Alle Schichten der Con (" . $iBelegteSchichtenCount . "/" . $iAlleSchichtenCount . ")</th></tr>";
echo "<th colspan='7'>" . "Alle Schichten der Con (";
echo $iBelegteSchichtenCount . "/" . $iAlleSchichtenCount . ")</th></tr>";
echo "\n<tr class='header'>\n"; // Zeitbereich tr
@ -227,7 +227,9 @@ foreach ($ZeitBereichWerte as &$EinZeitBereich) {
//$Text="$Text <br>$MeinVon $MeinBis"; // debug time strings
// write the field for each day
echo "<th style='width:{$ZeitBereichFeldBreite}%; $color' onclick='window.location.href=\"AlleSchichtenAusdruck.php?ZeitBereich={$EinZeitBereich}\";'>" . "$Text" . "</th>\n";
echo "<th style='width:{$ZeitBereichFeldBreite}%; $color' ";
echo "onclick='window.location.href=\"TeilnehmerSchichtenAusdruck.php?ZeitBereich={$EinZeitBereich}\";'>";
echo "$Text" . "</th>\n";
}
echo "</tr>"; //Zeitbereich tr
@ -242,13 +244,16 @@ $MeineDienste = SchichtIdArrayEinesHelfers($db_link, $HelferID);
echo "</table>\n";
// Table to print out the shifts for people to enter their name in. If a shift is already taken, the name is printed out.
// Table to print out the shifts for people to enter their name in.
// If a shift is already taken, the name is printed out.
// The table prints just one day, specified via Zeitbereich. The heading above wrote out the day.
// the table is sorted by shift type (Was) first and then by time (Ab).
// "Was" is printed in the middle together with two-letter day and time.
// the first and the 5th (last) column also contain two-letter day and time for people to tear off and take with them.
// the 2nd and 4th column are for the namer. if the shift is already taken, the name is printed in, else the field is empty to write in.
// we iterate over all tasks (Was) and then over Ist and Soll for each task, filling one field for each Ist or Soll and filling in the name in Ist and leave it empty if it is Soll.
// the 2nd and 4th column are for the name.
// if the shift is already taken, the name is printed in, else the field is empty to write in.
// we iterate over all tasks (Was) and then over Ist and Soll for each task,
// filling one field for each Ist or Soll and filling in the name in Ist and leave it empty if it is Soll.
echo "<br>next table<br>\n";
echo "<table class='commontable'>\n";
// $db_erg ist aus AlleSchichtenImZeitbereich
@ -269,7 +274,8 @@ while ($zeile = mysqli_fetch_array($db_erg, MYSQLI_ASSOC)) {
echo "<tr class='header'>";
echo "<th colspan=5 style='text-align:center'>$Was ($TagKurz)</th></tr>\n";
}
$db_erg_helfer = BeteiligteHelfer($db_link, $zeile['SchichtID']); // get the people who are already signed up for this shift
// get the people who are already signed up for this shift
$db_erg_helfer = BeteiligteHelfer($db_link, $zeile['SchichtID']);
// Wir geben zwei Helfer pro Zeile fuer die selbe Schicht aus
while ($Soll > 0) {
$Soll = $Soll - 1;

View File

@ -30,16 +30,21 @@ function collapse_table_rows()
{
$(document).ready(
function () {
$('tr:not(.header)').hide();
$('tr.header').click(
// Unter-Zeilen in collapsible Tabellen verbergen
$('table.collapsible tr:not(.header)').hide();
// Zeile mit dem target="active" (von PHP nach submit gesetzt) und dazugehoerige Zeilen anzeigen
$('table.collapsible tr[target="active"]').prevUntil('tr.header').addBack().nextUntil('tr.header').addBack().show();
// id="active" als Anker auf letztes tr.header vor der target=active Seite setzen und dort hin springen
// damit der Nutzer nach Abschicken des Posts seine geoeffneten Optionen sieht
$('table.collapsible tr[target="active"]').prevAll('.header').first().attr('id', 'active');
location.href = '#active';
$('table.collapsible tr.header').click(
function () {
$(this).find('span').text(
function (_, value) {
return value == '-' ? '+' : '-'
}
);
$(this).nextUntil('tr.header').slideToggle(100, function () {});
}
);
@ -50,6 +55,5 @@ function collapse_table_rows()
function expand_all_table_rows()
{
$('tr:not(.header)').hide(); // make all collapsed so that slideToggle doesnt close opened ones
$('tr:not(.header)').slideToggle(100, function () {});
$('tr:not(.header)').show();
}