293 lines
10 KiB
PHP
293 lines
10 KiB
PHP
<!DOCTYPE html>
|
|
<html dir="rtl" lang="fa">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>نسخه پذیرش جراحی - {{ $patient->full_name }}</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: Tahoma, Arial, sans-serif;
|
|
direction: rtl;
|
|
background: #e0e0e0;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
.print-toolbar {
|
|
background: #1f2937;
|
|
color: #fff;
|
|
padding: 10px 20px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
flex-wrap: wrap;
|
|
direction: rtl;
|
|
}
|
|
|
|
.print-toolbar span {
|
|
font-size: 14px;
|
|
color: #9ca3af;
|
|
margin-left: 6px;
|
|
}
|
|
|
|
.toolbar-btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 7px 16px;
|
|
border-radius: 6px;
|
|
font-size: 13px;
|
|
font-family: Tahoma, Arial, sans-serif;
|
|
font-weight: bold;
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
border: none;
|
|
}
|
|
|
|
.btn-print { background: #2563eb; color: #fff; }
|
|
.btn-active { background: #16a34a; color: #fff; cursor: default; }
|
|
.btn-back { background: #374151; color: #d1d5db; }
|
|
|
|
.toolbar-divider { flex: 1; }
|
|
|
|
.print-info-tooltip { position:relative;display:inline-flex;align-items:center; }
|
|
.print-info-tooltip .tip-icon { display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:#374151;border-radius:8px;cursor:pointer;color:#9ca3af;border:none;transition:background 0.15s,color 0.15s; }
|
|
.print-info-tooltip .tip-icon:hover { background:#4b5563;color:#fff; }
|
|
.print-info-tooltip .tip-box { display:none;position:absolute;top:calc(100% + 10px);left:50%;transform:translateX(-50%);background:#111827;border:1px solid #374151;border-radius:10px;padding:14px 18px;min-width:250px;box-shadow:0 4px 24px rgba(0,0,0,0.5);z-index:200;direction:rtl; }
|
|
.print-info-tooltip .tip-box.open { display:block; }
|
|
.print-info-tooltip .tip-box::after { content:'';position:absolute;bottom:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-bottom-color:#374151; }
|
|
.print-info-tooltip .tip-box h4 { margin:0 0 10px;font-size:12px;color:#9ca3af;border-bottom:1px solid #374151;padding-bottom:8px;font-weight:normal; }
|
|
.print-info-tooltip .tip-box ul { list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px; }
|
|
.print-info-tooltip .tip-box ul li { font-size:12px;color:#e5e7eb; }
|
|
|
|
.page-body {
|
|
padding: 20px;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
min-height: calc(100vh - 52px);
|
|
}
|
|
|
|
.prescription-container {
|
|
width: 210mm;
|
|
height: 148mm;
|
|
position: relative;
|
|
margin: 0 auto;
|
|
background: white;
|
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.prescription-bg {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.content-overlay {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.patient-name {
|
|
position: absolute;
|
|
top: 39%;
|
|
right: 82%;
|
|
font-size: 12pt;
|
|
font-weight: bold;
|
|
color: #000;
|
|
direction: rtl;
|
|
white-space: nowrap;
|
|
text-align: right;
|
|
}
|
|
|
|
.patient-name.long-name { font-size: 9pt; }
|
|
.patient-name.very-long-name { font-size: 7pt; }
|
|
|
|
.patient-date {
|
|
position: absolute;
|
|
top: 45.5%;
|
|
left: 5%;
|
|
font-size: 15px;
|
|
font-weight: bold;
|
|
color: #000;
|
|
direction: rtl;
|
|
}
|
|
|
|
.surgery-text {
|
|
position: absolute;
|
|
top: 37.9%;
|
|
right: 15%;
|
|
font-size: 12pt;
|
|
font-weight: bold;
|
|
color: #000;
|
|
direction: rtl;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.surgery-text.long-name { font-size: 9pt; }
|
|
.surgery-text.very-long-name { font-size: 7pt; }
|
|
|
|
.surgery-type {
|
|
position: absolute;
|
|
top: 37.5%;
|
|
right: 48%;
|
|
font-size: 13pt;
|
|
font-weight: bold;
|
|
color: #000;
|
|
direction: rtl;
|
|
}
|
|
|
|
.surgery-center {
|
|
position: absolute;
|
|
top: 23.5%;
|
|
right: 22%;
|
|
font-size: 14pt;
|
|
font-weight: bold;
|
|
color: #000;
|
|
direction: rtl;
|
|
}
|
|
|
|
.surgery-date-center {
|
|
position: absolute;
|
|
top: 45%;
|
|
right: 19%;
|
|
font-size: 15px;
|
|
font-weight: bold;
|
|
color: #000;
|
|
direction: rtl;
|
|
}
|
|
|
|
@media print {
|
|
.print-toolbar { display: none !important; }
|
|
.page-body { padding: 0 !important; min-height: unset !important; }
|
|
|
|
@page {
|
|
size: A5 landscape;
|
|
margin: 0;
|
|
}
|
|
|
|
* {
|
|
margin: 0 !important;
|
|
padding: 0 !important;
|
|
-webkit-print-color-adjust: exact !important;
|
|
print-color-adjust: exact !important;
|
|
}
|
|
|
|
html, body {
|
|
width: 210mm !important;
|
|
height: 148mm !important;
|
|
overflow: hidden !important;
|
|
background: white !important;
|
|
display: block !important;
|
|
}
|
|
|
|
.prescription-container {
|
|
width: 210mm !important;
|
|
height: 148mm !important;
|
|
position: fixed !important;
|
|
top: 0 !important;
|
|
left: 0 !important;
|
|
margin: 0 !important;
|
|
box-shadow: none !important;
|
|
}
|
|
|
|
.prescription-bg {
|
|
width: 210mm !important;
|
|
height: 148mm !important;
|
|
object-fit: fill !important;
|
|
display: block !important;
|
|
-webkit-print-color-adjust: exact !important;
|
|
print-color-adjust: exact !important;
|
|
}
|
|
|
|
.content-overlay {
|
|
width: 210mm !important;
|
|
height: 148mm !important;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="print-toolbar">
|
|
<span>نسخه پذیرش جراحی:</span>
|
|
<span class="toolbar-btn btn-active">{{ $patient->full_name }}</span>
|
|
|
|
<div class="toolbar-divider"></div>
|
|
|
|
<button class="toolbar-btn btn-print" onclick="window.print()">🖨 پرینت</button>
|
|
<div class="print-info-tooltip">
|
|
<button class="tip-icon">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:16px;height:16px;"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
|
|
</button>
|
|
<div class="tip-box">
|
|
<h4>تنظیمات پرینت</h4>
|
|
<ul>
|
|
<li>✅ Paper size: A5</li>
|
|
<li>✅ Orientation: Landscape (افقی)</li>
|
|
<li>✅ Margins: None (بدون حاشیه)</li>
|
|
<li>✅ Scale: 100%</li>
|
|
<li>✅ Background graphics: ON (فعال)</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<a class="toolbar-btn btn-back" href="{{ route('filament.admin.resources.patients.index') }}">
|
|
← بازگشت به لیست
|
|
</a>
|
|
</div>
|
|
|
|
<div class="page-body">
|
|
<div class="prescription-container">
|
|
<img src="{{ asset('images/prescription_admission_bg.jpg') }}" alt="نسخه پذیرش" class="prescription-bg">
|
|
|
|
<div class="content-overlay">
|
|
@php
|
|
$patientName = $patient->full_name;
|
|
$nameLength = mb_strlen($patientName, 'UTF-8');
|
|
$nameClass = 'patient-name';
|
|
if ($nameLength > 20) {
|
|
$nameClass .= ' very-long-name';
|
|
} elseif ($nameLength > 14) {
|
|
$nameClass .= ' long-name';
|
|
}
|
|
|
|
$surgeryTextClass = 'surgery-text';
|
|
if ($nameLength > 20) {
|
|
$surgeryTextClass .= ' very-long-name';
|
|
} elseif ($nameLength > 14) {
|
|
$surgeryTextClass .= ' long-name';
|
|
}
|
|
@endphp
|
|
|
|
<div class="{{ $nameClass }}">{{ $patientName }}</div>
|
|
<div class="patient-date">{{ $surgeryDate }}</div>
|
|
<div class="{{ $surgeryTextClass }}">{{ $patientName }}</div>
|
|
<div class="surgery-type">سپتورینوپلاستی</div>
|
|
<div class="surgery-date-center">{{ $surgeryDate }}</div>
|
|
<div class="surgery-center">{{ $centerName }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.querySelector('.print-info-tooltip .tip-icon').addEventListener('click', function(e) {
|
|
e.stopPropagation();
|
|
document.querySelector('.print-info-tooltip .tip-box').classList.toggle('open');
|
|
});
|
|
document.addEventListener('click', function() {
|
|
document.querySelector('.print-info-tooltip .tip-box').classList.remove('open');
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|