183 lines
14 KiB
PHP
183 lines
14 KiB
PHP
<?php $__env->startSection('content'); ?>
|
|
<div class="space-y-6">
|
|
<!-- Page Header -->
|
|
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
|
<h1 class="text-2xl font-bold text-gray-900"><?php echo e(__('letters.letters')); ?></h1>
|
|
<div class="flex gap-2 flex-wrap">
|
|
<a href="<?php echo e(route('letters.create', ['type' => 'incoming'])); ?>"
|
|
class="inline-flex items-center gap-2 px-4 py-2 bg-emerald-600 text-white text-sm font-medium rounded-lg hover:bg-emerald-700 transition-colors">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
|
|
<?php echo e(__('letters.new_incoming')); ?>
|
|
|
|
</a>
|
|
<a href="<?php echo e(route('letters.create', ['type' => 'outgoing'])); ?>"
|
|
class="inline-flex items-center gap-2 px-4 py-2 bg-sky-600 text-white text-sm font-medium rounded-lg hover:bg-sky-700 transition-colors">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
|
|
<?php echo e(__('letters.new_outgoing')); ?>
|
|
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Filters -->
|
|
<div class="bg-white rounded-xl border border-gray-200 p-4">
|
|
<form method="GET" action="<?php echo e(route('letters.index')); ?>" class="flex flex-wrap gap-3 items-end">
|
|
<div class="w-52">
|
|
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('common.search')); ?></label>
|
|
<input type="text" name="search" value="<?php echo e(request('search')); ?>"
|
|
placeholder="<?php echo e(__('letters.subject')); ?> / <?php echo e(__('letters.reference_number')); ?>"
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500">
|
|
</div>
|
|
<div class="w-36">
|
|
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('letters.type')); ?></label>
|
|
<select name="type" class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500">
|
|
<option value=""><?php echo e(__('common.all')); ?></option>
|
|
<?php $__currentLoopData = $types; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $t): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($t); ?>" <?php echo e(request('type') === $t ? 'selected' : ''); ?>><?php echo e(__('letters.type_' . $t)); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
<div class="w-36">
|
|
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('common.status')); ?></label>
|
|
<select name="status" class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500">
|
|
<option value=""><?php echo e(__('common.all')); ?></option>
|
|
<?php $__currentLoopData = $statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($s); ?>" <?php echo e(request('status') === $s ? 'selected' : ''); ?>><?php echo e(__('letters.status_' . $s)); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
<div class="w-44">
|
|
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('letters.project')); ?></label>
|
|
<select name="project_id" class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500">
|
|
<option value=""><?php echo e(__('common.all')); ?></option>
|
|
<?php $__currentLoopData = $projects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($project->id); ?>" <?php echo e(request('project_id') == $project->id ? 'selected' : ''); ?>><?php echo e($project->name); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
<div class="w-36">
|
|
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('letters.from_date')); ?></label>
|
|
<?php if (isset($component)) { $__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1 = $component; } ?>
|
|
<?php if (isset($attributes)) { $__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1 = $attributes; } ?>
|
|
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.date-input','data' => ['name' => 'from_date','value' => request('from_date')]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
|
|
<?php $component->withName('date-input'); ?>
|
|
<?php if ($component->shouldRender()): ?>
|
|
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
|
|
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
|
|
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
|
|
<?php endif; ?>
|
|
<?php $component->withAttributes(['name' => 'from_date','value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(request('from_date'))]); ?>
|
|
<?php echo $__env->renderComponent(); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1)): ?>
|
|
<?php $attributes = $__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1; ?>
|
|
<?php unset($__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1)): ?>
|
|
<?php $component = $__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1; ?>
|
|
<?php unset($__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
<div class="w-36">
|
|
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('letters.to_date')); ?></label>
|
|
<?php if (isset($component)) { $__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1 = $component; } ?>
|
|
<?php if (isset($attributes)) { $__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1 = $attributes; } ?>
|
|
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.date-input','data' => ['name' => 'to_date','value' => request('to_date')]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
|
|
<?php $component->withName('date-input'); ?>
|
|
<?php if ($component->shouldRender()): ?>
|
|
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
|
|
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
|
|
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
|
|
<?php endif; ?>
|
|
<?php $component->withAttributes(['name' => 'to_date','value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(request('to_date'))]); ?>
|
|
<?php echo $__env->renderComponent(); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1)): ?>
|
|
<?php $attributes = $__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1; ?>
|
|
<?php unset($__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1)): ?>
|
|
<?php $component = $__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1; ?>
|
|
<?php unset($__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
<button type="submit" class="px-4 py-2 bg-gray-100 text-gray-700 text-sm font-medium rounded-lg hover:bg-gray-200 transition-colors">
|
|
<?php echo e(__('common.filter')); ?>
|
|
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Letters List -->
|
|
<div class="bg-white rounded-xl border border-gray-200 overflow-hidden">
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full">
|
|
<thead class="bg-gray-50 border-b border-gray-200">
|
|
<tr>
|
|
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('letters.type')); ?></th>
|
|
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('letters.reference_number')); ?></th>
|
|
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('letters.subject')); ?></th>
|
|
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('letters.sender')); ?></th>
|
|
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('letters.recipient')); ?></th>
|
|
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('common.status')); ?></th>
|
|
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('letters.letter_date')); ?></th>
|
|
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
<?php $__empty_1 = true; $__currentLoopData = $letters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $letter): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
|
<tr class="hover:bg-gray-50 transition-colors">
|
|
<td class="px-5 py-3">
|
|
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium
|
|
<?php echo e($letter->type === 'incoming' ? 'bg-emerald-50 text-emerald-700' : 'bg-sky-50 text-sky-700'); ?>">
|
|
<?php echo e(__('letters.type_' . $letter->type)); ?>
|
|
|
|
</span>
|
|
</td>
|
|
<td class="px-5 py-3 text-sm text-gray-600 font-mono"><?php echo e($letter->reference_number ?? '-'); ?></td>
|
|
<td class="px-5 py-3 text-sm font-medium text-gray-900 max-w-xs truncate"><?php echo e($letter->subject); ?></td>
|
|
<td class="px-5 py-3 text-sm text-gray-600 max-w-[120px] truncate"><?php echo e($letter->sender); ?></td>
|
|
<td class="px-5 py-3 text-sm text-gray-600 max-w-[120px] truncate"><?php echo e($letter->recipient); ?></td>
|
|
<td class="px-5 py-3">
|
|
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium
|
|
<?php echo e($letter->status === 'draft' ? 'bg-gray-100 text-gray-600' :
|
|
($letter->status === 'sent' ? 'bg-sky-50 text-sky-700' :
|
|
($letter->status === 'received' ? 'bg-emerald-50 text-emerald-700' :
|
|
'bg-amber-50 text-amber-700'))); ?>">
|
|
<?php echo e(__('letters.status_' . $letter->status)); ?>
|
|
|
|
</span>
|
|
</td>
|
|
<td class="px-5 py-3 text-sm text-gray-400"><?php echo e($letter->letter_date ? calendar_date($letter->letter_date) : '-'); ?></td>
|
|
<td class="px-5 py-3">
|
|
<div class="flex items-center gap-1">
|
|
<?php if($letter->attachments->count() > 0): ?>
|
|
<span class="p-1 text-gray-400" title="<?php echo e($letter->attachments->count()); ?> پیوست">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"/></svg>
|
|
</span>
|
|
<?php endif; ?>
|
|
<a href="<?php echo e(route('letters.show', $letter)); ?>" class="p-1.5 text-gray-400 hover:text-teal-600 hover:bg-teal-50 rounded-lg transition-colors" title="<?php echo e(__('letters.view_letter')); ?>">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/></svg>
|
|
</a>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
|
<tr>
|
|
<td colspan="8" class="text-center py-12 text-gray-500"><?php echo e(__('letters.no_letters')); ?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
<div class="flex justify-center">
|
|
<?php echo e($letters->withQueryString()->links()); ?>
|
|
|
|
</div>
|
|
</div>
|
|
<?php $__env->stopSection(); ?>
|
|
|
|
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\projectra\resources\views/letters/index.blade.php ENDPATH**/ ?>
|