KUJUNTI.ID MINISH3LL
Path : /var/www/html/jewelry-pos/resources/views/reports/
(S)h3ll Cr3at0r :
F!le Upl0ad :

B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H

Current File : /var/www/html/jewelry-pos/resources/views/reports/index.blade.php


@extends('layouts.admin-main')
@section('content')
    <div class="col-lg-12" style="position: relative;margin: auto;width: 100%;">
        <div class="card-body shadow-1">
            <form method="GET" action="{{ route('report.index') }}" id="search-form">
                <div class="row" style="margin-bottom: 15px;">
                    <div class="col-md-4 col-xs-12 col-xl-6" style="display:flex;justify-content: space-between;align-items: center">
                        <div class="input-group" style="width: 70%;">
                            <input type="text" class="form-control rounded-0"
                                   placeholder="{{ __('message.select') }}" id="datepicker" name="date" readonly>
                            <div class="input-group-append">
                                <span class="input-group-text fs-xl ">
                                    <i class="fal fa-calendar text-info "></i>
                                </span>
                            </div>
                        </div>
                        <div class="" style="width: 25%;">
                            <a href="{{route('report.index')}}?start_date={{$start_date}}&end_date={{$end_date}}" type="rset" class="btn btn-sm btn-outline-info">
                                <i class="fal fa-sync"></i>
                                <span class="hidden-xs"> {{ __('message.refresh') }}</span>
                            </a>
                        </div>
                    </div>
                    <div class="col-md-6 col-xs-12 col-xl-6" style="display: flex;justify-content: end;align-items: center">
                        <a href="{{route('report.print')}}?start_date={{$start_date}}&end_date={{$end_date}}" type="submit"
                           class="btn btn-info bg-info-800 float-right rounded-0 mr-4"
                           title="{{ __('message.print') }}" name=""
                            {{--                                           onclick="return print()"--}}
                            {{--                                           @if (count($members) <= 0) disabled @endif>--}} >
                            <i class="fal fa-print"></i>
                            {{ __('message.print') }}
                        </a>
                    </div>
                </div>
            </form>
            <div class="panel-container show">
                <div class="d-flex flex-column h-100">
                    <div class="h-auto">
                        <table id="example" class="table table-bordered table-hover table-striped w-100">
                            <thead class="bg-fusion-400 text-center">
                            <tr>
                                <th>#</th>
                                <th>{{__('message.date')}}</th>
                                <th class="text-center">{{ __('message.total sale') }}</th>
{{--                                <th>{{ __('message.total discount') }}</th>--}}
                                <th class="text-center">{{ __('message.amount sale') }}</th>
{{--                                <th>{{ __('message.amount discount') }}</th>--}}
                            </tr>
                            </thead>
                            <tbody class="text-center">
                            <?php
                            $period = Carbon\CarbonPeriod::create($start_date,'1 day', $end_date);
                            $period = array_reverse($period->toArray());
                            $count = 1;
                            $total_usd = 0;
                            $total_khr=0;
                            $total_thb=0;
                            ?>
                            @foreach($period as $index => $date)
                                <?php
                                    $sales =  \App\Models\Sale::whereBetween('created_at' , [$date , $date->format('Y-m-d') . ' 23:59:59']);
                                    $currencies = \App\Models\Currency::all();
                                ?>
                                <tr>
                                    <td>{{$index+1}}</td>
                                    <td>
                                        {{$date->format('Y-m-d')}}
                                    </td>
                                    <td>
                                        <?php
                                            $help = Clone ($sales);
                                            $totalSale = $help->count();
                                        ?>
                                        {{$totalSale}}
                                    </td>
                                    <td class="credit">
                                        <div class="row">
                                            <?php

                                                $usd_amount = $help->sum('usd_amount');
                                                $total_usd= $total_usd + $usd_amount;
                                                $khr_amount = $help->sum('khr_amount');
                                                $total_khr = $total_khr + $khr_amount;
                                                $thb_amount = $help->sum('thb_amount');
                                                $total_thb = $total_thb + $thb_amount;
                                                $currencies = \App\Models\Currency::get();
                                            ?>
                                            <div class="col-sm-4 col-xl-4">
                                                {{$usd_amount}} {{$currencies[0]->currency_symbol}}
                                            </div>
                                            <div class="col-sm-4 col-xl-4">
                                                {{$khr_amount}} {{$currencies[2]->currency_symbol}}
                                            </div>
                                            <div class="col-sm-4 col-xl-4">
                                                {{$thb_amount}} {{$currencies[1]->currency_symbol}}
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            @endforeach
                            <tr style="font-size: 15px;">
                                <td colspan="3" class="credit">{{__('message.total')}} :</td>
                                <td class="p-2 credit">
                                    <div class="row">
                                        <div class="col-sm-4 col-xl-4">
                                            {{$total_usd}} {{$currencies[0]->name}}
                                        </div>
                                        <div class="col-sm-4 col-xl-4">
                                            {{$total_khr}} {{$currencies[2]->name}}
                                        </div>
                                        <div class="col-sm-4 col-xl-4">
                                            {{$total_thb}} {{$currencies[1]->name}}
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <!-- datatable end -->
                    </div>
                </div>
            </div>
        </div>
        <div class="py-4 mt-4 mx-2 ">
            <!-- Pagination bootstrap-->
{{--                        {{ $sales->appends($_GET)->links() }}--}}
        </div>
    </div>
@endsection
@section('scripts')
    @include('app.datepicker-js-config')
    <script>
        // date earchform  strt_date to EndDate
        $(document).ready(function() {
            $(".ranges > ul > li").click(function() {
                setTimeout(function() {
                    $('#search-form').submit();
                }, 100);

            });
            $("#datepicker").on("change.dp", function() {
                $('#search-form').submit();
            });

        });
        // date
        var runDatePicker = function() {
            // enable clear button
            $('#datepicker').datepicker({
                todayBtn: "linked",
                clearBtn: true,
                todayHighlight: true,
                templates: controls
            });
        }
        // end date
    </script>
    <script>
        $(document).ready(function() {
            $("#js-nav-menu").removeClass('active');
            $("#js-nav-menu li ul li").removeClass('active');
            $("#menu_report_list").addClass('active open');
            $("#collapse_setup").addClass('collapse in')
            // $("#menu_product").addClass('active')
            $("#menu_expense_report").addClass('active')
        })
    </script>
@endsection
@section('meta')
    <title>{{ __('message.summary report') }} - {{$settings_->shop_name}}</title>
@endsection

© KUJUNTI.ID