Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
timerec3public/kernz.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
58 lines (53 sloc)
2.9 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table class='tabelle'> | |
<tr class='topline'> | |
<th>Datum / Zeit</th><th>Status</th><th>Name</th><th></th> | |
</tr> | |
<?php | |
error_reporting(E_ALL & ~E_NOTICE); | |
if(!$include){ | |
echo "nicht innerhalb einer anderen Seite geöffnet!"; | |
exit; | |
} | |
$gestern = new DateTime(); | |
$gestern->modify('-1 day'); | |
$vor30tagen = new DateTime(); | |
$vor30tagen->modify('-30 day'); | |
//daten holen | |
$getdata = $dbc->query("select * from (select * from (select zeit_ID, datumzeit, date(datumzeit) as datum, time(datumzeit) as zeit, status, concat(nachname, ', ', vorname) as name, z.maID, kzvstart, kzvende, kznstart, kznende | |
from zeit z | |
join mitarbeiter m on z.maID = m.maID | |
join az_data_copy az on m.maID = az.maID | |
join az_time azt on az.azdID = azt.azdID | |
where gleitzeit = 1 | |
and status != 'Dienst' | |
and datum_ab <= date(datumzeit) | |
and date(datumzeit) between '".$vor30tagen->format('Y-m-d')."' and '".$gestern->format('Y-m-d')."' | |
and dayofweek(datumzeit) = tag | |
order by datumzeit desc, nachname asc, datum_ab desc, az.azdID desc) c | |
group by datumzeit | |
order by datum desc) cc | |
where ((time(datumzeit) > kzvstart and time(datumzeit) < kzvende) | |
or (time(datumzeit) > kznstart and time(datumzeit) < kznende));"); | |
foreach($getdata as $data){ | |
//index zeit_ID dient hier dazu, nur zum aktuellen AZModell passende Einträge anzuzeigen | |
//verhindert doppelte, falsche Aufzählungen | |
$alldata[$data['datum']][$data['zeit_ID']] = $data; | |
} | |
/* echo "<pre>"; | |
print_r($alldata); | |
echo "</pre>"; */ | |
foreach($alldata as $datum=>$output){ | |
echo "<tr class='topline'>"; | |
$formatdatum = new DateTime($datum); | |
echo "<th>".$formatdatum->format('d.m.Y')."</th><th></th><th></th><th></th>"; | |
echo "</tr>"; | |
$switch = false; | |
foreach($output as $ma){ | |
$linecolor = $switch ? "line2" : "line1"; | |
$switch = !$switch; | |
echo "<tr class='$linecolor'><td>$ma[zeit]</td><td>$ma[status]</td><td>$ma[name]</td> | |
<td><a href='index.php?tomonthcal&ma=$ma[maID]&m=".$formatdatum->format('m')."&y=".$formatdatum->format('Y')."'><button>öffnen</button></a></td></tr>"; | |
} | |
} | |
?> | |
</table> |