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 : |
@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">Sales Report</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">Reports</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 Sales Report</h4> <div id="education_fields" class=" m-t-20"></div> <form id="search" method="GET" 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 autocomplete="off" id="start_date" name="start_date" value="{{$s_date}}" type="text" class="form-control mydatepicker" placeholder="yyyy-mm-dd"> </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" id="end_date" name="end_date" value="{{$e_date}}" type="text" class="form-control mydatepicker" placeholder="yyyy-mm-dd"> </div> </div> </div> @if(auth()->user()->employee->user_type == 3) <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">Customer</label> <div class="col-sm-8"> <select id="customer" name="customer" class="form-control select2"> <option value="0">Select Customer</option> @foreach($customers as $customer) <option value="{{$customer->$customer_id}}">{{$customer->$customer_name}}</option> @endforeach </select> </div> </div> </div> @endif @if(auth()->user()->employee->user_type != 3) <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">Division</label> <div class="col-sm-9"> <select onchange="get_district();get_customer();" id="division" name="division" class="form-control select2"> <option value="">Select Division</option> @foreach($divisions as $division) <option value="{{$division->division_id}}">{{$division->division_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">District</label> <div class="col-sm-9"> <select onchange="get_customer();" id="district" name="district" class="form-control select2"> <option value="0">Select District</option> </select> </div> </div> </div> <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">Customer</label> <div class="col-sm-8"> <select id="customer" name="customer" class="form-control select2"> <option value="0">Select Customer</option> </select> </div> </div> </div> <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">Designation</label> <div class="col-sm-8"> <select onchange="get_employee();" name="designation" id="designation" class="form-control select2"> <option value="">Select Designation</option> @foreach($designations as $designation) <option value="{{$designation->designation_id}}">{{$designation->designation_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-4 text-right control-label col-form-label">Employee</label> <div class="col-sm-8"> <select id="employee" name="employee" class="form-control select2"> <option value="0">Select Employee</option> </select> </div> </div> </div> <div class="col-sm-12 col-lg-4"> <div class="form-group row"> <label for="email2" class="col-sm-6 text-right control-label col-form-label">Employee Status</label> <div class="col-sm-6"> <select id="emp_status" name="emp_status" class="form-control select2"> <option value="0">All</option> <option value="1">Current</option> <option value="2">Terminated</option> <option value="3">Resigned</option> </select> </div> </div> </div> @endif <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">Brand</label> <div class="col-sm-8"> <select onchange="get_product()" class="form-control" id="brand" name="brand"> <option value="0">Select Brand</option> @foreach($brands as $brand) <option value="{{$brand->brand_id}}">{{$brand->brand_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-4 text-right control-label col-form-label">Product</label> <div class="col-sm-8"> <select id="product" name="product" class="form-control select2"> <option value="0">Select Product</option> </select> </div> </div> </div> <div class="col-sm-2"> <div class="form-group"> <button id="btnsearch" 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.sales_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"> var date = new Date(); var today = new Date(date.getFullYear(), date.getMonth(), date.getDate()); $('.mydatepicker').datepicker({ format: 'yyyy-mm-dd', autoclose: true, todayHighlight: true }); //$( '.mydatepicker').datepicker( 'setDate', today ); function get_product(){ var id=$('#brand').val(); //console.log("{{url('get_productById')}}/"+id); $.ajax({ type : 'POST', url : "{{url('get_productById')}}", data:{brand_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); } }); } function get_employee(){ var id=$('#designation').val(); //console.log("{{url('get_productById')}}/"+id); $.ajax({ type : 'POST', url : "{{url('get_Employee_byDesignation_Id')}}", data:{designation_id:id}, dataType: 'json', success : function (data) { //var d=JSON.parse(data); var color="<option value=''>Select Employee</option>"; $.each(data,function(){ color +="<option value='"+this.employee_id+"'> "+this.employee_name+" </option>"; }); $('#employee').html(color); }, error : function (data) { //console.log(data); } }); } function get_district(){ var id=$('#division').val(); //console.log("{{url('get_productById')}}/"+id); $.ajax({ type : 'POST', url : "{{url('get_all_district_by_id')}}", data:{division_id:id}, dataType: 'json', success : function (data) { //var d=JSON.parse(data); var color="<option value=''>Select District</option>"; $.each(data,function(){ color +="<option value='"+this.district_id+"'> "+this.district_name+" </option>"; }); // console.log(color); $('#district').html(color); }, error : function (data) { //console.log(data); } }); } function get_customer(){ var id=$('#division').val(); var dis_id=$('#district').val(); //console.log("{{url('get_productById')}}/"+id); $.ajax({ type : 'POST', url : "{{url('get_customer_by_divanddis')}}", data:{division_id:id,district_id:dis_id}, dataType: 'json', success : function (data) { //var d=JSON.parse(data); var color="<option value=''>Select Customer</option>"; $.each(data,function(){ color +="<option value='"+this.customer_id+"'> "+this.customer_name+" </option>"; }); // console.log(color); $('#customer').html(color); }, error : function (data) { //console.log(data); } }); } //search $("#search").validate({ rules: { start_date: { required: true, }, }, submitHandler: submitForm }); function submitForm(url='') { event.preventDefault(); getdata(); return false; } $('#customer,#division,#district,#brand,#product,#start_date,#end_date').change(function(){ getdata(); }) //end search function getdata(page = 1){ //var data1 = new FormData(document.getElementById('search')); var s_date= $('#start_date').val(); var e_date= $('#end_date').val(); var customer= $('#customer').val(); var district= $('#district').val(); var division= $('#division').val(); var employee= $('#employee').val(); var emp_status= $('#emp_status').val(); var brand= $('#brand').val(); var product= $('#product').val(); var designation= $('#designation').val(); //if(url == ''){ var url="{{url('reports/sales')}}?page="+page+"&s_date="+s_date+"&e_date="+e_date+"&customer="+customer+"&district="+district+"&division="+division+"&emp_status="+emp_status+"&employee="+employee+"&designation="+designation+"&brand="+brand+"&product="+product; // } $.ajax({ type : 'GET', url : url, data : {s_date:s_date}, cache:false, //datatype: "json", contentType: false, processData: false, success : function (data) { console.log(data); console.log(s_date); $("#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