👁 查看:3c6e982d63d90df852733b931fbee97a143aed27.php
路径:/home/boguraj1/.trash/storage/framework/views/3c6e982d63d90df852733b931fbee97a143aed27.php
大小:5.83 KB · 修改:2026-07-24 16:31:31 · 权限:0644 · 可写
<?php $__env->startSection('title', 'Products'); ?>
<?php $__env->startSection('content'); ?>
<div class="d-flex justify-content-between align-items-center mb-4">
<h5 class="fw-bold mb-0">All Products</h5>
<a href="<?php echo e(route('admin.products.create')); ?>" class="btn btn-danger"><i class="bi bi-plus-lg me-1"></i>Add Product</a>
</div>
<div class="card mb-3">
<div class="card-body py-2 px-4">
<form class="row g-2 align-items-center" method="GET" action="<?php echo e(route('admin.products.index')); ?>">
<div class="col-sm-5">
<input type="text" name="search" class="form-control form-control-sm" placeholder="Search by name..." value="<?php echo e(request('search')); ?>">
</div>
<div class="col-sm-4">
<select name="category" class="form-select form-select-sm">
<option value="">All Categories</option>
<?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<option value="<?php echo e($cat->id); ?>" <?php echo e(request('category') == $cat->id ? 'selected' : ''); ?>><?php echo e($cat->name); ?></option>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</select>
</div>
<div class="col-sm-3 d-flex gap-2">
<button type="submit" class="btn btn-sm btn-danger">Filter</button>
<a href="<?php echo e(route('admin.products.index')); ?>" class="btn btn-sm btn-outline-secondary">Reset</a>
</div>
</form>
</div>
</div>
<div class="card">
<div class="card-body p-0">
<div class="table-responsive">
<table class="table mb-0">
<thead>
<tr>
<th class="px-4">Image</th>
<th>Name</th>
<th>Category</th>
<th>Price</th>
<th>Stock</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php $__empty_1 = true; $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr>
<td class="px-4">
<img src="<?php echo e($product->thumbnail_url); ?>" style="width:48px;height:48px;object-fit:cover;border-radius:8px" alt="">
</td>
<td>
<div class="fw-semibold"><?php echo e(Str::limit($product->name, 40)); ?></div>
<small class="text-muted"><?php echo e($product->sku); ?></small>
</td>
<td class="text-muted" style="font-size:13px"><?php echo e($product->category->name ?? '—'); ?></td>
<td>
<div class="fw-semibold" style="color:var(--primary)">৳<?php echo e(number_format($product->current_price, 0)); ?></div>
<?php if($product->is_on_sale): ?>
<small class="text-muted" style="text-decoration:line-through">৳<?php echo e(number_format($product->regular_price, 0)); ?></small>
<?php endif; ?>
</td>
<td>
<span class="badge bg-<?php echo e($product->stock > 0 ? 'success' : 'danger'); ?>"><?php echo e($product->stock); ?></span>
</td>
<td>
<span class="badge bg-<?php echo e($product->status ? 'success' : 'secondary'); ?>"><?php echo e($product->status ? 'Active' : 'Inactive'); ?></span>
<?php if($product->featured): ?>
<span class="badge bg-warning text-dark">Featured</span>
<?php endif; ?>
</td>
<td>
<a href="<?php echo e(route('product.show', $product->slug)); ?>" target="_blank" class="btn btn-sm btn-outline-secondary me-1" title="Preview"><i class="bi bi-eye"></i></a>
<a href="<?php echo e(route('admin.products.edit', $product)); ?>" class="btn btn-sm btn-outline-primary me-1"><i class="bi bi-pencil"></i></a>
<form action="<?php echo e(route('admin.products.destroy', $product)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Delete this product?')">
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
<button class="btn btn-sm btn-outline-danger"><i class="bi bi-trash"></i></button>
</form>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<tr><td colspan="7" class="text-center py-5 text-muted">No products found.</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<?php if($products->hasPages()): ?>
<div class="card-footer bg-white"><?php echo e($products->withQueryString()->links('pagination::bootstrap-5')); ?></div>
<?php endif; ?>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/boguraj1/public_html/udoktaecom/resources/views/admin/products/index.blade.php ENDPATH**/ ?>