KUJUNTI.ID MINISH3LL
Path : /var/www/html/jewelry-pos/resources/views/
(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/summary.blade.php


@extends('layouts.admin-main')
@section('content')
    <div class="col-lg-12">
        <div class="card-body shadow-1">
            <div class="row">
                <div class="col-lg-12 col-xs-12 my-2">
                    <div class="row ">
                        <div class="col-md-2 col-xs-12 ">
                            <form method="GET" action="{{ route('summary') }}" id="search-form">
                                <div class="input-group">
                                    <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>
                            </form>
                        </div>
                        <div class="col-md-2 col-xs-12">
                            <a href="{{ route('summary') }}" type="submit" class="btn btn-success mx-2">
                                <i class="fal fa-search"></i>
                                {{ __('message.search') }}
                            </a> 
                            {{-- <form method="GET" action="{{ route('bank-account-transactions.index') }}" id="search-form">
                            <div class="input-group">
                                <input type="text" class="form-control rounded-0"
                                    placeholder="{{ __('message.search') }}..." id="custom-range">
                                <div class="input-group-append">
                                    <a href="{{ route('summary') }}" type="submit"
                                        class="input-group-text fs-xl rounded-0">
                                        <i class="fal fa-search text-success"></i>
                                    </a>
                                </div>

                            </div>
                            </form> --}}
                        </div>
                        <div class="col-md-4 col-xs-12">

                            <a href="{{ route('summary') }}" type="rset" class="btn btn-outline-info rounded-0">
                                <i class="fal fa-sync"></i>
                                <span class="hidden-xs"> {{ __('message.refresh') }}</span>
                            </a>
                        </div>
                        {{-- <div class="col-md-4 col-xs-12">
                            <a href="{{ route('summary.download') }}" type="submit" class="btn btn-success bg-success-800 float-right rounded-0">
                                <i class="fal fa-download fa-lg"></i>
                                {{ __('message.export excel') }}
                            </a>
                        </div> --}}
                    </div>
                </div>
            </div>
            <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-50">
                                <tr>
                                    {{-- <th>{{ __('message.no') }}</th> --}}
                                    <th>{{ __('message.product') }}</th>
                                    <th>{{ __('message.deposit') }}</th>
                                    <th>{{ __('message.withdraw') }}</th>
                                    <th>{{ __('message.promotion') }}</th>
                                    <th>{{ __('message.rebate') }}</th>
                                    <th>{{ __('message.bonus') }}</th>
                                    <th>{{ __('message.bonus in') }}</th>
                                    <th>{{ __('message.total expense') }}</th>
                                    <th>{{ __('message.total win/lose') }}</th>
                                </tr>
                            </thead>
                            <tbody style="font-weight: bold;">
                                <?php
                                $totalDeposit = 0;
                                $totalWithdraw = 0;
                                $totalPromotion = 0;
                                $totalRebate = 0;
                                $totalBonus = 0;
                                $totalBonusIn = 0;
                                $totalWinLose = 0;
                                
                                ?>
                                @foreach ($products as $index => $product)
                                    <?php
                                    $deposit_ = App\Http\Controllers\HomeController::deposits($product, $start_date, $end_date)->sum('amount');
                                    $totalDeposit = $totalDeposit + $deposit_;
                                    
                                    $withdraw_ = App\Http\Controllers\HomeController::withdraws($product, $start_date, $end_date)->sum(\DB::raw('amount + tip'));
                                    $totalWithdraw = $totalWithdraw + $withdraw_;
                                    
                                    $promotion_ = App\Http\Controllers\HomeController::promotions($product, $start_date, $end_date)->sum('amount');
                                    $totalPromotion = $totalPromotion + $promotion_;
                                    
                                    $rebate_ = App\Http\Controllers\HomeController::rebates($product, $start_date, $end_date)
                                        ->where('is_bonus', false)
                                        ->sum('amount');
                                    $totalRebate = $totalRebate + $rebate_;
                                    
                                    $bonus_ = App\Http\Controllers\HomeController::rebates($product, $start_date, $end_date)
                                        ->where('is_bonus', true)
                                        ->sum('amount');
                                    $totalBonus = $totalBonus + $bonus_;
                                    
                                    $bonusIn_ = App\Http\Controllers\HomeController::withdraws($product, $start_date, $end_date)->sum('bonus');
                                    $totalBonusIn = $totalBonusIn + $bonusIn_;
                                    
                                    $winLose = $deposit_ - $withdraw_;
                                    $totalWinLose = $totalWinLose + $winLose;
                                    ?>

                                    <tr>
                                        <td>
                                            {{ $product->name ?? '' }}
                                        </td>
                                        <td
                                            style="@if ($deposit_ == 0) color: gray; @else color:#0a6778 ; @endif font-weight:bold;">
                                            {{ $currency }} {{ number_format($deposit_, 2) }}
                                        </td>
                                        <td
                                            style="@if ($withdraw_ == 0) color: gray; @else color:#c62232 ; @endif font-weight:bold;">
                                            {{ $currency }} {{ number_format($withdraw_, 2) }}
                                        </td>
                                        <td
                                            style="@if ($promotion_ == 0) color: gray; @else color:#c62232 ; @endif font-weight:bold;">
                                            {{ $currency }} {{ number_format($promotion_, 2) }}
                                        </td>
                                        <td
                                            style="@if ($rebate_ == 0) color: gray; @else color:#c62232; @endif font-weight:bold;">
                                            {{ $currency }} {{ number_format($rebate_, 2) }}
                                        </td>
                                        <td
                                            style="@if ($bonus_ == 0) color:gray; @else color:#c62232; @endif font-weight:bold;">
                                            {{ $currency }} {{ number_format($bonus_, 2) }}
                                        </td>
                                        <td
                                            style="@if ($bonusIn_ == 0) color:gray; @else color:#0a6778 ; @endif font-weight:bold;">
                                            {{ $currency }} {{ number_format($bonusIn_, 2) }}
                                        </td>
                                        <td style="background-color:#A9A9A9">

                                        </td>
                                        <td
                                            style="@if ($winLose < 0) color:#c62232; @elseif($winLose == 0) color:gray; @else color:#0a6778; @endif font-weight:bold;">
                                            {{ $currency }} {{ number_format($winLose, 2) }}
                                        </td>
                                    </tr>
                            </tbody>
                            @endforeach
                            <tr style="background-color: #a9a9a92d;">
                                <th>{{ __('message.total') }} :</th>
                                <th>
                                    {{ $currency }} {{ number_format($totalDeposit, 2) }}
                                </th>
                                <th>
                                    {{ $currency }} {{ number_format($totalWithdraw, 2) }}
                                </th>
                                <th>
                                    {{ $currency }} {{ number_format($totalPromotion, 2) }}
                                </th>
                                <th>
                                    {{ $currency }} {{ number_format($totalRebate, 2) }}
                                </th>
                                <th>
                                    {{ $currency }} {{ number_format($totalBonus, 2) }}
                                </th>
                                <th>
                                    {{ $currency }} {{ number_format($totalBonusIn, 2) }}
                                </th>
                                <th>
                                    {{ $currency }} {{ isset($expense) ? number_format($expense, 2) : 0 }}
                                </th>
                                <th title="{{ __('message.deposit') }} - {{ __('message.withdraw') }}"
                                    style="@if ($totalWinLose > 0) background-color:#006400 !important; @else  background-color:#a9a9a911 !important; @endif">
                                    <span style="@if ($totalWinLose < 0) color:#c62232 @else color:black @endif;">
                                        {{ $currency }} {{ number_format($totalWinLose, 2) }} </span>
                                    <br />
                                </th>
                            </tr>
                            <tr>
                            <tr style="background-color: #a9a9a92d;">
                                <th>{{ __('message.transaction count') }} :</th>
                                <th>{{ $depositCount }}</th>
                                <th>{{ $withdrawCount }}</th>
                                <th>{{ $promotionCount }}</th>
                                <th>{{ $rebateCount }}</th>
                                <th>{{ $bonusCount }}</th>
                                <th>{{ $bonusInCount }} </th>
                                <th>{{ $expenseCount }}</th>
                                <th></th>
                            </tr>
                            </tr>
                        </table>
                        <!-- datatable end -->
                    </div>
                </div>

            </div>
        </div>
        <div class="py-4 mt-4 mx-2 ">
            <!-- Pagination bootstrap-->
            {{-- {{ $bankAccountTranactions->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);

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

© KUJUNTI.ID