feat: initial project setup with Laravel 12 and Filament v4
This commit is contained in:
@@ -0,0 +1,232 @@
|
||||
<!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>
|
||||
@@ -0,0 +1,263 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="rtl" lang="fa">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>نسخه پذیرش - {{ $prescription->patientRecord?->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-admission{ background: #d97706; color: #fff; }
|
||||
.btn-lab { background: #6b7280; color: #fff; }
|
||||
.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: 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-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>
|
||||
<a class="toolbar-btn btn-print"
|
||||
href="{{ route('prescription.print', $prescription) }}">
|
||||
پرینت نسخه
|
||||
</a>
|
||||
<span class="toolbar-btn btn-active">✓ پرینت نسخه پذیرش</span>
|
||||
<a class="toolbar-btn btn-lab"
|
||||
href="{{ route('prescription.print', ['prescription' => $prescription, 'type' => 'lab']) }}">
|
||||
پرینت آزمایش
|
||||
</a>
|
||||
|
||||
<div class="toolbar-divider"></div>
|
||||
|
||||
<button class="toolbar-btn btn-print" onclick="window.print()">🖨 پرینت</button>
|
||||
<a class="toolbar-btn btn-back"
|
||||
href="{{ route('filament.admin.resources.prescriptions.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 = $prescription->patientRecord?->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 = str_replace('patient-name', 'surgery-text', $nameClass);
|
||||
|
||||
$dateStr = $prescription->issue_date ?? '';
|
||||
if ($dateStr && preg_match('/^\d{4}-\d{2}-\d{2}/', $dateStr)) {
|
||||
try {
|
||||
$dateStr = \Morilog\Jalali\Jalalian::fromCarbon(\Carbon\Carbon::parse($dateStr))->format('Y/m/d');
|
||||
} catch (\Exception $e) {}
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class="{{ $nameClass }}">{{ $patientName }}</div>
|
||||
<div class="patient-date">{{ $dateStr }}</div>
|
||||
<div class="{{ $surgeryTextClass }}">{{ $patientName }}</div>
|
||||
<div class="surgery-date-center">{{ $dateStr }}</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>
|
||||
@@ -0,0 +1,313 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="rtl" lang="fa">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ $type === 'lab' ? 'آزمایش' : 'نسخه' }} - {{ $prescription->patientRecord?->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-admission{ background: #d97706; color: #fff; }
|
||||
.btn-lab { background: #6b7280; color: #fff; }
|
||||
.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>
|
||||
|
||||
@if ($type === 'prescription')
|
||||
<span class="toolbar-btn btn-active">✓ پرینت نسخه</span>
|
||||
<a class="toolbar-btn btn-admission"
|
||||
href="{{ route('prescription.print.admission', $prescription) }}">
|
||||
پرینت نسخه پذیرش
|
||||
</a>
|
||||
<a class="toolbar-btn btn-lab"
|
||||
href="{{ route('prescription.print', ['prescription' => $prescription, 'type' => 'lab']) }}">
|
||||
پرینت آزمایش
|
||||
</a>
|
||||
@else
|
||||
<a class="toolbar-btn btn-print"
|
||||
href="{{ route('prescription.print', $prescription) }}">
|
||||
پرینت نسخه
|
||||
</a>
|
||||
<a class="toolbar-btn btn-admission"
|
||||
href="{{ route('prescription.print.admission', $prescription) }}">
|
||||
پرینت نسخه پذیرش
|
||||
</a>
|
||||
<span class="toolbar-btn btn-active">✓ پرینت آزمایش</span>
|
||||
@endif
|
||||
|
||||
<div class="toolbar-divider"></div>
|
||||
|
||||
<button class="toolbar-btn btn-print" onclick="window.print()">🖨 پرینت</button>
|
||||
<a class="toolbar-btn btn-back"
|
||||
href="{{ route('filament.admin.resources.prescriptions.index') }}">
|
||||
← بازگشت به لیست
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{-- ─── Print area ───────────────────────────────────────────── --}}
|
||||
<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 = $prescription->patientRecord?->full_name ?? '';
|
||||
$nameLength = mb_strlen($patientName, 'UTF-8');
|
||||
$nameClass = 'patient-name';
|
||||
if ($nameLength > 20) {
|
||||
$nameClass .= ' very-long-name';
|
||||
} elseif ($nameLength > 14) {
|
||||
$nameClass .= ' long-name';
|
||||
}
|
||||
|
||||
$dateStr = $prescription->issue_date ?? '';
|
||||
if ($dateStr && preg_match('/^\d{4}-\d{2}-\d{2}/', $dateStr)) {
|
||||
try {
|
||||
$dateStr = \Morilog\Jalali\Jalalian::fromCarbon(\Carbon\Carbon::parse($dateStr))->format('Y/m/d');
|
||||
} catch (\Exception $e) {}
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class="{{ $nameClass }}">{{ $patientName }}</div>
|
||||
<div class="patient-date">{{ $dateStr }}</div>
|
||||
|
||||
<div class="prescription-content">
|
||||
@if ($type === 'lab')
|
||||
<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>
|
||||
@else
|
||||
@php
|
||||
$content = $prescription->content ?? '';
|
||||
preg_match_all('/<li[^>]*>(.*?)<\/li>/s', $content, $m);
|
||||
$lines = $m[1] ?? [];
|
||||
if (empty($lines)) {
|
||||
$cleaned = preg_replace('/<br\s*\/?>/i', "\n", $content);
|
||||
$lines = explode("\n", strip_tags($cleaned));
|
||||
}
|
||||
$lines = array_values(array_filter(
|
||||
array_map(fn ($l) => html_entity_decode(trim(strip_tags($l)), ENT_QUOTES, 'UTF-8'), $lines)
|
||||
));
|
||||
@endphp
|
||||
<table style="width:100%;direction:ltr;font-size:20px;color:#333;border-collapse:collapse;table-layout:fixed;">
|
||||
@foreach ($lines as $line)
|
||||
@php
|
||||
$parts = preg_split('/\s+/', trim($line));
|
||||
$type_str = array_shift($parts);
|
||||
$freq = !empty($parts) ? array_pop($parts) : '';
|
||||
$count = $dose = '';
|
||||
$nameParts = [];
|
||||
foreach ($parts as $p) {
|
||||
if (str_starts_with($p, '#') && $count === '') { $count = $p; }
|
||||
elseif (preg_match('/^\d+(mg|g|ml|mcg|iu)$/i', $p) && $dose === '') { $dose = $p; }
|
||||
else { $nameParts[] = $p; }
|
||||
}
|
||||
$drugName = implode(' ', $nameParts);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style="padding:8px 2px 8px 10px;width:3%;font-weight:bold;">-</td>
|
||||
<td style="padding:8px 10px 8px 5px;width:12%;white-space:nowrap;">{{ $type_str }}</td>
|
||||
<td style="padding:8px 5px;width:33%;">{{ $drugName }}</td>
|
||||
<td style="padding:8px 5px;width:18%;">{{ $dose }}</td>
|
||||
<td style="padding:8px 5px;width:12%;">{{ $count }}</td>
|
||||
<td style="padding:8px 0 8px 5px;width:10%;">{{ $freq }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
</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>
|
||||
@@ -0,0 +1,273 @@
|
||||
<!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: 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>
|
||||
<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>
|
||||
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>
|
||||
Reference in New Issue
Block a user