103 lines
8.0 KiB
PHP
103 lines
8.0 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(__('inventory.warehouses')); ?></h1>
|
|
<a href="<?php echo e(route('inventory.warehouses.create')); ?>"
|
|
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(__('inventory.create_warehouse') ?? 'افزودن انبار'); ?>
|
|
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Filters -->
|
|
<div class="bg-white rounded-xl border border-gray-200 p-4">
|
|
<form method="GET" action="<?php echo e(route('inventory.warehouses')); ?>" 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(__('inventory.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-32">
|
|
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('common.status')); ?></label>
|
|
<select name="is_active" 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>
|
|
<option value="1" <?php echo e(request('is_active') === '1' ? 'selected' : ''); ?>><?php echo e(__('inventory.active')); ?></option>
|
|
<option value="0" <?php echo e(request('is_active') === '0' ? 'selected' : ''); ?>><?php echo e(__('inventory.inactive')); ?></option>
|
|
</select>
|
|
</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>
|
|
|
|
<!-- Warehouses 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(__('inventory.warehouse_name')); ?></th>
|
|
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('inventory.location')); ?></th>
|
|
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('inventory.project')); ?></th>
|
|
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('inventory.items_count') ?? 'تعداد اقلام'); ?></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"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
<?php $__empty_1 = true; $__currentLoopData = $warehouses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $warehouse): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
|
<tr class="hover:bg-gray-50 transition-colors">
|
|
<td class="px-5 py-3 text-sm font-medium text-gray-900"><?php echo e($warehouse->name); ?></td>
|
|
<td class="px-5 py-3 text-sm text-gray-600"><?php echo e($warehouse->location ?? '-'); ?></td>
|
|
<td class="px-5 py-3 text-sm text-gray-600"><?php echo e($warehouse->project?->name ?? '-'); ?></td>
|
|
<td class="px-5 py-3 text-sm text-gray-600"><?php echo e(persian_num($warehouse->inventoryTransactions()->distinct('item_id')->count('item_id'))); ?></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($warehouse->is_active ? 'bg-emerald-50 text-emerald-700' : 'bg-gray-100 text-gray-500'); ?>">
|
|
<?php echo e($warehouse->is_active ? __('inventory.active') : __('inventory.inactive')); ?>
|
|
|
|
</span>
|
|
</td>
|
|
<td class="px-5 py-3">
|
|
<div class="flex items-center gap-1">
|
|
<a href="<?php echo e(route('inventory.warehouses.edit', $warehouse)); ?>" class="p-1.5 text-gray-400 hover:text-sky-600 hover:bg-sky-50 rounded-lg transition-colors" title="<?php echo e(__('inventory.edit_warehouse')); ?>">
|
|
<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="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/></svg>
|
|
</a>
|
|
<?php if($warehouse->inventoryTransactions()->count() === 0): ?>
|
|
<form method="POST" action="<?php echo e(route('inventory.warehouses.destroy', $warehouse)); ?>" onsubmit="return confirm('<?php echo e(__('common.confirm_delete') ?? 'آیا مطمئن هستید؟'); ?>')">
|
|
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
|
|
<button type="submit" class="p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors" title="<?php echo e(__('common.delete')); ?>">
|
|
<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="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/></svg>
|
|
</button>
|
|
</form>
|
|
<?php endif; ?>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
|
<tr>
|
|
<td colspan="6" class="text-center py-12 text-gray-500"><?php echo e(__('inventory.no_warehouses')); ?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
<div class="flex justify-center">
|
|
<?php echo e($warehouses->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/inventory/warehouses.blade.php ENDPATH**/ ?>
|