KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
User : www-data ( 33)
PHP Version : 8.2.12
Disable Function : NONE
Directory :  /var/www/leadai/leadai.co.in/resources/views/products/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/leadai/leadai.co.in/resources/views/products/list.blade.php
@extends('layout')
@section('content')
<!-- begin::main content -->
<style>
   .input_upload{
   width:100px;
   height:35px;
   position:absolute;
   bottom:-34px;
   right:350px;
   }
   .import-content p{
   padding:0;
   margin:0;
   margin-bottom:8px;
   font-size:13px;
   }
   .filter-form-box{
   background-color:#FBFAFA;
   padding:10px 24px;
   position:absolute;
   width:450px;
   border:1px solid #ddd;
   border-radius:5px;
   top:71px;
   z-index:20;
   }
   .filter-form-box input{
   height:40px !important;
   }
   .diamond {
   width: 20px; 
   height: 20px; 
   background-color: #FBFAFA; 
   transform: rotate(45deg);
   position: relative; 
   top:-21px;
   left:0px;
   border-top:1px solid #ddd;
   border-left:1px solid #ddd;
   }
   .seach-input:focus{
   outline:none !important;
   border-top:1px solid #ddd !important;
   border-bottom:1px solid #ddd !important;
   }
   .seach-input{
   height:40px !important;
   border-top:1px solid #ddd !important;
   border-bottom:1px solid #ddd !important;
   border-left:1px solid #ddd !important;
   }
