194 lines
12 KiB
PHP
194 lines
12 KiB
PHP
<?php $__env->startSection('breadcrumb'); ?>
|
|
<div>
|
|
<h1 class="page-title fw-medium fs-18 mb-2">لیست ادمینها</h1>
|
|
<div>
|
|
<nav>
|
|
<ol class="breadcrumb mb-0">
|
|
<li class="breadcrumb-item"><a href="javascript:void(0);">ادمینها</a></li>
|
|
<li class="breadcrumb-item active" aria-current="page">لیست ادمینها</li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
<?php $__env->stopSection(); ?>
|
|
|
|
<?php $__env->startSection('content'); ?>
|
|
<div class="container-fluid pt-4">
|
|
|
|
|
|
<!-- Filter + Search -->
|
|
<div class="row">
|
|
<div class="col-xl-12">
|
|
<div class="card custom-card">
|
|
<div class="card-body p-3">
|
|
<form method="GET" action="<?php echo e(route('admin.admins.index')); ?>">
|
|
<div class="d-flex align-items-center justify-content-between flex-wrap gap-3">
|
|
|
|
<!-- Left: Add Admin + Sort -->
|
|
<div class="d-flex flex-wrap gap-1 project-list-main align-items-center">
|
|
<div class="d-flex me-2">
|
|
<input class="form-control me-2" type="search" name="search"
|
|
placeholder="جستجو ادمین" value="<?php echo e(request()->input('search')); ?>"
|
|
aria-label="جستجو">
|
|
<button class="btn btn-light" type="submit">جستجو</button>
|
|
</div>
|
|
|
|
<select id="choices-single-default" class="form-control" name="sort">
|
|
<option value="">مرتبسازی بر اساس</option>
|
|
<option
|
|
value="name_asc" <?php if(request()->missing('sort') || request()->input('sort') == 'name_asc'): echo 'selected'; endif; ?> >
|
|
نام (الف - ی)
|
|
</option>
|
|
<option
|
|
value="name_desc" <?php if( request()->input('sort') == 'name_desc'): echo 'selected'; endif; ?> >
|
|
نام (ی - الف)
|
|
</option>
|
|
<option value="email" <?php if( request()->input('sort') == 'email'): echo 'selected'; endif; ?> >
|
|
ایمیل
|
|
</option>
|
|
<option value="newest" <?php if( request()->input('sort') == 'newest'): echo 'selected'; endif; ?> >
|
|
جدیدترین
|
|
</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Right: Search -->
|
|
<div class="d-flex align-items-center gap-2" role="search">
|
|
<a href="<?php echo e(route('admin.admins.trash.index')); ?>" class="btn btn-danger-light d-flex align-items-center">
|
|
<i class="ri-delete-bin-3-line me-1 fw-medium align-middle"></i>
|
|
سطل زباله
|
|
</a>
|
|
<a href="<?php echo e(route('admin.admins.create')); ?>" class="btn btn-primary me-2">
|
|
<i class="ri-add-line me-1 fw-medium align-middle"></i>ایجاد مدیر
|
|
</a>
|
|
</div>
|
|
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Table -->
|
|
<div class="row">
|
|
<div class="col-xl-12">
|
|
<div class="card custom-card">
|
|
<div class="table-responsive">
|
|
<table class="table text-nowrap table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th><input class="form-check-input check-all" type="checkbox" id="all-admins"></th>
|
|
<th>تصویر</th>
|
|
<th>نام</th>
|
|
<th>نام خانوادگی</th>
|
|
<th>نام کاربری</th>
|
|
<th>ایمیل</th>
|
|
<th>وضعیت</th>
|
|
<th>نقش</th>
|
|
<th>آخرین ورود</th>
|
|
<th>تاریخ ایجاد</th>
|
|
<th>اقدامات</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $__empty_1 = true; $__currentLoopData = $admins; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $admin): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
|
<tr>
|
|
<td>
|
|
<input class="form-check-input" type="checkbox" value="<?php echo e($admin->id); ?>">
|
|
</td>
|
|
<td>
|
|
<span class="avatar avatar-md avatar-square bg-light">
|
|
<?php if($admin->file): ?>
|
|
<img src="<?php echo e(getFileUrl($admin->file_id)); ?>" class="w-100 h-100" alt="<?php echo e($admin->username); ?>">
|
|
<?php else: ?>
|
|
<img src="<?php echo e(asset('assets/admin/images/faces/DefaultAvatar.jpg')); ?>"
|
|
class="w-100 h-100" alt="<?php echo e($admin->username); ?>">
|
|
<?php endif; ?>
|
|
</span>
|
|
</td>
|
|
<td><?php echo e($admin->first_name); ?></td>
|
|
<td><?php echo e($admin->last_name); ?></td>
|
|
<td><?php echo e($admin->username); ?></td>
|
|
<td><?php echo e($admin->email ?: '-'); ?></td>
|
|
<td>
|
|
<?php if($admin->status == \App\Enums\Admin\AdminStatus::ACTIVE): ?>
|
|
<span
|
|
class="badge bg-primary-transparent">
|
|
فعال
|
|
</span>
|
|
<?php else: ?>
|
|
<span
|
|
class="badge bg-danger-transparent">
|
|
غیر فعال
|
|
</span>
|
|
<?php endif; ?>
|
|
</td>
|
|
<td>
|
|
<?php if($admin->role == \App\Enums\Admin\AdminRole::SUPERADMIN): ?>
|
|
<span
|
|
class="badge bg-success-transparent">
|
|
سوپر ادمین
|
|
</span>
|
|
<?php else: ?>
|
|
<span
|
|
class="badge bg-info-transparent">
|
|
ادمین عادی
|
|
</span>
|
|
|
|
<?php endif; ?>
|
|
</td>
|
|
<td><?php echo e($admin->last_login_at?->toJalali()->format('d F Y - H:i') ?: '-'); ?></td>
|
|
<td><?php echo e($admin->created_at->toJalali()->format('d F Y - H:i')); ?></td>
|
|
<td>
|
|
<div class="hstack gap-2 fs-15">
|
|
<a href="<?php echo e(route('admin.admins.edit' , $admin->id)); ?>"
|
|
class="btn btn-secondary-light btn-icon btn-sm" title="ویرایش">
|
|
<i class="ti ti-pencil"></i>
|
|
</a>
|
|
<?php if(auth()->guard('admin')->check()): ?>
|
|
<?php if(auth('admin')->user()->role == \App\Enums\Admin\AdminRole::SUPERADMIN && auth('admin')->id() !== $admin->id): ?>
|
|
<form
|
|
action="<?php echo e(route('admin.admins.destroy', $admin->id)); ?>"
|
|
method="POST"
|
|
class="d-inline"
|
|
onsubmit="return confirm('از حذف این مدیر مطمئن هستید؟')"
|
|
>
|
|
<?php echo csrf_field(); ?>
|
|
<?php echo method_field('DELETE'); ?>
|
|
|
|
<button type="submit" class="btn btn-icon btn-sm btn-danger-light">
|
|
<i class="ri-delete-bin-line"></i>
|
|
|
|
</button>
|
|
</form>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
|
<tr>
|
|
<td colspan="11" class="text-center text-muted py-4">
|
|
هیچ مدیری یافت نشد.
|
|
</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
<div class="d-flex justify-content-end mt-3">
|
|
<?php echo e($admins->links()); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<?php $__env->stopSection(); ?>
|
|
|
|
<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\ASUS\Desktop\airline-agency\resources\views/admin/admins/index.blade.php ENDPATH**/ ?>
|