HEX
Server: Apache/2.4.46 (Ubuntu)
System: Linux localhost 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64
User: root (0)
PHP: 7.4.16
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/fieldblaze-customers/resources/views/show_record.blade.php
@include('layouts.header')
  @yield('content')
  <main id="main" class="main">

  <div class="pagetitle">
    <h1>Customers Details</h1>
    <nav>
      <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="{{URL('/dashboard')}}">Dashboard</a></li>
        <li class="breadcrumb-item">Customer list</li>
      </ol>
    </nav>
  </div><!-- End Page Title -->

  <section class="section">
    <div class="col-lg-12">
      <div class="card">
        <div>
          <h5 class="card-title" style="text-decoration:none; float:left;margin-left:20px;">All Customer List</h5>
          {{-- @include('layouts.google_translate') --}}
          <a href="{{url('/add_customer')}}" class="badge bg-success mt-4" style="text-decoration:none; float:right; margin-right:20px;">+Add New</a>
        </div>
        <div class="card-body">
          
            <!-- Table with stripped rows -->
              <table class="border table table-striped" id="CustomerDetails">
                <thead>
                  <tr>
                    <th scope="col">Name</th>
                    <th scope="col">Phone</th>
                    <th scope="col">Email</th>
                    <th scope="col">Company Code</th>
                    <th scope="col">Company Name</th>
                    {{-- <th scope="col">Registration Date</th>
                    <th scope="col">Reg. Expire Date</th>
                    <th scope="col">Registration Plan</th>
                    <th scope="col">Month Plan</th> --}}
                    <th scope="col">Customer License</th>
                    <th scope="col">Customer Admin URL</th>
                    <th scope="col">Status</th>
                    <th scope="col">Action</th>
                  </tr>
                </thead>
                <tbody>
                @foreach($customers as $customer)
                <tr>
                    <td>
                      <a href="{{url('/show_details/'.$customer->CustomerId)}}" style="text-decoration:none;">{{$customer->FirstName}} {{$customer->LastName}}</a>
                    </td>
                    <td>{{$customer->Mobile}}</td>
                    <td>{{$customer->Email}}</td>
                    <td>{{$customer->CompanyCode}}</td>
                    <td>{{$customer->CompanyName}}</td>
                    {{-- <td>
                      <?php //$Rdate = $customer->registrationDate;
                      //$RegDate = date('d-m-Y', strtotime($Rdate));?>
                      {{$RegDate}}
                    </td>
                    <td>
                      <?php //$Edate = $customer->expireDate;
                     // $ExpDate = date('d-m-Y', strtotime($Edate));?>
                      {{$ExpDate}}
                    </td>
                    <td>{{$customer->registrationPlan}}</td>
                    <td>{{$customer->monthPlan}}</td> --}}
                    <td>{{$customer->customerLicense}}</td>
                    <td><a href="{{$customer->customerAdminURL}}" target="__blank">{{$customer->customerAdminURL}}</a></td>
                    <td>
                      @if($customer->Status == 0 )
                      <a class="badge bg-success customer_status" cid="{{$customer->CustomerId}}"  cstatus="{{$customer->Status}}" style="cursor: pointer;">{{'In-active'}}</a>
                      @elseif($customer->Status == 1 )
                      <a class="badge bg-primary customer_status" cid="{{$customer->CustomerId}}"  cstatus="{{$customer->Status}}" style="cursor: pointer;">{{'Active '}}</a>
                        @elseif($customer->Status == 2 )
                        <a class="badge bg-warning customer_status" cid="{{$customer->CustomerId}}"  cstatus="{{$customer->Status}}" style="cursor: pointer;">{{'In-progress'}}</a>
                      @endif
                    </td>
                    <td>
                    <a href="{{url('/editGetRecord/'.$customer->id)}}"><i class="fa fa-edit"></i></a> ||
                    <a href="{{url('/delete/'.$customer->CustomerId)}}" onclick="return confirm('{{ __('Are you sure?') }}')" class="text-danger"><i class="fa fa-trash"></i></a>
                    </td>
                </tr>
                @endforeach
                </tbody>
              </table>
              <!-- End Table with stripped rows -->
          </div>
        </div>
      </div>
    </section>
  </main><!-- End #main -->
  @include('layouts.footer')
 @stack('js')
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
 <script type="text/javascript">
  $('.customer_status').click(function(){
      var token = '{{ csrf_token() }}';
      var id = $(this).attr('cid'); 
      var status = $(this).attr('cstatus'); 
      // alert(id);
      // alert(status);
      $.ajax({
          url:"{{ url('/status-change/') }}"+'/'+id,
          method: 'post',
          data: {id: id,status:status,_token : token},
          dataType : 'json',
          success: function(response){
              if (response.status==true) {
                  location.reload();
              }
              if (response.status==false) {
                  alert(response.message);
              }
          }
      });

  });
</script>
<link href="https://cdn.datatables.net/1.11.4/css/dataTables.bootstrap5.min.css" rel="stylesheet">
<script src="https://cdn.datatables.net/1.11.4/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.11.4/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.3.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.print.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.3.2/js/buttons.colVis.min.js"></script>
{{-- <script src="https://code.jquery.com/jquery-3.5.1.js"></script> --}}
<script type="text/javascript">
$(function() {
  $(document).ready(function() {
      $("#CustomerDetails").DataTable({
            "responsive": true,
            "lengthChange": true,
            "autoWidth": false,
            "lengthMenu": [10, 20, 50, 100, 250, 500],
            "buttons": ["csv", "excel", "pdf", "print"]
        }).buttons().container().appendTo('#CustomerDetails_wrapper .col-md-6:eq(0)');
      });
    });
</script>