</style>
<main class="main-content">
   <div class="container">
      <div class="toast d-none float-right" >
         <div class="toast-body bg-success text-white">
            <i class="fa fa-check fa-lg"></i>&nbsp Status Update Successfully
         </div>
      </div>

      <section class='main-section1'>
          <!-- begin::page header -->
        <div class="page-header d-flex justify-content-between align-items-center">
            <div>
                <h3>{{__('message.course')}}</h3>
                <nav aria-label="breadcrumb">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="{{ asset('dashboard') }}">{{ __('message.dashboard') }}</a></li>
                    
                    <li class="breadcrumb-item "><a href="#" class="active text-primary">{{__('message.product')}}</a></li>
                </ol>
                </nav>
            </div>
           
        </div>
        <!-- end::page header -->
        
      </section>


      <div class="card">

         <div class="card-header">
            
               <div class="row">
                     <div class="col-md-4 py-3">
                        <form action="{{asset('products')}}" method="get">
                           
                           <div class="company-field-box">
                                 <div>
                                    <div class="input-group">
                                    <div class="input-group-prepend">
                                       <button type="button" class="btn border input-group-text filter-company-btn">
                                             <i class="ti-filter fa-lg px-2"></i>
                                       </button>
                                    </div>
                                       
                                       <input type="search" value="{{isset($_GET['search']) ? $_GET['search'] : null}}" name="search" class="form-control border-right-0 seach-input">
                                       <button class="btn border border-left-0" type="submit" style="margin-left:-5px;">
                                             <i class="ti-search fa-lg"></i>
                                       </button>
                                       
                                    </div>
                                    
                                    
                                    <div class="filter-form-box d-none">
                                       <div class="diamond"></div>
                                       <form method="get" action="{{asset('products')}}">
                                             <div class="form-group">
                                                <label>{{__('message.product')}} {{__('message.name')}} </label>
                                                <input value="{{isset($_GET['product_name']) ? $_GET['product_name'] : null}}" type="text" name="product_name" class="form-control" id="product_name">
                                             </div>
                                          
                                            
                                             
                                            
                                             <div class="row">
                                                <div class="form-group col-6">
                                                   <label>{{__('message.start')}} {{__('message.date')}}</label>
                                                   <input type="date" name="start_date" value="{{isset($_GET['start_date']) ? $_GET['start_date'] : null}}"  class="form-control" id="start_date">
                                                </div>
                                                
                                                <div class="form-group col-6">
                                                   <label>{{__('message.end')}} {{__('message.date')}}</label>
                                                   <input type="date" name="end_date" value="{{isset($_GET['end_date']) ? $_GET['end_date'] : null}}" class="form-control" id="end_date">
                                                </div>
                                                
                                             </div>
                                             <div class="row">
                                                <div class="form-group col-12">
                                                   <button type="submit" class="btn btn-success-lux mr-5 px-4 apply-button">{{__('message.apply')}}</button>
                                                
                                                   <a href="{{asset('products')}}" class="btn btn-primary-lux px-5 clear-button text-white">{{__('message.clear')}}</a>
                                                </div>
                                             </div>
                                       </form>
                                    </div>
                                 </div>
                           </div>
                           
                        </form>
                                 
                     </div>
                     
                     <div class="col-md-8 d-flex justify-content-end py-3">
                        <div>
                            @if (Auth::user()->type=="admin" || Auth::user()->can('delete-product') ) 
                            <button data-toggle="tooltip" data-original-title="Delete Products" class="btn btn-outline-secondary text-uppercase mr-2 multiple-delete-btn">
                                                <i class="ti-trash fa-lg"></i>
                                    </button>
                            @endif
                            @if (Auth::user()->type=="admin" || Auth::user()->can('add-product') ) 
                            <a data-toggle="tooltip" data-original-title="Add New Products"
                                    href="{{ asset('add-products') }}"
                                    class="btn btn-outline-secondary text-uppercase mr-2">
                                    <i class="ti-plus"></i>
                            </a>
                            @endif
                        </div>

                        {{--
                            @if (Auth::user()->can('view-product') || Auth::user()->type=="admin" ) 
                            <a data-toggle="tooltip" data-original-title="Export Products"
                                    href="{{ asset('export-products') }}"
                                    class="btn btn-white-lux text-uppercase mr-2"><i
                                        class="fa fa-download pr-2"></i>
                                        {{__('message.export')}}
                            </a>
                            @endif
                            @if (Auth::user()->can('add-product') || Auth::user()->type=="admin" ) 
                            <button type="button" class="btn btn-white-lux text-uppercase  mr-2" data-toggle="modal" data-target="#importModal"><i
                                        class="fa fa-upload pr-2"></i>
                                        {{__('message.import')}}
                            </button>
                            @endif
                        --}}
                        
                           
                        <button type="button" class="btn btn-danger d-none" id="delete-multiple">
                           <i class="fa fa-trash fa-lg"></i>
                        </button>
                     </div>
                     
                     
               </div>
               

            
         </div>

         <div class="card-body">

            @if (isset($products))

               <div class="table-responsive">
                     <table class="table table-bordered" >
                        <thead style="background-color:#E9EEF1">
                           <tr>
                                 <th>
                                    <input type="checkbox"  id="checkAll"  />
                                 </th>
                                 <th >{{__('message.sno')}}</th>
                                
                                 <th >{{__('message.course')}} {{__('message.name')}}</th>
                               
                              
                                 
                                 <th>{{ __('message.action') }}</th>
                           </tr>
                        </thead>
                        <tbody>
                           @if (!empty($products))
                                 @foreach ($products as $key=>$value)
                                 <tr>
                                 
                                 <th>
                                 
                                    <input type="checkbox" name="checkbox[]" class="userids" value="{{$value->id}}" />
                                 </th>
                                    <td>{{++$key}}</td>
                                    {{--<td>
                                        @if($value->pro_image)
                                            <img src="{{asset('public/'.$value->pro_image)}}" alt="product" width="50" height="50">
                                        @endif
                                    </td>--}}
                                    <td>{{$value->name}}</td>
                                    
                                 
                                    
                                    
                                    
                                    <td>
                                       <div class="btn-group">   

                                            @if (Auth::user()->can('edit-product') || Auth::user()->type=="admin" ) 
                                            
                                                <a class="btn btn-sm btn-success text-white"
                                                   data-toggle="tooltip" data-original-title="Edit Product"
                                                   href="{{ asset('edit-products/'.$value->id) }}"><i
                                                         class="fa fa-edit fa-lg"></i>
                                                </a>
                                            @endif
                                            @if (Auth::user()->can('delete-product') || Auth::user()->type=="admin" ) 
                                                <buttton class="btn btn-sm btn-danger text-white product-delete-btn"
                                                   data-toggle="tooltip" data-original-title="Delete Product"
                                                   product_id="{{$value->id}}">
                                                   <i class="fa fa-trash fa-lg"></i>
                                                </button>                                                            

                                             @endif
                                       </div>
                                    </td>
                                 </tr>
                                 @endforeach
                           @else
                                 <h1>No Record Found!!</h1>
                           @endif
                        </tbody>
                     </table>
               </div>

               <div class="blade-pagination py-3 d-flex justify-content-center">
                            {{$products->links()}}
                        </div>
               
            @endif
         </div>
      </div>
    
   </div>
   <!-- The Modal -->
   <div class="modal" id="importModal">
      <div class="modal-dialog modal-dialog-centered" style="width:40%;">
         <div class="modal-content">
            <!-- Modal Header -->
            <div class="modal-header bg-success  rounded-0">
               <h4 class="modal-title">Import Products</h4>
               <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
            <!-- Modal body -->
            <div class="modal-body">
               <div class="row">
                  <div class="col-md-3 py-5">
                     <i class="fa fa-warning text-warning" style="font-size:50px"></i>
                  </div>
                  <div class="col-md-9 import-content">
                     <p>Import Products (.xls, .xlsx)</p>
                     <p><strong>Follow these steps:</strong></p>
                     <p>1. Download the Excel template to your computer by clicking the <strong>Download</strong> button.</p>
                     <p>2. Integrate your data into the template file, minding the column names.</p>
                     <p>3. Click the <strong>Import</strong> button.</p>
                     <p><strong>IMPORTANT</strong></p>
                     <p>- If you do not have data for a particular column, leave it empty and do not move or delete the column.</p>
                  </div>
               </div>
            </div>
            <!-- Modal footer -->
            <div class="modal-footer position-relative">
               <form  class="import-company-form" enctype="multipart/form-data" >
                  @csrf
                  <div class="">
                     <div class="">
                        <div class="" style="position:relative">
                           <input type="file" accept="" name="excel_file" class="input_upload input_file_upload" style="z-index:5;opacity:0;cusor:pointer;">
                           <button type="submit" class="btn bg-blue text-uppercase input_upload input_upload_btn text-white mr-2">
                           <i class="fa fa-upload pr-2"></i>
                           Import
                           </button>
                        </div>
                     </div>
                     <div class="">
                        <div class="d-flex justify-content-center">
                           <a href="{{asset('public/products_sample.xlsx')}}" class="btn btn-info" download>Download Sample &nbsp<i class="fa fa-download"></i></a>
                        </div>
                     </div>
                  </div>
               </form>
            </div>
         </div>
      </div>
   </div>
