Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mcoil.corals.io/resources/views/admin/customers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mcoil.corals.io/resources/views/admin/customers/list.blade.php
@extends('layouts.admin.app')
@section('stylesheets')
<link href="{{ asset('css/sweetalert2.min.css') }}" rel="stylesheet" type="text/css" />
@endsection
@inject('helper','App\Helper\Helper')
@section('content')
<div class="row">
    <div class="col-md-12">
        <section class="content">
        @include('layouts.errors-and-messages')
{{--            @if($customers)--}}
                <div class="box">
                    <div class="box-body">
                        <div class="col-md-12">
                            <h3 class="bold">Customers <span class="font-black">|</span> <a href="{{ route('admin.customers.create') }}" class="btn btn-dark">+ Add New</a></h3>
                            <table class="table table-striped table-hover table-checkable dataTable table-responsive table-responsive-md responsive" id="order_table">
                                <thead class="thead-dark">
                                    <tr>
                                        <th scope="col" class="all">ID</th>
                                        <th scope="col" class="min-mobile-l">Name</th>
                                        <th scope="col" class="min-tablet-l">Email</th>
                                        <th scope="col" class="min-tablet-l">Registered</th>
                                        <th scope="col" class="min-mobile-l">Status</th>
                                        <th scope="col" class="min-mobile-l">Actions</th>
                                    </tr>
                                </thead>
                                <tbody>
{{--                                <!-- @foreach ($customers as $customer)--}}
{{--                                   --}}
{{--                                    @if( $customer->is_driver == 0)--}}
{{--                                     <?php --}}
{{--                                        $check_order = $helper::getCustomerOrders($customer->id);--}}
{{--                                    ?>--}}
{{--                                    <tr>--}}
{{--                                        <td class="dtr-control">{{ $customer->id }}</td>--}}
{{--                                        <td data-sort="{{$customer->lname}}">{{ $customer->name }}</td>--}}
{{--                                        <td>{{ $customer->email }}</td>--}}
{{--                                        <td data-sort="{{ date('Ymd', strtotime($customer->created_at)) }}">{{ date('M d, Y h:i a', strtotime($customer->created_at)) }}</td>--}}
{{--                                        <td><span class="badge font-badge @if($customer->status != '1') badge-danger @else badge-success @endif">@if($customer->status != '1') disabled @else enabled @endif</span></td>--}}
{{--                                        <td>--}}
{{--                                            <form action="{{ route('admin.customers.destroy', $customer->id) }}" method="post" id="remove-from-form" class="form-horizontal">--}}
{{--                                                <input  type="hidden" name="row_id" id="" value="{{ $customer->id }}">--}}
{{--                                                {{ csrf_field() }}--}}
{{--                                                <input type="hidden" name="_method" value="delete">--}}
{{--                                                <div class="btn-group">--}}
{{--                                                    <a href="{{ route('admin.customers.show', $customer->id) }}" class="btn btn-default"><i class="fa fa-eye"></i> View</a>--}}
{{--                                                    <a href="{{ route('admin.customers.edit', $customer->id) }}" class="btn btn-dark"><i class="fa fa-pencil"></i> Edit</a>--}}
{{--                                                    @if($check_order == true)--}}
{{--                                                        <button type="submit" id="{{ $customer->id }}" title="Delete" class="btn btn-danger" disabled><i class="fa fa-times"></i> Delete</button>--}}
{{--                                                    @else--}}
{{--                                                        <button type="submit" id="{{ $customer->id }}" title="Delete" class="btn btn-danger delete_submit"><i class="fa fa-times"></i> Delete</button>--}}
{{--                                                    @endif--}}
{{--                                                    --}}
{{--                                                </div>--}}
{{--                                            </form>--}}
{{--                                        </td>--}}
{{--                                    </tr>--}}
{{--                                    @endif--}}
{{--                                @endforeach -->--}}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
{{--            @endif--}}
        </section>
    </div>
</div>
@endsection
@section('js')
<script src="{{ asset('js/sweetalert2.all.min.js') }}"></script>
<script type="text/javascript">
$(document).ready( function () {
    $.fn.DataTable.ext.pager.numbers_length = 5;
    $('#order_table').DataTable({
        "responsive": true,
        "processing": true,
            "serverSide": true,
            "ajax":{
                     "url": "{{ url('admin/customers/server-pagination') }}",
                     "dataType": "json",
                     "type": "POST",
                     "data":{ _token: "{{csrf_token()}}"}
                  },
                  "columns": [
                { "data": "id" },
                { "data": "name" },
                { "data": "email" },
                { "data": "created_at" },
                { "data": "status" },
                { "data": "actions" },
               
            ],
            // createdRow: function( row, data, dataIndex ) {
            //    if(data.driver_name == ''){
            //        $( row ).find('td:eq(9)').addClass('redbg');
            //    }
        // Set the data-status attribute, and add a class
       // $( row ).find('td:eq(0)').addClass('dtr-control');
        
   // },
       "order": [[ 1, "asc" ]],
        "bAutoWidth": false,
        "rowReorder": {
            selector: 'td:nth-child(2)'
        },
        "columnDefs": [
          { "width": "200px", "targets": 5 }
        ]
    });
 //    $('#order_table').DataTable({
	// 	"responsive": true,
	// 	"order": [[ 1, "asc" ]],
 //        "bAutoWidth": false,
 //        "rowReorder": {
 //            selector: 'td:nth-child(2)'
 //        },
 //        "columnDefs": [
 //          { "width": "200px", "targets": 5 }
 //        ]
	// });
	$(document).on('click', 'button.delete_submit', function(e) {
        var refer = $(this).attr("id");
		var step_remove_url = $(this).closest("#remove-from-form").attr('action');
		e.preventDefault();
		e.stopPropagation();
		if (refer != '') {
			Swal.fire({
                title: 'Are you sure?',
                text: "You won't be able to revert this!",
    	        type: 'warning',
    	        showCancelButton: true,
                confirmButtonColor: '#3085d6',
    	        cancelButtonColor: '#d33',
    	        confirmButtonText: 'Yes, delete it!'
            }).then((result) => {
    	        if (result.value) {
    	            Swal.fire({
                        title: 'Deleted!',
            	        text: "Your customer has been deleted.",
            	        type: 'success',
                        showConfirmButton: false,
                        timer: 1500
    	            });
                    $.ajax({
    			        url: step_remove_url,
    			        method: "POST",
        		        data: {
        		        	"_token": "{{ csrf_token() }}",
        		        	"_method": "delete",
    			        	row_id: refer
        		        },
        		        success:function(response){
    			            setTimeout(function(){
                                window.location.reload();
                            }, 1500);
    			        }
    			    });
                }
            });
        }
    });
});
</script>
@endsection

Spamworldpro Mini