updating printing ticket
This commit is contained in:
parent
9991d51541
commit
1148add8f4
12
display.php
12
display.php
@ -142,8 +142,8 @@ qh_page_start(
|
||||
<div class="sticky-top" style="top: 1rem; height: 60vh;">
|
||||
<?php if (!empty($activeVideos)): ?>
|
||||
<div class="card shadow-sm border-0 h-100 bg-black overflow-hidden d-flex justify-content-center align-items-center">
|
||||
<video id="adsVideoPlayer" class="w-100 h-100 object-fit-contain" autoplay muted playsinline>
|
||||
<source src="<?= qh_h($activeVideos[0]) ?>" type="video/mp4">
|
||||
<video id="adsVideoPlayer" class="w-100 h-100 object-fit-contain" src="<?= qh_h($activeVideos[0]) ?>" autoplay muted playsinline>
|
||||
|
||||
</video>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
@ -161,7 +161,12 @@ qh_page_start(
|
||||
}
|
||||
|
||||
player.src = videos[currentIdx];
|
||||
player.currentTime = isNaN(currentTime) ? 0 : currentTime;
|
||||
player.load();
|
||||
player.addEventListener('loadedmetadata', function() {
|
||||
if (currentTime > 0) {
|
||||
player.currentTime = isNaN(currentTime) ? 0 : currentTime;
|
||||
}
|
||||
}, { once: true });
|
||||
|
||||
if (window.localStorage.getItem('hospitalQueue:audioEnabled') === 'true') {
|
||||
player.muted = false;
|
||||
@ -179,6 +184,7 @@ qh_page_start(
|
||||
player.addEventListener('ended', function() {
|
||||
currentIdx = (currentIdx + 1) % videos.length;
|
||||
player.src = videos[currentIdx];
|
||||
player.load();
|
||||
player.play().catch(function(e) { console.error("Error playing video:", e); });
|
||||
});
|
||||
} else {
|
||||
|
||||
@ -848,6 +848,19 @@ function qh_fetch_tickets(array $statuses = [], ?int $doctorId = null, ?int $lim
|
||||
return $stmt->fetchAll();
|
||||
}
|
||||
|
||||
|
||||
function qh_get_waiting_count_for_ticket(array $ticket): int
|
||||
{
|
||||
try {
|
||||
$pdo = db();
|
||||
$stmt = $pdo->prepare("SELECT COUNT(*) FROM hospital_queue_records WHERE item_type = 'ticket' AND DATE(created_at) = CURDATE() AND doctor_id = :doctor_id AND status IN ('waiting_vitals', 'nursing_called', 'ready_for_doctor', 'called', 'in_progress') AND id < :ticket_id");
|
||||
$stmt->execute(['doctor_id' => (int)$ticket['doctor_id'], 'ticket_id' => (int)$ticket['id']]);
|
||||
return (int) $stmt->fetchColumn();
|
||||
} catch (Throwable $e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function qh_queue_overview(): array
|
||||
{
|
||||
$sql = "SELECT c.id, c.name_en, c.name_ar, c.code, c.requires_vitals,
|
||||
|
||||
@ -154,6 +154,9 @@ qh_page_start(
|
||||
<div class="pt-detail">
|
||||
<span class="pt-label"><?= qh_h(qh_t("Room", "الغرفة")) ?>:</span> <?= qh_h($currentTicket["doctor_room"] ?? "--") ?>
|
||||
</div>
|
||||
<div class="pt-detail">
|
||||
<span class="pt-label"><?= qh_h(qh_t("Waiting ahead", "أمامك في الطابور")) ?>:</span> <strong><?= qh_get_waiting_count_for_ticket($currentTicket) ?></strong>
|
||||
</div>
|
||||
<div class="pt-detail pt-datetime">
|
||||
<span class="pt-label"><?= qh_h(qh_t("Time", "الوقت")) ?>:</span> <span><?= qh_format_datetime($currentTicket["created_at"]) ?></span>
|
||||
</div>
|
||||
@ -164,4 +167,4 @@ qh_page_start(
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php qh_page_end(); ?>
|
||||
<?php qh_page_end(); ?>
|
||||
|
||||
@ -102,6 +102,9 @@ qh_page_start(
|
||||
<div class="pt-detail">
|
||||
<span class="pt-label"><?= qh_h(qh_t("Room", "الغرفة")) ?>:</span> <?= qh_h($ticket["doctor_room"] ?? "--") ?>
|
||||
</div>
|
||||
<div class="pt-detail">
|
||||
<span class="pt-label"><?= qh_h(qh_t("Waiting ahead", "أمامك في الطابور")) ?>:</span> <strong><?= qh_get_waiting_count_for_ticket($ticket) ?></strong>
|
||||
</div>
|
||||
<div class="pt-detail pt-datetime">
|
||||
<span class="pt-label"><?= qh_h(qh_t("Time", "الوقت")) ?>:</span> <span><?= qh_format_datetime($ticket["created_at"]) ?></span>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user