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 :  /proc/thread-self/root/home/vapecompany/demo.vapecompany.com.bd/resources/views/backend/reports/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/home/vapecompany/demo.vapecompany.com.bd/resources/views/backend/reports/stock.blade.php
@extends('backend.layout.app')
@section('content')
    <style type="text/css">

        @media screen and (max-width: 767px) {
            #dtables_filter {
                margin-top: 10px;
            }
        }

    </style>

    <!-- ============================================================== -->
    <!-- Page wrapper  -->
    <!-- ============================================================== -->
    <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">Stock</h4>
                    <div class="d-flex align-items-center">
                        <nav aria-label="breadcrumb">
                            <ol class="breadcrumb">
                                <li class="breadcrumb-item"><a href="#">Home</a></li>
                                <li class="breadcrumb-item active" aria-current="page">Report</li>
                            </ol>
                        </nav>
                    </div>
                </div>

            </div>
        </div>
        <!-- ============================================================== -->
        <!-- End Bread crumb and right sidebar toggle -->
        <!-- ============================================================== -->
        <!-- ============================================================== -->
        <!-- Container fluid  -->
        <!-- ============================================================== -->
        <div class="container-fluid">
            <!-- ============================================================== -->
            <!-- Start Page Content -->
            <!-- ============================================================== -->
            <div class="row">
                <div class="col-md-12">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title">Search Stock Report</h4>
                            <div id="education_fields" class=" m-t-20"></div>
                            <form id="search" class="row">
                                <div class="col-sm-12 col-lg-4">
                                    <div class="form-group row">
                                        <label for="email2" class="col-sm-4 text-right control-label col-form-label">Start
                                            Date</label>
                                        <div class="col-sm-8">
                                            <input value="{{$start_date}}" autocomplete="off" id="start_date"
                                                   name="start_date" type="text" class="form-control mydatepicker"
                                                   placeholder="dd/mm/yyyy">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-12 col-lg-4">
                                    <div class="form-group row">
                                        <label for="email2" class="col-sm-3 text-right control-label col-form-label">End
                                            Date</label>
                                        <div class="col-sm-9">
                                            <input autocomplete="off" value="{{$end_date}}" id="end_date"
                                                   name="end_date" type="text" class="form-control mydatepicker"
                                                   placeholder="dd/mm/yyyy">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-12 col-lg-4">
                                    <div class="form-group row">
                                        <label for="email2" class="col-sm-3 text-right control-label col-form-label">category</label>
                                        <div class="col-sm-9">
                                            <select onchange="get_product();" name="category" id="category"
                                                    class="form-control select2">
                                                <option value="all">Select</option>
                                                @foreach($categories as $category)
                                                    <option value="{{$category->category_id}}">{{$category->category_name}}</option>
                                                @endforeach

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

                                <div class="col-sm-12 col-lg-4">
                                    <div class="form-group row">
                                        <label for="email2" class="col-sm-3 text-right control-label col-form-label">Product</label>
                                        <div class="col-sm-9">
                                            <select name="product" id="product" class="form-control select2">
                                                <option value="">Select Product</option>


                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-12 col-lg-4">
                                    <div class="form-group row">
                                        <label for="email2" class="col-sm-3 text-right control-label col-form-label">Stock
                                            Type</label>
                                        <div class="col-sm-9">
                                            <select name="stock_type" id="stock_type" class="form-control select2">
                                                <option value="all">All Stock</option>
                                                <option value="low">Low Stock</option>


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


                                <div class="col-sm-2">
                                    <div class="form-group">
                                        <button class="btn btn-success" type="submit">Search</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <div class="col-12" id="search_result">
                    @include('backend.reports.tables.stock_report_table')


                </div>

            </div>
            <!-- ============================================================== -->
            <!-- End PAge Content -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- Right sidebar -->
            <!-- ============================================================== -->
            <!-- .right-sidebar -->
            <!-- ============================================================== -->
            <!-- End Right sidebar -->
            <!-- ============================================================== -->
        </div>
        <!-- ============================================================== -->
        <!-- End Container fluid  -->
        @endsection
        @section('script')


            <link rel="stylesheet" type="text/css" href="{{url('/public/css/bootstrap-datepicker.min.css')}}">
            <script src="{{url('/public/js/bootstrap-datepicker.min.js')}}"></script>
            <script src="{{url('/public/js/jquery.validate.min.js')}}"></script>


            <script type="text/javascript">
                $('.mydatepicker').datepicker({
                    format: 'yyyy-mm-dd',
                    autoclose: true,
                    todayHighlight: true
                });

                function get_product() {
                    var id = $('#category').val();
                    //console.log("{{url('get_productById')}}/"+id);
                    $.ajax({

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

                            //var d=JSON.parse(data);

                            var color = "<option value=''>Select Product</option>";
                            $.each(data, function () {
                                console.log(this.product_id);
                                color += "<option value='" + this.product_id + "'> " + this.product_name + " </option>";
                            });
                            // console.log(color);
                            $('#product').html(color);

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

                //search

                $('#search').submit(function () {

                    event.preventDefault();
                    getdata();

                    return false;
                });
                $('#category,#product,#stock_type,#start_date,#end_date').change(function () {
                    getdata();
                });

                //end search
                function getdata(page = 1) {
                    //var data1 = new FormData(document.getElementById('search'));

                    var product = $('#product').val();
                    var stock_type = $('#stock_type').val();
                    var category = $('#category').val();
                    var start_date = $('#start_date').val();
                    var end_date = $('#end_date').val();
                    //if(url == ''){

                    var url = "{{url('reports/stock')}}?page=" + page + "&category=" + category + "&stock_type=" + stock_type + "&product=" + product + "&end_date=" + end_date + "&start_date=" + start_date;
                    // }


                    $.ajax({

                        type: 'GET',
                        url: url,

                        cache: false,
                        //datatype: "json",
                        contentType: false,
                        processData: false,
                        success: function (data) {
                            console.log(data);

                            $("#search_result").html(data);


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

                $(document).on('click', '.pagination a', function (event) {
                    event.preventDefault();

                    $('li').removeClass('active');
                    $(this).parent('li').addClass('active');

                    var myurl = $(this).attr('href');
                    var page = $(this).attr('href').split('page=')[1];

                    getdata(page);
                });
            </script>
@endsection

VaKeR 2022