ok

Mini Shell

Direktori : /home2/selectio/www/a1tex.in/storage/framework/views/
Upload File :
Current File : /home2/selectio/www/a1tex.in/storage/framework/views/d8771c023a3398ced3375dd014156de68053788a.php

<?php $__env->startSection('title',\App\CPU\translate('customer_loyalty_point').' '.\App\CPU\translate('report')); ?>

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

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

<?php $__env->startSection('content'); ?>
    <div class="content container-fluid">
        <!-- Page Title -->
        <div class="mb-3">
            <h2 class="h1 mb-0 text-capitalize d-flex align-items-center gap-2">
                <img width="20" src="<?php echo e(asset('/public/assets/back-end/img/loyalty_point.png')); ?>" alt="">
                <?php echo e(\App\CPU\translate('customer_loyalty_point_report')); ?>

            </h2>
        </div>
        <!-- End Page Title -->

        <div class="card">
            <div class="card-header text-capitalize">
                <h4 class="mb-0"><?php echo e(\App\CPU\translate('filter')); ?> <?php echo e(\App\CPU\translate('options')); ?></h4>
            </div>
            <div class="card-body">
                <div class="row">
                    <div class="col-lg-12 pt-3">
                        <form action="<?php echo e(route('admin.customer.loyalty.report')); ?>" method="get">
                            <div class="row">
                                <div class="col-sm-6 col-12">
                                    <div class="mb-3">
                                        <input type="date" name="from" id="from_date" value="<?php echo e(request()->get('from')); ?>" class="form-control" title="<?php echo e(\App\CPU\translate('from')); ?> <?php echo e(\App\CPU\translate('date')); ?>">
                                    </div>
                                </div>
                                <div class="col-sm-6 col-12">
                                    <div class="mb-3">
                                        <input type="date" name="to" id="to_date" value="<?php echo e(request()->get('to')); ?>" class="form-control" title="<?php echo e(ucfirst(\App\CPU\translate('to'))); ?> <?php echo e(\App\CPU\translate('date')); ?>">
                                    </div>
                                </div>
                                <div class="col-sm-6 col-12">
                                    <div class="mb-3">
                                        <?php
                                        $transaction_status=request()->get('transaction_type');
                                        ?>
                                        <select name="transaction_type" id="" class="form-control" title="<?php echo e(\App\CPU\translate('select')); ?> <?php echo e(\App\CPU\translate('transaction_type')); ?>">
                                            <option value=""><?php echo e(\App\CPU\translate('all')); ?></option>
                                            <option value="point_to_wallet" <?php echo e(isset($transaction_status) && $transaction_status=='point_to_wallet'?'selected':''); ?>><?php echo e(\App\CPU\translate('point_to_wallet')); ?></option>
                                            <option value="order_place" <?php echo e(isset($transaction_status) && $transaction_status=='order_place'?'selected':''); ?>><?php echo e(\App\CPU\translate('order_place')); ?></option>
                                            <option value="refund_order" <?php echo e(isset($transaction_status) && $transaction_status=='refund_order'?'selected':''); ?>><?php echo e(\App\CPU\translate('refund_order')); ?></option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-12">
                                    <div class="mb-3">
                                        <select id='customer' name="customer_id" data-placeholder="<?php echo e(\App\CPU\translate('select_customer')); ?>" class="js-data-example-ajax form-control" title="<?php echo e(\App\CPU\translate('select_customer')); ?>">
                                            <?php if(request()->get('customer_id') && $customer_info = \App\User::find(request()->get('customer_id'))): ?>
                                                <option value="<?php echo e($customer_info->id); ?>" selected><?php echo e($customer_info->f_name.' '.$customer_info->l_name); ?>(<?php echo e($customer_info->phone); ?>)</option>
                                            <?php endif; ?>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div>
                                <button type="submit" class="btn btn--primary px-4"><i class="tio-filter-list mr-1"></i><?php echo e(\App\CPU\translate('filter')); ?></button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>

        </div>
        <div class="card mt-3">
            <div class="card-header text-capitalize">
                <h4 class="mb-0"><?php echo e(\App\CPU\translate('summary')); ?></h4>
            </div>
            <div class="card-body">
                <div class="d-flex flex-wrap gap-3">
                    <?php
                        $credit = $data[0]->total_credit??0;
                        $debit = $data[0]->total_debit??0;
                        $balance = $credit - $debit;
                    ?>

                    <!--Debit earned-->
                    <div class="order-stats flex-grow-1">
                        <div class="order-stats__content">
                            <i class="tio-atm"></i>
                            <h6 class="order-stats__subtitle"><?php echo e(\App\CPU\translate('debit')); ?></h6>
                        </div>
                        <span class="order-stats__title fz-14 text--primary">
                            <?php echo e($debit); ?>

                        </span>
                    </div>
                    <!--Debit earned End-->

                    <!--credit earned-->
                    <div class="order-stats flex-grow-1">
                        <div class="order-stats__content">
                            <i class="tio-money"></i>
                            <h6 class="order-stats__subtitle"><?php echo e(\App\CPU\translate('credit')); ?></h6>
                        </div>
                        <span class="order-stats__title fz-14 text-warning">
                            <?php echo e($credit); ?>

                        </span>
                    </div>
                    <!--credit earned end-->

                    <!--balance earned-->
                    <div class="order-stats flex-grow-1">
                        <div class="order-stats__content">
                            <i class="tio-wallet"></i>
                            <h6 class="order-stats__subtitle"><?php echo e(\App\CPU\translate('balance')); ?></h6>
                        </div>
                        <span class="order-stats__title fz-14 text-success">
                            <?php echo e($balance); ?>

                        </span>
                    </div>
                    <!--balance earned end-->
                </div>
            </div>
        </div>

        <!-- Card -->
        <div class="card mt-3">
            <!-- Header -->
            <div class="card-header text-capitalize">
                <h4 class="mb-0">
                    <?php echo e(\App\CPU\translate('transactions')); ?>

                    <span class="badge badge-soft-dark radius-50 fz-12 ml-1"><?php echo e($transactions->count()); ?></span>
                </h4>
            </div>
            <!-- End Header -->

            <!-- Body -->
            <div class="table-responsive">
                <table id="datatable"
                    class="table table-hover table-borderless table-thead-bordered table-nowrap table-align-middle card-table <?php echo e(Session::get('direction') === "rtl" ? 'text-right' : 'text-left'); ?>">
                    <thead class="thead-light thead-50 text-capitalize">
                        <tr>
                            <th><?php echo e(\App\CPU\translate('SL')); ?></th>
                            <th><?php echo e(\App\CPU\translate('transaction')); ?> <?php echo e(\App\CPU\translate('id')); ?></th>
                            <th><?php echo e(\App\CPU\translate('Customer')); ?></th>
                            <th><?php echo e(\App\CPU\translate('credit')); ?></th>
                            <th><?php echo e(\App\CPU\translate('debit')); ?></th>
                            <th><?php echo e(\App\CPU\translate('balance')); ?></th>
                            <th><?php echo e(\App\CPU\translate('transaction_type')); ?></th>
                            <th><?php echo e(\App\CPU\translate('reference')); ?></th>
                            <th class="text-center"><?php echo e(\App\CPU\translate('created_at')); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php $__currentLoopData = $transactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k=>$wt): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr scope="row">
                            <td ><?php echo e($k+$transactions->firstItem()); ?></td>
                            <td><?php echo e($wt->transaction_id); ?></td>
                            <td><a href="<?php echo e(route('admin.customer.view',['user_id'=>$wt->user_id])); ?>" class="title-color hover-c1"><?php echo e(Str::limit($wt->user?$wt->user->f_name.' '.$wt->user->l_name:\App\CPU\translate('not_found'),20,'...')); ?></a></td>
                            <td><?php echo e($wt->credit); ?></td>
                            <td><?php echo e($wt->debit); ?></td>
                            <td><?php echo e($wt->balance); ?></td>
                            <td>
                                <span class="badge badge-soft-<?php echo e($wt->transaction_type=='order_refund'
                                    ?'danger'
                                    :($wt->transaction_type=='loyalty_point'?'warning'
                                        :($wt->transaction_type=='order_place'
                                            ?'info'
                                            :'success'))); ?>">
                                    <?php echo e(\App\CPU\translate($wt->transaction_type)); ?>

                                </span>
                            </td>
                            <td><?php echo e($wt->reference); ?></td>
                            <td class="text-center"><?php echo e(date('Y/m/d '.config('timeformat'), strtotime($wt->created_at))); ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>


            <div class="table-responsive mt-4">
                <div class="px-4 d-flex justify-content-lg-end">
                    <!-- Pagination -->
                    <?php echo $transactions->links(); ?>

                </div>
            </div>

            <!-- End Body -->
            <?php if(count($transactions)==0): ?>
                <div class="text-center p-4">
                    <img class="mb-3 w-160" src="<?php echo e(asset('public/assets/back-end')); ?>/svg/illustrations/sorry.svg" alt="Image Description">
                    <p class="mb-0"><?php echo e(\App\CPU\translate('No_data_to_show')); ?></p>
                </div>
            <?php endif; ?>

        </div>
        <!-- End Card -->
    </div>
