[194a359] | 1 | @extends('layouts.app')
|
---|
| 2 |
|
---|
[d795fa6] | 3 | @section("title", "SaveSpace - Users")
|
---|
[194a359] | 4 |
|
---|
[d795fa6] | 5 | @section('pageTitle', 'Users')
|
---|
[194a359] | 6 |
|
---|
| 7 | @section('head')
|
---|
| 8 | <!-- Datatable -->
|
---|
| 9 | <link rel="stylesheet" href="{{ url('vendors/dataTable/dataTables.min.css') }}" type="text/css">
|
---|
[24a616f] | 10 |
|
---|
[194a359] | 11 | @endsection
|
---|
| 12 |
|
---|
| 13 | @section('content')
|
---|
| 14 |
|
---|
| 15 | <div class="page-header justify-content-between">
|
---|
| 16 | <nav aria-label="breadcrumb" class="d-flex align-items-start">
|
---|
| 17 | <ol class="breadcrumb">
|
---|
| 18 | <li class="breadcrumb-item">
|
---|
| 19 | <a href="{{ url('dashboard.users') }}">Users</a>
|
---|
| 20 | </li>
|
---|
| 21 | <li class="breadcrumb-item active" aria-current="page">User List</li>
|
---|
| 22 | </ol>
|
---|
| 23 | </nav>
|
---|
| 24 | <div class="dropdown">
|
---|
| 25 | <a href="{{ route("dashboard.users.create") }}" class="btn btn-primary text-white">
|
---|
| 26 | Add user
|
---|
| 27 | </a>
|
---|
| 28 | </div>
|
---|
| 29 | </div>
|
---|
| 30 |
|
---|
| 31 | <div class="row">
|
---|
| 32 | <div class="col-md-12">
|
---|
| 33 | <div class="card">
|
---|
| 34 | <div class="card-body">
|
---|
| 35 | <div class="table-responsive">
|
---|
| 36 | <table id="user-list" class="table table-lg">
|
---|
| 37 | <thead>
|
---|
| 38 | <tr>
|
---|
[d795fa6] | 39 | <th></th>
|
---|
[24a616f] | 40 | <th>State</th>
|
---|
[194a359] | 41 | <th>Username</th>
|
---|
| 42 | <th>Name</th>
|
---|
| 43 | <th>Email</th>
|
---|
| 44 | <th>Phone Number</th>
|
---|
[d795fa6] | 45 | <th>Created by</th>
|
---|
[24a616f] | 46 | <th>Created at</th>
|
---|
[d795fa6] | 47 | <th>Updated at</th>
|
---|
[194a359] | 48 | <th>Role</th>
|
---|
[24a616f] | 49 | <th>Status</th>
|
---|
| 50 | <th>Last seen</th>
|
---|
[194a359] | 51 | <th>Actions</th>
|
---|
| 52 | </tr>
|
---|
| 53 | </thead>
|
---|
| 54 | <tbody>
|
---|
| 55 | @foreach($users as $user)
|
---|
| 56 | <tr>
|
---|
[24a616f] | 57 | <td></td>
|
---|
[194a359] | 58 | <td>
|
---|
| 59 | @if($user->is_confirmed)
|
---|
| 60 | @if ($user->is_active)
|
---|
| 61 | <span class="badge bg-success-bright text-success">Active</span>
|
---|
| 62 | @else
|
---|
| 63 | <span class="badge bg-danger-bright text-danger">Blocked</span>
|
---|
| 64 | @endif
|
---|
| 65 | @else
|
---|
| 66 | <span class="badge bg-warning-bright text-warning">New user</span>
|
---|
| 67 | @endif
|
---|
| 68 | </td>
|
---|
| 69 | <td>
|
---|
[24a616f] | 70 | @include('dashboard.partials.avatar')
|
---|
| 71 | {{$user->username}}
|
---|
[194a359] | 72 | </td>
|
---|
[24a616f] | 73 | <td>{{$user->name .' '. $user->surname}}</td>
|
---|
[194a359] | 74 | <td>{{$user->email}}</td>
|
---|
[d795fa6] | 75 | <td>{{$user->phone_number}}</td>
|
---|
| 76 | <td>{{ $user->getCreatedByName() }}</td>
|
---|
[ea7b12a] | 77 | <td>{{ date('d.m.Y - H:i', strtotime($user->created_at)) }}</td>
|
---|
[d795fa6] | 78 | @if($user->updated_at==NULL)
|
---|
| 79 | <td>/</td>
|
---|
| 80 | @else
|
---|
| 81 | <td>{{ date('d.m.Y - H:i', strtotime($user->updated_at)) }}</td>
|
---|
| 82 | @endif
|
---|
[194a359] | 83 | <td>{{ $user->role->name }}</td>
|
---|
[24a616f] | 84 | <td>
|
---|
| 85 | @if(Cache::has('is_online' . $user->id))
|
---|
| 86 | <span class="text-success">Online</span>
|
---|
| 87 | @else
|
---|
| 88 | <span class="text-secondary">Offline</span>
|
---|
| 89 | @endif
|
---|
| 90 | </td>
|
---|
| 91 | @if($user->last_seen==NULL)
|
---|
| 92 | <td>Never logged in</td>
|
---|
| 93 | @else
|
---|
| 94 | <td>{{ \Carbon\Carbon::parse($user->last_seen)->diffForHumans() }}</td>
|
---|
| 95 | @endif
|
---|
[194a359] | 96 | @if($user->hasRole("Referent") && $user->is_confirmed)
|
---|
| 97 | <td>
|
---|
| 98 | <a href="{{ route("dashboard.users.edit", ["id" => $user->id]) }}" class="text-secondary" data-toggle="tooltip" title="Edit">
|
---|
| 99 | <i class="ti-pencil"></i>
|
---|
| 100 | </a>
|
---|
| 101 | <a href="javascript:void(0)" class="text-danger ml-2" data-action="{{ route("dashboard.users.destroy", ["id" => $user->id]) }}" data-method="delete" title="Delete">
|
---|
| 102 | <i class="ti-trash"></i>
|
---|
| 103 | </a>
|
---|
| 104 | </td>
|
---|
| 105 | @else
|
---|
| 106 | <td>Not available</td>
|
---|
| 107 | @endif
|
---|
| 108 | </tr>
|
---|
| 109 | @endforeach
|
---|
| 110 |
|
---|
| 111 |
|
---|
| 112 | </tbody>
|
---|
| 113 | </table>
|
---|
| 114 | </div>
|
---|
| 115 | </div>
|
---|
| 116 | </div>
|
---|
| 117 | </div>
|
---|
| 118 | </div>
|
---|
| 119 |
|
---|
| 120 | @endsection
|
---|
| 121 |
|
---|
| 122 | @section('script')
|
---|
[24a616f] | 123 | <script src="{{ url('assets/js/examples/pages/user-list.js') }}"></script>
|
---|
[194a359] | 124 | <!-- Datatable -->
|
---|
| 125 | <script src="{{ url('vendors/dataTable/dataTables.min.js') }}"></script>
|
---|
| 126 | @endsection
|
---|