</main>
<!-- end::main content -->
@endsection
@push('footer-script')
<!-- begin::dataTable -->
<!-- end::dataTable -->
<script>
   $(document).ready(function() {
       $("#checkAll").click(function() {
           $('.userids:checkbox').not(this).prop('checked', this.checked);
           /*var length = $('.userids[type="checkbox"]:checked').length;
           if($(".multiple-delete-btn").hasClass('d-none'))
           {
               $(".multiple-delete-btn").removeClass("d-none");
               $(".multiple-delete-btn").html('<span class="">Delete ('+length+")</span>");
           }
           else
           {
               $(".multiple-delete-btn").addClass("d-none");
           }*/
           
       });
   
       //employee delte button code
       $(".product-delete-btn").click(function(){
           var product_id = $(this).attr("product_id");
           
   
           swal({
               title: 'Are you sure?',
               text: 'Once deleted, you will not be recover!',
               icon: 'warning',
               dangerMode: true,
               buttons: ["Cancel", "Yes!"],
           }).then(function(value) {
               if (value) {
                   $.ajaxSetup({
                       headers: {
                           'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                       }
                   });
   
                   $.ajax({
                       type: "post",
                       data: {
                           "product_id": product_id
                       },
                       url: "{{asset('delete-product')}}",
                       dataType: "html",
                       success: function(result) {
                           //console.log(result);
                           swal("success!", "Successfully deleted!", "success");
                           window.location.reload();
                       },
                       error:function(error)
                       {
                           swal("Failed !", "Failed !", "error");
                           window.location.reload();
                       }
                   });
                  
               }
           });
       });
   
       
   
       $(".input_file_upload").on("change",function(){
           $(".import-company-form").click();
       });
   
       $(".import-company-form").on("submit", function(event) {
               // Prevent the default form submission
               event.preventDefault();
               
               
               $.ajax({
                   type: "POST",
                   url: "{{asset('import-products')}}",
                   headers: {
                           'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                       },                       
                   data: new FormData(this), 
                   processData: false,
                   contentType: false,
                   cache:false,
                   beforeSend:function()
                   {
                       $(".import-content").html("<h5>Please wait uploading...</h5>");
                   },
                   success: function(response) 
                   {
                       if(response.message=="success")
                       {
                           var div = `<div class='text-success text-center' style='font-size:50px'>
                           <i class='fa fa-check-circle' ></i>
                           <p  style='font-size:20px'>Products Import Successfully !</p>
                       </div>`;
                           $(".import-content").html(div);
                           setTimeout(function(){
                               window.location.reload();
                           },3000);
                           
                       }
                       else
                       {
                           //console.log(error);
                           var div = `<div class='text-danger text-center' style='font-size:50px'>
                           <i class='fa fa-times-circle' ></i>
                           <p  style='font-size:20px'>Please check the datasheet !</p>
                       </div>`;
                           $(".import-content").html(div);
                       }
                   },
                   error: function(xhr, status, error) 
                   {
                       //console.log(error);
                       var div = `<div class='text-danger text-center' style='font-size:50px'>
                       <i class='fa fa-times-circle' ></i>
                       <p  style='font-size:20px'>Please check the datasheet !</p>
                   </div>`;
                       $(".import-content").html(div);
                   }
               });
       });
   
   
       // Delete Multiple
       $(".multiple-delete-btn").click(function() {
           var URL = "{{ asset('product-delete-multiple') }}";
           var user_ids = [];
           $('.userids:checkbox:checked').each(function() {
               user_ids.push($(this).val());
           });
   
           
       
           swal({
               title: 'Are you sure?',
               text: 'Once deleted, you will not be recover!',
               icon: 'warning',
               dangerMode: true,
               buttons: ["Cancel", "Yes!"],
           }).then(function(value) {
               if (value) {
                   $.ajaxSetup({
                       headers: {
                           'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                       }
                   });
   
                   $.ajax({
                       type: "post",
                       data: {
                           "ids": user_ids
                       },
                       url: URL,
                       dataType: "html",
                       success: function(result) {
                           console.log(result);
                           swal("success!", "Successfully deleted!", "success");
                           window.location.reload();
                       },
                       error:function(xhr,status,error)
                       {
                           swal("failed!", "Failed !", "error");
                          window.location.reload();
                       }
                   });
                 
               }
           });
   
       });
   
      
   });
   
   $(".apply-button").click(function(){
       $(".filter-form-box").addClass("d-none");
   });
   
   
   //filter company code
   $(".filter-company-btn").click(function(){
      
       if($(".filter-form-box").hasClass("d-none"))
       {
           $(".filter-form-box").removeClass("d-none");
       }
       else
       {
           $(".filter-form-box").addClass("d-none");
       }
   });
   
   
   
    //change status code
   $(".status-change").on("change",function(){
       
       var check_val = 0;
       if( $(this).is(":checked"))
       {
           check_val = 1;
       }
      
       var id = $(this).val();
       
       $.ajax({
           type: "post",
           headers: {
               'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
           },
           url: "{{asset('change-user-status')}}",
           data:{
               user_id:id,
               status:check_val
           },
           dataType: "html",
           success: function(result) 
           {   console.log(result);
               var allData = JSON.parse(result);
               
               if(allData.message=="success")
               {
                   $('.toast').removeClass('d-none');
                   $('.toast').toast('show');
               }
               else
               {
                   var div = `
                   <div class="toast-body bg-danger text-white">
                           <i class="fa fa-times-circle-o fa-lg"></i>&nbsp Status Update Failed
                       
                   </div>
               `;
   
               $('.toast').removeClass('d-none');
                   $('.toast').toast('show');
                   $('.toast').html(div);
               }
           },
           error:function(xhr,status,error)
           {
               console.log(error);
               var div = `
                   <div class="toast-body bg-danger text-white">
                           <i class="fa fa-times-circle-o fa-lg"></i>&nbsp Status Update Failed
                       
                   </div>
               `;
   
               $('.toast').removeClass('d-none');
                   $('.toast').toast('show');
                   $('.toast').html(div);
   
           }
       });
       
   });
   $(".main-section").hide();

   $(".ghm-hotel").click(function(){
  $(".main-section").show();
  $(".main-section1").hide();
});
  
</script>
@endpush

Anon7 - 2021