233 lines
7.1 KiB
PHP
233 lines
7.1 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; }
|
|
|
|
.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: 58.7%;
|
|
right: 79%;
|
|
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: 68.4%;
|
|
left: 10%;
|
|
font-size: 12pt;
|
|
font-weight: normal;
|
|
color: #000;
|
|
direction: rtl;
|
|
}
|
|
|
|
.prescription-content {
|
|
position: absolute;
|
|
top: 3%;
|
|
left: 28%;
|
|
width: 73%;
|
|
height: 94%;
|
|
padding: 10px;
|
|
overflow: hidden;
|
|
pointer-events: auto;
|
|
}
|
|
|
|
@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;
|
|
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">✓ پرینت آزمایش</span>
|
|
<div class="toolbar-divider"></div>
|
|
<button class="toolbar-btn btn-print" onclick="window.print()">🖨 پرینت</button>
|
|
<a class="toolbar-btn btn-back"
|
|
href="{{ url()->previous() }}">
|
|
← بازگشت
|
|
</a>
|
|
</div>
|
|
|
|
<div class="page-body">
|
|
<div class="prescription-container">
|
|
<img src="{{ asset('images/prescription_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'; }
|
|
@endphp
|
|
|
|
<div class="{{ $nameClass }}">{{ $patientName }}</div>
|
|
<div class="patient-date">{{ $issueDate }}</div>
|
|
|
|
<div class="prescription-content">
|
|
<table style="width:100%;direction:ltr;font-size:20px;color:#333;table-layout:fixed;">
|
|
@foreach (['CBC','PT/PTT/INR','BS','HIV/Ab HBS/Ag Hcv/Ab'] as $test)
|
|
<tr>
|
|
<td style="padding:8px 2px 8px 0;width:3%;font-weight:bold;">-</td>
|
|
<td style="padding:8px 5px;width:97%;">{!! $test !!}</td>
|
|
</tr>
|
|
@endforeach
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
window.onload = function () {
|
|
const userConfirmed = confirm(
|
|
'لطفاً تنظیمات پرینت را به این صورت انجام دهید:\n\n' +
|
|
'✅ Paper size: A5\n' +
|
|
'✅ Orientation: Landscape (افقی)\n' +
|
|
'✅ Margins: None (بدون حاشیه)\n' +
|
|
'✅ Scale: 100%\n' +
|
|
'✅ Background graphics: ON (فعال)\n\n' +
|
|
'آیا آماده پرینت هستید؟'
|
|
);
|
|
if (userConfirmed) {
|
|
window.print();
|
|
}
|
|
};
|
|
</script>
|
|
</body>
|
|
</html>
|