VaKeR CYBER ARMY
Logo of a company Server : Apache
System : Linux host44.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
User : vapecompany ( 2719)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /home/vapecompany/demo.vapecompany.com.bd/resources/views/backend/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/vapecompany/demo.vapecompany.com.bd/resources/views/backend/old_dashboard.blade.php
@extends('backend.layout.app')
@section('content')
<style type="text/css">
    #container {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}
</style>
 <div class="page-wrapper">
            <!-- ============================================================== -->
            <!-- Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <div class="page-breadcrumb">
                <div class="row">
                    <div class="col-5 align-self-center">
                        <h4 class="page-title">Dashboard</h4>

                    </div>
                    <div class="col-7 align-self-center">
                        <div class="d-flex no-block justify-content-end align-items-center">
                         <!--    <div class="mr-2">
                                <div class="lastmonth"></div>
                            </div> -->
                           <!--  <div class=""><small>LAST MONTH</small>
                                <h4 class="text-info mb-0 font-medium">$58,256</h4></div> -->
                        </div>
                    </div>
                </div>
            </div>
            <!-- ============================================================== -->
            <!-- End Bread crumb and right sidebar toggle -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- Container fluid  -->
            <!-- ============================================================== -->
            <div class="container-fluid">
                <!-- ============================================================== -->
                <!-- Earnings -->
                <!-- ============================================================== -->

                <!-- ============================================================== -->
                <!-- Product Sales -->
                <!-- ============================================================== -->
                <div class="row">
                    <div class="col-sm-12">
                        <div class="card">
                            <div class="card-body">
                                <div class="d-md-flex align-items-center">
                                    <div>
                                        <h4 class="card-title">Product Sales</h4>
                                        <h5 class="card-subtitle">Total Sales</h5>
                                    </div>
                                    <div class="ml-auto d-flex align-items-center">
                                        <!-- Tabs -->
                                        <ul class="nav nav-pills custom-pills" id="pills-tab" role="tablist">
                                            <li class="nav-item">
                                                <a class="nav-link active" id="pills-home-tab2" data-toggle="pill" href="#day" role="tab" aria-selected="true">Day</a>
                                            </li>
                                            <li class="nav-item">
                                                <a class="nav-link" id="pills-profile-tab2" data-toggle="pill" href="#week" role="tab" aria-selected="false">Week</a>
                                            </li>
                                            <li class="nav-item">
                                                <a class="nav-link" id="pills-month-tab2" data-toggle="pill" href="#month" role="tab" aria-selected="false">Month</a>
                                            </li>
                                        </ul>
                                        <!-- Tabs -->
                                    </div>
                                </div>
                                <div class="tab-content mt-3" id="pills-tabContent2">
                                    <div class="tab-pane fade show active" id="day" role="tabpanel" aria-labelledby="pills-home-tab2">
                                        <div class="product-sales" style="height:400px; width:100%;"></div>
                                    </div>
                                    <div class="tab-pane fade" id="week" role="tabpanel" aria-labelledby="pills-profile-tab2">
                                        <div class="rate" style="height:400px; width:100%;"></div>
                                    </div>
                                    <div class="tab-pane fade" id="month" role="tabpanel" aria-labelledby="pills-month-tab2">
                                        <div class="revenue" style="height:400px; width:100%;"></div>
                                    </div>
                                </div>
                                 <input type="hidden" value="{{$lastDayOfMonth}}" class="currentMonthlastday">
                                 <input type="hidden" value="{{Carbon\Carbon::now()->day}}" class="currentMonthnow">
                                 @foreach($selldetailsmonth as $selldetail)
                                <div>

                                        <input type="hidden" class="product_name" value="{{$selldetail->product->product_name}}">
                                         <input type="hidden" class="sall_quantity" value="{{$selldetail->total_sales}}">
                                </div>
                                @endforeach
                                @foreach($selldetailsweek as $selldetail)
                                <div>

                                        <input type="hidden" class="product_name_week" value="{{$selldetail->product->product_name}}">
                                         <input type="hidden" class="sall_quantity_week" value="{{$selldetail->total_sales}}">
                                </div>
                                @endforeach
                                @foreach($selldetailsmonthly as $k=>$selldetail)
                                <div>


                                         <input type="hidden" class="product_name_daily" value="{{$selldetail->product->product_name}}">
                                         <input type="hidden" class="sall_quantity_daily" value="{{$selldetail->total_sales}}">
                                </div>
                                @endforeach

                            </div>
                        </div>
                    </div>
                </div>
                <!-- ============================================================== -->
                 @if($salestarget->count() >0)
               <div class="row">
                    <div class="col-sm-12">
                        <div class="card">
                            <div class="card-body">
                                <h4 class="card-title">Target Vs. Acheivement</h4>
                                <!-- <h5 class="card-subtitle">Overview of Top Selling Items</h5> -->
                                <div class="table-responsive mt-3">

                                    <table id="cc-table" class="table table-bordered mb-3" data-page-length='10'>
                                        <thead>
                                            <tr class="bg-light">
                                                <th>#</th>
                                                <th>Employee Name </th>
                                                <th>Target Qantity </th>
                                                <th>Target Value</th>
                                                <th>Acheivement Quantity</th>
                                                <th>Acheivement Value</th>
                                                <th>Qty %</th>
                                                <th>Balance</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            @foreach($salestarget as $k=>$salestarget)
                                            <tr>
                                                <td>
                                                    {{$k+1}}
                                                </td>
                                                <td>
                                                    <h6>{{$salestarget->employee->employee_name}}</h6>

                                                </td>
                                                <td>
                                                    @php
                                                    $targetqty=$salestarget->details->sum('target_quantity');
                                                    @endphp
                                                   {{$targetqty}}
                                                </td>
                                                <td>
                                                    @php
                                                    $targetvalue=$salestarget->details->sum('target_amount');
                                                    @endphp
                                                    {{number_format($targetvalue,2)}}
                                                </td>
                                                <td>
                                                    @php
                                                        $a_qty=$salestarget->details->sum('sales_quantity');
                                                    @endphp
                                                    {{$a_qty}}
                                                </td>
                                                <td class="no-wrap">
                                                    @php
                                                     $a_value=$salestarget->details->sum('sales_amount');
                                                    @endphp
                                                    {{number_format($a_value,2)}}
                                                </td>
                                                <td class="no-wrap">
                                                    @php
                                                    $qtyper=100;
                                                       if($targetqty > $a_qty) {
                                                            $qtyper=$a_qty/$targetqty * 100;
                                                        }
                                                    @endphp
                                                    {{number_format($qtyper, 2, '.', '').'%'}}

                                                </td>
                                                <td class="no-wrap">
                                                    @php
                                                    $qtyper=0;
                                                       if($targetvalue > $a_value) {
                                                            $qtyper=$targetvalue-$a_value;
                                                        }
                                                    @endphp
                                                    {{number_format($qtyper,2)}}

                                                </td>
                                            </tr>
                                        @endforeach



                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                @endif
               <div class="row">
                    <div class="col-sm-12">
                        <div class="card">
                            <div class="card-body">
                                <h4 class="card-title">Stock Status (Last 30 Days)</h4>
                                <!-- <h5 class="card-subtitle">Overview of Top Selling Items</h5> -->
                                <div class="table-responsive mt-3">
                                    <table id="cc-table" class="table table-bordered mb-3" data-page-length='10'>
                                        <thead>
                                            <tr class="bg-light">
                                                <th>#</th>
                                                <th>Brand </th>
                                                <th>Product </th>
                                                <th>Total Stock In</th>
                                                <th>Total Sales</th>
                                                <th>Current Stock</th>
                                                <th>Rating</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            @foreach($products as $product)
                                                @php
                                                $s_month_day=\Carbon\Carbon::now('Asia/dhaka')->subDays(29)->format('Y-m-d');
                                                $e_month_day=\Carbon\Carbon::now('Asia/dhaka')->format('Y-m-d');
                                                @endphp
                                                 @php
                                                 $s_in_q=$product->stock_colors->whereBetween('stock_date', [$s_month_day, $e_month_day])->sum('product_quantity');
                                                     $saleQty=  $product->chalan_details->whereBetween('chalan_date', [$s_month_day, $e_month_day])->sum('product_quantity');

                                                    @endphp
                                            @if($product->barcodes->sum('quantity') > 0 || $s_in_q > 0 || $saleQty > 0)
                                            <tr>
                                                <td>
                                                    <img src="{{url('public/images/product/'.$product->product_image)}}" alt="user" class="circle" width="45">
                                                </td>
                                                <td>
                                                    <h6>{{$product->brand->brand_name}}</h6>

                                                </td>
                                                <td>
                                                   {{$product->product_name}}
                                                </td>
                                                <td>

                                                    {{$s_in_q}}

                                                </td>
                                                <td>

                                                    {{$saleQty}}
                                                </td>
                                                <td class="no-wrap">
                                                    {{$product->barcodes->sum('quantity')}}
                                                </td>
                                                <td class="no-wrap">
                                                    @if($saleQty >=  $companyInfo->rating_a)
                                                    {{'A'}}
                                                    @elseif($saleQty >=  $companyInfo->rating_b)
                                                    {{'B'}}
                                                    @elseif($saleQty >=  $companyInfo->rating_c)
                                                    {{'c'}}
                                                    @elseif($saleQty >=  $companyInfo->rating_d)
                                                    {{'D'}}
                                                    @elseif($saleQty >=  $companyInfo->rating_e)
                                                    {{'E'}}
                                                    @else
                                                    {{'F'}}
                                                    @endif

                                                </td>
                                            </tr>
                                            @endif
                                        @endforeach



                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- Orders -->
                <!-- ============================================================== -->
                <div class="row">

                       <div class="col-sm-12 col-lg-8">
                         <div class="card">
                            <div class="card-body border-bottom">

                                <div class="d-md-flex align-items-center">
                                    <div>
                                        <h4 class="card-title">Division Wise Sales</h4>

                                    </div>
                                    <div class="ml-auto d-flex align-items-center">
                                        <div class="dl">
                                            <select onchange="get_category_data(this)" class="custom-select">
                                                <option value="0" selected="">Select Category</option>
                                                @foreach($categories as $category)
                                                <option value="{{$category->category_id}}">{{$category->category_name}}</option>
                                                @endforeach

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

                                <!-- <h4 class="card-title">Division Wise Sales</h4> -->
                               <!--  <h5 class="card-subtitle">Overview of orders</h5> -->
                                <div id="container" style="height:500px; width:100%"></div>
                            </div>
                            <div class="card-body">


                                <div class="row" id="saleByDivision">
                                    @include('division_wise_sale')

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

                    </div>

                    <div class="col-sm-12 col-lg-4">
                        <div class="card">
                            <div class="card-body border-bottom">
                                <div class="d-md-flex align-items-center">
                                    <div>
                                        <h4 class="card-title">Order Status</h4>
                                <h5 class="card-subtitle">Overview of orders</h5>

                                    </div>
                                    <div class="ml-auto d-flex align-items-center">
                                        <div class="dl">
                                            <select onchange="get_division_data(this)" class="custom-select">
                                                <option value="0" selected="">Select Division</option>
                                                @foreach($divisions as $division)
                                                <option value="{{$division->division_id}}">{{$division->division_name}}</option>
                                                @endforeach

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

                                <div class="status mt-4" style="height:280px; width:100%"></div>
                            </div>
                            <div class="card-body" id="orderDivision">
                                @include('order_status_division')
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">

                </div>

            </div>
            <!-- ============================================================== -->
            <!-- End Container fluid  -->
           @endsection
