@extends('layouts.page') @section('title', 'Users') @section('content')

All Employees

@include('layouts.error')
{{--
--}} {{--
--}}
@if(!$result->isEmpty()) @php $i = $result->firstItem() - 1; @endphp @foreach ($result as $row) @php $tot_docs = 0; $tot_dpm_fill = 0; $tot_docs_comp = 0; $doctor_ids = array(); if($row->user_type == "1"){ foreach(@$row->ChildUser as $rbm_row){ foreach(@$rbm_row->ChildUser as $abm_row){ foreach(@$abm_row->ChildUser as $be_row){ $tot_docs += count($be_row->Doctors); foreach(@$be_row->Doctors as $value){ if($value->doctor_status == '2'){ $tot_docs_comp++; } if($value->dpm->where('dpm_month','=',CommonFunction::get_month(date('M')))->count() > 0) { $tot_dpm_fill++; } } } } } } else if($row->user_type == "2"){ foreach($row->ChildUser as $abm_row){ foreach($abm_row->ChildUser as $be_row){ $tot_docs += count($be_row->Doctors); foreach($be_row->Doctors as $value){ if($value->doctor_status=='2'){ $tot_docs_comp++; } if($value->dpm->where('dpm_month',CommonFunction::get_month(date('M')))->count() > 0){ $tot_dpm_fill++; } } } } } else if($row->user_type == "3"){ foreach($row->ChildUser as $be_row){ $tot_docs += count($be_row->Doctors); foreach($be_row->Doctors as $value){ if($value->doctor_status=='2'){ $tot_docs_comp++; } if($value->dpm->where('dpm_month',CommonFunction::get_month(date('M')))->count() > 0){ $tot_dpm_fill++; } } } } else if($row->user_type == "4"){ $tot_docs += count($row->Doctors); foreach($row->Doctors as $value){ if($value->doctor_status=='2'){ $tot_docs_comp++; } if($value->dpm->where('dpm_month',CommonFunction::get_month(date('M')))->count() > 0){ $tot_dpm_fill++; } } } $dpm_avg = $tot_dpm_fill > 0 ? (($tot_docs * 100 ) / $tot_dpm_fill) : 0; // FOR DOCTOR FILLED BASIC DETAIL if($tot_docs_comp > 0){ //$pr_value = number_format(100/($tot_docs/$tot_pending_docs),0); $pr_value = number_format((100 * $tot_docs_comp) / $tot_docs,0); }else{ $pr_value = 0; } $status_class = ''; if($pr_value > config('custom_config.user_list_full_detail.green')){ $status_class = 'progress-bar-striped bg-success'; }else if($pr_value > config('custom_config.user_list_full_detail.blue')){ $status_class = 'progress-bar-striped bg-info'; }else if($pr_value > config('custom_config.user_list_full_detail.orange')){ $status_class = 'progress-bar-striped bg-warning'; }else { $status_class = 'progress-bar-striped bg-danger'; } if($tot_dpm_fill > 0){ $dpm_pr_value = number_format(100/($tot_docs/$tot_dpm_fill),0); }else{ $dpm_pr_value = 0; } $dpm_status_class = ''; if($dpm_pr_value > config('custom_config.user_list_dpm.green')){ $dpm_status_class = 'progress-bar-striped bg-success'; } else if($dpm_pr_value > config('custom_config.user_list_dpm.blue')){ $dpm_status_class = 'progress-bar-striped bg-info'; } else if($dpm_pr_value > config('custom_config.user_list_dpm.orange')){ $dpm_status_class = 'progress-bar-striped bg-warning'; } else { $dpm_status_class = 'progress-bar-striped bg-danger'; } @endphp @endforeach @else @endif
No User Info Pos Info. HQ Info. Completed Doctors Current Month DPM Status Action
{{ ++$i }}

Name:
{{ $row->user_name }}

User Type:
{{ config('custom.user_type')[$row->user_type] }}

Pos Name:
{{ $row->user_pos_name }}

Pos Code:
{{ $row->user_pos_code }}

Desg:
{{ $row->user_desg }}

HQ Code:
{{ $row->user_hq_code ? $row->user_hq_code :'-' }}

HQ Name:
{{ $row->user_hq_name ? $row->user_hq_name : '-' }}

{{ $tot_docs_comp }}/{{ $tot_docs }} ({{ $pr_value }}%)
{{ $dpm_pr_value }}/{{ $tot_docs }} ({{ $dpm_pr_value }}%)
user_id }} }}> {{ $row->user_status == "2" ? "Suspended" : "Active" }}
@php $user_info = ''; if($row->user_type == "1") $user_info = route('users').'?sm='.$row->user_id; else if($row->user_type == "2") $user_info = route('users').'?rbm='.$row->user_id; else if($row->user_type == "3") $user_info = route('users').'?abm='.$row->user_id; @endphp @if($user_info) @endif
No Records Found.
@endsection @section('custom-js') @endsection