109 lines
4.0 KiB
PHP
109 lines
4.0 KiB
PHP
@extends('admin.layouts.master')
|
|
|
|
@section('content')
|
|
|
|
|
|
<div class="page-header">
|
|
<h1 class="page-title">Welcome {{ Auth::guard('admin')->user()->name }}</h1>
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item active">Dashboard</li>
|
|
</ol>
|
|
</div>
|
|
|
|
|
|
<div class="page-content container-fluid">
|
|
<div class="row">
|
|
<div class="col-xxl-12 col-lg-12">
|
|
<div class="row">
|
|
<div id="" class="col-xl-12 col-md-12">
|
|
<h3>Role and Users </h3>
|
|
</div>
|
|
@if (!empty($roles))
|
|
@foreach($roles as $key=> $role)
|
|
@php
|
|
$count = App\User::where('roles.id', '=', $role->id)
|
|
->join('role_user', 'users.id', '=', 'role_user.user_id')
|
|
->join('roles', 'role_user.role_id', '=', 'roles.id')
|
|
->select(DB::raw('count(*) as user_count'))
|
|
->where('users.status', '=', 1)
|
|
->where('users.working_status', '=', 1)
|
|
->first();
|
|
$class_array=['btn-primary', 'btn-secondary', 'btn-success', 'btn-warning', 'btn-danger', 'btn-primary', 'btn-secondary', 'btn-success', 'btn-warning', 'btn-danger']
|
|
@endphp
|
|
<div class="col-xl-3 col-md-6 info-panel">
|
|
<div class="card card-shadow">
|
|
<div class="card-block bg-white p-20">
|
|
<button type="button" class="btn btn-floating btn-sm {{ $class_array[($key%10)] }}">
|
|
<i class="icon wb-user-circle"></i>
|
|
</button>
|
|
<span class="ml-15 font-weight-400"><b>{{ dataTranslation($role->name) }}</b></span>
|
|
<div class="content-text text-center mb-0">
|
|
<i class="text-danger icon font-size-20"></i>
|
|
<span class="font-size-40 font-weight-100">{{ $count->user_count && $count->user_count > 0 ? $count->user_count : 0 }}</span>
|
|
<p class="blue-grey-400 font-weight-100 m-0"> </p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-xxl-12 col-lg-12">
|
|
<div class="card card-shadow table-row">
|
|
<div class="card-header card-header-transparent py-20">
|
|
<div class="btn-group dropdown">
|
|
<a href="#" class="text-body dropdown-toggle blue-grey-700" data-toggle="dropdown"><b>TODAY'S ABSENCE USER</b></a>
|
|
</div>
|
|
</div>
|
|
<div class="card-block bg-white table-responsive">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>#</th>
|
|
<th>Name</th>
|
|
<th>Designation</th>
|
|
<th>Phone</th>
|
|
<th>Address</th>
|
|
<th>Profile Picture</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@if (!empty($todays_absent_user))
|
|
@foreach($todays_absent_user as $key=> $user)
|
|
<tr>
|
|
<td>{{ $key+1 }}</td>
|
|
<td>{{ $user->first_name }} {{ $user->last_name }}</td>
|
|
<td>{{ dataTranslation($user->role_name) }}</td>
|
|
<td>{{ $user->cell_phone_number }}</td>
|
|
<td>{{ $user->home_address }}</td>
|
|
<td>
|
|
@if($user->profile_picture && trim($user->profile_picture)!='' && file_exists(public_path('uploads/user_folder/'.$user->profile_picture)))
|
|
<div id='profile_picture_preview' style ="padding:10px 0 0 0;">
|
|
<img src='{{ asset(env("UPLOADS_FOLDER") . "/" . env("USER_FOLDER") . "/" . $user->profile_picture)}}' alt="Photo Id Proof" style ='max-width:50px;' >
|
|
</div>
|
|
@else
|
|
N/A
|
|
@endif
|
|
</td>
|
|
<td>
|
|
<a class="btn btn-sm btn-icon btn-default btn-outline btn-round" href="{{ route('add-assign-absence', base64_encode($user->absent_id)) }}" data-toggle="tooltip" data-original-title="Assign absence"><i class="fa fa-user-plus" aria-hidden="true"></i></a>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
@else
|
|
<tr>
|
|
<td colspan="100%" class="text-center">No record found</td>
|
|
</tr>
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|