@section('script')
  <script src="{{url('public/backend/js/anychart-base.min.js')}}"></script>
  <script src="https://cdn.anychart.com/releases/8.9.0/js/anychart-exports.min.js?hcode=a0c21fc77e1449cc86299c5faa067dc4"></script>

  <link href="https://cdn.anychart.com/releases/8.9.0/css/anychart-ui.min.css?hcode=a0c21fc77e1449cc86299c5faa067dc4">

  <script>



</script>
 <script src="{{ asset('public/backend/js/d3.min.js"></script>
    <script src="{{ asset('public/backend/js/c3.min.js"></script>
    <script src="{{ asset('public/backend/js/dashboard1.js"></script>
    <script type="text/javascript">

         function change_order_status(){
            var tre=$('#total_requisition').val();
            var tde=$('#total_chalan').val();
            var tpe=$('#total_pending').val();
            var chart = c3.generate({
                bindto: '.status',
                data: {
                    columns: [
                        ['Total Requisition',tre],
                        ['Total Delivery',tde],
                        ['Total Pending',tpe]
                    ],

                    type : 'donut'
                },
                donut: {
                    label: {
                        show: false
                      },
                    title:"Orders",
                    width:35,

                },

                legend: {
                  hide: true
                  //or hide: 'data1'
                  //or hide: ['data1', 'data2']
                },
                color: {
                      pattern: ['#7460ee', '#2962ff', '#fb8c00']
                }
            });
            chart.resize();

        }
         function get_category_data(arg){
            var id=arg.value;

            $.ajax({

                type : 'POST',
                url  : "{{url('get_sales_data_By_category')}}",
                data:{category_id:id},
                // dataType: 'json',
                success :  function (data)
                {

                   $('#saleByDivision').html(data);
                   change_division_status();
                    //console.log(data);

                },
                error :  function (data)
                {
                    //console.log(data);
                }
            });
        }

        function get_division_data(arg){
            var id=arg.value;

            $.ajax({

                type : 'POST',
                url  : "{{url('get_order_data_By_division')}}",
                data:{division_id:id},
                // dataType: 'json',
                success :  function (data)
                {

                   $('#orderDivision').html(data);
                   change_order_status();
                    //console.log(data);

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

VaKeR 2022