feat: initial project setup with Laravel 12 and Filament v4

This commit is contained in:
SajjadMahmoody
2026-04-03 17:25:17 +03:30
parent eca5d74b36
commit 09ee1cb743
324 changed files with 78304 additions and 23 deletions
@@ -0,0 +1,89 @@
@props([
'heading' => 'تایید عملیات',
'description' => 'آیا از انجام این عملیات مطمئنید؟',
'confirmLabel' => 'بله، انجام شود',
'cancelLabel' => 'انصراف',
'event' => 'confirm-modal',
'color' => 'danger', {{-- danger | primary | warning --}}
])
@php
$colors = [
'danger' => ['bg' => 'bg-danger-50 dark:bg-danger-900/30', 'icon' => 'text-danger-500', 'btn' => 'bg-danger-600 hover:bg-danger-700'],
'primary' => ['bg' => 'bg-primary-50 dark:bg-primary-900/30', 'icon' => 'text-primary-500', 'btn' => 'bg-primary-600 hover:bg-primary-700'],
'warning' => ['bg' => 'bg-warning-50 dark:bg-warning-900/30', 'icon' => 'text-warning-500', 'btn' => 'bg-warning-600 hover:bg-warning-700'],
];
$c = $colors[$color] ?? $colors['danger'];
@endphp
<div
x-data="{
show: false,
payload: null,
open(e) { this.payload = e.detail ?? null; this.show = true; },
cancel() { this.show = false; this.payload = null; },
confirm() {
this.$dispatch('{{ $event }}-confirmed', this.payload);
this.show = false;
this.payload = null;
}
}"
x-on:{{ $event }}-open.window="open($event)"
x-on:{{ $event }}-open.document="open($event)"
>
<template x-teleport="body">
<div
x-show="show"
x-transition.opacity
class="fixed inset-0 z-999 flex items-center justify-center bg-black/50 backdrop-blur-sm"
style="display:none"
>
<div
@click.outside="cancel()"
class="bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-md mx-4 overflow-hidden"
>
{{-- Header --}}
<div class="px-6 pt-6 pb-4">
<div class="flex items-center gap-3 mb-4">
<div class="flex items-center justify-center w-10 h-10 rounded-full {{ $c['bg'] }}">
@if($color === 'danger')
<x-heroicon-o-trash class="w-5 h-5 {{ $c['icon'] }}" />
@elseif($color === 'warning')
<x-heroicon-o-exclamation-triangle class="w-5 h-5 {{ $c['icon'] }}" />
@else
<x-heroicon-o-check-circle class="w-5 h-5 {{ $c['icon'] }}" />
@endif
</div>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">
{{ $heading }}
</h3>
</div>
<p class="text-sm text-gray-600 dark:text-gray-400">
{{ $description }}
</p>
{{-- Optional slot for extra content --}}
@if(isset($extra))
<div class="mt-3">{{ $extra }}</div>
@endif
</div>
{{-- Footer --}}
<div class="flex items-center justify-end gap-3 px-6 py-4 bg-gray-50 dark:bg-gray-900/50">
<button
@click="cancel()"
class="px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-600 transition"
>
{{ $cancelLabel }}
</button>
<button
@click="confirm()"
class="px-4 py-2 text-sm font-medium text-white {{ $c['btn'] }} rounded-lg transition"
>
{{ $confirmLabel }}
</button>
</div>
</div>
</div>
</template>
</div>
@@ -0,0 +1,56 @@
@props([
'title',
'description' => null,
'icon' => 'heroicon-o-squares-2x2',
'url' => '#',
'count' => null,
'color' => 'blue',
])
@php
$headerClass = match ($color) {
'blue', 'primary' => 'bg-blue-600',
'green', 'success' => 'bg-green-600',
'red', 'danger' => 'bg-red-600',
'yellow', 'warning'=> 'bg-amber-500',
'purple' => 'bg-purple-600',
'orange' => 'bg-orange-500',
'teal' => 'bg-teal-600',
'slate' => 'bg-slate-600',
default => 'bg-blue-600',
};
$dir = app()->getLocale() === 'fa' ? 'rtl' : 'ltr';
@endphp
<a href="{{ $url }}" wire:navigate class="group block h-full">
<div class="nav-card group-hover:shadow-md">
<div class="flex items-center gap-4 px-6 py-5 {{ $headerClass }}" dir="{{ $dir }}">
<div class="shrink-0 rounded-lg bg-white/25 p-2">
<x-dynamic-component
:component="$icon"
class="h-5 w-5 text-white"
style="width:1.25rem;height:1.25rem;display:block;color:white"
/>
</div>
<div class="min-w-0 flex-1">
<p class="truncate text-xl font-bold text-white leading-snug">
{{ $title }}
</p>
@if ($count !== null)
<p class="mt-0.5 text-sm text-white/75">{{ number_format($count) }}</p>
@endif
</div>
</div>
<div class="flex-1 px-6 py-5" dir="{{ $dir }}">
@if ($description)
<p class="nav-card-body-text line-clamp-3">
{{ $description }}
</p>
@endif
</div>
</div>
</a>
@@ -0,0 +1,48 @@
<div style="padding-inline-start: 1rem; margin-inline-start: 1rem; border-inline-start: 1px solid rgb(229 231 235);">
<div
class="flex items-center gap-2 text-sm font-medium text-gray-600 dark:text-gray-400"
style="padding-block: 0.375rem;"
x-data="appClock('{{ app()->getLocale() }}')"
x-init="start()"
:dir="locale === 'fa' ? 'rtl' : 'ltr'"
>
<span x-text="weekday"></span>
<span x-text="date"></span>
<span x-text="time" class="tabular-nums"></span>
</div>
</div>
@once
<script>
function appClock(locale) {
const isPersian = locale === 'fa';
const fmt = isPersian ? {
weekday: new Intl.DateTimeFormat('fa-IR-u-ca-persian', { timeZone: 'Asia/Tehran', weekday: 'long' }),
date: new Intl.DateTimeFormat('fa-IR-u-ca-persian', { timeZone: 'Asia/Tehran', year: 'numeric', month: 'long', day: 'numeric' }),
time: new Intl.DateTimeFormat('fa-IR', { timeZone: 'Asia/Tehran', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }),
} : {
weekday: new Intl.DateTimeFormat('en-US', { timeZone: 'Asia/Tehran', weekday: 'long' }),
date: new Intl.DateTimeFormat('en-US', { timeZone: 'Asia/Tehran', year: 'numeric', month: 'long', day: 'numeric' }),
time: new Intl.DateTimeFormat('en-US', { timeZone: 'Asia/Tehran', hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false }),
};
return {
locale,
weekday: '',
date: '',
time: '',
start() {
this.tick();
setInterval(() => this.tick(), 1000);
},
tick() {
const now = new Date();
this.weekday = fmt.weekday.format(now);
this.date = fmt.date.format(now);
this.time = fmt.time.format(now);
}
};
}
</script>
@endonce
@@ -0,0 +1,248 @@
<div class="flex items-center gap-1">
<button
x-data
@click="$dispatch('theme-changed', $store.theme === 'dark' ? 'light' : 'dark')"
class="flex items-center justify-center w-9 h-9 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-700 transition"
>
<span x-show="$store.theme === 'dark'" x-cloak>
<x-heroicon-o-sun class="w-5 h-5" />
</span>
<span x-show="$store.theme !== 'dark'" x-cloak>
<x-heroicon-o-moon class="w-5 h-5" />
</span>
</button>
@can('View:SyncPage')
<div
class="relative"
x-data="{
open: false,
showConfirm: false,
showProgress: false,
progress: 0,
statusText: '',
done: false,
failed: false,
reportLines: [],
startSync() {
this.showConfirm = false;
this.showProgress = true;
this.progress = 0;
this.statusText = 'در حال اتصال به سیستم مقابل...';
this.done = false;
this.failed = false;
this.reportLines = [];
// Simulate initial progress
this.progress = 15;
let progressInterval = setInterval(() => {
if (this.progress < 85) {
this.progress += Math.random() * 10;
if (this.progress > 40 && this.progress < 60) {
this.statusText = 'در حال دریافت تغییرات...';
} else if (this.progress >= 60) {
this.statusText = 'در حال ارسال تغییرات...';
}
}
}, 500);
fetch('{{ route('sync.run') }}', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-TOKEN': document.querySelector('meta[name=csrf-token]')?.content || '{{ csrf_token() }}',
'Accept': 'application/json',
},
})
.then(r => r.json())
.then(data => {
clearInterval(progressInterval);
this.progress = 100;
this.reportLines = data.report || [];
if (data.success) {
this.statusText = 'همگام‌سازی با موفقیت انجام شد';
this.done = true;
} else {
this.statusText = 'همگام‌سازی با خطا مواجه شد';
this.failed = true;
}
})
.catch(err => {
clearInterval(progressInterval);
this.progress = 100;
this.statusText = 'خطا در اتصال به سرور';
this.failed = true;
this.reportLines = [err.message || 'خطای ناشناخته'];
});
},
closeModal() {
this.showProgress = false;
this.showConfirm = false;
if (this.done) {
window.location.reload();
}
}
}"
@click.outside="open = false"
>
<button
@click="open = !open"
class="flex items-center justify-center w-9 h-9 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-700 transition"
title="{{ __('navigation.groups.system') }}"
>
<x-heroicon-o-cog-6-tooth class="w-5 h-5" />
</button>
<div
x-show="open"
x-transition:enter="transition ease-out duration-100"
x-transition:enter-start="opacity-0 scale-95"
x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-95"
class="absolute inset-s-0 mt-1 w-52 rounded-xl bg-white dark:bg-gray-800 shadow-lg ring-1 ring-gray-200 dark:ring-gray-700 z-50 py-1"
style="display:none"
>
@can('View:SyncPage')
<button
type="button"
@click="open = false; showConfirm = true"
class="flex items-center gap-3 px-4 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition w-full"
>
<x-heroicon-o-arrows-right-left class="w-4 h-4 text-primary-500 shrink-0" />
{{ __('navigation.sync.label') }}
</button>
@endcan
@can('View:SyncPage')
<a
href="{{ \App\Filament\Pages\SyncPage::getUrl() }}"
@click="open = false"
class="flex items-center gap-3 px-4 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition"
>
<x-heroicon-o-document-magnifying-glass class="w-4 h-4 text-info-500 shrink-0" />
{{ __('navigation.sync.details') }}
</a>
@endcan
@can('View:SyncPage')
<a
href="{{ route('backup.download') }}"
@click="open = false"
class="flex items-center gap-3 px-4 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition"
>
<x-heroicon-o-arrow-down-tray class="w-4 h-4 text-success-500 shrink-0" />
{{ __('navigation.backup.label') }}
</a>
@endcan
</div>
<template x-teleport="body">
<div
x-show="showConfirm"
x-transition.opacity
class="fixed inset-0 z-999 flex items-center justify-center bg-black/50 backdrop-blur-sm"
style="display:none"
>
<div
@click.outside="showConfirm = false"
class="bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-md mx-4 overflow-hidden"
>
<div class="px-6 pt-6 pb-4">
<div class="flex items-center gap-3 mb-4">
<div class="flex items-center justify-center w-10 h-10 rounded-full bg-primary-50 dark:bg-primary-900/30">
<x-heroicon-o-arrows-right-left class="w-5 h-5 text-primary-500" />
</div>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">همگام‌سازی دو طرفه</h3>
</div>
<p class="text-sm text-gray-600 dark:text-gray-400">
اطلاعات این سیستم با سیستم مقابل همگام‌سازی خواهد شد. آیا مطمئنید؟
</p>
</div>
<div class="flex items-center justify-end gap-3 px-6 py-4 bg-gray-50 dark:bg-gray-900/50">
<button
@click="showConfirm = false"
class="px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-600 transition"
>
انصراف
</button>
<button
@click="startSync()"
class="px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition"
>
بله، همگام کن
</button>
</div>
</div>
</div>
</template>
<template x-teleport="body">
<div
x-show="showProgress"
x-transition.opacity
class="fixed inset-0 z-999 flex items-center justify-center bg-black/50 backdrop-blur-sm"
style="display:none"
>
<div class="bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-md mx-4 overflow-hidden">
<div class="px-6 pt-6 pb-4">
<div class="flex items-center gap-3 mb-5">
<div class="flex items-center justify-center w-10 h-10 rounded-full"
:class="failed ? 'bg-danger-50 dark:bg-danger-900/30' : (done ? 'bg-success-50 dark:bg-success-900/30' : 'bg-primary-50 dark:bg-primary-900/30')">
<template x-if="!done && !failed">
<svg class="w-5 h-5 text-primary-500 animate-spin" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
</svg>
</template>
<template x-if="done">
<x-heroicon-o-check-circle class="w-5 h-5 text-success-500" />
</template>
<template x-if="failed">
<x-heroicon-o-x-circle class="w-5 h-5 text-danger-500" />
</template>
</div>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">همگام‌سازی</h3>
</div>
<div class="w-full bg-gray-200 dark:bg-gray-700 rounded-full h-3 mb-3 overflow-hidden">
<div
class="h-3 rounded-full transition-all duration-500 ease-out"
:class="failed ? 'bg-danger-500' : (done ? 'bg-success-500' : 'bg-primary-500')"
:style="'width: ' + Math.min(progress, 100) + '%'"
></div>
</div>
<p class="text-sm text-gray-600 dark:text-gray-400 mb-1" x-text="statusText"></p>
<p class="text-xs text-gray-400 dark:text-gray-500" x-text="Math.round(Math.min(progress, 100)) + '%'"></p>
<template x-if="reportLines.length > 0">
<div class="mt-4 max-h-40 overflow-y-auto bg-gray-50 dark:bg-gray-900/50 rounded-lg p-3">
<template x-for="(line, i) in reportLines" :key="i">
<p class="text-xs text-gray-600 dark:text-gray-400 leading-relaxed" x-text="line"></p>
</template>
</div>
</template>
</div>
<div class="flex items-center justify-end px-6 py-4 bg-gray-50 dark:bg-gray-900/50">
<button
x-show="done || failed"
@click="closeModal()"
class="px-4 py-2 text-sm font-medium text-white rounded-lg transition"
:class="done ? 'bg-success-600 hover:bg-success-700' : 'bg-gray-600 hover:bg-gray-700'"
x-text="done ? 'بستن' : 'بستن'"
></button>
</div>
</div>
</div>
</template>
</div>
@endcan
</div>
@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* {
font-family: 'tahoma', sans-serif;
}
body {
font-size: 12px;
direction: rtl;
margin: 0;
padding: 0;
color: #333;
}
h1 {
font-size: 16px;
text-align: center;
margin-bottom: 4px;
color: #1e40af;
font-weight: bold;
}
.subtitle {
text-align: center;
color: #6b7280;
font-size: 10px;
margin-bottom: 14px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 8px;
}
th {
background-color: #1e40af;
color: #ffffff;
padding: 7px 8px;
text-align: right;
font-size: 11px;
font-weight: bold;
border: 1px solid #1e3a8a;
}
th.col-num {
text-align: center;
width: 30px;
}
td {
padding: 6px 8px;
border: 1px solid #e5e7eb;
font-size: 11px;
text-align: right;
}
td.col-num {
text-align: center;
}
tr:nth-child(even) td {
background-color: #f9fafb;
}
.footer {
margin-top: 14px;
text-align: center;
font-size: 9px;
color: #9ca3af;
}
</style>
</head>
<body>
<h1>{{ __('navigation.doctors.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('doctors.fields.first_name') }}</th>
<th>{{ __('doctors.fields.last_name') }}</th>
<th>{{ __('doctors.fields.speciality') }}</th>
<th>{{ __('doctors.fields.license_id') }}</th>
<th>{{ __('doctors.fields.created_at') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $doctor)
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $doctor->first_name }}</td>
<td>{{ $doctor->last_name }}</td>
<td>{{ $doctor->speciality }}</td>
<td>{{ $doctor->license_id }}</td>
<td>{{ $doctor->created_at
? \Morilog\Jalali\Jalalian::fromCarbon(\Carbon\Carbon::parse($doctor->getRawOriginal('created_at')))->format('Y/m/d')
: '' }}
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.doctors.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>
@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* {
font-family: 'tahoma', sans-serif;
}
body {
font-size: 12px;
direction: rtl;
margin: 0;
padding: 0;
color: #333;
}
h1 {
font-size: 16px;
text-align: center;
margin-bottom: 4px;
color: #1e40af;
font-weight: bold;
}
.subtitle {
text-align: center;
color: #6b7280;
font-size: 10px;
margin-bottom: 14px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 8px;
}
th {
background-color: #1e40af;
color: #ffffff;
padding: 7px 8px;
text-align: right;
font-size: 11px;
font-weight: bold;
border: 1px solid #1e3a8a;
}
th.col-num {
text-align: center;
width: 30px;
}
td {
padding: 6px 8px;
border: 1px solid #e5e7eb;
font-size: 11px;
text-align: right;
}
td.col-num {
text-align: center;
}
tr:nth-child(even) td {
background-color: #f9fafb;
}
.footer {
margin-top: 14px;
text-align: center;
font-size: 9px;
color: #9ca3af;
}
</style>
</head>
<body>
<h1>{{ __('navigation.osurg_initials.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('osurg_initials.fields.init_parameter') }}</th>
<th>{{ __('osurg_initials.fields.init_value') }}</th>
<th>{{ __('osurg_initials.fields.created_at') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $record)
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $record->init_parameter }}</td>
<td>{{ $record->init_value ?? '—' }}</td>
<td>{{ $record->created_at
? \Morilog\Jalali\Jalalian::fromCarbon(\Carbon\Carbon::parse($record->getRawOriginal('created_at')))->format('Y/m/d')
: '' }}
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.osurg_initials.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* { font-family: 'tahoma', sans-serif; }
body { font-size: 12px; direction: rtl; margin: 0; padding: 0; color: #333; }
h1 { font-size: 16px; text-align: center; margin-bottom: 4px; color: #1e40af; font-weight: bold; }
.subtitle { text-align: center; color: #6b7280; font-size: 10px; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th { background-color: #1e40af; color: #ffffff; padding: 7px 8px; text-align: right; font-size: 11px; font-weight: bold; border: 1px solid #1e3a8a; }
th.col-num { text-align: center; width: 30px; }
td { padding: 6px 8px; border: 1px solid #e5e7eb; font-size: 11px; text-align: right; }
td.col-num, td.col-center { text-align: center; }
tr:nth-child(even) td { background-color: #f9fafb; }
.footer { margin-top: 14px; text-align: center; font-size: 9px; color: #9ca3af; }
</style>
</head>
<body>
<h1>{{ __('navigation.patient_illness.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('patient_illness.fields.illness') }}</th>
<th style="width:60px; text-align:center;">{{ __('patient_illness.fields.row_no') }}</th>
<th style="width:60px; text-align:center;">{{ __('patient_illness.fields.priority') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $item)
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $item->illness }}</td>
<td class="col-center">{{ $item->row_no }}</td>
<td class="col-center">{{ $item->priority }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.patient_illness.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* { font-family: 'tahoma', sans-serif; }
body { font-size: 12px; direction: rtl; margin: 0; padding: 0; color: #333; }
h1 { font-size: 16px; text-align: center; margin-bottom: 4px; color: #1e40af; font-weight: bold; }
.subtitle { text-align: center; color: #6b7280; font-size: 10px; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th { background-color: #1e40af; color: #ffffff; padding: 7px 8px; text-align: right; font-size: 11px; font-weight: bold; border: 1px solid #1e3a8a; }
th.col-num { text-align: center; width: 30px; }
td { padding: 6px 8px; border: 1px solid #e5e7eb; font-size: 11px; text-align: right; }
td.col-num { text-align: center; }
tr:nth-child(even) td { background-color: #f9fafb; }
.footer { margin-top: 14px; text-align: center; font-size: 9px; color: #9ca3af; }
</style>
</head>
<body>
<h1>{{ __('navigation.patients.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('patients.fields.full_name') }}</th>
<th>{{ __('patients.fields.icno') }}</th>
<th>{{ __('patients.fields.gender') }}</th>
<th>{{ __('patients.fields.hand_phone') }}</th>
<th>{{ __('patients.fields.insurance') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $item)
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $item->full_name }}</td>
<td>{{ $item->icno }}</td>
<td>{{ $item->gender ?? '-' }}</td>
<td>{{ $item->hand_phone ?? '-' }}</td>
<td>{{ $item->insurance ?? '-' }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.patients.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* { font-family: 'tahoma', sans-serif; }
body { font-size: 12px; direction: rtl; margin: 0; padding: 0; color: #333; }
h1 { font-size: 16px; text-align: center; margin-bottom: 4px; color: #1e40af; font-weight: bold; }
.subtitle { text-align: center; color: #6b7280; font-size: 10px; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th { background-color: #1e40af; color: #ffffff; padding: 7px 8px; text-align: right; font-size: 11px; font-weight: bold; border: 1px solid #1e3a8a; }
th.col-num { text-align: center; width: 30px; }
td { padding: 6px 8px; border: 1px solid #e5e7eb; font-size: 11px; text-align: right; }
td.col-num { text-align: center; }
tr:nth-child(even) td { background-color: #f9fafb; }
.footer { margin-top: 14px; text-align: center; font-size: 9px; color: #9ca3af; }
</style>
</head>
<body>
<h1>{{ __('navigation.payment_types.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('payment_types.fields.payment_type') }}</th>
<th>{{ __('payment_types.fields.account_no') }}</th>
<th>{{ __('payment_types.fields.pos_no') }}</th>
<th>{{ __('payment_types.fields.description') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $item)
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $item->payment_type }}</td>
<td>{{ $item->account_no ?? '-' }}</td>
<td>{{ $item->pos_no ?? '-' }}</td>
<td>{{ $item->description ?? '-' }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.payment_types.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* { font-family: 'tahoma', sans-serif; }
body { font-size: 12px; direction: rtl; margin: 0; padding: 0; color: #333; }
h1 { font-size: 16px; text-align: center; margin-bottom: 4px; color: #1e40af; font-weight: bold; }
.subtitle { text-align: center; color: #6b7280; font-size: 10px; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th { background-color: #1e40af; color: #ffffff; padding: 7px 8px; text-align: right; font-size: 11px; font-weight: bold; border: 1px solid #1e3a8a; }
th.col-num { text-align: center; width: 30px; }
td { padding: 6px 8px; border: 1px solid #e5e7eb; font-size: 11px; text-align: right; }
td.col-num { text-align: center; }
tr:nth-child(even) td { background-color: #f9fafb; }
.footer { margin-top: 14px; text-align: center; font-size: 9px; color: #9ca3af; }
</style>
</head>
<body>
<h1>{{ __('navigation.prescriptions.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('prescriptions.fields.patient') }}</th>
<th>{{ __('prescriptions.fields.doctor') }}</th>
<th>{{ __('prescriptions.fields.issue_date') }}</th>
<th>{{ __('prescriptions.fields.content') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $item)
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $item->patientRecord?->full_name ?? '-' }}</td>
<td>{{ $item->doctor ?? '-' }}</td>
<td>{{ $item->issue_date ?? '-' }}</td>
<td>{{ strip_tags($item->content ?? '-') }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.prescriptions.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>
+101
View File
@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* {
font-family: 'tahoma', sans-serif;
}
body {
font-size: 12px;
direction: rtl;
margin: 0;
padding: 0;
color: #333;
}
h1 {
font-size: 16px;
text-align: center;
margin-bottom: 4px;
color: #1e40af;
font-weight: bold;
}
.subtitle {
text-align: center;
color: #6b7280;
font-size: 10px;
margin-bottom: 14px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 8px;
}
th {
background-color: #1e40af;
color: #ffffff;
padding: 7px 8px;
text-align: right;
font-size: 11px;
font-weight: bold;
border: 1px solid #1e3a8a;
}
th.col-num {
text-align: center;
width: 30px;
}
td {
padding: 6px 8px;
border: 1px solid #e5e7eb;
font-size: 11px;
text-align: right;
}
td.col-num {
text-align: center;
}
tr:nth-child(even) td {
background-color: #f9fafb;
}
.footer {
margin-top: 14px;
text-align: center;
font-size: 9px;
color: #9ca3af;
}
</style>
</head>
<body>
<h1>{{ __('navigation.roles.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('filament-shield::filament-shield.column.name') }}</th>
<th>{{ __('filament-shield::filament-shield.column.guard_name') }}</th>
<th>{{ __('filament-shield::filament-shield.column.permissions') }}</th>
<th>{{ __('filament-shield::filament-shield.column.updated_at') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $role)
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $role->name }}</td>
<td>{{ $role->guard_name }}</td>
<td style="text-align:center;">{{ $role->permissions()->count() }}</td>
<td>{{ $role->updated_at
? \Morilog\Jalali\Jalalian::fromCarbon($role->updated_at)->format('Y/m/d')
: '' }}
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.roles.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* { font-family: 'tahoma', sans-serif; }
body { font-size: 12px; direction: rtl; margin: 0; padding: 0; color: #333; }
h1 { font-size: 16px; text-align: center; margin-bottom: 4px; color: #1e40af; font-weight: bold; }
.subtitle { text-align: center; color: #6b7280; font-size: 10px; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th { background-color: #1e40af; color: #ffffff; padding: 7px 8px; text-align: right; font-size: 11px; font-weight: bold; border: 1px solid #1e3a8a; }
th.col-num { text-align: center; width: 30px; }
td { padding: 6px 8px; border: 1px solid #e5e7eb; font-size: 11px; text-align: right; }
td.col-num { text-align: center; }
tr:nth-child(even) td { background-color: #f9fafb; }
.footer { margin-top: 14px; text-align: center; font-size: 9px; color: #9ca3af; }
</style>
</head>
<body>
<h1>{{ __('navigation.surgery_centers.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('surgery_centers.fields.name') }}</th>
<th>{{ __('surgery_centers.fields.phone') }}</th>
<th>{{ __('surgery_centers.fields.contact_person') }}</th>
<th>{{ __('surgery_centers.fields.address') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $item)
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $item->name }}</td>
<td>{{ $item->phone ?: '-' }}</td>
<td>{{ $item->contact_person ?? '-' }}</td>
<td>{{ $item->address ?? '-' }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.surgery_centers.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* { font-family: 'tahoma', sans-serif; }
body { font-size: 12px; direction: rtl; margin: 0; padding: 0; color: #333; }
h1 { font-size: 16px; text-align: center; margin-bottom: 4px; color: #1e40af; font-weight: bold; }
.subtitle { text-align: center; color: #6b7280; font-size: 10px; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th { background-color: #1e40af; color: #ffffff; padding: 7px 8px; text-align: right; font-size: 11px; font-weight: bold; border: 1px solid #1e3a8a; }
th.col-num { text-align: center; width: 30px; }
td { padding: 6px 8px; border: 1px solid #e5e7eb; font-size: 11px; text-align: right; }
td.col-num { text-align: center; }
tr:nth-child(even) td { background-color: #f9fafb; }
.footer { margin-top: 14px; text-align: center; font-size: 9px; color: #9ca3af; }
</style>
</head>
<body>
<h1>{{ __('navigation.treatments.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('treatments.fields.treatment_name') }}</th>
<th>{{ __('treatments.fields.treatment_type') }}</th>
<th>{{ __('treatments.fields.treatment_cost') }}</th>
<th>{{ __('treatments.fields.descriptions') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $item)
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $item->treatment_name }}</td>
<td>{{ $item->treatment_type ?? '-' }}</td>
<td>{{ $item->treatment_cost !== null ? number_format($item->treatment_cost) : '-' }}</td>
<td>{{ $item->descriptions ?? '-' }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.treatments.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>
+101
View File
@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* {
font-family: 'tahoma', sans-serif;
}
body {
font-size: 12px;
direction: rtl;
margin: 0;
padding: 0;
color: #333;
}
h1 {
font-size: 16px;
text-align: center;
margin-bottom: 4px;
color: #1e40af;
font-weight: bold;
}
.subtitle {
text-align: center;
color: #6b7280;
font-size: 10px;
margin-bottom: 14px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 8px;
}
th {
background-color: #1e40af;
color: #ffffff;
padding: 7px 8px;
text-align: right;
font-size: 11px;
font-weight: bold;
border: 1px solid #1e3a8a;
}
th.col-num {
text-align: center;
width: 30px;
}
td {
padding: 6px 8px;
border: 1px solid #e5e7eb;
font-size: 11px;
text-align: right;
}
td.col-num {
text-align: center;
}
tr:nth-child(even) td {
background-color: #f9fafb;
}
.footer {
margin-top: 14px;
text-align: center;
font-size: 9px;
color: #9ca3af;
}
</style>
</head>
<body>
<h1>{{ __('navigation.users.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('users.fields.name') }}</th>
<th>{{ __('users.fields.username') }}</th>
<th>{{ __('users.fields.roles') }}</th>
<th>{{ __('users.fields.created_at') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $user)
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $user->name }}</td>
<td>{{ $user->username }}</td>
<td>{{ $user->roles->pluck('name')->join('، ') }}</td>
<td>{{ $user->getRawOriginal('created_at')
? \Morilog\Jalali\Jalalian::fromCarbon(\Carbon\Carbon::parse($user->getRawOriginal('created_at')))->format('Y/m/d H:i')
: '' }}
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.users.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* { font-family: 'tahoma', sans-serif; }
body { font-size: 11px; direction: rtl; margin: 0; padding: 0; color: #333; }
h1 { font-size: 16px; text-align: center; margin-bottom: 4px; color: #1e40af; font-weight: bold; }
.subtitle { text-align: center; color: #6b7280; font-size: 10px; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th { background-color: #1e40af; color: #ffffff; padding: 6px 6px; text-align: right; font-size: 10px; font-weight: bold; border: 1px solid #1e3a8a; }
th.col-num { text-align: center; width: 25px; }
td { padding: 5px 6px; border: 1px solid #e5e7eb; font-size: 10px; text-align: right; }
td.col-num { text-align: center; }
td.col-money { text-align: left; direction: ltr; }
td.remained { color: #dc2626; font-weight: bold; }
td.paid-full { color: #16a34a; }
tr:nth-child(even) td { background-color: #f9fafb; }
.footer { margin-top: 14px; text-align: center; font-size: 9px; color: #9ca3af; }
</style>
</head>
<body>
<h1>{{ __('navigation.visits.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('visits.fields.visit_date') }}</th>
<th>{{ __('visits.fields.patient') }}</th>
<th>{{ __('visits.fields.doctor') }}</th>
<th>{{ __('visits.fields.treatment') }}</th>
<th>{{ __('visits.fields.treatment_cost') }}</th>
<th>{{ __('visits.fields.paid_amount') }}</th>
<th>{{ __('visits.fields.remained_amount') }}</th>
<th>{{ __('visits.fields.payment_type') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $item)
@php $remained = (int)($item->treatment_cost ?? 0) - (int)($item->paid_amount ?? 0); @endphp
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $item->visit_date ?? '-' }}</td>
<td>{{ $item->patientRecord?->full_name ?? '-' }}</td>
<td>{{ $item->doctorRecord?->full_name ?? '-' }}</td>
<td>{{ $item->treatmentRecord ? ($item->treatmentRecord->treatment_name ?: $item->treatmentRecord->treatment_type) : '-' }}</td>
<td class="col-money">{{ $item->treatment_cost !== null ? number_format((int)$item->treatment_cost) : '-' }}</td>
<td class="col-money">{{ $item->paid_amount !== null ? number_format((int)$item->paid_amount) : '-' }}</td>
<td class="col-money {{ $remained > 0 ? 'remained' : 'paid-full' }}">{{ number_format($remained) }}</td>
<td>{{ $item->paymentTypeRecord?->payment_type ?? '-' }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.visits.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>
@@ -0,0 +1,190 @@
<x-filament-panels::page>
@php
$user = auth()->user();
$groups = [
[
'label' => __('navigation.groups.patients'),
'color' => 'blue',
'cards' => [
[
'title' => __('navigation.patients.title'),
'description' => __('navigation.patients.description'),
'icon' => 'heroicon-o-user-group',
'url' => \App\Filament\Resources\PatientResource::getUrl('index'),
'permission' => 'ViewAny:Patient',
],
[
'title' => __('navigation.visits.title'),
'description' => __('navigation.visits.description'),
'icon' => 'heroicon-o-calendar',
'url' => \App\Filament\Resources\VisitResource::getUrl('index'),
'permission' => 'ViewAny:Visit',
],
[
'title' => __('navigation.prescriptions.title'),
'description' => __('navigation.prescriptions.description'),
'icon' => 'heroicon-o-document-text',
'url' => \App\Filament\Resources\PrescriptionResource::getUrl('index'),
'permission' => 'ViewAny:Prescription',
],
[
'title' => __('navigation.surgery_appointments.title'),
'description' => __('navigation.surgery_appointments.description'),
'icon' => 'heroicon-o-calendar-days',
'url' => \App\Filament\Resources\SurgeryAppointmentResource::getUrl('index'),
'permission' => 'ViewAny:SurgeryAppointment',
],
],
],
[
'label' => __('navigation.groups.diseases'),
'color' => 'orange',
'cards' => [
[
'title' => __('navigation.patient_illness.title'),
'description' => __('navigation.patient_illness.description'),
'icon' => 'heroicon-o-heart',
'url' => \App\Filament\Resources\PatientIllnessResource::getUrl('index'),
'permission' => 'ViewAny:PatientIllness',
],
[
'title' => __('navigation.treatments.title'),
'description' => __('navigation.treatments.description'),
'icon' => 'heroicon-o-clipboard-document-list',
'url' => \App\Filament\Resources\TreatmentResource::getUrl('index'),
'permission' => 'ViewAny:Treatment',
],
[
'title' => __('navigation.medications.title'),
'description' => __('navigation.medications.description'),
'icon' => 'heroicon-o-beaker',
'url' => \App\Filament\Resources\MedicationResource::getUrl('index'),
'permission' => 'ViewAny:Medication',
],
],
],
[
'label' => __('navigation.groups.clinic'),
'color' => 'teal',
'cards' => [
[
'title' => __('navigation.doctors.title'),
'description' => __('navigation.doctors.description'),
'icon' => 'heroicon-o-user-circle',
'url' => \App\Filament\Resources\DoctorResource::getUrl('index'),
'permission' => 'ViewAny:Doctor',
],
[
'title' => __('navigation.payment_types.title'),
'description' => __('navigation.payment_types.description'),
'icon' => 'heroicon-o-credit-card',
'url' => \App\Filament\Resources\PaymentTypeResource::getUrl('index'),
'permission' => 'ViewAny:PaymentType',
],
[
'title' => __('navigation.surgery_centers.title'),
'description' => __('navigation.surgery_centers.description'),
'icon' => 'heroicon-o-building-office-2',
'url' => \App\Filament\Resources\SurgeryCenterResource::getUrl('index'),
'permission' => 'ViewAny:SurgeryCenter',
],
[
'title' => __('navigation.users.title'),
'description' => __('navigation.users.description'),
'icon' => 'heroicon-o-users',
'url' => \App\Filament\Resources\UserResource::getUrl('index'),
'permission' => 'ViewAny:User',
],
],
],
[
'label' => __('navigation.groups.settings'),
'color' => 'slate',
'cards' => [
[
'title' => __('navigation.osurg_audit.title'),
'description' => __('navigation.osurg_audit.description'),
'icon' => 'heroicon-o-clipboard-document-list',
'url' => \App\Filament\Resources\OsurgAuditResource::getUrl('index'),
'permission' => 'ViewAny:SyncLog',
],
[
'title' => __('navigation.osurg_initials.title'),
'description' => __('navigation.osurg_initials.description'),
'icon' => 'heroicon-o-adjustments-horizontal',
'url' => \App\Filament\Resources\OsurgInitialResource::getUrl('index'),
'permission' => 'ViewAny:OsurgInitial',
],
[
'title' => __('navigation.sms_logs.title'),
'description' => __('navigation.sms_logs.description'),
'icon' => 'heroicon-o-chat-bubble-left-ellipsis',
'url' => \App\Filament\Pages\SmsLogsPage::getUrl(),
'permission' => 'View:SmsLogsPage',
],
[
'title' => __('navigation.roles.title'),
'description' => __('navigation.roles.description'),
'icon' => 'heroicon-o-shield-check',
'url' => \App\Filament\Resources\RoleResource::getUrl('index'),
'permission' => 'ViewAny:Role',
],
],
],
];
$groups = array_filter(array_map(function ($group) use ($user) {
$group['cards'] = array_filter($group['cards'], fn ($card) =>
!isset($card['permission']) || $user->can($card['permission'])
);
return $group;
}, $groups), fn ($group) => !empty($group['cards']));
@endphp
<div class="space-y-8">
<div class="grid grid-cols-1 gap-6 lg:grid-cols-2">
@foreach (array_slice($groups, 0, 2) as $group)
<div>
<h2 class="mb-4 text-sm font-semibold uppercase tracking-widest text-gray-400 dark:text-gray-500">
{{ $group['label'] }}
</h2>
<div class="grid grid-cols-1 gap-3 sm:grid-cols-2">
@foreach ($group['cards'] as $card)
<x-navigation-card
:title="$card['title']"
:description="$card['description']"
:icon="$card['icon']"
:url="$card['url']"
:color="$group['color']"
/>
@endforeach
</div>
</div>
@endforeach
</div>
<div class="grid grid-cols-1 gap-6 lg:grid-cols-2">
@foreach (array_slice($groups, 2) as $group)
<div>
<h2 class="mb-4 text-sm font-semibold uppercase tracking-widest text-gray-400 dark:text-gray-500">
{{ $group['label'] }}
</h2>
<div class="grid grid-cols-1 gap-3 sm:grid-cols-2">
@foreach ($group['cards'] as $card)
<x-navigation-card
:title="$card['title']"
:description="$card['description']"
:icon="$card['icon']"
:url="$card['url']"
:color="$group['color']"
/>
@endforeach
</div>
</div>
@endforeach
</div>
</div>
</x-filament-panels::page>
@@ -0,0 +1,39 @@
<x-filament-panels::page>
<div class="flex flex-col gap-6">
<div class="order-2">
{{ $this->table }}
</div>
<div class="order-1 grid grid-cols-2 gap-4 sm:grid-cols-4">
<x-filament::card>
<div class="text-center">
<p class="text-3xl font-bold text-primary-600 dark:text-primary-400">{{ $this->stats['patients'] }}</p>
<p class="text-sm text-gray-500 mt-1">بیمار&lrm; ({{ $this->stats['total'] }} پیام)</p>
</div>
</x-filament::card>
<x-filament::card>
<div class="text-center">
<p class="text-3xl font-bold text-success-600 dark:text-success-400">{{ $this->stats['sent'] }}</p>
<p class="text-sm text-gray-500 mt-1">ارسال شده</p>
</div>
</x-filament::card>
<x-filament::card>
<div class="text-center">
<p class="text-3xl font-bold text-warning-600 dark:text-warning-400">{{ $this->stats['pending'] }}</p>
<p class="text-sm text-gray-500 mt-1">در انتظار</p>
</div>
</x-filament::card>
<x-filament::card>
<div class="text-center">
<p class="text-3xl font-bold text-danger-600 dark:text-danger-400">{{ $this->stats['failed'] }}</p>
<p class="text-sm text-gray-500 mt-1">ناموفق</p>
</div>
</x-filament::card>
</div>
</div>
</x-filament-panels::page>
@@ -0,0 +1,61 @@
<x-filament-panels::page>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-3 mb-6">
<x-filament::card>
<div class="flex items-center gap-3">
<x-heroicon-o-clock class="w-8 h-8 text-gray-400" />
<div>
<p class="text-sm text-gray-500">{{ __('navigation.sync.last_sync') }}</p>
<p class="text-lg font-bold">{{ $this->getLastSyncTime() }}</p>
</div>
</div>
</x-filament::card>
<x-filament::card>
<div class="flex items-center gap-3">
<x-heroicon-o-queue-list class="w-8 h-8 text-amber-400" />
<div>
<p class="text-sm text-gray-500">{{ __('navigation.sync.pending_changes') }}</p>
<p class="text-2xl font-bold text-amber-500">{{ $this->getPendingCount() }}</p>
</div>
</div>
</x-filament::card>
<x-filament::card>
<div class="flex items-center gap-3">
<x-heroicon-o-server class="w-8 h-8 text-blue-400" />
<div>
<p class="text-sm text-gray-500">{{ __('navigation.sync.peer_address') }}</p>
<p class="text-lg font-bold font-mono">
{{ \App\Models\OsurgInitial::val('sync_peer_ip', config('sync.peer_ip')) ?: '—' }}
@php($port = \App\Models\OsurgInitial::val('sync_peer_port', config('sync.peer_port')))
@if($port && $port != 80)
:{{ $port }}
@endif
</p>
</div>
</div>
</x-filament::card>
</div>
<x-filament::card>
<div class="space-y-2 text-sm text-gray-600 dark:text-gray-400">
<h3 class="font-semibold text-base text-gray-800 dark:text-gray-200">{{ __('navigation.sync.setup_guide') }}</h3>
<p>{{ __('navigation.sync.setup_description_dynamic') }}</p>
<ul class="list-disc list-inside space-y-1 text-xs">
<li><code class="bg-gray-100 dark:bg-gray-800 px-1 rounded">sync_peer_ip</code> — {{ __('navigation.sync.field_peer_ip') }}</li>
<li><code class="bg-gray-100 dark:bg-gray-800 px-1 rounded">sync_peer_port</code> — {{ __('navigation.sync.field_peer_port') }}</li>
<li><code class="bg-gray-100 dark:bg-gray-800 px-1 rounded">sync_token</code> — {{ __('navigation.sync.field_sync_token') }}</li>
</ul>
<p class="text-amber-600 dark:text-amber-400">⚠ {{ __('navigation.sync.setup_warning') }}</p>
</div>
</x-filament::card>
@if($report)
<x-filament::card>
<h3 class="font-semibold text-base mb-2">{{ __('navigation.sync.last_report') }}</h3>
<pre class="bg-gray-50 dark:bg-gray-900 border rounded p-3 text-xs leading-loose max-h-64 overflow-y-auto whitespace-pre-wrap">{{ $report }}</pre>
</x-filament::card>
@endif
</x-filament-panels::page>
@@ -0,0 +1,108 @@
@php
$photosBeforeRaw = $record->photos_before ?? [];
$photosAfterRaw = $record->photos_after ?? [];
$videosRaw = $record->videos ?? [];
$audioRaw = $record->audio_files ?? [];
$toUrls = fn($files) => collect((array) $files)
->filter()
->map(fn($f) => Storage::disk('public')->url($f))
->values();
$photosBefore = $toUrls($photosBeforeRaw);
$photosAfter = $toUrls($photosAfterRaw);
$videos = $toUrls($videosRaw);
$audios = $toUrls($audioRaw);
@endphp
<div class="space-y-6 p-2" dir="rtl">
{{-- Photos Before --}}
@if($photosBefore->isNotEmpty())
<div>
<h3 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">{{ __('patients.fields.photos_before') }}</h3>
<div class="grid grid-cols-3 gap-2">
@foreach($photosBefore as $url)
<a href="{{ $url }}" target="_blank">
<img src="{{ $url }}" class="w-full h-32 object-cover rounded-lg border border-gray-200 dark:border-gray-700 hover:opacity-80 transition" />
</a>
@endforeach
</div>
</div>
@endif
{{-- Photos After --}}
@if($photosAfter->isNotEmpty())
<div>
<h3 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">{{ __('patients.fields.photos_after') }}</h3>
<div class="grid grid-cols-3 gap-2">
@foreach($photosAfter as $url)
<a href="{{ $url }}" target="_blank">
<img src="{{ $url }}" class="w-full h-32 object-cover rounded-lg border border-gray-200 dark:border-gray-700 hover:opacity-80 transition" />
</a>
@endforeach
</div>
</div>
@endif
{{-- Videos --}}
@if($videos->isNotEmpty())
<div>
<h3 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">{{ __('patients.fields.videos') }}</h3>
<div class="space-y-3">
@foreach($videos as $i => $url)
@php $vid = 'patient-video-'.$i.'-'.uniqid(); @endphp
<div class="rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 bg-black">
<video id="{{ $vid }}" src="{{ $url }}" controls class="w-full max-h-64"></video>
<div class="flex items-center gap-2 bg-gray-900 px-3 py-1">
<span class="text-xs text-gray-400">سرعت:</span>
@foreach([0.5, 1, 1.5, 2] as $speed)
<button
onclick="(function(){ var v=document.getElementById('{{ $vid }}'); v.playbackRate={{ $speed }}; this.closest('.flex').querySelectorAll('[data-speed]').forEach(function(b){b.classList.remove('bg-blue-600','text-white'); b.classList.add('text-gray-300');}); this.classList.add('bg-blue-600','text-white'); this.classList.remove('text-gray-300'); }).call(this)"
data-speed="{{ $speed }}"
class="text-xs px-2 py-0.5 rounded {{ $speed == 1 ? 'bg-blue-600 text-white' : 'text-gray-300' }} hover:bg-blue-500 hover:text-white transition"
>{{ $speed }}x</button>
@endforeach
<a href="{{ $url }}" download class="mr-auto text-gray-400 hover:text-white transition" title="دانلود">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" />
</svg>
</a>
</div>
</div>
@endforeach
</div>
</div>
@endif
{{-- Audio Files --}}
@if($audios->isNotEmpty())
<div>
<h3 class="text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">{{ __('patients.fields.audio_files') }}</h3>
<div class="space-y-2">
@foreach($audios as $i => $url)
@php $aid = 'patient-audio-'.$i.'-'.uniqid(); @endphp
<div class="rounded-lg border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 p-3">
<audio id="{{ $aid }}" src="{{ $url }}" controls class="w-full mb-2"></audio>
<div class="flex items-center gap-2">
<span class="text-xs text-gray-500 dark:text-gray-400">سرعت:</span>
@foreach([0.5, 1, 1.5, 2] as $speed)
<button
onclick="(function(){ var a=document.getElementById('{{ $aid }}'); a.playbackRate={{ $speed }}; this.closest('.flex').querySelectorAll('[data-speed]').forEach(function(b){b.classList.remove('bg-blue-600','text-white'); b.classList.add('text-gray-500');}); this.classList.add('bg-blue-600','text-white'); this.classList.remove('text-gray-500'); }).call(this)"
data-speed="{{ $speed }}"
class="text-xs px-2 py-0.5 rounded {{ $speed == 1 ? 'bg-blue-600 text-white' : 'text-gray-500' }} hover:bg-blue-500 hover:text-white transition"
>{{ $speed }}x</button>
@endforeach
<a href="{{ $url }}" download class="mr-auto text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 transition" title="دانلود">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" />
</svg>
</a>
</div>
</div>
@endforeach
</div>
</div>
@endif
</div>
@@ -0,0 +1,227 @@
<div class="flex items-center gap-1">
<button
x-data
@click="$dispatch('theme-changed', $store.theme === 'dark' ? 'light' : 'dark')"
class="flex items-center justify-center w-9 h-9 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-700 transition"
>
<span x-show="$store.theme === 'dark'" x-cloak>
<x-heroicon-o-sun class="w-5 h-5" />
</span>
<span x-show="$store.theme !== 'dark'" x-cloak>
<x-heroicon-o-moon class="w-5 h-5" />
</span>
</button>
@can('View:SyncPage')
<div
class="relative"
x-data="{
open: false,
showConfirm: false,
showProgress: false,
progress: 0,
statusText: '',
done: false,
failed: false,
interval: null,
confirmSync() {
this.open = false;
this.showConfirm = true;
},
startSync() {
this.showConfirm = false;
this.showProgress = true;
this.progress = 0;
this.done = false;
this.failed = false;
this.statusText = '{{ __('navigation.sync.status_connecting') }}';
this.progress = 15;
this.interval = setInterval(() => {
if (this.progress < 85) {
this.progress += Math.random() * 10;
if (this.progress > 40 && this.progress < 60) {
this.statusText = '{{ __('navigation.sync.status_receiving') }}';
} else if (this.progress >= 60) {
this.statusText = '{{ __('navigation.sync.status_sending') }}';
}
}
}, 500);
$wire.runSync();
},
closeModal() {
this.showProgress = false;
this.showConfirm = false;
if (this.done) {
window.location.reload();
}
}
}"
x-on:sync-finished.window="
clearInterval(interval);
progress = 100;
if ($event.detail.success) {
statusText = '{{ __('navigation.sync.success') }}';
done = true;
} else {
statusText = '{{ __('navigation.sync.failed') }}';
failed = true;
}
"
@click.outside="open = false"
>
<button
@click="open = !open"
class="flex items-center justify-center w-9 h-9 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 dark:text-gray-400 dark:hover:text-gray-200 dark:hover:bg-gray-700 transition"
title="{{ __('navigation.groups.system') }}"
>
<x-heroicon-o-cog-6-tooth class="w-5 h-5" />
</button>
<div
x-show="open"
x-transition:enter="transition ease-out duration-100"
x-transition:enter-start="opacity-0 scale-95"
x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition ease-in duration-75"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-95"
class="absolute inset-s-0 mt-1 w-52 rounded-xl bg-white dark:bg-gray-800 shadow-lg ring-1 ring-gray-200 dark:ring-gray-700 z-50 py-1"
style="display:none"
>
<button
type="button"
@click="confirmSync()"
class="flex items-center gap-3 px-4 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition w-full"
>
<x-heroicon-o-arrows-right-left class="w-4 h-4 text-primary-500 shrink-0" />
{{ __('navigation.sync.label') }}
</button>
<a
href="{{ \App\Filament\Pages\SyncPage::getUrl() }}"
@click="open = false"
class="flex items-center gap-3 px-4 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition"
>
<x-heroicon-o-document-magnifying-glass class="w-4 h-4 text-info-500 shrink-0" />
{{ __('navigation.sync.details') }}
</a>
<a
href="{{ route('backup.download') }}"
@click="open = false"
class="flex items-center gap-3 px-4 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition"
>
<x-heroicon-o-arrow-down-tray class="w-4 h-4 text-success-500 shrink-0" />
{{ __('navigation.backup.label') }}
</a>
</div>
<template x-teleport="body">
<div
x-show="showConfirm"
x-transition.opacity
class="fixed inset-0 z-999 flex items-center justify-center bg-black/50 backdrop-blur-sm"
style="display:none"
>
<div
@click.outside="showConfirm = false"
class="bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-md mx-4 overflow-hidden"
>
<div class="px-6 pt-6 pb-4">
<div class="flex items-center gap-3 mb-4">
<div class="flex items-center justify-center w-10 h-10 rounded-full bg-primary-50 dark:bg-primary-900/30">
<x-heroicon-o-arrows-right-left class="w-5 h-5 text-primary-500" />
</div>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">{{ __('navigation.sync.confirm_heading') }}</h3>
</div>
<p class="text-sm text-gray-600 dark:text-gray-400">
{{ __('navigation.sync.confirm_description') }}
</p>
</div>
<div class="flex items-center justify-end gap-3 px-6 py-4 bg-gray-50 dark:bg-gray-900/50">
<button
@click="showConfirm = false"
class="px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-600 transition"
>
{{ __('filament-actions::modal.actions.cancel.label') }}
</button>
<button
@click="startSync()"
class="px-4 py-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition"
>
{{ __('navigation.sync.confirm_button') }}
</button>
</div>
</div>
</div>
</template>
<template x-teleport="body">
<div
x-show="showProgress"
x-transition.opacity
class="fixed inset-0 z-999 flex items-center justify-center bg-black/50 backdrop-blur-sm"
style="display:none"
>
<div class="bg-white dark:bg-gray-800 rounded-2xl shadow-2xl w-full max-w-md mx-4 overflow-hidden">
<div class="px-6 pt-6 pb-4">
<div class="flex items-center gap-3 mb-5">
<div class="flex items-center justify-center w-10 h-10 rounded-full"
:class="failed ? 'bg-danger-50 dark:bg-danger-900/30' : (done ? 'bg-success-50 dark:bg-success-900/30' : 'bg-primary-50 dark:bg-primary-900/30')">
<template x-if="!done && !failed">
<svg class="w-5 h-5 text-primary-500 animate-spin" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
</svg>
</template>
<template x-if="done">
<x-heroicon-o-check-circle class="w-5 h-5 text-success-500" />
</template>
<template x-if="failed">
<x-heroicon-o-x-circle class="w-5 h-5 text-danger-500" />
</template>
</div>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">{{ __('navigation.sync.label') }}</h3>
</div>
<div class="w-full bg-gray-200 dark:bg-gray-700 rounded-full h-3 mb-3 overflow-hidden">
<div
class="h-3 rounded-full transition-all duration-500 ease-out"
:class="failed ? 'bg-danger-500' : (done ? 'bg-success-500' : 'bg-primary-500')"
:style="'width: ' + Math.min(progress, 100) + '%'"
></div>
</div>
<p class="text-sm text-gray-600 dark:text-gray-400 mb-1" x-text="statusText"></p>
<p class="text-xs text-gray-400 dark:text-gray-500" x-text="Math.round(Math.min(progress, 100)) + '%'"></p>
<template x-if="(done || failed) && $wire.reportLines.length > 0">
<div class="mt-4 max-h-40 overflow-y-auto bg-gray-50 dark:bg-gray-900/50 rounded-lg p-3">
<template x-for="(line, i) in $wire.reportLines" :key="i">
<p class="text-xs text-gray-600 dark:text-gray-400 leading-relaxed" x-text="line"></p>
</template>
</div>
</template>
</div>
<div class="flex items-center justify-end px-6 py-4 bg-gray-50 dark:bg-gray-900/50">
<button
x-show="done || failed"
@click="closeModal()"
class="px-4 py-2 text-sm font-medium text-white rounded-lg transition"
:class="done ? 'bg-success-600 hover:bg-success-700' : 'bg-gray-600 hover:bg-gray-700'"
>
{{ __('navigation.sync.close') }}
</button>
</div>
</div>
</div>
</template>
</div>
@endcan
</div>
@@ -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 &nbsp;&nbsp;&nbsp; HBS/Ag &nbsp;&nbsp;&nbsp; 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 &nbsp;&nbsp;&nbsp; HBS/Ag &nbsp;&nbsp;&nbsp; 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>
@@ -0,0 +1,209 @@
@props([
'currentPageOptionProperty' => 'tableRecordsPerPage',
'extremeLinks' => false,
'paginator',
'pageOptions' => [],
])
@php
use Illuminate\Contracts\Pagination\CursorPaginator;
$isRtl = __('filament-panels::layout.direction') === 'rtl';
$isSimple = ! $paginator instanceof \Illuminate\Pagination\LengthAwarePaginator;
$perPageLabel = __('filament::components/pagination.fields.records_per_page.label');
@endphp
<nav
aria-label="{{ __('filament::components/pagination.label') }}"
role="navigation"
{{
$attributes->class([
'fi-pagination',
'fi-simple' => $isSimple,
])
}}
>
@if (! $paginator->onFirstPage())
@php
if ($paginator instanceof CursorPaginator) {
$wireClickAction = "setPage('{$paginator->previousCursor()->encode()}', '{$paginator->getCursorName()}')";
} else {
$wireClickAction = "previousPage('{$paginator->getPageName()}')";
}
@endphp
<x-filament::button
color="gray"
rel="prev"
:wire:click="$wireClickAction"
:wire:key="$this->getId() . '.pagination.previous'"
class="fi-pagination-previous-btn"
>
{{ __('filament::components/pagination.actions.previous.label') }}
</x-filament::button>
@endif
@if (! $isSimple)
<span class="fi-pagination-overview">
{{
trans_choice(
'filament::components/pagination.overview',
$paginator->total(),
[
'first' => \Illuminate\Support\Number::format($paginator->firstItem() ?? 0),
'last' => \Illuminate\Support\Number::format($paginator->lastItem() ?? 0),
'total' => \Illuminate\Support\Number::format($paginator->total()),
],
)
}}
</span>
@endif
@if (count($pageOptions) > 1)
<div class="fi-pagination-records-per-page-select-ctn">
<label class="fi-pagination-records-per-page-select fi-compact">
<x-filament::input.wrapper>
<x-filament::input.select
:wire:model.live="$currentPageOptionProperty"
>
@foreach ($pageOptions as $option)
<option value="{{ $option }}">
{{ $option === 'all' ? __('filament::components/pagination.fields.records_per_page.options.all') : $option }}
</option>
@endforeach
</x-filament::input.select>
</x-filament::input.wrapper>
<span class="fi-sr-only">
{{ $perPageLabel }}
</span>
</label>
<label class="fi-pagination-records-per-page-select">
<x-filament::input.wrapper
:prefix="$perPageLabel"
>
<x-filament::input.select
:wire:model.live="$currentPageOptionProperty"
>
@foreach ($pageOptions as $option)
<option value="{{ $option }}">
{{ $option === 'all' ? __('filament::components/pagination.fields.records_per_page.options.all') : $option }}
</option>
@endforeach
</x-filament::input.select>
</x-filament::input.wrapper>
</label>
</div>
@endif
@if ($paginator->hasMorePages())
@php
if ($paginator instanceof CursorPaginator) {
$wireClickAction = "setPage('{$paginator->nextCursor()->encode()}', '{$paginator->getCursorName()}')";
} else {
$wireClickAction = "nextPage('{$paginator->getPageName()}')";
}
@endphp
<x-filament::button
color="gray"
rel="next"
:wire:click="$wireClickAction"
:wire:key="$this->getId() . '.pagination.next'"
class="fi-pagination-next-btn"
>
{{ __('filament::components/pagination.actions.next.label') }}
</x-filament::button>
@endif
@if ((! $isSimple) && $paginator->hasPages())
<ol class="fi-pagination-items">
@if (! $paginator->onFirstPage())
@if ($extremeLinks)
<x-filament::pagination.item
:aria-label="__('filament::components/pagination.actions.first.label')"
:icon="$isRtl ? \Filament\Support\Icons\Heroicon::ChevronDoubleRight : \Filament\Support\Icons\Heroicon::ChevronDoubleLeft"
:icon-alias="
$isRtl
? \Filament\Support\View\SupportIconAlias::PAGINATION_FIRST_BUTTON_RTL
: \Filament\Support\View\SupportIconAlias::PAGINATION_FIRST_BUTTON
"
rel="first"
:wire:click="'gotoPage(1, \'' . $paginator->getPageName() . '\')'"
:wire:key="$this->getId() . '.pagination.first'"
/>
@endif
<x-filament::pagination.item
:aria-label="__('filament::components/pagination.actions.previous.label')"
:icon="$isRtl ? \Filament\Support\Icons\Heroicon::ChevronRight : \Filament\Support\Icons\Heroicon::ChevronLeft"
{{-- @deprecated Use `SupportIconAlias::PAGINATION_PREVIOUS_BUTTON_RTL` instead of `SupportIconAlias::PAGINATION_PREVIOUS_BUTTON` for RTL. --}}
:icon-alias="
$isRtl
? [
\Filament\Support\View\SupportIconAlias::PAGINATION_PREVIOUS_BUTTON_RTL,
\Filament\Support\View\SupportIconAlias::PAGINATION_PREVIOUS_BUTTON,
]
: \Filament\Support\View\SupportIconAlias::PAGINATION_PREVIOUS_BUTTON
"
rel="prev"
:wire:click="'previousPage(\'' . $paginator->getPageName() . '\')'"
:wire:key="$this->getId() . '.pagination.previous'"
/>
@endif
@foreach ($paginator->render()->offsetGet('elements') as $element)
@if (is_string($element))
<x-filament::pagination.item disabled :label="$element" />
@endif
@if (is_array($element))
@foreach ($element as $page => $url)
<x-filament::pagination.item
:active="$page === $paginator->currentPage()"
:aria-label="trans_choice('filament::components/pagination.actions.go_to_page.label', $page, ['page' => \Illuminate\Support\Number::format($page)])"
:label="\Illuminate\Support\Number::format($page)"
:wire:click="'gotoPage(' . $page . ', \'' . $paginator->getPageName() . '\')'"
:wire:key="$this->getId() . '.pagination.' . $paginator->getPageName() . '.' . $page"
/>
@endforeach
@endif
@endforeach
@if ($paginator->hasMorePages())
<x-filament::pagination.item
:aria-label="__('filament::components/pagination.actions.next.label')"
:icon="$isRtl ? \Filament\Support\Icons\Heroicon::ChevronLeft : \Filament\Support\Icons\Heroicon::ChevronRight"
{{-- @deprecated Use `SupportIconAlias::PAGINATION_NEXT_BUTTON_RTL` instead of `SupportIconAlias::PAGINATION_NEXT_BUTTON` for RTL. --}}
:icon-alias="
$isRtl
? [
\Filament\Support\View\SupportIconAlias::PAGINATION_NEXT_BUTTON_RTL,
\Filament\Support\View\SupportIconAlias::PAGINATION_NEXT_BUTTON,
]
: \Filament\Support\View\SupportIconAlias::PAGINATION_NEXT_BUTTON
"
rel="next"
:wire:click="'nextPage(\'' . $paginator->getPageName() . '\')'"
:wire:key="$this->getId() . '.pagination.next'"
/>
@if ($extremeLinks)
<x-filament::pagination.item
:aria-label="__('filament::components/pagination.actions.last.label')"
:icon="$isRtl ? \Filament\Support\Icons\Heroicon::ChevronDoubleLeft : \Filament\Support\Icons\Heroicon::ChevronDoubleRight"
:icon-alias="
$isRtl
? \Filament\Support\View\SupportIconAlias::PAGINATION_LAST_BUTTON_RTL
: \Filament\Support\View\SupportIconAlias::PAGINATION_LAST_BUTTON
"
rel="last"
:wire:click="'gotoPage(' . $paginator->lastPage() . ', \'' . $paginator->getPageName() . '\')'"
:wire:key="$this->getId() . '.pagination.last'"
/>
@endif
@endif
</ol>
@endif
</nav>