vernova/storage/framework/views/e3358e6b2ca544b1228f9c327b88a6e0.php
2026-07-26 19:58:27 +03:30

125 lines
9.8 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.items')); ?></h1>
<a href="<?php echo e(route('inventory.items.create')); ?>"
class="inline-flex items-center gap-2 px-4 py-2 bg-teal-600 text-white text-sm font-medium rounded-lg hover:bg-teal-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_item') ?? 'افزودن قلم'); ?>
</a>
</div>
<!-- Filters -->
<div class="bg-white rounded-xl border border-gray-200 p-4">
<form method="GET" action="<?php echo e(route('inventory.items')); ?>" 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(__('inventory.item_name')); ?> / <?php echo e(__('inventory.item_code')); ?>"
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-40">
<label class="block text-xs font-medium text-gray-500 mb-1"><?php echo e(__('inventory.category')); ?></label>
<select name="category" 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 = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($cat); ?>" <?php echo e(request('category') === $cat ? 'selected' : ''); ?>><?php echo e($cat); ?></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>
<!-- Items 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.item_code')); ?></th>
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('inventory.item_name')); ?></th>
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('inventory.category')); ?></th>
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('inventory.unit')); ?></th>
<th class="px-5 py-3 text-start text-xs font-medium text-gray-500"><?php echo e(__('inventory.current_stock')); ?></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 = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr class="hover:bg-gray-50 transition-colors">
<td class="px-5 py-3 text-sm text-gray-600 font-mono"><?php echo e($item->code ?? '-'); ?></td>
<td class="px-5 py-3 text-sm font-medium text-gray-900"><?php echo e($item->name); ?></td>
<td class="px-5 py-3 text-sm text-gray-600"><?php echo e($item->category ?? '-'); ?></td>
<td class="px-5 py-3 text-sm text-gray-600"><?php echo e($item->unit ?? '-'); ?></td>
<td class="px-5 py-3">
<?php
$stock = $item->current_stock ?? 0;
$minStock = $item->min_stock ?? 0;
?>
<span class="text-sm font-medium <?php echo e($stock <= 0 ? 'text-red-600' : ($stock <= $minStock ? 'text-amber-600' : 'text-emerald-600')); ?>">
<?php echo e(persian_num(number_format($stock, 2))); ?>
</span>
<?php if($stock <= $minStock && $stock > 0): ?>
<svg class="w-3.5 h-3.5 inline text-amber-500 ms-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"/></svg>
<?php elseif($stock <= 0): ?>
<svg class="w-3.5 h-3.5 inline text-red-500 ms-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"/></svg>
<?php endif; ?>
</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($item->is_active ? 'bg-emerald-50 text-emerald-700' : 'bg-gray-100 text-gray-500'); ?>">
<?php echo e($item->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.items.edit', $item)); ?>" class="p-1.5 text-gray-400 hover:text-teal-600 hover:bg-teal-50 rounded-lg transition-colors" title="<?php echo e(__('inventory.edit_item')); ?>">
<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($item->inventoryTransactions()->count() === 0): ?>
<form method="POST" action="<?php echo e(route('inventory.items.destroy', $item)); ?>" 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="7" class="text-center py-12 text-gray-500"><?php echo e(__('inventory.no_items')); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<!-- Pagination -->
<div class="flex justify-center">
<?php echo e($items->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/items.blade.php ENDPATH**/ ?>