Autosave: 20260401-074438

This commit is contained in:
Flatlogic Bot 2026-04-01 07:44:38 +00:00
parent 2808b801bb
commit 8d5d2b0838
4 changed files with 53 additions and 7 deletions

View File

@ -107,12 +107,12 @@ qh_page_start(
<td class="py-3"><span class="badge bg-<?= (int) $clinic['requires_vitals'] === 1 ? 'warning text-dark' : 'info text-dark' ?> rounded-pill px-2 py-1"><?= qh_h((int) $clinic['requires_vitals'] === 1 ? qh_t('Vitals', 'علامات') : qh_t('Direct', 'مباشر')) ?></span></td>
<td class="text-end px-4 py-3">
<div class="d-inline-flex gap-2">
<a class="btn btn-sm btn-light border shadow-sm" href="<?= qh_h($editUrl) ?>"><i class="bi bi-pencil"></i></a>
<a class="btn btn-sm btn-light border shadow-sm" href="<?= qh_h($editUrl) ?>"><i class="bi bi-pencil me-1"></i><?= qh_h(qh_t('Edit', 'تعديل')) ?></a>
<form method="post" class="m-0" onsubmit="return confirm('<?= qh_h(qh_t('Delete this clinic record?', 'هل تريد حذف سجل هذه العيادة؟')) ?>');">
<input type="hidden" name="action" value="delete_clinic">
<input type="hidden" name="clinic_id" value="<?= qh_h((string) $clinic['id']) ?>">
<input type="hidden" name="return_to" value="admin_clinics.php">
<button class="btn btn-sm btn-outline-danger shadow-sm bg-white" type="submit"><i class="bi bi-trash"></i></button>
<button class="btn btn-sm btn-outline-danger shadow-sm bg-white" type="submit"><i class="bi bi-trash me-1"></i><?= qh_h(qh_t('Delete', 'حذف')) ?></button>
</form>
</div>
</td>

View File

@ -84,9 +84,42 @@ document.addEventListener('DOMContentLoaded', () => {
fullscreenButton.hidden = true;
}
const audioBtn = document.querySelector('.js-audio-toggle');
if (audioBtn) {
const updateAudioBtnState = () => {
const isEnabled = window.localStorage.getItem('hospitalQueue:audioEnabled') === 'true';
if (isEnabled) {
audioBtn.innerHTML = '<i class="bi bi-volume-up"></i>';
} else {
audioBtn.innerHTML = '<i class="bi bi-volume-mute"></i>';
}
audioBtn.setAttribute('aria-pressed', isEnabled.toString());
const videoPlayer = document.getElementById('adsVideoPlayer');
if (videoPlayer) {
videoPlayer.muted = !isEnabled;
}
};
updateAudioBtnState();
audioBtn.addEventListener('click', () => {
const isEnabled = window.localStorage.getItem('hospitalQueue:audioEnabled') === 'true';
const nextState = !isEnabled;
window.localStorage.setItem('hospitalQueue:audioEnabled', nextState.toString());
updateAudioBtnState();
if (nextState && 'speechSynthesis' in window) {
const primeUtterance = new SpeechSynthesisUtterance('');
window.speechSynthesis.speak(primeUtterance);
}
});
}
const cards = Array.from(document.querySelectorAll('.announcement-card'));
const latest = cards[0];
if (latest && 'speechSynthesis' in window) {
const audioEnabled = window.localStorage.getItem('hospitalQueue:audioEnabled') === 'true';
if (latest && 'speechSynthesis' in window && audioEnabled) {
const announcementKey = latest.dataset.announcementKey || '';
const storageKey = `hospitalQueue:lastAnnouncement:${locale}`;
const storedKey = window.localStorage.getItem(storageKey) || '';

View File

@ -59,13 +59,16 @@ qh_page_start(
</div>
<div class="d-flex align-items-center gap-3">
<div class="fs-4 fw-bold text-dark js-live-clock"><?= qh_h(date('H:i')) ?></div>
<button type="button" class="btn btn-outline-secondary btn-sm shadow-sm me-2 js-audio-toggle" id="globalAudioToggle" title="<?= qh_h(qh_t('Toggle Audio', 'تبديل الصوت')) ?>">
<i class="bi bi-volume-mute"></i>
</button>
<button type="button" class="btn btn-outline-secondary btn-sm shadow-sm js-fullscreen-toggle" aria-pressed="false" data-label-enter="<?= qh_h(qh_t('Fullscreen', 'ملء الشاشة')) ?>" data-label-exit="<?= qh_h(qh_t('Exit fullscreen', 'إنهاء ملء الشاشة')) ?>"><i class="bi bi-arrows-fullscreen"></i></button>
</div>
</header>
<?php $pb = !empty($activeNews) ? "padding-bottom: 4rem !important;" : "padding-bottom: 1.5rem !important;"; ?>
<div class="row g-4 m-0 mt-2 px-3 px-lg-4 pt-0 flex-grow-1" style="<?= $pb ?>">
<div class="col-xl-8 col-lg-7 d-flex flex-column gap-4">
<div class="col-xl-8 col-lg-7 d-flex flex-column gap-4" id="queueSections">
<div class="card shadow-sm border-0 flex-grow-1">
<div class="card-header bg-white border-bottom py-2 d-flex justify-content-between align-items-center">
<div>
@ -78,7 +81,7 @@ qh_page_start(
<div class="row g-3">
<?php foreach ($activeCalls as $ticket): $speech = qh_call_message($ticket); ?>
<div class="col-6 col-lg-3">
<div class="card border-0 shadow-sm h-100" data-announcement-key="<?= qh_h((string) $ticket['id']) ?>-<?= qh_h((string) strtotime((string) $ticket['called_at'])) ?>" data-announcement-en="<?= qh_h($speech['en']) ?>" data-announcement-ar="<?= qh_h($speech['ar']) ?>">
<div class="card border-0 shadow-sm h-100 announcement-card" data-announcement-key="<?= qh_h((string) $ticket['id']) ?>-<?= qh_h((string) strtotime((string) $ticket['called_at'])) ?>" data-announcement-en="<?= qh_h($speech['en']) ?>" data-announcement-ar="<?= qh_h($speech['ar']) ?>">
<div class="card-body text-center p-3">
<div class="display-5 fw-bold text-primary mb-1"><?= qh_h($ticket['ticket_number']) ?></div>
<div class="fs-6 text-muted mb-1 text-truncate" style="max-width: 100%;" title="<?= qh_h(qh_name($ticket, 'doctor_name', qh_t('Doctor', 'الطبيب'))) ?>"><?= qh_h(qh_name($ticket, 'doctor_name', qh_t('Doctor', 'الطبيب'))) ?></div>
@ -158,7 +161,17 @@ qh_page_start(
player.src = videos[currentIdx];
player.currentTime = isNaN(currentTime) ? 0 : currentTime;
player.play().catch(function(e) { console.error("Error playing video:", e); });
if (window.localStorage.getItem('hospitalQueue:audioEnabled') === 'true') {
player.muted = false;
}
player.play().catch(function(e) {
console.error("Error playing video:", e);
if (!player.muted) {
player.muted = true;
player.play().catch(e => console.error("Fallback play failed:", e));
}
});
if (videos.length > 1) {
player.addEventListener('ended', function() {

View File

@ -56,7 +56,7 @@ qh_page_start(
<div class="col-xl-8">
<div class="card shadow-sm border-0 h-100">
<div class="card-header bg-white border-bottom py-3 d-flex justify-content-between align-items-center">
<h5 class="mb-0 font-weight-bold text-dark"><?= qh_h(qh_t('Room Queue', 'طابور الغرفة')) ?></h5>
<h5 class="mb-0 font-weight-bold text-dark"><?= qh_h(qh_t('Room Queue', 'قائمة الإنتظار')) ?></h5>
</div>
<div class="card-body p-0">
<?php if (!$selectedDoctor): ?>