

<?php $__env->startSection('content'); ?>
<h2 class="mb-4">Component 3 Dashboard</h2>

<div class="row g-3 mb-5">
    <div class="col-md-3">
        <div class="card card-stat h-100 text-center p-3">
            <h5>Total Calls</h5>
            <h2><?php echo e($totalCalls); ?></h2>
        </div>
    </div>
    <div class="col-md-3">
        <div class="card card-stat h-100 text-center p-3">
            <h5>GBV Cases</h5>
            <h2><?php echo e($totalCases); ?></h2>
        </div>
    </div>
    <div class="col-md-3">
        <div class="card card-stat h-100 text-center p-3">
            <h5>Prevention Reach</h5>
            <h2><?php echo e($totalPrevention); ?></h2>
        </div>
    </div>
    <div class="col-md-3">
        <div class="card card-stat h-100 text-center p-3">
            <h5>Satisfied Survivors</h5>
            <h2><?php echo e($satisfied); ?></h2>
        </div>
    </div>
</div>

<div class="row g-4">
    <div class="col-md-6">
        <div class="card">
            <div class="card-header">GBV Types Reported</div>
            <div class="card-body">
                <canvas id="gbvChart" height="180"></canvas>
            </div>
        </div>
    </div>
    <div class="col-md-6">
        <div class="card">
            <div class="card-header">Prevention Activities</div>
            <div class="card-body">
                <canvas id="preventionChart" height="180"></canvas>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script>
    new Chart(document.getElementById('gbvChart'), {
        type: 'bar',
        data: {
            labels: ['Rape', 'Denial of Resources', 'Psychological Abuse', 'Wife Beating', 'Child Marriage'],
            datasets: [{ label: 'Cases', data: <?php echo e(json_encode($gbvCounts)); ?>, backgroundColor: '#198754' }]
        },
        options: { responsive: true, scales: { y: { beginAtZero: true } } }
    });

    new Chart(document.getElementById('preventionChart'), {
        type: 'doughnut',
        data: {
            labels: ['Prevention Messages', 'Referral Pathways', 'Male Engagement', 'IEC Materials'],
            datasets: [{ data: <?php echo e(json_encode($preventionCounts)); ?>, backgroundColor: ['#198754','#28a745','#34d399','#4ade80'] }]
        }
    });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('c3.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\wampserver64\www\sswseepcomponents\resources\views/c3/dashboard.blade.php ENDPATH**/ ?>