<?php $__env->startSection('content'); ?>
<div id="vue-admin-user">
    <div class="main-panel">
        <div class="content">
            <div class="panel-header">
                <div class="page-inner py-5 text-white"  style="background:#313232">
                    <div class="d-flex align-items-left align-items-md-center flex-column flex-md-row">
                        <div><div class="page-header">
                                <h4 class="page-title text-white">Dashboard      </h4>
                                <ul class="breadcrumbs">
                                    <li class="nav-home">
                                        <a class="text-white" href="#">
                                            <i class="flaticon-home"></i>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>

                    </div>
                </div>

                <div class="page-category">
                    <div class="page-inner mt--5">
                        <div class="row mt--2">
                            <div class="col-md-12">
                                <div class="card full-height">
                                    <div class="card-body">
                                        <div class="card-body">SMS statistics
                                            <?php echo $__env->make('fcviews.partials.filter-sentsms', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                                            <div class="text-right mb-3 border-bottom pb-1">
                                                <div class="card-title pull-left"></div>

                                                <a class="btn btn-success btn-border btn-round btn-sm" data-toggle="collapse" data-target="#filter-sentsms">
                                                    <i class="fas fa-filter"></i> Filter
                                                </a>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="card-category">Total number of Weekly SMS</div>
                                                <div class="d-flex flex-wrap justify-content-around pb-2 pt-4">
                                                    <canvas id="multipleBarChart"></canvas>

                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="card-category">Total SMS statistics</div>

                                                <?php echo $__env->make('fcviews.partials.filter-requestivr', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                                <div class="row py-3">
                                                    <div class="col-md-4 d-flex flex-column justify-content-around">
                                                        <div>
                                                     
                                                            <h6 class="fw-bold">Total  No. <?php echo e($smscount); ?></h6>
                                                     
                                                            <h6 class="fw-bold"> Sent No. <?php echo e($smscountsent); ?></h6>
                                             
                                                            <h6 class="fw-bold"> Success No. <?php echo e($smscountSuccess); ?></h6>
                                                 
                                                            <h6 class="fw-bold"> Failed No. <?php echo e($smscountfailed); ?></h6>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-8">
                                                        <div style="width:80%;">

                                                            <div id="chart">
                                                            <?php echo $chart1->container(); ?>

                                                            </div>
                                                           
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>	
                        </div>
         <div class="row mt--2">
                            <div class="col-md-12">
                                <div class="card full-height">
                                    <div class="card-body">
                                        <div class="card-body">Shortcode statistics
                                            <?php echo $__env->make('fcviews.partials.filter-shortcode', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                                            <div class="text-right mb-3 border-bottom pb-1">
                                                <div class="card-title pull-left"></div>

                                                <a class="btn btn-success btn-border btn-round btn-sm" data-toggle="collapse" data-target="#filter-shortcode">
                                                    <i class="fas fa-filter"></i> Filter
                                                </a>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="card-category">Total number of Weekly SHORTCODE  sms </div>
                                                <div class="d-flex flex-wrap justify-content-around pb-2 pt-4">
                                                    <canvas id="myMultipleBarChartshortcode"></canvas>
                                                    <!-- <progress id="animationProgress" max="1" value="0" style="width: 100%"></progress> -->
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="card-category">Total SHORTCODE statistics</div>

                                                <?php echo $__env->make('fcviews.partials.filter-requestivr', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                                <div class="row py-3">
                                                        <div class="col-md-4 d-flex flex-column justify-content-around">
                                            <div>
                                          
                                               
                                            </div>
                                        </div>
                                                    <div class="col-md-8">
                                                        <div style="width:80%;">

                                                            <div id="chart">
                                                             <?php echo $chart2->container(); ?>

                                                            </div>
                                                            
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>	




                        </div>






     <div class="row mt--2">



                            <div class="col-md-12">
                                <div class="card full-height">
                                    <div class="card-body">
                                        <div class="card-body">IVR statistics
                                            <?php echo $__env->make('fcviews.partials.filter-ivr', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                                            <div class="text-right mb-3 border-bottom pb-1">
                                                <div class="card-title pull-left"></div>

                                                <a class="btn btn-success btn-border btn-round btn-sm" data-toggle="collapse" data-target="#filter-ivr">
                                                    <i class="fas fa-filter"></i> Filter
                                                </a>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="card-category">Total number of Weekly IVR</div>
                                                <div class="d-flex flex-wrap justify-content-around pb-2 pt-4">
                                                    <canvas id="myMultipleBarChartivr"></canvas>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="card-category">Total IVR statistics</div>

                                            
                                                <div class="row py-3">
                                                         <div class="col-md-4 d-flex flex-column justify-content-around">
                                            <div>
                                                <h6 class="fw-bold text-uppercase text-danger op-8"></h6>
                                                <h3 class="fw-bold">
                                            </div>
                                            <div>
                                                <h6 class="fw-bold text-uppercase text-warning op-8"></h6>
                                                <h3 class="fw-bold"> 
                                            </div>

                                            <div>
                                                <h6 class="fw-bold text-uppercase text-warning op-8"></h6>
                                                <h3 class="fw-bold">
                                            </div>
                                        </div>
                                                    <div class="col-md-8">
                                                        <div style="width:80%;">

                                                            <div id="chart">
                                                              <?php echo $chart3->container(); ?>

                                                            </div>
                                                            
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>	
                        </div></div>
        <div class="row">
                        <div class="col-md-12">
                            <div class="card">
                                <div class="card-header">
                                    <div class="card-head-row">
                                        <div class="card-title">


                                            <div class="card-body">Messages  
                                                

                                                <div class="text-right mb-3 border-bottom pb-1">
                                                    <div class="card-title pull-left"></div>

                                                    <!--<a class="btn btn-success btn-border btn-round btn-sm" data-toggle="collapse" data-target="#filter-panel">-->
                                                    <!--    <i class="fas fa-filter"></i> Filter-->
                                                    <!--</a>-->
                                                </div>


                                            </div>

                                        </div>
                                    </div>
                                    <div class="card-body">
                                        <div class="chart-container" style="min-height: 5px">

                                            <!-- check if exist -->
                                            <?php if(!$trans->count()): ?>
                                            <?php echo $__env->make('layouts.nodata', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                            <?php else: ?>

                                            <div class="table-responsive">
                                                <table  id="table" class="display table table-striped table-hover">
                                                    <thead>
                                                        <tr>
                                                            <th>Destination</th>

                                                            <th>SMS</th>
                                                            <th>Source</th>
                                                            <th class="text-center">SMS No</th>
                                                        </tr>
                                                    </thead>
                                                    <tfoot>
                                                    <tr>
                                                            <th>Destination</th>

                                                            <th>SMS</th>
                                                            <th>Source</th>
                                                            <th class="text-center">SMS No</th>
                                                        </tr>
                                                    </tfoot>
                                                    <tbody>
                                                        <?php $__currentLoopData = $trans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <tr>
                                                            <td><?php echo e($group->description); ?></td>

                                                            <td><?php echo e($group->sms); ?></td>
                                                            <td><?php echo e($group->source); ?></td>
                                                            <td><?php echo e($group->sms_size); ?> </td>
                                                        </tr>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    </tbody>
                                                </table>

                                                <?php endif; ?>
                                            </div>

                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="<?php echo e(asset('js/jquery.min.js')); ?>"></script>
<script type="text/javascript">
$(document).ready(function() {
    // var progress = document.getElementById('animationProgress');
    $.ajax({
        url: '/fc/getshortcodealldata',
        dataType: 'json',
        type: "GET",
        success: function (data) {
        var complex = data;

        var success = complex.success;
        var failed = complex.failed;
        var sent = complex.sent;
        var failed = complex.failed;
        var day7 = "<?php echo now()->subDays(6)->format('d');?>";
        var day6 = "<?php echo now()->subDays(5)->format('d');?>";
        var day5 = "<?php echo now()->subDays(4)->format('d');?>";
        var day4 = "<?php echo now()->subDays(3)->format('d');?>";
        var day3 = "<?php echo now()->subDays(2)->format('d');?>";
        var day2 = "<?php echo now()->subDays(1)->format('d');?>";
        var day1 = "<?php echo now()->format('d'); ?>";
        var myMultipleBarChart = new Chart(myMultipleBarChartshortcode, {
            type: 'bar',
            data: {
                labels: [day7,day6,day5,day4,day3,day2,day1],
                datasets: [{
                        label: "Success",
                        backgroundColor: '#59d05d',
                        borderColor: '#59d05d',
                        data: [success.day1, success.day2, success.day3, success.day4, success.day5, success.day6, success.day7],
                    }, {
                        label: "Failed",
                        backgroundColor: '#fdaf4b',
                        borderColor: '#fdaf4b',
                        data: [failed.day1, failed.day2, failed.day3, failed.day4, failed.day5, failed.day6, failed.day7],
                    }],
            },
            options: {
                responsive: true,
                maintainAspectRatio: true,
                legend: {
                    position: 'bottom'
                },
                title: {
                    display: true,
                    text: 'SMS Stats'
                },
                tooltips: {
                    mode: 'index',
                    intersect: false
                },
                responsive: true,
                scales: {
                    xAxes: [{
                            stacked: true,
                             gridLines: {
                            show: false
                          }
                        }],
                    yAxes: [{
                            stacked: true,
                        
                        }]
                },
                // animation: {
                //     duration: 2000,
                //     onProgress: function(animation) {
                //         progress.value = animation.currentStep / animation.numSteps;
                //     },
                //     onComplete: function(animation) {
                //         window.setTimeout(function() {
                //             progress.value = 0;
                //         }, 2000);
                //     }
                // }
            },

        });
        },
        // error: function (data) {
        //     console.log('Error:', data);
        // }
    });
});
</script>

<script type="text/javascript">
    $(document).ready(function() {
        $.ajax({
            url: '/fc/getivralldata',
            dataType: 'json',
            type: "GET",
            success: function (data) {
                var complex = data;

                var success = complex.success;
                var failed = complex.failed;
                var day7 = "<?php echo now()->subDays(6)->format('d');?>";
                var day6 = "<?php echo now()->subDays(5)->format('d');?>";
                var day5 = "<?php echo now()->subDays(4)->format('d');?>";
                var day4 = "<?php echo now()->subDays(3)->format('d');?>";
                var day3 = "<?php echo now()->subDays(2)->format('d');?>";
                var day2 = "<?php echo now()->subDays(1)->format('d');?>";
                var day1 = "<?php echo now()->format('d'); ?>";
                var myMultipleBarChart = new Chart(myMultipleBarChartivr, {
                    type: 'bar',
                    data: {
                        labels: [day7,day6,day5,day4,day3,day2,day1],
                        datasets: [{
                                label: "Success",
                                backgroundColor: '#59d05d',
                                borderColor: '#59d05d',
                                data: [success.day1, success.day2, success.day3, success.day4, success.day5, success.day6, success.day7],
                            }, {
                                label: "Failed",
                                backgroundColor: '#fdaf4b',
                                borderColor: '#fdaf4b',
                                data: [failed.day1, failed.day2, failed.day3, failed.day4, failed.day5, failed.day6, failed.day7],
                            }],
                    },
                    options: {
                        responsive: true,
                        maintainAspectRatio: true,
                        legend: {
                            position: 'bottom'
                        },
                        title: {
                            display: true,
                            text: 'SMS Stats'
                        },
                        tooltips: {
                            mode: 'index',
                            intersect: false
                        },
                        responsive: true,
                        scales: {
                            xAxes: [{
                                    stacked: true,
                                    gridLines: {
                                    show: false
                                }
                                }],
                            yAxes: [{
                                    stacked: true,
                                
                                }]
                        }
                    }
                });
                },
            // error: function (data) {
            //     console.log('Error:', data);
            // }
        });
    });

</script>
<script type="text/javascript">
$(document).ready(function() {
    $.ajax({
        url: '/fc/getalldata',
        dataType: 'json',
        type: "GET",
        success: function (data) {
            var complex = data;
            
            var success = complex.success;
            var failed = complex.failed;
            var sent = complex.sent;
            var day7 = "<?php echo now()->subDays(6)->format('d');?>";
            var day6 = "<?php echo now()->subDays(5)->format('d');?>";
            var day5 = "<?php echo now()->subDays(4)->format('d');?>";
            var day4 = "<?php echo now()->subDays(3)->format('d');?>";
            var day3 = "<?php echo now()->subDays(2)->format('d');?>";
            var day2 = "<?php echo now()->subDays(1)->format('d');?>";
            var day1 = "<?php echo now()->format('d'); ?>";
            console.log(day1);
            var myMultipleBarChart = new Chart(multipleBarChart, {
                type: 'bar',
                data: {
                    labels: [day7,day6,day5,day4,day3,day2,day1],
                    datasets: [{
                            label: "Success",
                            backgroundColor: '#59d05d',
                            borderColor: '#59d05d',
                            data: [success.day7, success.day6, success.day5, success.day4, success.day3, success.day2, success.day1],
                        }, {
                            label: "Failed",
                            backgroundColor: '#fdaf4b',
                            borderColor: '#fdaf4b',
                            data: [failed.day7, failed.day6, failed.day5, failed.day4, failed.day3, failed.day2, failed.day1],
                        }, {
                            label: "Sent",
                            backgroundColor: '#177dff',
                            borderColor: '#177dff',
                            data: [sent.day7, sent.day6, sent.day5, sent.day4, sent.day3, sent.day2, sent.day1],
                        }],
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: true,
                    legend: {
                        position: 'bottom'
                    },
                    title: {
                        display: true,
                        text: 'SMS Stats'
                    },
                    tooltips: {
                        mode: 'index',
                        intersect: false
                    },
                    responsive: true,
                    scales: {
                        xAxes: [{
                                stacked: true,
                                gridLines: {
                                show: false
                            }
                            }],
                        yAxes: [{
                                stacked: true,
                            
                            }]
                    }
                }
            });
        },
        // error: function (data) {
        //     console.log('Error:', data);
        // }
    });
});


</script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('fcviews.layouts.org', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/dashmobisky/public_html/Accounts/resources/views/fcviews/organization-dashboard.blade.php ENDPATH**/ ?>