changes
This commit is contained in:
@@ -16,6 +16,7 @@ use App\Exports\CustomerExportSelected;
|
||||
use App\Models\ManageRestaurant;
|
||||
use App\Models\ManageState;
|
||||
use App\Models\RedeemRestaurant;
|
||||
use App\Models\Subscriptions;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Barryvdh\DomPDF\PDF as DomPDFPDF;
|
||||
@@ -34,21 +35,31 @@ class ManageCustomerController extends Controller
|
||||
Created at : 28 May 2024
|
||||
Use : To Get User Page.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
try {
|
||||
// Eager load the state relationship for all customers
|
||||
$customers = IamPrincipal::where('principal_type_xid', 3)
|
||||
->with('state')
|
||||
->orderBy('created_at', 'desc')
|
||||
->get();
|
||||
public function index()
|
||||
{
|
||||
try {
|
||||
$customers = IamPrincipal::with(['isSubscribed', 'state'])
|
||||
->where('principal_type_xid', 3)
|
||||
->orderBy('created_at', 'desc')
|
||||
->get();
|
||||
|
||||
return view('Admin.pages.manage_users.manage_customer.customer', compact('customers'));
|
||||
} catch (Exception $e) {
|
||||
Log::error("Manage Voucher Page Not Load " . $e->getMessage());
|
||||
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
|
||||
$dateTime = now();
|
||||
$formattedDateTime = $dateTime->format('Y-m-d H:i:s');
|
||||
|
||||
foreach ($customers as $customer) {
|
||||
$customer->is_subscribed = $customer->isSubscribed->contains(function ($subscription) use ($formattedDateTime) {
|
||||
return $subscription->subscription_status == 'active' && $subscription->next_payment_date >= $formattedDateTime;
|
||||
});
|
||||
}
|
||||
|
||||
return view('Admin.pages.manage_users.manage_customer.customer', compact('customers'));
|
||||
} catch (Exception $e) {
|
||||
Log::error("Manage Voucher Page Not Load " . $e->getMessage());
|
||||
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Created By : Sayali Parab
|
||||
Created at : 28 May 2024
|
||||
@@ -56,13 +67,14 @@ class ManageCustomerController extends Controller
|
||||
*/
|
||||
public function view_customer($id)
|
||||
{
|
||||
|
||||
|
||||
try {
|
||||
$customers_data = IamPrincipal::with('state', 'contactMessages')->findOrFail($id);
|
||||
$customers_data = IamPrincipal::with('state', 'contactMessages','isSubscribed')->findOrFail($id);
|
||||
if ($customers_data->contactMessages->isEmpty()) {
|
||||
Log::info('No contact messages found for customer with ID: ' . $id);
|
||||
}
|
||||
if ($customers_data->isSubscribed->isEmpty()) {
|
||||
Log::info('No payment history found for customer with ID: ' . $id);
|
||||
}
|
||||
// return $customers_data;
|
||||
return view('Admin.pages.manage_users.manage_customer.view_customer_details', compact('customers_data'));
|
||||
} catch (Exception $e) {
|
||||
|
||||
@@ -192,4 +192,9 @@ class IamPrincipal extends Authenticatable implements JWTSubject
|
||||
{
|
||||
return $this->hasMany(ManageContactus::class, 'principal_xid', 'id');
|
||||
}
|
||||
|
||||
public function isSubscribed()
|
||||
{
|
||||
return $this->hasMany(Subscriptions::class, 'iam_principal_xid', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,186 +1,187 @@
|
||||
@extends('Admin.layouts.master')
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$currentPage = 'manage-customer';
|
||||
@endphp
|
||||
<style>
|
||||
/* CSS for action icons */
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
@php
|
||||
$currentPage = 'manage-customer';
|
||||
@endphp
|
||||
<style>
|
||||
/* CSS for action icons */
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.actions a {
|
||||
margin: 0 5px;
|
||||
/* Space between icons */
|
||||
}
|
||||
.actions a {
|
||||
margin: 0 5px;
|
||||
/* Space between icons */
|
||||
}
|
||||
|
||||
.actions img {
|
||||
width: 20px;
|
||||
/* Adjust the size as needed */
|
||||
height: 20px;
|
||||
/* Adjust the size as needed */
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
.actions img {
|
||||
width: 20px;
|
||||
/* Adjust the size as needed */
|
||||
height: 20px;
|
||||
/* Adjust the size as needed */
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
|
||||
.actions img:hover {
|
||||
transform: scale(1.2);
|
||||
}
|
||||
.actions img:hover {
|
||||
transform: scale(1.2);
|
||||
}
|
||||
|
||||
/* Ensuring icons are properly aligned in their table cells */
|
||||
td.actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
/* Ensuring icons are properly aligned in their table cells */
|
||||
td.actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* Additional global styles for consistency */
|
||||
table td,
|
||||
table th {
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
/* Additional global styles for consistency */
|
||||
table td,
|
||||
table th {
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Ensuring the table does not overflow */
|
||||
table {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
}
|
||||
</style>
|
||||
/* Ensuring the table does not overflow */
|
||||
table {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="layout-px-spacing">
|
||||
<div class="middle-content container-xxl p-0">
|
||||
<div class="row layout-top-spacing ">
|
||||
<div class="top-tabel">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h6 class="card-title">Manage Customers</h6>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="layout-px-spacing">
|
||||
<div class="middle-content container-xxl p-0">
|
||||
<div class="row layout-top-spacing ">
|
||||
<div class="top-tabel">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<h6 class="card-title">Manage Customers</h6>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
|
||||
<div class="widget-content widget-content-area br-8 position-btn" style="overflow: auto;">
|
||||
<form action="{{ route('export-selected-customer') }}" method="POST" id="customer-form">
|
||||
@csrf
|
||||
<input type="hidden" name="selected_id" id="ids" disabled>
|
||||
<div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
|
||||
<div class="widget-content widget-content-area br-8 position-btn" style="overflow: auto;">
|
||||
<form action="{{ route('export-selected-customer') }}" method="POST" id="customer-form">
|
||||
@csrf
|
||||
<input type="hidden" name="selected_id" id="ids" disabled>
|
||||
|
||||
<input type="hidden" name="all_id" id="all_id" value="all" disabled>
|
||||
<table id="zero-config" class="table dt-table-hover" style="width:100%">
|
||||
<thead class="text-center">
|
||||
<th class="w-10px pe-2">
|
||||
<div class="form-check form-check-sm form-check-custom form-check-solid me-3">
|
||||
<input type="hidden" name="all_id" id="all_id" value="all" disabled>
|
||||
<table id="zero-config" class="table dt-table-hover" style="width:100%">
|
||||
<thead class="text-center">
|
||||
<th class="w-10px pe-2">
|
||||
<div class="form-check form-check-sm form-check-custom form-check-solid me-3">
|
||||
<input class="form-check-input" type="checkbox" name="customer_ids"
|
||||
id="select-all-ids" />
|
||||
</div>
|
||||
</th>
|
||||
</th>
|
||||
|
||||
<th class="text-start">Sr no</th>
|
||||
<th class="text-start">First Name</th>
|
||||
|
||||
<th class="text-start">Last Name</th>
|
||||
<th class="text-start">Sr no</th>
|
||||
<th class="text-start">First Name</th>
|
||||
|
||||
<th class="text-start">User ID</th>
|
||||
<th class="text-start">Email Id</th>
|
||||
<th class="text-start">Redeemed Restaurant</th>
|
||||
<th class="text-start">Date of birth</th>
|
||||
<th class="text-start">Phone Number</th>
|
||||
<th class="text-start">Last Name</th>
|
||||
|
||||
<th class="text-start">Subscribe/Unsubscribe</th>
|
||||
<th class="text-start">Location</th>
|
||||
<!-- <th class="text-start">Passports</th> -->
|
||||
<th class="text-start">User ID</th>
|
||||
<th class="text-start">Email Id</th>
|
||||
<th class="text-start">Redeemed Restaurant</th>
|
||||
<th class="text-start">Date of birth</th>
|
||||
<th class="text-start">Phone Number</th>
|
||||
|
||||
<th class="no-content">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<th class="text-start">Subscribe/Unsubscribe</th>
|
||||
<th class="text-start">Location</th>
|
||||
<!-- <th class="text-start">Passports</th> -->
|
||||
|
||||
<tbody class="text-center">
|
||||
@foreach ($customers as $customer)
|
||||
<tr>
|
||||
<td>
|
||||
<div class="form-check form-check-sm form-check-custom form-check-solid">
|
||||
<input class="form-check-input" type="checkbox" id="customer_checkbox_ids" name="customer_ids" value="{{ $customer->id }}" />
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-start">{{ $loop->iteration }}</td>
|
||||
<!-- <td class="text-start">{{ $customer->first_name }}</td> -->
|
||||
<td class="text-start">{{ $customer->first_name }}
|
||||
<th class="no-content">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</td>
|
||||
<td class="text-start">{{ $customer->last_name }}</td>
|
||||
<tbody class="text-center">
|
||||
@foreach ($customers as $customer)
|
||||
<tr>
|
||||
<td>
|
||||
<div class="form-check form-check-sm form-check-custom form-check-solid">
|
||||
<input class="form-check-input" type="checkbox"
|
||||
id="customer_checkbox_ids" name="customer_ids"
|
||||
value="{{ $customer->id }}" />
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-start">{{ $loop->iteration }}</td>
|
||||
<!-- <td class="text-start">{{ $customer->first_name }}</td> -->
|
||||
<td class="text-start">{{ $customer->first_name }}
|
||||
|
||||
</td>
|
||||
<td class="text-start">{{ $customer->last_name }}</td>
|
||||
|
||||
|
||||
|
||||
|
||||
<td class="text-start">{{ $customer->id }}</td>
|
||||
<td class="text-start">{{ $customer->email_address }}</td>
|
||||
<td class="text-start">
|
||||
<a class="view-btn" href="{{ url('/manage_customer_restaurant/' . $customer->id) }}">View</a>
|
||||
</td>
|
||||
<td class="text-start">{{ $customer->id }}</td>
|
||||
<td class="text-start">{{ $customer->email_address }}</td>
|
||||
<td class="text-start">
|
||||
<a class="view-btn"
|
||||
href="{{ url('/manage_customer_restaurant/' . $customer->id) }}">View</a>
|
||||
</td>
|
||||
|
||||
<td>{{ \Carbon\Carbon::parse($customer->date_of_birth)->format('m/d/Y') }}</td>
|
||||
<td class="text-start">{{ $customer->phone_number }}</td>
|
||||
<!-- <td class="text-start"></td> -->
|
||||
<td>
|
||||
<div class="switch-btn">
|
||||
<input data-id="{{ $customer['id'] }}"
|
||||
{{ $customer['is_active'] ? 'checked' : '' }}
|
||||
class="active_rest_user" type="checkbox"
|
||||
id="switch{{ $customer['id'] }}" switch="bool" />
|
||||
<label for="switch{{ $customer['id'] }}" data-on-label="Subscribe"
|
||||
data-off-label="Unsubscribe"></label>
|
||||
<td>{{ \Carbon\Carbon::parse($customer->date_of_birth)->format('m/d/Y') }}</td>
|
||||
<td class="text-start">{{ $customer->phone_number }}</td>
|
||||
<!-- <td class="text-start"></td> -->
|
||||
<td>
|
||||
@if ($customer['is_subscribed'])
|
||||
<span class="badge badge-success">Subscribed</span>
|
||||
@else
|
||||
<span class="badge badge-danger">Unsubscribed</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>{{ $customer->state ? $customer->state->name : 'No state assigned' }}</td>
|
||||
<td>{{ $customer->state ? $customer->state->name : 'No state assigned' }}</td>
|
||||
|
||||
|
||||
|
||||
<!-- <td class="text-start">{{ $customer->address_line1 }}</td> -->
|
||||
<!-- <td class="text-start">{{ $customer->address_line1 }}</td> -->
|
||||
|
||||
<!-- <td class="text-start">{{ $customer->activePassportCount }}</td> -->
|
||||
<td class="actions">
|
||||
<a href="{{ url('/manage_customer_view/' . $customer->id) }}">
|
||||
<img src="{{ asset('public/assets/img/view.svg') }}" alt="View" title="View" />
|
||||
</a>
|
||||
<a href="{{ url('/manage_customer_edit/' . $customer->id) }}">
|
||||
<img src="{{ asset('public/assets/img/edit.svg') }}" alt="Edit" title="Edit" />
|
||||
</a>
|
||||
<!-- <a class="cust_archive_btn" data-id="{{ $customer->id }}" data-toggle="modal" data-target="#archive-modal">
|
||||
<img src="{{ asset('public/assets/img/archive.svg') }}" alt="Archive" title="Archive" />
|
||||
</a> -->
|
||||
<a href="#" id="delete_customer_user_id"
|
||||
data-id="{{ $customer->id }}" data-toggle="modal"
|
||||
data-target="#delete-customer-user-modal"><img
|
||||
src="{{ asset('public/assets/img/delete-recycle.svg') }}" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
<!-- <td class="text-start">{{ $customer->activePassportCount }}</td> -->
|
||||
<td class="actions">
|
||||
<a href="{{ url('/manage_customer_view/' . $customer->id) }}">
|
||||
<img src="{{ asset('public/assets/img/view.svg') }}" alt="View"
|
||||
title="View" />
|
||||
</a>
|
||||
<a href="{{ url('/manage_customer_edit/' . $customer->id) }}">
|
||||
<img src="{{ asset('public/assets/img/edit.svg') }}" alt="Edit"
|
||||
title="Edit" />
|
||||
</a>
|
||||
<!-- <a class="cust_archive_btn" data-id="{{ $customer->id }}" data-toggle="modal" data-target="#archive-modal">
|
||||
<img src="{{ asset('public/assets/img/archive.svg') }}" alt="Archive" title="Archive" />
|
||||
</a> -->
|
||||
<a href="#" id="delete_customer_user_id"
|
||||
data-id="{{ $customer->id }}" data-toggle="modal"
|
||||
data-target="#delete-customer-user-modal"><img
|
||||
src="{{ asset('public/assets/img/delete-recycle.svg') }}" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="delete-customer-user-modal" tabindex="-1" role="dialog"
|
||||
<div class="modal fade" id="delete-customer-user-modal" tabindex="-1" role="dialog"
|
||||
aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
@@ -200,33 +201,34 @@ $currentPage = 'manage-customer';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="archive-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="modal-header">
|
||||
<button type="button pointer" class="btn-close" data-dismiss="modal" aria-label="Close">
|
||||
x
|
||||
</button>
|
||||
</div>
|
||||
<input type="hidden" id="archive_id" name="customer_id">
|
||||
<p class="modal-text">Are you sure you want to<br>archive?</p>
|
||||
<div class="modal-btn d-flex ">
|
||||
<a class="extra-btn pointer" data-dismiss="modal">No</a>
|
||||
<a class="download-btn-custom customer_archive" href="{{ route('manage.customer') }}">Yes,
|
||||
archive</a>
|
||||
</div>
|
||||
<div class="modal fade" id="archive-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="modal-header">
|
||||
<button type="button pointer" class="btn-close" data-dismiss="modal" aria-label="Close">
|
||||
x
|
||||
</button>
|
||||
</div>
|
||||
<input type="hidden" id="archive_id" name="customer_id">
|
||||
<p class="modal-text">Are you sure you want to<br>archive?</p>
|
||||
<div class="modal-btn d-flex ">
|
||||
<a class="extra-btn pointer" data-dismiss="modal">No</a>
|
||||
<a class="download-btn-custom customer_archive" href="{{ route('manage.customer') }}">Yes,
|
||||
archive</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@section('section_script')
|
||||
<script src="{{ asset('public/assets/js/admin/manage_customer/main.js') }}"></script>
|
||||
<!-- <script>
|
||||
<script src="{{ asset('public/assets/js/admin/manage_customer/main.js') }}"></script>
|
||||
<!-- <script>
|
||||
$('#zero-config').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'table-responsive'tr>" +
|
||||
@@ -247,22 +249,20 @@ $currentPage = 'manage-customer';
|
||||
});
|
||||
</script> -->
|
||||
|
||||
<script>
|
||||
//old code which have the archieve button
|
||||
// $(document).ready(function() {
|
||||
// $('<button><a class="extra-btn width-max-content" href="{{ route('customer_archive') }}">View Archive List</a></button><button><ul class="navbar-item flex-row ms-lg-auto ms-0"><li class="nav-item dropdown action-dropdown order-lg-0 order-1"><a href="javascript:void(0);"class="nav-link dropdown-toggle user extra-btn" id="actionDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><div class="avatar-container"><div class="avatar avatar-sm avatar-indicators avatar-online"><h3>Export</h3></div></div></a><div class="dropdown-menu position-absolute" aria-labelledby="actionDropdown"><div class="dropdown-item"><a href="javascript:void(0)" id="download_all"><span>Download Overview</span></a></div><div class="dropdown-item"><a href="javascript:void(0)" id="download-selected"><span id="export">Download Selected</span></a></div></div></li></ul></button>')
|
||||
// .insertBefore("#zero-config_filter label");
|
||||
// });
|
||||
<script>
|
||||
//old code which have the archieve button
|
||||
// $(document).ready(function() {
|
||||
// $('<button><a class="extra-btn width-max-content" href="{{ route('customer_archive') }}">View Archive List</a></button><button><ul class="navbar-item flex-row ms-lg-auto ms-0"><li class="nav-item dropdown action-dropdown order-lg-0 order-1"><a href="javascript:void(0);"class="nav-link dropdown-toggle user extra-btn" id="actionDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><div class="avatar-container"><div class="avatar avatar-sm avatar-indicators avatar-online"><h3>Export</h3></div></div></a><div class="dropdown-menu position-absolute" aria-labelledby="actionDropdown"><div class="dropdown-item"><a href="javascript:void(0)" id="download_all"><span>Download Overview</span></a></div><div class="dropdown-item"><a href="javascript:void(0)" id="download-selected"><span id="export">Download Selected</span></a></div></div></li></ul></button>')
|
||||
// .insertBefore("#zero-config_filter label");
|
||||
// });
|
||||
|
||||
//below script don't have the archieve button
|
||||
$(document).ready(function() {
|
||||
$('<button><ul class="navbar-item flex-row ms-lg-auto ms-0"><li class="nav-item dropdown action-dropdown order-lg-0 order-1"><a href="javascript:void(0);" class="nav-link dropdown-toggle user extra-btn" id="actionDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><div class="avatar-container"><div class="avatar avatar-sm avatar-indicators avatar-online"><h3>Export</h3></div></div></a><div class="dropdown-menu position-absolute" aria-labelledby="actionDropdown"><div class="dropdown-item"><a href="javascript:void(0)" id="download_all"><span>Download Overview</span></a></div><div class="dropdown-item"><a href="javascript:void(0)" id="download-selected"><span id="export">Download Selected</span></a></div></div></li></ul></button>')
|
||||
.insertBefore("#zero-config_filter label");
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<script>
|
||||
//below script don't have the archieve button
|
||||
$(document).ready(function() {
|
||||
$('<button><ul class="navbar-item flex-row ms-lg-auto ms-0"><li class="nav-item dropdown action-dropdown order-lg-0 order-1"><a href="javascript:void(0);" class="nav-link dropdown-toggle user extra-btn" id="actionDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><div class="avatar-container"><div class="avatar avatar-sm avatar-indicators avatar-online"><h3>Export</h3></div></div></a><div class="dropdown-menu position-absolute" aria-labelledby="actionDropdown"><div class="dropdown-item"><a href="javascript:void(0)" id="download_all"><span>Download Overview</span></a></div><div class="dropdown-item"><a href="javascript:void(0)" id="download-selected"><span id="export">Download Selected</span></a></div></div></li></ul></button>')
|
||||
.insertBefore("#zero-config_filter label");
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).on('click', "#delete_customer_user_id", function() {
|
||||
var delete_customer_user_id = $(this).data('id');
|
||||
$("#customer_delete").val(delete_customer_user_id);
|
||||
@@ -301,5 +301,4 @@ $(document).ready(function() {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
@@ -1,116 +1,180 @@
|
||||
@extends('Admin.layouts.master')
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$currentPage = 'manage-customer';
|
||||
@endphp
|
||||
<style>
|
||||
.message {
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 10px;
|
||||
padding: 15px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.reply {
|
||||
background-color: #e2e3e5;
|
||||
border-radius: 10px;
|
||||
padding: 15px;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
.message-label {
|
||||
font-size: 1.1em;
|
||||
color: #007bff;
|
||||
}
|
||||
.reply-label {
|
||||
font-size: 1.1em;
|
||||
color: #28a745;
|
||||
}
|
||||
.message p, .reply p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
@php
|
||||
$currentPage = 'manage-customer';
|
||||
@endphp
|
||||
<style>
|
||||
.message {
|
||||
background-color: #f8f9fa;
|
||||
border-radius: 10px;
|
||||
padding: 15px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
<div class="layout-px-spacing">
|
||||
<div class="middle-content container-xxl p-0">
|
||||
<div class="row layout-top-spacing ">
|
||||
<div class="top-tabel">
|
||||
<div class="row">
|
||||
<div class="col-md-4 left">
|
||||
<a class="d-flex align-items-center justify-content-center pl-2" href="{{ route('manage.customer') }}">
|
||||
<img class="back-btn" src="{{ asset('public/assets/img/left-arrow.svg') }}">
|
||||
<h6 class="card-title p-0">View Details</h6>
|
||||
</a>
|
||||
.reply {
|
||||
background-color: #e2e3e5;
|
||||
border-radius: 10px;
|
||||
padding: 15px;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.message-label {
|
||||
font-size: 1.1em;
|
||||
color: #007bff;
|
||||
}
|
||||
|
||||
.reply-label {
|
||||
font-size: 1.1em;
|
||||
color: #28a745;
|
||||
}
|
||||
|
||||
.message p,
|
||||
.reply p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="layout-px-spacing">
|
||||
<div class="middle-content container-xxl p-0">
|
||||
<div class="row layout-top-spacing ">
|
||||
<div class="top-tabel">
|
||||
<div class="row">
|
||||
<div class="col-md-4 left">
|
||||
<a class="d-flex align-items-center justify-content-center pl-2"
|
||||
href="{{ route('manage.customer') }}">
|
||||
<img class="back-btn" src="{{ asset('public/assets/img/left-arrow.svg') }}">
|
||||
<h6 class="card-title p-0">View Details</h6>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
|
||||
<div class="widget-content widget-content-area br-8 position-btn p-0">
|
||||
<div class="view-details">
|
||||
<div class="simple-tab">
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="home-tab-pane" role="tabpanel" aria-labelledby="home-tab" tabindex="0">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-10 tabs23">
|
||||
<table>
|
||||
<tr class="title">
|
||||
<td>Name :</td>
|
||||
<td>User ID :</td>
|
||||
<td>Date of birth :</td>
|
||||
<td>Phone Number :</td>
|
||||
</tr>
|
||||
<tr class="w-100">
|
||||
<td>{{ $customers_data->first_name }} {{ $customers_data->last_name }}</td>
|
||||
<td>{{ $customers_data->id }}</td>
|
||||
<td>{{ \Carbon\Carbon::parse($customers_data->date_of_birth)->format('m/d/Y') }}</td>
|
||||
<td>{{ $customers_data->phone_number }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<a class="download-btn-custom mt-3" href="{{ url('/create-pdf-file', $customers_data->id) }}">
|
||||
<span>Download user report</span>
|
||||
<img src="{{ asset('public/assets/img/download.svg') }}" />
|
||||
</a>
|
||||
<div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
|
||||
<div class="widget-content widget-content-area br-8 position-btn p-0">
|
||||
<div class="view-details">
|
||||
<div class="simple-tab">
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="home-tab-pane" role="tabpanel"
|
||||
aria-labelledby="home-tab" tabindex="0">
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-10 tabs23">
|
||||
<table>
|
||||
<tr class="title">
|
||||
<td>Name :</td>
|
||||
<td>User ID :</td>
|
||||
<td>Date of birth :</td>
|
||||
<td>Phone Number :</td>
|
||||
</tr>
|
||||
<tr class="w-100">
|
||||
<td>{{ $customers_data->first_name }}
|
||||
{{ $customers_data->last_name }}</td>
|
||||
<td>{{ $customers_data->id }}</td>
|
||||
<td>{{ \Carbon\Carbon::parse($customers_data->date_of_birth)->format('m/d/Y') }}
|
||||
</td>
|
||||
<td>{{ $customers_data->phone_number }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<a class="download-btn-custom mt-3"
|
||||
href="{{ url('/create-pdf-file', $customers_data->id) }}">
|
||||
<span>Download user report</span>
|
||||
<img src="{{ asset('public/assets/img/download.svg') }}" />
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<table>
|
||||
<tr class="title">
|
||||
<td>Location :</td>
|
||||
<td>Email ID :</td>
|
||||
<td>Onboarded date :</td>
|
||||
</tr>
|
||||
<tr class="w-100">
|
||||
<td>{{ $customers_data->state->name}}</td>
|
||||
<td>{{ $customers_data->email_address }}</td>
|
||||
<td>{{ \Carbon\Carbon::parse($customers_data->created_at)->format('d-m-y') }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-12 mb-10">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<b> Contact History </b>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($customers_data->contactMessages->isNotEmpty())
|
||||
@foreach($customers_data->contactMessages as $message)
|
||||
<div class="message">
|
||||
<strong>Message:</strong>
|
||||
<p>{{ $message->message }}</p>
|
||||
</div>
|
||||
@if($message->reply_message)
|
||||
<div class="reply">
|
||||
<strong>Reply:</strong>
|
||||
<p>{{ $message->reply_message }}</p>
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<table>
|
||||
<tr class="title">
|
||||
<td>Location :</td>
|
||||
<td>Email ID :</td>
|
||||
<td>Onboarded date :</td>
|
||||
</tr>
|
||||
<tr class="w-100">
|
||||
<td>{{ $customers_data->state->name }}</td>
|
||||
<td>{{ $customers_data->email_address }}</td>
|
||||
<td>{{ \Carbon\Carbon::parse($customers_data->created_at)->format('m-d-y') }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-md-12 mb-10">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<b> Contact History </b>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if ($customers_data->contactMessages->isNotEmpty())
|
||||
@foreach ($customers_data->contactMessages as $message)
|
||||
<div class="message">
|
||||
<strong>Message:</strong>
|
||||
<p>{{ $message->message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@else
|
||||
<p>No contact history available.</p>
|
||||
@endif
|
||||
@if ($message->reply_message)
|
||||
<div class="reply">
|
||||
<strong>Reply:</strong>
|
||||
<p>{{ $message->reply_message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@else
|
||||
<p>No contact history available.</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{--
|
||||
--}}
|
||||
<div class="col-md-12 mb-10">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<b> Payment History </b>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if ($customers_data->isSubscribed->isNotEmpty())
|
||||
<div class="col-md-6 mb-10">
|
||||
<table>
|
||||
@foreach ($customers_data->isSubscribed as $subscribe)
|
||||
<tr class="title">
|
||||
<td>Amount :</td>
|
||||
<td>Stripe Customer Id :</td>
|
||||
<td>Subscription Id :</td>
|
||||
<td>Subscription Status :</td>
|
||||
<td>Current Start Period </td>
|
||||
<td>Current End Period :</td>
|
||||
<td>Next Payment Date :</td>
|
||||
|
||||
</tr>
|
||||
<tr class="w-100">
|
||||
<td>{{ $subscribe->amount }}
|
||||
</td>
|
||||
<td>{{ $subscribe->stripe_customer_id }}
|
||||
</td>
|
||||
<td>{{ $subscribe->subscription_id }}
|
||||
</td>
|
||||
<td>{{ $subscribe->subscription_status }}
|
||||
</td>
|
||||
<td>{{ \Carbon\Carbon::parse($subscribe->current_period_start)->format('m-d-y') }}
|
||||
</td>
|
||||
<td>{{ \Carbon\Carbon::parse($subscribe->current_period_end)->format('m-d-y') }}
|
||||
</td>
|
||||
<td>{{ \Carbon\Carbon::parse($subscribe->next_payment_date)->format('m-d-y') }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@else
|
||||
<p>No payment history available.</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{--
|
||||
--}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -121,9 +185,8 @@ $currentPage = 'manage-customer';
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('section_script')
|
||||
<script src="{{ asset('assets/js/admin/manage_customer/main.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/admin/manage_customer/main.js') }}"></script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user