<?php $__env->stopSection(); ?>

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

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

<?php $__env->startPush('script_2'); ?>
    <script>
        $(document).on('ready', function () {
            $('.js-data-example-ajax').select2({
                ajax: {
                    url: '<?php echo e(route('admin.customer.customer-list-search')); ?>',
                    data: function (params) {
                        return {
                            q: params.term, // search term
                            all:true,
                            page: params.page
                        };
                    },
                    processResults: function (data) {
                        return {
                        results: data
                        };
                    },
                    __port: function (params, success, failure) {
                        var $request = $.ajax(params);

                        $request.then(success);
                        $request.fail(failure);

                        return $request;
                    }
                }
            });

            // INITIALIZATION OF FLATPICKR
            // =======================================================
            $('.js-flatpickr').each(function () {
                $.HSCore.components.HSFlatpickr.init($(this));
            });


            // INITIALIZATION OF NAV SCROLLER
            // =======================================================
            $('.js-nav-scroller').each(function () {
                new HsNavScroller($(this)).init()
            });


            // INITIALIZATION OF DATERANGEPICKER
            // =======================================================
            $('.js-daterangepicker').daterangepicker();

            $('.js-daterangepicker-times').daterangepicker({
                timePicker: true,
                startDate: moment().startOf('hour'),
                endDate: moment().startOf('hour').add(32, 'hour'),
                locale: {
                    format: 'M/DD hh:mm A'
                }
            });

            var start = moment();
            var end = moment();

            function cb(start, end) {
                $('#js-daterangepicker-predefined .js-daterangepicker-predefined-preview').html(start.format('MMM D') + ' - ' + end.format('MMM D, YYYY'));
            }

            $('#js-daterangepicker-predefined').daterangepicker({
                startDate: start,
                endDate: end,
                ranges: {
                    'Today': [moment(), moment()],
                    'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                    'Last 7 Days': [moment().subtract(6, 'days'), moment()],
                    'Last 30 Days': [moment().subtract(29, 'days'), moment()],
                    'This Month': [moment().startOf('month'), moment().endOf('month')],
                    'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
                }
            }, cb);

            cb(start, end);


            // INITIALIZATION OF CHARTJS
            // =======================================================
            $('.js-chart').each(function () {
                $.HSCore.components.HSChartJS.init($(this));
            });

            var updatingChart = $.HSCore.components.HSChartJS.init($('#updatingData'));

            // Call when tab is clicked
            $('[data-toggle="chart"]').click(function (e) {
                let keyDataset = $(e.currentTarget).attr('data-datasets')

                // Update datasets for chart
                updatingChart.data.datasets.forEach(function (dataset, key) {
                    dataset.data = updatingChartDatasets[keyDataset][key];
                });
                updatingChart.update();
            })


            // INITIALIZATION OF MATRIX CHARTJS WITH CHARTJS MATRIX PLUGIN
            // =======================================================
            function generateHoursData() {
                var data = [];
                var dt = moment().subtract(365, 'days').startOf('day');
                var end = moment().startOf('day');
                while (dt <= end) {
                    data.push({
                        x: dt.format('YYYY-MM-DD'),
                        y: dt.format('e'),
                        d: dt.format('YYYY-MM-DD'),
                        v: Math.random() * 24
                    });
                    dt = dt.add(1, 'day');
                }
                return data;
            }

            $.HSCore.components.HSChartMatrixJS.init($('.js-chart-matrix'), {
                data: {
                    datasets: [{
                        label: 'Commits',
                        data: generateHoursData(),
                        width: function (ctx) {
                            var a = ctx.chart.chartArea;
                            return (a.right - a.left) / 70;
                        },
                        height: function (ctx) {
                            var a = ctx.chart.chartArea;
                            return (a.bottom - a.top) / 10;
                        }
                    }]
                },
                options: {
                    tooltips: {
                        callbacks: {
                            title: function () {
                                return '';
                            },
                            label: function (item, data) {
                                var v = data.datasets[item.datasetIndex].data[item.index];

                                if (v.v.toFixed() > 0) {
                                    return '<span class="font-weight-bold">' + v.v.toFixed() + ' hours</span> on ' + v.d;
                                } else {
                                    return '<span class="font-weight-bold">No time</span> on ' + v.d;
                                }
                            }
                        }
                    },
                    scales: {
                        xAxes: [{
                            position: 'bottom',
                            type: 'time',
                            offset: true,
                            time: {
                                unit: 'week',
                                round: 'week',
                                displayFormats: {
                                    week: 'MMM'
                                }
                            },
                            ticks: {
                                "labelOffset": 20,
                                "maxRotation": 0,
                                "minRotation": 0,
                                "fontSize": 12,
                                "fontColor": "rgba(22, 52, 90, 0.5)",
                                "maxTicksLimit": 12,
                            },
                            gridLines: {
                                display: false
                            }
                        }],
                        yAxes: [{
                            type: 'time',
                            offset: true,
                            time: {
                                unit: 'day',
                                parser: 'e',
                                displayFormats: {
                                    day: 'ddd'
                                }
                            },
                            ticks: {
                                "fontSize": 12,
                                "fontColor": "rgba(22, 52, 90, 0.5)",
                                "maxTicksLimit": 2,
                            },
                            gridLines: {
                                display: false
                            }
                        }]
                    }
                }
            });


            // INITIALIZATION OF CLIPBOARD
            // =======================================================
            $('.js-clipboard').each(function () {
                var clipboard = $.HSCore.components.HSClipboard.init(this);
            });


            // INITIALIZATION OF CIRCLES
            // =======================================================
            $('.js-circle').each(function () {
                var circle = $.HSCore.components.HSCircles.init($(this));
            });
        });
    </script>

    <script>
        $('#from_date,#to_date').change(function () {
            let fr = $('#from_date').val();
            let to = $('#to_date').val();
            if (fr != '' && to != '') {
                if (fr > to) {
                    $('#from_date').val('');
                    $('#to_date').val('');
                    toastr.error('Invalid date range!', Error, {
                        CloseButton: true,
                        ProgressBar: true
                    });
                }
            }

        })
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.back-end.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home2/selectio/public_html/myclassicfit.com/resources/views/admin-views/customer/loyalty/report.blade.php ENDPATH**/ ?>

Zerion Mini Shell 1.0