@extends('layouts.admin') @section('page-title') {{__('Manage Indicator')}} @endsection @push('css-page') @endpush @push('script-page') @endpush @section('breadcrumb') @endsection @section('action-btn')
@can('create indicator') @endcan
@endsection @section('content')
@if( Gate::check('edit indicator') ||Gate::check('delete indicator') ||Gate::check('show indicator')) @endif @foreach ($indicators as $indicator) @php if(!empty($indicator->rating)){ $rating = json_decode($indicator->rating,true); if(!empty($rating)){ $starsum = array_sum($rating); $overallrating = $starsum/count($rating); }else{ $overallrating = 0; } } else{ $overallrating = 0; } @endphp @if( Gate::check('edit indicator') ||Gate::check('delete indicator') || Gate::check('show indicator')) @endif @endforeach
{{__('Branch')}} {{__('Department')}} {{__('Designation')}} {{__('Overall Rating')}} {{__('Added By')}} {{__('Created At')}}{{__('Action')}}
{{ !empty($indicator->branches)?$indicator->branches->name:'' }} {{ !empty($indicator->departments)?$indicator->departments->name:'' }} {{ !empty($indicator->designations)?$indicator->designations->name:'' }} @for($i=1; $i<=5; $i++) @if($overallrating < $i) @if(is_float($overallrating) && (round($overallrating) == $i)) @else @endif @else @endif @endfor ({{number_format($overallrating,1)}}) {{ !empty($indicator->user)?$indicator->user->name:'' }} {{ \Auth::user()->dateFormat($indicator->created_at) }} @can('show indicator') @endcan @can('edit indicator') @endcan @can('delete indicator')
{!! Form::open(['method' => 'DELETE', 'route' => ['indicator.destroy', $indicator->id],'id'=>'delete-form-'.$indicator->id]) !!} {!! Form::close() !!}
@endcan
@endsection