pending view calendar
This commit is contained in:
+39
-3
@@ -64,7 +64,7 @@ if (!empty($scheduleIds)) {
|
|||||||
FROM bookingclass
|
FROM bookingclass
|
||||||
LEFT JOIN auth_users ON bookingclass.iduser = auth_users.id
|
LEFT JOIN auth_users ON bookingclass.iduser = auth_users.id
|
||||||
WHERE bookingclass.idserviceschedule IN ($ph)
|
WHERE bookingclass.idserviceschedule IN ($ph)
|
||||||
AND bookingclass.status = 'booked'
|
AND bookingclass.status IN ('booked', 'pending')
|
||||||
ORDER BY auth_users.last_name, auth_users.first_name";
|
ORDER BY auth_users.last_name, auth_users.first_name";
|
||||||
$stmtBookings = $pdo->prepare($sqlBookings);
|
$stmtBookings = $pdo->prepare($sqlBookings);
|
||||||
$stmtBookings->execute(array_values($scheduleIds));
|
$stmtBookings->execute(array_values($scheduleIds));
|
||||||
@@ -508,8 +508,12 @@ $italianMonths = [
|
|||||||
$monthIt = $italianMonths[$dateObj->format("F")];
|
$monthIt = $italianMonths[$dateObj->format("F")];
|
||||||
$whenFmt = $dateObj->format("d-m-Y H:i");
|
$whenFmt = $dateObj->format("d-m-Y H:i");
|
||||||
$scheduleId = (int) $sch['idserviceschedule'];
|
$scheduleId = (int) $sch['idserviceschedule'];
|
||||||
$bookings = $bookingsBySchedule[$scheduleId] ?? [];
|
$allRows = $bookingsBySchedule[$scheduleId] ?? [];
|
||||||
$countPersons = count($bookings);
|
// separa confermati (booked) da in attesa (pending)
|
||||||
|
$bookings = array_filter($allRows, fn($b) => $b['status'] === 'booked');
|
||||||
|
$pendings = array_filter($allRows, fn($b) => $b['status'] === 'pending');
|
||||||
|
$countPersons = count($bookings); // contatore = solo confermati
|
||||||
|
$countPending = count($pendings);
|
||||||
$maxcap = (int) $sch['maxcapacity'];
|
$maxcap = (int) $sch['maxcapacity'];
|
||||||
$isFull = $maxcap > 0 && $countPersons >= $maxcap;
|
$isFull = $maxcap > 0 && $countPersons >= $maxcap;
|
||||||
$colorclass = $sch['colorclass'] ?: '#e6f3ff';
|
$colorclass = $sch['colorclass'] ?: '#e6f3ff';
|
||||||
@@ -526,6 +530,12 @@ $italianMonths = [
|
|||||||
<i class="fas fa-user-group" style="font-size:11px;"></i>
|
<i class="fas fa-user-group" style="font-size:11px;"></i>
|
||||||
<?php echo $countPersons; ?>/<?php echo $maxcap; ?>
|
<?php echo $countPersons; ?>/<?php echo $maxcap; ?>
|
||||||
</span>
|
</span>
|
||||||
|
<?php if ($countPending > 0) : ?>
|
||||||
|
<span class="capacity-pill" style="background:#fff4d6;color:#8a6d00;">
|
||||||
|
<i class="fas fa-hourglass-half" style="font-size:11px;"></i>
|
||||||
|
<?php echo $countPending; ?> in attesa
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
</h3>
|
</h3>
|
||||||
<p class="class-meta"><i class="far fa-clock me-1"></i><?php echo e($whenFmt); ?></p>
|
<p class="class-meta"><i class="far fa-clock me-1"></i><?php echo e($whenFmt); ?></p>
|
||||||
<p class="class-meta"><i class="fas fa-location-dot me-1"></i>via Valassina 62/B Seregno - Sala Contesto Yoga</p>
|
<p class="class-meta"><i class="fas fa-location-dot me-1"></i>via Valassina 62/B Seregno - Sala Contesto Yoga</p>
|
||||||
@@ -577,6 +587,32 @@ $italianMonths = [
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if ($countPending > 0) : ?>
|
||||||
|
<div class="bookings-header" style="margin-top:18px;">
|
||||||
|
<span class="title" style="color:#8a6d00;"><i class="fas fa-hourglass-half me-1"></i> In attesa di conferma (<?php echo $countPending; ?>)</span>
|
||||||
|
</div>
|
||||||
|
<div class="booking-list">
|
||||||
|
<?php foreach ($pendings as $b) :
|
||||||
|
$idbc = (int) $b['idbookingclass'];
|
||||||
|
$fullName = trim($b['first_name'] . ' ' . $b['last_name']);
|
||||||
|
$ini = initials($b['first_name'] ?? '', $b['last_name'] ?? '');
|
||||||
|
$avColor = avatarColor($fullName);
|
||||||
|
?>
|
||||||
|
<div class="booking-item" style="background:#fffbf0;border-color:#f5e6b8;" data-iduser="<?php echo (int) $b['iduser']; ?>">
|
||||||
|
<div class="avatar" style="background: <?php echo $avColor; ?>;"><?php echo e($ini); ?></div>
|
||||||
|
<div class="booking-info">
|
||||||
|
<span class="booking-name"><?php echo e($fullName); ?></span>
|
||||||
|
<span class="status-chip" style="background:#fff4d6;color:#8a6d00;">In attesa</span>
|
||||||
|
</div>
|
||||||
|
<div class="booking-actions">
|
||||||
|
<button class="mini-btn restore confirm-pending" data-idbookingclass="<?php echo $idbc; ?>"><i class="fas fa-check"></i> Conferma</button>
|
||||||
|
<button class="mini-btn remove" onclick="handleRemoveClick(<?php echo $idbc; ?>)"><i class="fas fa-trash"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="add-box">
|
<div class="add-box">
|
||||||
<strong class="d-block mb-2" style="font-size:14px;"><i class="fas fa-user-plus me-1" style="color:#1ebf73;"></i> Aggiungi partecipante</strong>
|
<strong class="d-block mb-2" style="font-size:14px;"><i class="fas fa-user-plus me-1" style="color:#1ebf73;"></i> Aggiungi partecipante</strong>
|
||||||
<form class="add-booking-form" action="inserisci_record.php" method="post">
|
<form class="add-booking-form" action="inserisci_record.php" method="post">
|
||||||
|
|||||||
Reference in New Issue
Block a user