
<?php $__env->startSection('subtitle'); ?>
Game Loadouts Stats
<?php $__env->stopSection(); ?>

<?php $__env->startSection('description'); ?>
View the stats we have collected on all the game loadout submissions.
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="col-md-12">
    <h2>Website Stats <small class="pull-right">Stats are cached hourly.</small></h2>
    <span class="line"> <span class="sub-line"></span> </span>

</div>
<div class="col-md-4">
    <h2>Loadout Stats</h2>
    <table class="table">
        <tr>
            <th>Game</th>
            <th>Loadout Votes</th>
            <th>Unique Loadouts</th>
        </tr>
        <?php foreach($submissionsPerGame as $submissions): ?>
        <tr>
            <td><?php echo $submissions -> game; ?></td>
            <td><?php echo $submissions -> votes; ?></td>
            <td><?php echo $submissions -> loadouts; ?></td>
        </tr>
        <?php endforeach; ?>
    </table>
</div>
<div class="col-md-8">
    <h2>Votes Per Day</h2>
    <h3>
        <?php $counter = 0; ?>
        <?php foreach ($gamesVotes as $game => $votes): ?>
        <span style="color: <?php echo $colors[$counter++]; ?>"><?php echo $game; ?></span> 
        <?php endforeach; ?>
    </h3>
    <canvas id="canvas" height="547" width="730"></canvas>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script src="<?php echo asset('js/Chart.min.js'); ?>"></script>
<script>
    var lineChartData = {
    labels : <?php echo $daysJSON; ?>,
    datasets : [
    <?php $counter = 0; ?>
        <?php foreach ($gamesVotes as $gameVotes): ?>
        {
        fillColor : "rgba(220,220,220,0.0)",
        strokeColor : "<?php echo $colors[$counter]; ?>",
        pointColor : "<?php echo $colors[$counter++]; ?>",
        pointStrokeColor : "#fff",
        data : <?php echo json_encode($gameVotes); ?>

        },
        <?php endforeach; ?>
        ]

        }
        var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Line(lineChartData);
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>