feat: initialize Dr-Panel project with patient file number support
This commit is contained in:
@@ -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') }} — {{ \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') }} — {{ \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') }} — {{ \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') }} — {{ \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') }} — {{ \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') }} — {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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') }} — {{ \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') }} — {{ \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') }} — {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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') }} — {{ \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') }} — {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
@php
|
||||
$files = $getState() ?? [];
|
||||
$files = is_array($files) ? array_values(array_filter($files)) : [];
|
||||
$urls = array_values(array_map(
|
||||
fn ($path) => \Illuminate\Support\Facades\Storage::disk('public')->url($path),
|
||||
$files
|
||||
));
|
||||
@endphp
|
||||
|
||||
@if(count($urls) > 0)
|
||||
<div class="flex flex-col gap-1.5">
|
||||
@foreach($urls as $idx => $url)
|
||||
@php
|
||||
$filename = basename(parse_url($url, PHP_URL_PATH));
|
||||
$ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
||||
$isVideo = in_array($ext, ['mp4', 'mov', 'avi', 'mkv', 'webm']);
|
||||
@endphp
|
||||
<a
|
||||
href="{{ $url }}"
|
||||
target="_blank"
|
||||
download
|
||||
class="flex items-center gap-2 text-sm text-primary-600 hover:text-primary-800 transition-colors"
|
||||
>
|
||||
@if($isVideo)
|
||||
<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.069A1 1 0 0121 8.879V15.12a1 1 0 01-1.447.894L15 14M3 8a2 2 0 012-2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V8z"/>
|
||||
</svg>
|
||||
@else
|
||||
<svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"/>
|
||||
</svg>
|
||||
@endif
|
||||
<span class="truncate max-w-[180px]">{{ $idx + 1 }}. {{ $filename }}</span>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<span class="text-sm text-gray-400">-</span>
|
||||
@endif
|
||||
@@ -0,0 +1 @@
|
||||
@livewire('patient-media-player', ['patientId' => $patientId, 'field' => $field], key('media-' . $patientId . '-' . $field))
|
||||
@@ -0,0 +1,33 @@
|
||||
@php
|
||||
$images = $getState() ?? [];
|
||||
$images = is_array($images) ? array_values(array_filter($images)) : [];
|
||||
$urls = array_values(array_map(
|
||||
fn ($path) => \Illuminate\Support\Facades\Storage::disk('public')->url($path),
|
||||
$images
|
||||
));
|
||||
$group = 'gallery-' . md5(implode(',', $urls));
|
||||
@endphp
|
||||
|
||||
@if(count($urls) > 0)
|
||||
<div class="grid grid-cols-4 gap-2">
|
||||
@foreach($urls as $idx => $url)
|
||||
<div
|
||||
class="relative cursor-pointer rounded-lg overflow-hidden border border-gray-200 hover:border-primary-400 hover:opacity-80 transition-all shadow-sm group"
|
||||
style="aspect-ratio:16/9;"
|
||||
data-lb-group="{{ $group }}"
|
||||
data-lb-idx="{{ $idx }}"
|
||||
data-lb-src="{{ $url }}"
|
||||
>
|
||||
<img
|
||||
src="{{ $url }}"
|
||||
class="w-full h-full object-cover"
|
||||
alt=""
|
||||
loading="lazy"
|
||||
/>
|
||||
<div class="absolute inset-0 bg-black/0 group-hover:bg-black/20 transition duration-200"></div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<span class="text-sm text-gray-400">-</span>
|
||||
@endif
|
||||
@@ -0,0 +1,197 @@
|
||||
<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',
|
||||
],
|
||||
[
|
||||
'title' => __('navigation.lab_tests.title'),
|
||||
'description' => __('navigation.lab_tests.description'),
|
||||
'icon' => 'heroicon-o-beaker',
|
||||
'url' => \App\Filament\Resources\LabTestResource::getUrl('index'),
|
||||
'permission' => 'ViewAny:LabTest',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'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">بیمار‎ ({{ $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,187 @@
|
||||
<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>
|
||||
|
||||
<x-filament::card>
|
||||
<div
|
||||
x-data="{
|
||||
dragging: false,
|
||||
fileName: '',
|
||||
fileSize: '',
|
||||
uploading: false,
|
||||
uploaded: false,
|
||||
uploadProgress: 0,
|
||||
setFile(file) {
|
||||
this.fileName = file.name;
|
||||
this.fileSize = (file.size / 1024 / 1024).toFixed(2) + ' MB';
|
||||
this.uploading = true;
|
||||
this.uploaded = false;
|
||||
this.uploadProgress = 0;
|
||||
$wire.upload(
|
||||
'sqlFile',
|
||||
file,
|
||||
() => { this.uploading = false; this.uploaded = true; this.uploadProgress = 100; },
|
||||
() => { this.uploading = false; this.uploaded = false; this.fileName = ''; this.uploadProgress = 0; },
|
||||
(event) => { if (event && event.detail) this.uploadProgress = event.detail.progress; }
|
||||
);
|
||||
}
|
||||
}"
|
||||
class="space-y-4"
|
||||
>
|
||||
<div class="flex items-center gap-2">
|
||||
<x-heroicon-o-arrow-up-tray class="w-5 h-5 text-amber-500" />
|
||||
<h3 class="font-semibold text-base text-gray-800 dark:text-gray-200">
|
||||
{{ __('navigation.import.label') }}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<p class="text-sm text-gray-500 dark:text-gray-400">
|
||||
{{ __('navigation.import.confirm_description') }}
|
||||
</p>
|
||||
|
||||
{{-- File drop zone --}}
|
||||
<div
|
||||
@dragover.prevent="dragging = true"
|
||||
@dragleave.prevent="dragging = false"
|
||||
@drop.prevent="
|
||||
dragging = false;
|
||||
const file = $event.dataTransfer.files[0];
|
||||
if (file) setFile(file);
|
||||
"
|
||||
class="relative border-2 border-dashed rounded-xl p-6 text-center transition-colors"
|
||||
:class="dragging
|
||||
? 'border-amber-400 bg-amber-50 dark:bg-amber-900/20'
|
||||
: 'border-gray-300 dark:border-gray-600 hover:border-amber-400 dark:hover:border-amber-500'"
|
||||
>
|
||||
<input
|
||||
x-ref="fileInput"
|
||||
type="file"
|
||||
accept=".sql,.txt"
|
||||
class="absolute inset-0 opacity-0 cursor-pointer w-full h-full"
|
||||
x-on:change="
|
||||
const file = $event.target.files[0];
|
||||
if (file) setFile(file);
|
||||
"
|
||||
/>
|
||||
|
||||
{{-- Idle state --}}
|
||||
<div x-show="!fileName" class="space-y-2">
|
||||
<x-heroicon-o-document-arrow-up class="w-10 h-10 text-gray-400 mx-auto" />
|
||||
<p class="text-sm font-medium text-gray-600 dark:text-gray-300">
|
||||
{{ __('navigation.import.drop_or_click') }}
|
||||
</p>
|
||||
<p class="text-xs text-gray-400">{{ __('navigation.import.file_hint') }}</p>
|
||||
</div>
|
||||
|
||||
{{-- File selected state --}}
|
||||
<div x-show="fileName" class="space-y-1">
|
||||
<x-heroicon-o-document-check class="w-10 h-10 text-amber-500 mx-auto" />
|
||||
<p class="text-sm font-semibold text-gray-700 dark:text-gray-200" x-text="fileName"></p>
|
||||
<p class="text-xs text-gray-400" x-text="fileSize"></p>
|
||||
<p class="text-xs" :class="uploading ? 'text-blue-500' : 'text-amber-600 dark:text-amber-400'">
|
||||
<span x-show="uploading">{{ __('navigation.import.uploading') }}</span>
|
||||
<span x-show="!uploading && uploaded">{{ __('navigation.import.file_ready') }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@error('sqlFile')
|
||||
<p class="text-sm text-red-600 dark:text-red-400">{{ $message }}</p>
|
||||
@enderror
|
||||
|
||||
{{-- Upload progress bar --}}
|
||||
<div x-show="uploading" class="space-y-1">
|
||||
<div class="w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2">
|
||||
<div
|
||||
class="bg-amber-500 h-2 rounded-full transition-all"
|
||||
:style="'width: ' + uploadProgress + '%'"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Submit button --}}
|
||||
<div class="flex justify-end">
|
||||
<x-filament::button
|
||||
wire:click="startImport"
|
||||
wire:loading.attr="disabled"
|
||||
wire:target="startImport"
|
||||
color="warning"
|
||||
icon="heroicon-o-arrow-up-tray"
|
||||
:disabled="$this->importing"
|
||||
x-bind:disabled="!uploaded || uploading"
|
||||
>
|
||||
<span wire:loading.remove wire:target="startImport">
|
||||
{{ __('navigation.import.confirm_button') }}
|
||||
</span>
|
||||
<span wire:loading wire:target="startImport">
|
||||
{{ __('navigation.import.processing') }}
|
||||
</span>
|
||||
</x-filament::button>
|
||||
</div>
|
||||
</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
|
||||
|
||||
@if($importReport)
|
||||
<x-filament::card>
|
||||
<h3 class="font-semibold text-base mb-2">{{ __('navigation.import.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">{{ $importReport }}</pre>
|
||||
</x-filament::card>
|
||||
@endif
|
||||
|
||||
</x-filament-panels::page>
|
||||
@@ -0,0 +1,116 @@
|
||||
@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="fi-lb-gallery" style="display:flex;flex-wrap:wrap;gap:6px;">
|
||||
@foreach($photosBefore as $i => $url)
|
||||
<div class="relative rounded-lg overflow-hidden bg-gray-800 cursor-pointer group" style="width:80px;height:45px;flex-shrink:0;"
|
||||
data-lb-group="modal-before-{{ $record->id }}"
|
||||
data-lb-idx="{{ $i }}"
|
||||
data-lb-src="{{ $url }}">
|
||||
<img src="{{ $url }}" class="w-full h-full object-cover transition group-hover:scale-105 duration-200" loading="lazy" />
|
||||
<div class="absolute inset-0 bg-black/0 group-hover:bg-black/25 transition duration-200"></div>
|
||||
</div>
|
||||
@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="fi-lb-gallery" style="display:flex;flex-wrap:wrap;gap:6px;">
|
||||
@foreach($photosAfter as $i => $url)
|
||||
<div class="relative rounded-lg overflow-hidden bg-gray-800 cursor-pointer group" style="width:80px;height:45px;flex-shrink:0;"
|
||||
data-lb-group="modal-after-{{ $record->id }}"
|
||||
data-lb-idx="{{ $i }}"
|
||||
data-lb-src="{{ $url }}">
|
||||
<img src="{{ $url }}" class="w-full h-full object-cover transition group-hover:scale-105 duration-200" loading="lazy" />
|
||||
<div class="absolute inset-0 bg-black/0 group-hover:bg-black/25 transition duration-200"></div>
|
||||
</div>
|
||||
@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">
|
||||
<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 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,7 @@
|
||||
<div style="width:100%;height:80vh;overflow:hidden;border-radius:8px;">
|
||||
<iframe
|
||||
src="{{ $url }}"
|
||||
style="width:100%;height:100%;border:none;display:block;"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
@livewire('expandable-text', ['html' => $html], key($key))
|
||||
@@ -0,0 +1,9 @@
|
||||
<div>
|
||||
<div class="prose prose-sm max-w-none overflow-hidden transition-all duration-300"
|
||||
style="{{ $expanded ? '' : 'max-height: 8rem;' }}">
|
||||
{!! $html !!}
|
||||
</div>
|
||||
<button type="button" wire:click="toggle" class="text-primary-600 text-xs font-semibold hover:underline mt-1">
|
||||
{{ $expanded ? 'کمتر' : 'بیشتر' }}
|
||||
</button>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
{{ $this->form }}
|
||||
</div>
|
||||
@@ -0,0 +1,243 @@
|
||||
<div
|
||||
class="flex items-center gap-1"
|
||||
x-init="if (['/admin', '/admin/'].includes(window.location.pathname)) $wire.checkPeerStatus()"
|
||||
>
|
||||
|
||||
@can('View:SyncPage')
|
||||
@if($peerChecked)
|
||||
<span class="text-xs font-medium px-1 whitespace-nowrap"
|
||||
style="{{ $peerConnected ? 'color: #15803d' : 'color: #dc2626' }}"
|
||||
x-bind:style="{{ json_encode($peerConnected) }} ? ($store.theme === 'dark' ? 'color: #4ade80' : 'color: #15803d') : ($store.theme === 'dark' ? 'color: #f87171' : 'color: #dc2626')"
|
||||
@if($peerPath) title="{{ $peerPath }}" @endif>
|
||||
{{ $peerConnected ? __('navigation.sync.peer_connected') : __('navigation.sync.peer_disconnected') }}
|
||||
</span>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
<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;
|
||||
$wire.checkPeerStatus();
|
||||
},
|
||||
|
||||
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,255 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="rtl" lang="fa">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>آزمایش - {{ $patient->full_name }}</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
|
||||
body {
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
direction: rtl;
|
||||
background: #e0e0e0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.print-toolbar {
|
||||
background: #1f2937;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.print-toolbar span {
|
||||
font-size: 14px;
|
||||
color: #9ca3af;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.toolbar-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 7px 16px;
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn-print { background: #2563eb; color: #fff; }
|
||||
.btn-active { background: #16a34a; color: #fff; cursor: default; }
|
||||
.btn-back { background: #374151; color: #d1d5db; }
|
||||
|
||||
.toolbar-divider { flex: 1; }
|
||||
|
||||
.print-info-tooltip { position:relative;display:inline-flex;align-items:center; }
|
||||
.print-info-tooltip .tip-icon { display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:#374151;border-radius:8px;cursor:pointer;color:#9ca3af;border:none;transition:background 0.15s,color 0.15s; }
|
||||
.print-info-tooltip .tip-icon:hover { background:#4b5563;color:#fff; }
|
||||
.print-info-tooltip .tip-box { display:none;position:absolute;top:calc(100% + 10px);left:50%;transform:translateX(-50%);background:#111827;border:1px solid #374151;border-radius:10px;padding:14px 18px;min-width:250px;box-shadow:0 4px 24px rgba(0,0,0,0.5);z-index:200;direction:rtl; }
|
||||
.print-info-tooltip .tip-box.open { display:block; }
|
||||
.print-info-tooltip .tip-box::after { content:'';position:absolute;bottom:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-bottom-color:#374151; }
|
||||
.print-info-tooltip .tip-box h4 { margin:0 0 10px;font-size:12px;color:#9ca3af;border-bottom:1px solid #374151;padding-bottom:8px;font-weight:normal; }
|
||||
.print-info-tooltip .tip-box ul { list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px; }
|
||||
.print-info-tooltip .tip-box ul li { font-size:12px;color:#e5e7eb; }
|
||||
|
||||
.page-body {
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: calc(100vh - 52px);
|
||||
}
|
||||
|
||||
.prescription-container {
|
||||
width: 210mm;
|
||||
height: 148mm;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
box-shadow: 0 4px 20px rgba(0,0,0,0.2);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.prescription-bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.content-overlay {
|
||||
position: absolute;
|
||||
top: 0; left: 0;
|
||||
width: 100%; height: 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.patient-name {
|
||||
position: absolute;
|
||||
top: 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 {
|
||||
@page {
|
||||
size: A5 landscape;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* {
|
||||
-webkit-print-color-adjust: exact !important;
|
||||
print-color-adjust: exact !important;
|
||||
color-adjust: exact !important;
|
||||
}
|
||||
|
||||
.print-toolbar { display: none !important; }
|
||||
|
||||
html, body {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
overflow: hidden !important;
|
||||
background: white !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.page-body {
|
||||
display: block !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
min-height: unset !important;
|
||||
}
|
||||
|
||||
.prescription-container {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
position: relative !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
box-shadow: none !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.prescription-bg {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
object-fit: fill !important;
|
||||
display: block !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>
|
||||
<div class="print-info-tooltip">
|
||||
<button class="tip-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:16px;height:16px;"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
|
||||
</button>
|
||||
<div class="tip-box">
|
||||
<h4>تنظیمات پرینت</h4>
|
||||
<ul>
|
||||
<li>✅ Paper size: A5</li>
|
||||
<li>✅ Orientation: Landscape (افقی)</li>
|
||||
<li>✅ Margins: None (بدون حاشیه)</li>
|
||||
<li>✅ Scale: 100%</li>
|
||||
<li>✅ Background graphics: ON (فعال)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<a class="toolbar-btn btn-back"
|
||||
href="{{ 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>
|
||||
document.querySelector('.print-info-tooltip .tip-icon').addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
document.querySelector('.print-info-tooltip .tip-box').classList.toggle('open');
|
||||
});
|
||||
document.addEventListener('click', function() {
|
||||
document.querySelector('.print-info-tooltip .tip-box').classList.remove('open');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,304 @@
|
||||
<!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-both { background: #7c3aed; color: #fff; }
|
||||
.btn-back { background: #374151; color: #d1d5db; }
|
||||
|
||||
.toolbar-divider { flex: 1; }
|
||||
|
||||
.print-info-tooltip { position:relative;display:inline-flex;align-items:center; }
|
||||
.print-info-tooltip .tip-icon { display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:#374151;border-radius:8px;cursor:pointer;color:#9ca3af;border:none;transition:background 0.15s,color 0.15s; }
|
||||
.print-info-tooltip .tip-icon:hover { background:#4b5563;color:#fff; }
|
||||
.print-info-tooltip .tip-box { display:none;position:absolute;top:calc(100% + 10px);left:50%;transform:translateX(-50%);background:#111827;border:1px solid #374151;border-radius:10px;padding:14px 18px;min-width:250px;box-shadow:0 4px 24px rgba(0,0,0,0.5);z-index:200;direction:rtl; }
|
||||
.print-info-tooltip .tip-box.open { display:block; }
|
||||
.print-info-tooltip .tip-box::after { content:'';position:absolute;bottom:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-bottom-color:#374151; }
|
||||
.print-info-tooltip .tip-box h4 { margin:0 0 10px;font-size:12px;color:#9ca3af;border-bottom:1px solid #374151;padding-bottom:8px;font-weight:normal; }
|
||||
.print-info-tooltip .tip-box ul { list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px; }
|
||||
.print-info-tooltip .tip-box ul li { font-size:12px;color:#e5e7eb; }
|
||||
|
||||
.page-body {
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: calc(100vh - 52px);
|
||||
}
|
||||
|
||||
.prescription-container {
|
||||
width: 210mm;
|
||||
height: 148mm;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.prescription-bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.content-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.patient-name {
|
||||
position: absolute;
|
||||
top: 39%;
|
||||
right: 82%;
|
||||
font-size: 12pt;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
direction: rtl;
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.patient-name.long-name { font-size: 9pt; }
|
||||
.patient-name.very-long-name { font-size: 7pt; }
|
||||
|
||||
.patient-date {
|
||||
position: absolute;
|
||||
top: 45.5%;
|
||||
left: 5%;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.surgery-text {
|
||||
position: absolute;
|
||||
top: 37.9%;
|
||||
right: 15%;
|
||||
font-size: 12pt;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
direction: rtl;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.surgery-text.long-name { font-size: 9pt; }
|
||||
.surgery-text.very-long-name { font-size: 7pt; }
|
||||
|
||||
.surgery-date-center {
|
||||
position: absolute;
|
||||
top: 45%;
|
||||
right: 19%;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
@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>
|
||||
<a class="toolbar-btn btn-both"
|
||||
href="{{ route('prescription.print', ['prescription' => $prescription, 'type' => 'both']) }}">
|
||||
نسخه + آزمایش
|
||||
</a>
|
||||
|
||||
<div class="toolbar-divider"></div>
|
||||
|
||||
<button class="toolbar-btn btn-print" onclick="window.print()">🖨 پرینت</button>
|
||||
<div class="print-info-tooltip">
|
||||
<button class="tip-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:16px;height:16px;"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
|
||||
</button>
|
||||
<div class="tip-box">
|
||||
<h4>تنظیمات پرینت</h4>
|
||||
<ul>
|
||||
<li>✅ Paper size: A5</li>
|
||||
<li>✅ Orientation: Landscape (افقی)</li>
|
||||
<li>✅ Margins: None (بدون حاشیه)</li>
|
||||
<li>✅ Scale: 100%</li>
|
||||
<li>✅ Background graphics: ON (فعال)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<a class="toolbar-btn btn-back"
|
||||
href="{{ route('filament.admin.resources.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);
|
||||
|
||||
@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>
|
||||
@if($centerName)
|
||||
<div class="surgery-center">{{ $centerName }}</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.querySelector('.print-info-tooltip .tip-icon').addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
document.querySelector('.print-info-tooltip .tip-box').classList.toggle('open');
|
||||
});
|
||||
document.addEventListener('click', function() {
|
||||
document.querySelector('.print-info-tooltip .tip-box').classList.remove('open');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,611 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="rtl" lang="fa">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>
|
||||
@if($type === 'both') نسخه و آزمایش
|
||||
@elseif($type === 'lab') آزمایش
|
||||
@else نسخه
|
||||
@endif - {{ $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; }
|
||||
.btn-both { background: #7c3aed; color: #fff; }
|
||||
.btn-edit { background: #0f766e; color: #fff; }
|
||||
|
||||
.toolbar-divider { flex: 1; }
|
||||
|
||||
.print-info-tooltip { position:relative;display:inline-flex;align-items:center; }
|
||||
.print-info-tooltip .tip-icon { display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:#374151;border-radius:8px;cursor:pointer;color:#9ca3af;border:none;transition:background 0.15s,color 0.15s; }
|
||||
.print-info-tooltip .tip-icon:hover { background:#4b5563;color:#fff; }
|
||||
.print-info-tooltip .tip-box { display:none;position:absolute;top:calc(100% + 10px);left:50%;transform:translateX(-50%);background:#111827;border:1px solid #374151;border-radius:10px;padding:14px 18px;min-width:250px;box-shadow:0 4px 24px rgba(0,0,0,0.5);z-index:200;direction:rtl; }
|
||||
.print-info-tooltip .tip-box.open { display:block; }
|
||||
.print-info-tooltip .tip-box::after { content:'';position:absolute;bottom:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-bottom-color:#374151; }
|
||||
.print-info-tooltip .tip-box h4 { margin:0 0 10px;font-size:12px;color:#9ca3af;border-bottom:1px solid #374151;padding-bottom:8px;font-weight:normal; }
|
||||
.print-info-tooltip .tip-box ul { list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px; }
|
||||
.print-info-tooltip .tip-box ul li { font-size:12px;color:#e5e7eb; }
|
||||
|
||||
.edit-modal-overlay {
|
||||
display: none;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0,0,0,0.7);
|
||||
z-index: 9999;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.edit-modal-overlay.open { display: flex; }
|
||||
.edit-modal {
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
width: 92vw;
|
||||
max-width: 1000px;
|
||||
height: 90vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 25px 60px rgba(0,0,0,0.5);
|
||||
}
|
||||
.edit-modal-header {
|
||||
background: #1f2937;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
direction: rtl;
|
||||
flex-shrink: 0;
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.edit-modal-close {
|
||||
background: #374151;
|
||||
border: none;
|
||||
color: #d1d5db;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.edit-modal-close:hover { background: #ef4444; color: #fff; }
|
||||
.edit-modal iframe { flex: 1; border: none; width: 100%; }
|
||||
@media print { .edit-modal-overlay { display: none !important; } }
|
||||
|
||||
.page-body {
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: calc(100vh - 52px);
|
||||
}
|
||||
|
||||
.page-body-both {
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.print-section {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.section-toolbar {
|
||||
background: #374151;
|
||||
color: #fff;
|
||||
padding: 8px 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-radius: 6px 6px 0 0;
|
||||
font-size: 13px;
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.section-label {
|
||||
font-weight: bold;
|
||||
color: #e5e7eb;
|
||||
}
|
||||
|
||||
.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 {
|
||||
@page {
|
||||
size: A5 landscape;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* {
|
||||
-webkit-print-color-adjust: exact !important;
|
||||
print-color-adjust: exact !important;
|
||||
color-adjust: exact !important;
|
||||
}
|
||||
|
||||
.print-toolbar { display: none !important; }
|
||||
.section-toolbar { display: none !important; }
|
||||
|
||||
html, body {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
overflow: hidden !important;
|
||||
background: white !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.page-body {
|
||||
display: block !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
min-height: unset !important;
|
||||
}
|
||||
|
||||
.page-body-both {
|
||||
display: block !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
gap: 0 !important;
|
||||
}
|
||||
|
||||
.print-section {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
overflow: hidden !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.prescription-container {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
position: relative !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
box-shadow: none !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.prescription-bg {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
object-fit: fill !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.content-overlay {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
}
|
||||
|
||||
body.printing-prescription .section-lab { display: none !important; }
|
||||
body.printing-lab .section-prescription { display: none !important; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="print-toolbar">
|
||||
<span>نوع پرینت:</span>
|
||||
|
||||
@if ($type === 'both')
|
||||
<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>
|
||||
<a class="toolbar-btn btn-lab"
|
||||
href="{{ route('prescription.print', ['prescription' => $prescription, 'type' => 'lab']) }}">
|
||||
آزمایش تنها
|
||||
</a>
|
||||
<span class="toolbar-btn btn-active">✓ نسخه + آزمایش</span>
|
||||
@elseif ($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>
|
||||
<a class="toolbar-btn btn-both"
|
||||
href="{{ route('prescription.print', ['prescription' => $prescription, 'type' => 'both']) }}">
|
||||
نسخه + آزمایش
|
||||
</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>
|
||||
<a class="toolbar-btn btn-both"
|
||||
href="{{ route('prescription.print', ['prescription' => $prescription, 'type' => 'both']) }}">
|
||||
نسخه + آزمایش
|
||||
</a>
|
||||
@endif
|
||||
|
||||
<div class="toolbar-divider"></div>
|
||||
|
||||
@if ($type !== 'both')
|
||||
<button class="toolbar-btn btn-print" onclick="window.print()">🖨 پرینت</button>
|
||||
<button class="toolbar-btn btn-edit" onclick="openEditModal()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:14px;height:14px;flex-shrink:0;"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> ویرایش نسخه</button>
|
||||
@endif
|
||||
|
||||
<div class="print-info-tooltip">
|
||||
<button class="tip-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:16px;height:16px;"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
|
||||
</button>
|
||||
<div class="tip-box">
|
||||
<h4>تنظیمات پرینت</h4>
|
||||
<ul>
|
||||
<li>✅ Paper size: A5</li>
|
||||
<li>✅ Orientation: Landscape (افقی)</li>
|
||||
<li>✅ Margins: None (بدون حاشیه)</li>
|
||||
<li>✅ Scale: 100%</li>
|
||||
<li>✅ Background graphics: ON (فعال)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<a class="toolbar-btn btn-back"
|
||||
href="{{ route('filament.admin.resources.prescriptions.index') }}">
|
||||
← بازگشت به لیست
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="edit-modal-overlay" id="editModalOverlay" onclick="if(event.target===this)closeEditModal()">
|
||||
<div class="edit-modal">
|
||||
<div class="edit-modal-header">
|
||||
<span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:14px;height:14px;flex-shrink:0;"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> ویرایش نسخه — {{ $prescription->patientRecord?->full_name ?? '' }}</span>
|
||||
<button class="edit-modal-close" onclick="closeEditModal()">×</button>
|
||||
</div>
|
||||
<iframe
|
||||
id="editModalFrame"
|
||||
src=""
|
||||
data-src="{{ route('filament.admin.resources.prescriptions.edit', $prescription) }}"
|
||||
></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@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) {}
|
||||
}
|
||||
|
||||
$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
|
||||
|
||||
@if ($type === 'both')
|
||||
<div class="page-body-both">
|
||||
|
||||
{{-- Prescription section --}}
|
||||
<div class="print-section section-prescription">
|
||||
<div class="section-toolbar">
|
||||
<span class="section-label">نسخه دارویی</span>
|
||||
<div style="display:flex;gap:6px;">
|
||||
<button class="toolbar-btn btn-print" onclick="printSection('prescription')" style="font-size:12px;padding:5px 12px;">🖨 پرینت نسخه</button>
|
||||
<button class="toolbar-btn btn-edit" onclick="openEditModal()" style="font-size:12px;padding:5px 12px;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:14px;height:14px;flex-shrink:0;"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> ویرایش نسخه</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prescription-container">
|
||||
<img src="{{ asset('images/prescription_bg.jpg') }}" alt="نسخه" class="prescription-bg">
|
||||
<div class="content-overlay">
|
||||
<div class="{{ $nameClass }}">{{ $patientName }}</div>
|
||||
<div class="patient-date">{{ $dateStr }}</div>
|
||||
<div class="prescription-content">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Lab section --}}
|
||||
<div class="print-section section-lab">
|
||||
<div class="section-toolbar">
|
||||
<span class="section-label">درخواست آزمایش</span>
|
||||
<div style="display:flex;gap:6px;">
|
||||
<button class="toolbar-btn btn-lab" onclick="printSection('lab')" style="font-size:12px;padding:5px 12px;">🖨 پرینت آزمایش</button>
|
||||
<button class="toolbar-btn btn-edit" onclick="openEditModal()" style="font-size:12px;padding:5px 12px;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:14px;height:14px;flex-shrink:0;"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> ویرایش آزمایش</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="prescription-container">
|
||||
<img src="{{ asset('images/prescription_bg.jpg') }}" alt="آزمایش" class="prescription-bg">
|
||||
<div class="content-overlay">
|
||||
<div class="{{ $nameClass }}">{{ $patientName }}</div>
|
||||
<div class="patient-date">{{ $dateStr }}</div>
|
||||
<div class="prescription-content">
|
||||
<table style="width:100%;direction:ltr;font-size:20px;color:#333;table-layout:fixed;">
|
||||
@forelse ($labLines as $line)
|
||||
<tr>
|
||||
<td style="padding:8px 2px 8px 0;width:3%;font-weight:bold;">-</td>
|
||||
<td style="padding:8px 5px;width:97%;">{{ $line }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="2" style="padding:8px 5px;color:#999;font-size:14px;">آزمایشی انتخاب نشده است.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@else
|
||||
<div class="page-body">
|
||||
<div class="prescription-container">
|
||||
<img src="{{ asset('images/prescription_bg.jpg') }}" alt="نسخه" class="prescription-bg">
|
||||
<div class="content-overlay">
|
||||
<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;">
|
||||
@forelse ($labLines as $line)
|
||||
<tr>
|
||||
<td style="padding:8px 2px 8px 0;width:3%;font-weight:bold;">-</td>
|
||||
<td style="padding:8px 5px;width:97%;">{{ $line }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="2" style="padding:8px 5px;color:#999;font-size:14px;">آزمایشی انتخاب نشده است.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</table>
|
||||
@else
|
||||
<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>
|
||||
@endif
|
||||
|
||||
<script>
|
||||
@if ($type === 'both')
|
||||
function printSection(section) {
|
||||
document.body.classList.remove('printing-prescription', 'printing-lab');
|
||||
document.body.classList.add('printing-' + section);
|
||||
window.print();
|
||||
document.body.classList.remove('printing-prescription', 'printing-lab');
|
||||
}
|
||||
@endif
|
||||
|
||||
const overlay = document.getElementById('editModalOverlay');
|
||||
const frame = document.getElementById('editModalFrame');
|
||||
let frameLoaded = false;
|
||||
|
||||
function openEditModal() {
|
||||
if (!frameLoaded) {
|
||||
frame.src = frame.dataset.src;
|
||||
frameLoaded = true;
|
||||
}
|
||||
overlay.classList.add('open');
|
||||
document.body.style.overflow = 'hidden';
|
||||
}
|
||||
|
||||
function closeEditModal() {
|
||||
overlay.classList.remove('open');
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
|
||||
frame.addEventListener('load', function () {
|
||||
if (!frameLoaded) return;
|
||||
try {
|
||||
const url = frame.contentWindow.location.href;
|
||||
if (url.includes('/prescriptions') && !url.includes('/edit')) {
|
||||
closeEditModal();
|
||||
window.location.reload();
|
||||
}
|
||||
} catch (e) {}
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', e => { if (e.key === 'Escape') closeEditModal(); });
|
||||
|
||||
document.querySelector('.print-info-tooltip .tip-icon').addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
document.querySelector('.print-info-tooltip .tip-box').classList.toggle('open');
|
||||
});
|
||||
document.addEventListener('click', function() {
|
||||
document.querySelector('.print-info-tooltip .tip-box').classList.remove('open');
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,292 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="rtl" lang="fa">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>نسخه پذیرش جراحی - {{ $patient->full_name }}</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
direction: rtl;
|
||||
background: #e0e0e0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.print-toolbar {
|
||||
background: #1f2937;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.print-toolbar span {
|
||||
font-size: 14px;
|
||||
color: #9ca3af;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.toolbar-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 7px 16px;
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn-print { background: #2563eb; color: #fff; }
|
||||
.btn-active { background: #16a34a; color: #fff; cursor: default; }
|
||||
.btn-back { background: #374151; color: #d1d5db; }
|
||||
|
||||
.toolbar-divider { flex: 1; }
|
||||
|
||||
.print-info-tooltip { position:relative;display:inline-flex;align-items:center; }
|
||||
.print-info-tooltip .tip-icon { display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:#374151;border-radius:8px;cursor:pointer;color:#9ca3af;border:none;transition:background 0.15s,color 0.15s; }
|
||||
.print-info-tooltip .tip-icon:hover { background:#4b5563;color:#fff; }
|
||||
.print-info-tooltip .tip-box { display:none;position:absolute;top:calc(100% + 10px);left:50%;transform:translateX(-50%);background:#111827;border:1px solid #374151;border-radius:10px;padding:14px 18px;min-width:250px;box-shadow:0 4px 24px rgba(0,0,0,0.5);z-index:200;direction:rtl; }
|
||||
.print-info-tooltip .tip-box.open { display:block; }
|
||||
.print-info-tooltip .tip-box::after { content:'';position:absolute;bottom:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-bottom-color:#374151; }
|
||||
.print-info-tooltip .tip-box h4 { margin:0 0 10px;font-size:12px;color:#9ca3af;border-bottom:1px solid #374151;padding-bottom:8px;font-weight:normal; }
|
||||
.print-info-tooltip .tip-box ul { list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px; }
|
||||
.print-info-tooltip .tip-box ul li { font-size:12px;color:#e5e7eb; }
|
||||
|
||||
.page-body {
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: calc(100vh - 52px);
|
||||
}
|
||||
|
||||
.prescription-container {
|
||||
width: 210mm;
|
||||
height: 148mm;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.prescription-bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.content-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.patient-name {
|
||||
position: absolute;
|
||||
top: 39%;
|
||||
right: 82%;
|
||||
font-size: 12pt;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
direction: rtl;
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.patient-name.long-name { font-size: 9pt; }
|
||||
.patient-name.very-long-name { font-size: 7pt; }
|
||||
|
||||
.patient-date {
|
||||
position: absolute;
|
||||
top: 45.5%;
|
||||
left: 5%;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.surgery-text {
|
||||
position: absolute;
|
||||
top: 37.9%;
|
||||
right: 15%;
|
||||
font-size: 12pt;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
direction: rtl;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.surgery-text.long-name { font-size: 9pt; }
|
||||
.surgery-text.very-long-name { font-size: 7pt; }
|
||||
|
||||
.surgery-type {
|
||||
position: absolute;
|
||||
top: 37.5%;
|
||||
right: 48%;
|
||||
font-size: 13pt;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.surgery-center {
|
||||
position: absolute;
|
||||
top: 23.5%;
|
||||
right: 22%;
|
||||
font-size: 14pt;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.surgery-date-center {
|
||||
position: absolute;
|
||||
top: 45%;
|
||||
right: 19%;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
@media print {
|
||||
.print-toolbar { display: none !important; }
|
||||
.page-body { padding: 0 !important; min-height: unset !important; }
|
||||
|
||||
@page {
|
||||
size: A5 landscape;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
-webkit-print-color-adjust: exact !important;
|
||||
print-color-adjust: exact !important;
|
||||
}
|
||||
|
||||
html, body {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
overflow: hidden !important;
|
||||
background: white !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.prescription-container {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
position: fixed !important;
|
||||
top: 0 !important;
|
||||
left: 0 !important;
|
||||
margin: 0 !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.prescription-bg {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
object-fit: fill !important;
|
||||
display: block !important;
|
||||
-webkit-print-color-adjust: exact !important;
|
||||
print-color-adjust: exact !important;
|
||||
}
|
||||
|
||||
.content-overlay {
|
||||
width: 210mm !important;
|
||||
height: 148mm !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="print-toolbar">
|
||||
<span>نسخه پذیرش جراحی:</span>
|
||||
<span class="toolbar-btn btn-active">{{ $patient->full_name }}</span>
|
||||
|
||||
<div class="toolbar-divider"></div>
|
||||
|
||||
<button class="toolbar-btn btn-print" onclick="window.print()">🖨 پرینت</button>
|
||||
<div class="print-info-tooltip">
|
||||
<button class="tip-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="width:16px;height:16px;"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>
|
||||
</button>
|
||||
<div class="tip-box">
|
||||
<h4>تنظیمات پرینت</h4>
|
||||
<ul>
|
||||
<li>✅ Paper size: A5</li>
|
||||
<li>✅ Orientation: Landscape (افقی)</li>
|
||||
<li>✅ Margins: None (بدون حاشیه)</li>
|
||||
<li>✅ Scale: 100%</li>
|
||||
<li>✅ Background graphics: ON (فعال)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<a class="toolbar-btn btn-back" href="{{ route('filament.admin.resources.patients.index') }}">
|
||||
← بازگشت به لیست
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="page-body">
|
||||
<div class="prescription-container">
|
||||
<img src="{{ asset('images/prescription_admission_bg.jpg') }}" alt="نسخه پذیرش" class="prescription-bg">
|
||||
|
||||
<div class="content-overlay">
|
||||
@php
|
||||
$patientName = $patient->full_name;
|
||||
$nameLength = mb_strlen($patientName, 'UTF-8');
|
||||
$nameClass = 'patient-name';
|
||||
if ($nameLength > 20) {
|
||||
$nameClass .= ' very-long-name';
|
||||
} elseif ($nameLength > 14) {
|
||||
$nameClass .= ' long-name';
|
||||
}
|
||||
|
||||
$surgeryTextClass = 'surgery-text';
|
||||
if ($nameLength > 20) {
|
||||
$surgeryTextClass .= ' very-long-name';
|
||||
} elseif ($nameLength > 14) {
|
||||
$surgeryTextClass .= ' long-name';
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class="{{ $nameClass }}">{{ $patientName }}</div>
|
||||
<div class="patient-date">{{ $surgeryDate }}</div>
|
||||
<div class="{{ $surgeryTextClass }}">{{ $patientName }}</div>
|
||||
<div class="surgery-type">سپتورینوپلاستی</div>
|
||||
<div class="surgery-date-center">{{ $surgeryDate }}</div>
|
||||
<div class="surgery-center">{{ $centerName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.querySelector('.print-info-tooltip .tip-icon').addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
document.querySelector('.print-info-tooltip .tip-box').classList.toggle('open');
|
||||
});
|
||||
document.addEventListener('click', function() {
|
||||
document.querySelector('.print-info-tooltip .tip-box').classList.remove('open');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user