| Server IP : 188.114.96.3 / Your IP : 216.73.216.143 Web Server : Apache System : Linux sv058.home.net.pl 6.8.2 husak_dirty_pages_fix #1 SMP PREEMPT_DYNAMIC Tue Apr 2 22:06:51 CEST 2024 x86_64 User : ( 3194769) PHP Version : 8.5.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /polana/pracownik/ |
Upload File : |
<?php
declare(strict_types=1);
require_once dirname(__DIR__).'/includes/functions.php';
$user=require_staff_portal();ensure_schedule_schema();ensure_tips_schema();ensure_reservations_schema();
$today=date('Y-m-d');$todayShift=schedule_entries_for_date($today,(int)$user['id']);$upcoming=schedule_upcoming_shifts_for_user((int)$user['id'],6);$todayTip=tip_user_day_row((int)$user['id'],$today);
$resToday=0;if($user['role']==='waiter')$resToday=(int)db()->query("SELECT COUNT(*) FROM reservations WHERE reservation_date=CURDATE() AND status NOT IN ('rejected','cancelled')")->fetchColumn();
render_staff_header('Dzisiaj','today'); ?>
<section class="staff-hero"><span>Dzisiaj · <?= e((new DateTimeImmutable($today))->format('d.m.Y')) ?></span><?php if($todayShift): ?><strong>Pracujesz</strong><b><?= e(schedule_time_label($todayShift[0]['start_time'],$todayShift[0]['end_time'])) ?></b><?php else: ?><strong>Wolne</strong><b>Brak grafiku</b><?php endif; ?></section>
<div class="staff-grid-two"><a class="staff-stat" href="/pracownik/napiwki.php"><span>Napiwek dzisiaj</span><strong><?= $todayTip ? e(tip_money((float)$todayTip['share_amount'])) : '—' ?></strong><small><?= !$todayTip ? 'Brak rozliczenia' : ($todayTip['status']==='open'?'W trakcie':($todayTip['payout_status']==='paid'?'Wypłacono':'Do wypłaty')) ?></small></a><?php if($user['role']==='waiter'): ?><a class="staff-stat" href="/pracownik/rezerwacje.php"><span>Rezerwacje dzisiaj</span><strong><?= $resToday ?></strong><small>Podgląd stolików</small></a><?php endif; ?></div>
<section class="staff-section"><div class="staff-section-head"><h2>Najbliższe dni pracy</h2><a href="/pracownik/grafik.php">Cały grafik</a></div><?php if(!$upcoming): ?><div class="staff-empty">Brak kolejnych dni w grafiku.</div><?php endif; ?><?php foreach($upcoming as $row): ?><article class="staff-row"><div><strong><?= e((new DateTimeImmutable($row['work_date']))->format('d.m.Y')) ?></strong><small><?= e((new DateTimeImmutable($row['work_date']))->format('D')) ?></small></div><b><?= e(schedule_time_label($row['start_time'],$row['end_time'])) ?></b></article><?php endforeach; ?></section>
<?php render_staff_footer('today'); ?>