fix: update user side
This commit is contained in:
@@ -1,5 +1,254 @@
|
||||
@extends('admin.layouts.app')
|
||||
@section('breadcrumb')<div><h1 class="page-title fw-medium fs-18 mb-1">ثبتنامهای سایت</h1><span class="text-muted fs-12">جستجو، مشاهده، ویرایش، حذف و مدیریت کاربران</span></div>@endsection
|
||||
@section('content')<div class="container-fluid pt-4">@include('admin.partials.errors')
|
||||
<div class="card custom-card"><div class="card-body"><form method="GET"><div class="row g-2"><div class="col-md-6"><input class="form-control" name="search" value="{{ request('search') }}" placeholder="نام، نام خانوادگی، ایمیل یا موبایل"></div><div class="col-md-3"><select name="sort" class="form-control"><option value="newest">جدیدترین ثبتنام</option><option value="oldest" @selected(request('sort')==='oldest')>قدیمیترین</option><option value="name" @selected(request('sort')==='name')>نام</option></select></div><div class="col-md-2"><button class="btn btn-light w-100">جستجو</button></div></div></form></div></div>
|
||||
<div class="card custom-card mt-3"><div class="table-responsive"><table class="table text-nowrap table-hover mb-0"><thead><tr><th>کاربر</th><th>ایمیل</th><th>موبایل</th><th>تاریخ ثبتنام</th><th>عملیات</th></tr></thead><tbody>@forelse(($users ?? []) as $user)<tr><td>{{ trim(($user->first_name ?? '').' '.($user->last_name ?? '')) ?: '-' }}</td><td>{{ $user->email }}</td><td>{{ $user->mobile ?? '-' }}</td><td>{{ isset($user->created_at) ? $user->created_at->toJalali()->format('Y/m/d H:i') : '-' }}</td><td><div class="hstack gap-2"><a href="{{ route('admin.users.show',$user) }}" class="btn btn-primary-light btn-icon btn-sm" title="مشاهده"><i class="ri-eye-line"></i></a><a href="{{ route('admin.users.edit',$user) }}" class="btn btn-secondary-light btn-icon btn-sm" title="ویرایش/تغییر رمز"><i class="ri-edit-line"></i></a><form method="POST" action="{{ route('admin.users.destroy',$user) }}" onsubmit="return confirm('آیا از حذف کاربر مطمئن هستید؟')">@csrf @method('DELETE')<button class="btn btn-danger-light btn-icon btn-sm" title="حذف"><i class="ri-delete-bin-line"></i></button></form></div></td></tr>@empty<tr><td colspan="5" class="text-center py-5 text-muted">کاربری یافت نشد.</td></tr>@endforelse</tbody></table></div></div>{{ ($users ?? collect())->links() }}</div>@endsection
|
||||
|
||||
@section('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>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="main-content app-content">
|
||||
|
||||
@error('general')
|
||||
<span class="alert alert-danger">{{ $message }}</span>
|
||||
@enderror
|
||||
|
||||
<div class="container-fluid pt-4">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="card custom-card">
|
||||
<div class="card-body p-3">
|
||||
|
||||
<form method="GET">
|
||||
<div class="d-flex align-items-center justify-content-between flex-wrap gap-3">
|
||||
|
||||
<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="{{ 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="" selected>
|
||||
مرتبسازی بر اساس
|
||||
</option>
|
||||
|
||||
<option
|
||||
value="newest"
|
||||
@selected(request()->input('sort') == 'newest')
|
||||
>
|
||||
جدیدترین
|
||||
</option>
|
||||
|
||||
<option
|
||||
value="name_asc"
|
||||
@selected(request()->input('sort') == 'name_asc')
|
||||
>
|
||||
الفبا (الف - ی)
|
||||
</option>
|
||||
|
||||
<option
|
||||
value="name_desc"
|
||||
@selected(request()->input('sort') == 'name_desc')
|
||||
>
|
||||
الفبا (ی - الف)
|
||||
</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Users 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 scope="col">عکس</th>
|
||||
<th scope="col">نام و نام خانوادگی</th>
|
||||
<th scope="col">وضعیت تأهل</th>
|
||||
<th scope="col">نام و نام خانوادگی همسر</th>
|
||||
<th scope="col">ایمیل</th>
|
||||
<th scope="col">استان</th>
|
||||
<th scope="col">شهر</th>
|
||||
<th scope="col">شماره موبایل</th>
|
||||
<th scope="col">تاریخ ثبت نام</th>
|
||||
<th scope="col">عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@foreach($users as $user)
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<span class="avatar avatar-md avatar-square bg-light">
|
||||
|
||||
@if($user->file?->id)
|
||||
<img src="{{ getFileUrl($user->file?->id) }}"
|
||||
class="w-100 h-100"
|
||||
alt="{{ getUserFullName($user) }}">
|
||||
@else
|
||||
<img
|
||||
src="{{ asset('assets/admin/images/faces/DefaultAvatar.jpg') }}"
|
||||
class="w-100 h-100"
|
||||
alt="{{ getUserFullName($user) }}"
|
||||
>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
|
||||
<div class="flex-fill">
|
||||
|
||||
<span class="fw-medium fs-14 d-block">
|
||||
{{ getUserFullName($user) }}
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
|
||||
@if($user->marital_status == \App\Enums\UserMaritalStatus::SINGLE)
|
||||
<span class="badge bg-primary-transparent">
|
||||
مجرد
|
||||
</span>
|
||||
|
||||
@elseif($user->marital_status == \App\Enums\UserMaritalStatus::MARRIED)
|
||||
<span class="badge bg-success-transparent">
|
||||
متأهل
|
||||
</span>
|
||||
|
||||
@elseif($user->marital_status == \App\Enums\UserMaritalStatus::SEPARATED)
|
||||
<span class="badge bg-warning-transparent">
|
||||
جداشده
|
||||
</span>
|
||||
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
|
||||
</td>
|
||||
<td>
|
||||
@if($user->spouse_name)
|
||||
{{ $user->spouse_name }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ $user->email }}
|
||||
</td>
|
||||
<td>
|
||||
{{$user->province}}
|
||||
</td>
|
||||
<td>
|
||||
{{$user->city}}
|
||||
</td>
|
||||
<td>
|
||||
{{ $user->mobile }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $user->created_at->toJalali()->format('H:i Y-m-d') }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="hstack gap-2 fs-15">
|
||||
|
||||
@if(auth('admin')->user()->permission?->user_edit)
|
||||
<a href="{{ route('admin.users.edit', $user->id) }}"
|
||||
class="btn btn-secondary-light btn-icon btn-sm"
|
||||
title="ویرایش">
|
||||
<i class="ti ti-pencil"></i>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(auth('admin')->user()->permission?->user_delete)
|
||||
<form action="{{ route('admin.users.destroy', $user->id) }}"
|
||||
method="POST"
|
||||
onsubmit="return confirm('آیا از حذف این کاربر مطمئن هستید؟')">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
<button type="submit"
|
||||
class="btn btn-icon btn-sm btn-danger-light">
|
||||
<i class="ri-delete-bin-line"></i>
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{ $users->links() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
Reference in New Issue
Block a user