169 lines
6.9 KiB
PHP
169 lines
6.9 KiB
PHP
<?php
|
|
|
|
$geschlechttxt = array("n.d.","männlich","weiblich","divers");
|
|
$sortiertxt = array("a.nachname COLLATE latin1_german2_ci, a.vorname COLLATE latin1_german2_ci","p.geburtstag DESC","p.geschlecht","g.gruppe","x.zeltnummer","p.geschlecht, p.geburtstag DESC");
|
|
|
|
$mydb= new DB_MySQL('zeltlager','zeltlager','Z3ltlager3363','localhost');
|
|
|
|
if (isset($_POST["submit"]))
|
|
{
|
|
//Submit-Handle
|
|
foreach($_POST['uid'] as $index => $uid)
|
|
{
|
|
$sql = "UPDATE AnmeldungVerwaltung SET zeltnummer='". $_POST['tent'][$index]."' , gruppe='". $_POST['group'][$index]."' WHERE uid ='". $uid ."'";
|
|
$mydb->query($sql);
|
|
|
|
$sql = "UPDATE JubilaeumTeilnahme SET anmeldung_zelt = '". $_POST['tent'][$index]."', anmeldung_gruppe = '". $_POST['group'][$index]."' WHERE anmeldung_uid = '". $uid ."'";
|
|
$mydb->query($sql);
|
|
}
|
|
}
|
|
|
|
if(isset($_GET["sortitem"]))
|
|
{
|
|
$sortitem = $_GET["sortitem"];
|
|
}
|
|
else
|
|
{
|
|
$sortitem = 0;
|
|
}
|
|
|
|
echo "<div class=\"row\"><p align=center><a href=\"addons/zeltwunschliste.php\" target=\"_blank\">Zeltwunschliste als PDF<i class=\"fa fa-eye\"></i></a> -  <a href=\"addons/ExcelZeltwunschliste.php\" target=\"_blank\">Zeltwunschliste als Excel <i class=\"fa fa-download\"></i></a> - <a href=\"addons/mitarbeiterliste.php\" target=\"_blank\">Mitarbeiterliste als PDF<i class=\"fa fa-eye\"></i></a></p></div><br><br>";
|
|
|
|
echo "<div class=\"row\"><p align=center><b>Sortierreihenfolge:</b>";
|
|
echo " ";
|
|
|
|
if ($sortitem == 0)
|
|
echo "<a href=\"index.php?pageId=4&sortitem=0\" class=\"btn btn-success\">Namen</a>";
|
|
else
|
|
echo "<a href=\"index.php?pageId=4&sortitem=0\" class=\"btn btn-outline btn-success\">Namen</a>";
|
|
|
|
echo " ";
|
|
|
|
if ($sortitem == 1)
|
|
echo "<a href=\"index.php?pageId=4&sortitem=1\" class=\"btn btn-success\">Alter</a>";
|
|
else
|
|
echo "<a href=\"index.php?pageId=4&sortitem=1\" class=\"btn btn-outline btn-success\">Alter</a>";
|
|
|
|
echo " ";
|
|
|
|
if ($sortitem == 2)
|
|
echo "<a href=\"index.php?pageId=4&sortitem=2\" class=\"btn btn-success\">Geschlecht</a>";
|
|
else
|
|
echo "<a href=\"index.php?pageId=4&sortitem=2\" class=\"btn btn-outline btn-success\">Geschlecht</a>";
|
|
|
|
echo " ";
|
|
|
|
if ($sortitem == 5)
|
|
echo "<a href=\"index.php?pageId=4&sortitem=5\" class=\"btn btn-success\">Alter & Geschlecht</a>";
|
|
else
|
|
echo "<a href=\"index.php?pageId=4&sortitem=5\" class=\"btn btn-outline btn-success\">Alter & Geschlecht</a>";
|
|
echo " ";
|
|
|
|
if ($sortitem == 3)
|
|
echo "<a href=\"index.php?pageId=4&sortitem=3\" class=\"btn btn-success\">Gruppe</a>";
|
|
else
|
|
echo "<a href=\"index.php?pageId=4&sortitem=3\" class=\"btn btn-outline btn-success\">Gruppe</a>";
|
|
|
|
echo " ";
|
|
|
|
if ($sortitem == 4)
|
|
echo "<a href=\"index.php?pageId=4&sortitem=4\" class=\"btn btn-success\">Zelt</a></p></div>";
|
|
else
|
|
echo "<a href=\"index.php?pageId=4&sortitem=4\" class=\"btn btn-outline btn-success\">Zelt</a></p></div>";
|
|
|
|
echo "</div>";
|
|
|
|
echo "<div class=\"row\"> </div>";
|
|
|
|
//DropDown Werte für Gruppe
|
|
$sql = "SELECT * FROM VerwaltungGruppe";
|
|
$mydb->query($sql);
|
|
|
|
$NumberOfGroups = $mydb->count() ;
|
|
|
|
for ($i = 0 ; $i < $NumberOfGroups; $i++)
|
|
{
|
|
$row = $mydb->fetchRow();
|
|
$NameOfGroups[$i] = $row['gruppe_txt'];
|
|
}
|
|
|
|
//DropDown Werte für Zelte
|
|
$sql = "SELECT * FROM VerwaltungZelte ORDER BY zeltnummer ASC";
|
|
$mydb->query($sql);
|
|
|
|
$NumberOfTents = $mydb->count() ;
|
|
|
|
for ($i = 0 ; $i < $NumberOfTents; $i++)
|
|
{
|
|
$row = $mydb->fetchRow();
|
|
$NameOfTents[$i] = $row['zelt'];
|
|
}
|
|
|
|
|
|
|
|
$sql = "SELECT a.uid, a.nachname, a.vorname, a.strasse, a.wohnort, DATE_FORMAT(p.geburtstag, '%d.%m.%Y') as geburtsdatum, (YEAR(CURRENT_DATE) - YEAR(p.geburtstag)) - (RIGHT(CURRENT_DATE,5) < RIGHT(p.geburtstag,5)) AS age ,p.geschlecht, s.step , z.mitarbeiter, z.mitfahrzeitraum, t.gruppe, t.zeltnummer, g.gruppe_txt, x.zelt FROM AnmeldungAdressen a LEFT JOIN AnmeldungPerson p ON a.uid = p.uid LEFT JOIN AnmeldungStatus s ON a.uid = s.uid LEFT JOIN AnmeldungZeltwunsch z ON a.uid = z.uid LEFT JOIN AnmeldungVerwaltung t ON a.uid = t.uid LEFT JOIN VerwaltungGruppe g ON t.gruppe = g.gruppe LEFT JOIN VerwaltungZelte x ON t.zeltnummer = x.zeltnummer WHERE s.step >= 11 AND s.bestaetigt = 1 ORDER BY $sortiertxt[$sortitem]";
|
|
$mydb->query($sql);
|
|
|
|
echo "<form action=\"index.php?pageId=4&sortitem=". $sortitem ."\" method=\"post\">";
|
|
echo "<p align = center><input type=\"submit\" name=\"submit\" value=\"Änderungen der Einteilung übernehmen\" class=\"btn btn-outline btn-primary btn-lg btn-block\" ></p>\n";
|
|
|
|
echo "<div class=\"panel-body\"><div class=\"panel panel-default\"><div class=\"table-responsive\"><table class=\"table table-hover\">";
|
|
echo " <thead><tr><th>Nachname</th><th>Vorname</th><th>Geb.-Datum</th><th>Alter (heute)</th>";
|
|
echo "<th>Geschlecht</th><th>MA</th><th>Mitfahrzeitraum</th><th>Gruppe</th><th>Zelt</th></tr> </thead> <tbody>\n";
|
|
|
|
while ($row = $mydb->fetchRow())
|
|
{
|
|
if ( ($row['zelt'] == "---") || ($row['gruppe_txt'] == "---") )
|
|
{
|
|
$markertag="#bb5555";
|
|
//$mousetag="#aa1111";
|
|
}
|
|
else
|
|
{
|
|
$markertag="#ffffff";
|
|
//$mousetag="#aaaaFF";
|
|
}
|
|
|
|
$mitfahrzeitraum_txt = array("n.a", "zwei Wochen", "1. Woche", "2. Woche", "Wochenende") ;
|
|
$ausgabe_zeitraum = $mitfahrzeitraum_txt[$row['mitfahrzeitraum']];
|
|
|
|
echo "<tr bgcolor=\"". $markertag ."\" onMouseOver=\"this.bgColor='". $mousetag ."'\" onMouseOut=\"this.bgColor='". $markertag ." '\"><td class=\"linieunten\">" . $row['nachname'] . "</td><td class=\"linieunten\">" . $row['vorname'] . "</td><td class=\"linieunten\">" . $row['geburtsdatum'] . "</td></td><td>" . $row['age'] . "</td>";
|
|
echo "<td>" . $geschlechttxt[$row['geschlecht']] . "</td><td class=\"linieunten\">" . $row['mitarbeiter'] . "</td><td class=\"linieunten\">" . $ausgabe_zeitraum . "</td>";
|
|
|
|
echo "<td>" . generateSelect('group', $NameOfGroups,0, $row['gruppe_txt']) . "</td>";
|
|
echo "<td>" . generateSelect('tent', $NameOfTents,0, $row['zelt']) ."</td>";
|
|
|
|
echo "</tr>\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"uid[]\" value=\"". $row['uid'] ."\" >";
|
|
}
|
|
|
|
echo " </tbody></table></div></div></div>";
|
|
echo "<br><p align = center><input type=\"submit\" name=\"submit\" value=\"Änderungen der Einteilung übernehmen\" class=\"btn btn-outline btn-primary btn-lg btn-block\"></p>";
|
|
|
|
echo "</form>";
|
|
|
|
$mydb->disconnect();
|
|
|
|
function generateSelect($name = '', $clearnames = array(), $startvalue, $SelectedOption )
|
|
{
|
|
$html = '<select name="'.$name.'[]">';
|
|
foreach ($clearnames as $option)
|
|
{
|
|
if ($option == $SelectedOption )
|
|
{
|
|
$html .= '<option selected value='.$startvalue.'>'.$option.'</option>';
|
|
}
|
|
else
|
|
{
|
|
$html .= '<option value='.$startvalue.'>'.$option.'</option>';
|
|
}
|
|
$startvalue++;
|
|
}
|
|
$html .= '</select>';
|
|
return $html;
|
|
}
|
|
|
|
?>
|
|
|