@extends('layouts.app')
@section('title') {{'Dashboard'}} @endsection
@section('content')
@php
$pre_year = date("Y") - 1; // Get the previous year
$cur_year = date("Y"); // Get the current year
$colors = array('00a65a','dd4b39','00a65a','dd4b39','f39c12');
$Y_A_T = '';
$Y_A_C_R = '';
$Y_A_S_R = '';
foreach($targets as $row)
{
$title = $row['value'];
$sales = round($row['yesterday_sales']);
$achieve =round($row['yesterday_achievement']);
$Y_A_T .= "'".$title."',";
$Y_A_C_R .= $sales.",";
$Y_A_S_R .= $achieve.",";
}
$U_T_D_A_T = '';
$U_T_D_A_C_R = '';
$U_T_D_A_S_R = '';
foreach($upto_targets as $row)
{
$title = $row['value'];
$t_sales = round($row['up_to_sales']);
$t_achieve =round($row['up_to_achievement']);
$U_T_D_A_T .= "'".$title."',";
$U_T_D_A_C_R .= $t_sales.",";
$U_T_D_A_S_R .= $t_achieve.",";
}
$Y_Y_A_T = '';
$Y_Y_A_C_R = '';
$Y_Y_A_S_R = '';
foreach($yearly_targets as $row)
{
$title = $row['value'];
$y_t_sales = round($row['yearly_sales']);
$y_t_achieve =round($row['yearly_sales_achievement']);
$Y_Y_A_T .= "'".$title."',";
$Y_Y_A_C_R .= $y_t_sales.",";
$Y_Y_A_S_R .= $y_t_achieve.",";
}
$G_M_T_S = '';
$G_M_T_S_N = '';
$G_M_PiChart = '';
$c=0;
foreach($dues_status as $row)
{
$title = $row['value'];
$total = round($row['dues']);
$G_M_T_S .= "'".$title."',";
$G_M_T_S_N .= $total.",";
$G_M_PiChart .= "{ value : ".$total.", color : '#".$colors[$c]."', highlight: '#353ae7', label : '".$title."' },";
$c++;
if($c==5){ $c=0; }
}
$G_M_T_S = rtrim($G_M_T_S,',');
$G_M_T_S_N = rtrim($G_M_T_S_N,',');
$G_M_PiChart = rtrim($G_M_PiChart,',');
$Y_G_S_S = '';
$Y_G_C_S = '';
foreach($yearly_grouth as $row)
{
$last_year = round($row['last_year']);
$current_year =round($row['current_year']);
$Y_G_C_S .= $last_year.", ";
$Y_G_S_S .= $current_year.", ";
}
$monthly_sales = '';
$monthly_collection = '';
foreach($monthly_achivement as $row)
{
$current_sales = round($row['current_sales']);
$current_collection = round($row['current_collection']);
$monthly_sales .= $current_sales.", ";
$monthly_collection .= $current_collection.", ";
}
@endphp
@if(session()->has('success'))
{{ session()->get('success') }}
@endif
@if(session()->has('message'))
{{ session()->get('message') }}
@endif
@if ($errors->any())
@foreach ($errors->all() as $error)
- {{ $error }}
@endforeach
@endif
@php
$i = 0;
$colors = array('00a65a','dd4b39','72c5e5','b64dd9','f39c12');
@endphp
- Achieved
- Due
@foreach($RecentlyAddedProducts as $row)
-
{{ $row->id}}
@endforeach
@endsection