%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/dsr_code/storage/framework/views/
Upload File :
Create Path :
Current File : /home/silvzytp/dsr_code/storage/framework/views/4eaf87ecd97aa89385668b71ce23500faffbd6cc.php

<?php $__env->startSection('title', $siteTitle); ?>

<?php $__env->startPush('styles'); ?>

<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>

<div class="row">
    <?php $__currentLoopData = $targets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $target_data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="col-md-6">
            <div class="ibox">
                <div class="ibox-head">
                    <div class="ibox-title">Manager: <?php echo e($target_data->name); ?></div>
                </div>
                <div class="ibox-body">
                    <div>
                        <canvas id="doughnut_chart-<?php echo e($target_data->id); ?>"  class="compare-manager-data" style="height:200px;"></canvas>
                    </div>
                </div>
            </div>
        </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>
<script src="<?php echo e(asset('/')); ?>assets/js/Chart.min.js" type="text/javascript"></script>
<script>
    <?php $__currentLoopData = $targets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $target_data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php
            $monthlyData = App\Models\MonthlyData::toBase()->where('user_id',$target_data->id)->get();

            $revenueAchievment = $monthlyData->sum('revenue_achievment');

            $saleAchieved = App\Models\MonthlyData::toBase()->where('user_id',$target_data->id)
                    ->sum('sale_achievment');

            $saleTarget = $target_data->individualTargets->sum('s_target');

            $revenueDeficit = ($target_data->target - $revenueAchievment);
            $saleDeficit = ($saleTarget - $saleAchieved);
        ?>

        var target = {
            's_target':"<?php echo e($saleTarget); ?>",
            's_achived':"<?php echo e($saleAchieved); ?>",
            's_deifict':"<?php echo e($saleDeficit); ?>",
            'a_target':"<?php echo e($target_data->target); ?>",
            'a_achived':"<?php echo e($revenueAchievment); ?>",
            'a_deifict':"<?php echo e($revenueDeficit); ?>",
            'attendance':"<?php echo e($monthlyData->sum('meeting_attendance')); ?>",
        };

        var doughnutData = {
            labels: ['Sale Target','Sale Achieved', 'Sale Deifict','Revenue Target','Revenue Achieved', 'Revenue Deifict', 'Meeting Attendance'],
            datasets: [{
                data: [target.s_target,target.s_achived,target.s_deifict,target.a_target,target.a_achived,target.a_deifict,target.attendance],
                backgroundColor: ["rgb(255, 99, 132)","rgb(54, 162, 235)","rgb(255, 205, 86)","rgb(18, 203, 196)","rgb(181, 52, 113)","rgb(0, 148, 50)","rgb(54, 162, 235)"]
            }]
        };

        var doughnutOptions = {
            responsive: true
        };
        var ctx4 = document.getElementById("doughnut_chart-<?php echo e($target_data->id); ?>").getContext("2d");
        new Chart(ctx4, {type: 'doughnut', data: doughnutData, options:doughnutOptions});
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.backend', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/silvzytp/dsr_code/resources/views/global/compare/compare.blade.php ENDPATH**/ ?>

Zerion Mini Shell 1.0