File: /var/www/html/fieldsblaze-heroku/resources/views/admin/active-customer.blade.php
@extends('admin.include.master')
@section('content')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>Active Customer</h1>
</div>
<div class="col-sm-6 text-right">
<button type="button" class="btn btn-sm btn-outline-info mx-1" data-toggle="modal"
data-target="#addCustomer">Add New</button>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<form action="{{ url('delete-selected-customer') }}" method="post" id="deleteSelectedRecord">
@csrf
<div class="card">
<div class="card-header">
<a href="{{ url('all-customer') }}" class="btn btn-default btn-sm card-title px-2 mx-1">All <span
class="badge badge-info">{{ $Customer->count() }}</span></a>
<a href="{{ url('active-customer') }}" class="btn btn-info btn-sm card-title px-2 mx-1">Active <span
class="badge badge-light">{{ $ActiveCustomer->count() }}</span></a>
<a href="{{ url('inactive-customer') }}" class="btn btn-default btn-sm card-title px-2 mx-1">Inactive
<span class="badge badge-info">{{ $InActiveCustomer->count() }}</span></a>
<a href="{{ url('trash-customer') }}" class="btn btn-default btn-sm card-title px-2 mx-1">Deleted <span
class="badge badge-info">{{ $TrashCustomer->count() }}</span></a>
<div class="text-right">
<button style="float:right; display:none" type="submit" class="btn btn-sm btn-outline-info mx-1" id="btn-submit" value="Delete Selected">Delete Selected</button>
</div>
</div>
<!-- /.card-header -->
<div class="card-body">
<table id="accountTable" class="table table-bordered table-striped table-sm">
<thead>
<tr>
<th><input type="checkbox" id="checkAll" onchange="selectRecordDelete()"> All</th>
<th>S.N.</th>
<th>Customer Code</th>
<th>Customer</th>
<th>Parent Customer</th>
<th>Billing Address</th>
<th>Status</th>
<th>Type</th>
<th>Created at</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach ($ActiveCustomer as $Customer)
<tr>
<td align="middle"><input type="checkbox" id="checkItem" name="SelectedCustomer[]" value="{{ $Customer->id }}" onchange="selectRecordDelete()"></td>
<td>{{$loop->iteration}}</td>
<td><a href="{{ url('view-customer',$Customer->CustomerId) }}">{{ $Customer->CustomerCode }}</a>
</td>
<td><a href="{{ url('view-customer',$Customer->CustomerId) }}">{{ $Customer->CustomerName }}</a>
</td>
<td>@if ($Customer->ParentCustomerName)
{{ $Customer->ParentCustomerName }}
@else
N/A
@endif</td>
<td>{{ $Customer->BillingAddress.', '. $Customer->BillingCity.', '. $Customer->BillingState }}</td>
<td>
@if ($Customer->Status=='1')
<a href="{{ url('/status-update-customer',$Customer->id) }}"
class="btn btn-success bg-success btn-xs" data-toggle="tooltip" data-placement="top"
title="Click to De-activate" data-id="{{ $Customer->id }}">Active</a>
@else
<a href="{{ url('/status-update-customer',$Customer->id) }}" class="btn btn-danger btn-xs"
data-toggle="tooltip" data-placement="top" title="Click to Activate">InActive</a>
@endif
</td>
<td>{{ $Customer->CustomerType }}</td>
<td>
@if ($Customer->AdminCreated_by)
{{ $Customer->AdminCreated_by }}
@else
{{ $Customer->Created_by }}
@endif,
{{ date('d-M-y, h:i a', strtotime($Customer->Created_at)) }}</td>
<td>
<div class="btn-group">
<button type="button" class="btn btn-default btn-sm dropdown-toggle dropdown-icon"
data-toggle="dropdown" aria-expanded="false">
</button>
<div class="dropdown-menu dropdown-menu-right" role="menu">
<button type="button" class="dropdown-item btn btn-default" data-id="{{ $Customer->CustomerId }}"
onclick="editCustomerRecord('{{ $Customer->CustomerId }}')">Edit</button>
<button type="button" class="dropdown-item btn btn-default" data-id="{{ $Customer->CustomerId }}"
onclick="deleteTempCustomer('{{ $Customer->CustomerId }}');">Delete</button>
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
<!-- /.card -->
</form>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.content -->
</div>
<x-CustomerModal />
<!-- /.content-wrapper -->
@endsection