%PDF- %PDF-
Direktori : /home/silvzytp/crm-ind-code/resources/views/backend/pages/compare/ |
Current File : /home/silvzytp/crm-ind-code/resources/views/backend/pages/compare/compare.blade.php |
@extends('layouts.backend') @section('title', $siteTitle) @push('styles') @endpush @section('content') <div class="row"> @foreach ($compareData as $compare) <div class="col-md-6"> <div class="card"> <div class="card-header"> <div class="card-title d-flex align-items-center justify-content-between">Agent: {{ $compare->name }} <h6 class="mb-0">Total Calling: {{ $compare->callings->count() }}</h6> </div> </div> <div class="card-body"> <div> <canvas id="doughnut_chart-{{ $compare->id }}" class="compare-manager-data" style="height:200px;"></canvas> </div> </div> </div> </div> @endforeach </div> @endsection @push('scripts') <script src="{{ asset('assets') }}/vendors/chartjs/Chart.min.js" type="text/javascript"></script> <script> @foreach ($compareData as $value) @php $openCount = DB::table('collings')->where(['agent_id'=>$value->id,'status'=>1])->count(); $closedCount = DB::table('collings')->where(['agent_id'=>$value->id,'status'=>2])->count(); @endphp var target = { 'open':"{{ $openCount }}", 'closed':"{{ $closedCount }}" }; var doughnutData = { labels: ['Open','Closed'], datasets: [{ data: [target.open,target.closed], backgroundColor: ["rgb(54, 162, 235)","rgb(255, 99, 132)"] }] }; var doughnutOptions = { responsive: true }; var ctx4 = document.getElementById("doughnut_chart-{{ $value->id }}").getContext("2d"); new Chart(ctx4, {type: 'doughnut', data: doughnutData, options:doughnutOptions}); @endforeach </script> @endpush