Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $user_id = $_GET["userid"];
- $groupid = $_GET["group"];
- echo('<table border="1">'."n");
- echo('<tr><th></th>');
- $weekModifier = 0;
- $date = new DateTime();
- if($date->format('N') !== 1) {
- $date->sub(new DateInterval('P'. $date->format('N') . 'D'));
- }
- $interval = new DateInterval('P'.abs($weekModifier).'W');
- if($weekModifier > 0) {
- $date->add($interval);
- } else {
- $date->sub($interval);
- }
- for($i = 1; $i <= 7; $i++) {
- echo "<th>" . $date->add(new DateInterval('P1D'))->format('d-m') . "</th>";
- }
- echo "</tr>";
- $stmt = $dbh->query("SELECT fullname, name FROM people, shifts WHERE group_id=$groupid AND shift_id IN (SELECT shift_id FROM shift_assigned WHERE (user_id=$user_id AND day_id=8))");
- while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) {
- echo "<tr><td>";
- echo(htmlentities($row['fullname']));
- echo "</td><td>";
- echo(htmlentities($row['name']));
- echo "</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>";
- }
- echo "</table>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement