This commit is contained in:
pbao9
2026-02-02 17:27:33 +07:00
parent 17b02631e4
commit 8125804bac
22 changed files with 1047 additions and 379 deletions
@@ -44,6 +44,9 @@
<!-- CSS for LTR layout-->
@vite(['resources/sass/app.scss'])
<!-- Global Modal CSS -->
@vite(['resources/css/components/micromodal.css'])
<!-- CSS for RTL layout-->
@@ -77,6 +80,9 @@
<!-- common js -->
@vite(['resources/js/pages/template.js'])
<!-- Global Modal JS -->
@vite(['resources/js/components/micromodal.js'])
<!-- end common js -->
<!-- Global Select2 initialization -->
@@ -88,6 +94,16 @@
height: "100%",
});
};
// Global ModalManager initialization
document.addEventListener('DOMContentLoaded', function() {
if (typeof ModalManager !== 'undefined') {
ModalManager.init();
console.log('ModalManager initialized globally');
} else {
console.warn('ModalManager not loaded');
}
});
</script>
@include('administrator.layout.partials.toast')
@@ -13,61 +13,64 @@
<h4 class="title">Clients Information</h4>
<!--Box info-->
<div class="summary__box">
<table class="table table-borderless">
<tbody>
<tr>
<th scope="row">First Name</th>
<td>{{ $customer->firstname }}</td>
<div class="table-responsive">
<table class="table table-borderless table-sm">
<tbody>
<tr>
<th scope="row">First Name</th>
<td>{{ $customer->firstname }}</td>
</tr>
<tr>
<th scope="row">Last Name</th>
<td>{{ $customer->lastname }}</td>
</tr>
<tr>
<th scope="row">Company</th>
<td>{{ $customer->company }}</td>
</tr>
<tr>
<th scope="row">Email</th>
<td>{{ $customer->email }}</td>
</tr>
<tr>
<th scope="row">Address</th>
<td>{{ $customer->address }}</td>
</tr>
<tr>
<th scope="row">City</th>
<td>{{ $customer->city }}</td>
</tr>
<tr>
<th scope="row">Country</th>
<td>{{ $customer->country }}</td>
</tr>
<tr>
<th scope="row">Phone Number</th>
<td>{{ $customer->phone }}</td>
</tr>
</tbody>
</table>
</tr>
<tr>
<th scope="row">Last Name</th>
<td>{{ $customer->lastname }}</td>
</tr>
<tr>
<th scope="row">Company</th>
<td>{{ $customer->company }}</td>
</tr>
<tr>
<th scope="row">Email</th>
<td>{{ $customer->email }}</td>
</tr>
<tr>
<th scope="row">Address</th>
<td>{{ $customer->address }}</td>
</tr>
<tr>
<th scope="row">City</th>
<td>{{ $customer->city }}</td>
</tr>
<tr>
<th scope="row">Country</th>
<td>{{ $customer->country }}</td>
</tr>
<tr>
<th scope="row">Phone Number</th>
<td>{{ $customer->phone }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--Box Action-->
<div class="summary--box__action mt-2">
<ul class="list-unstyled">
<li>
<a id="summary-reset-password"
<div class="summary--box__action mt-3">
<div class="list-group list-group-flush">
<div class="list-group-item border-0 px-0">
<a class="btn btn-outline-warning btn-sm btn-block" id="summary-reset-password"
href="{{ route('customer.PasswordReset', ['userid' => $customer->id]) }}">
<img src="{{ asset('images/resetpw.png') }}">
<i data-lucide="key" class="mr-2"></i>
Reset & Send Password
</a>
</li>
<li>
<a target="_blank" id="summary-login-as-client"
</div>
<div class="list-group-item border-0 px-0">
<a class="btn btn-outline-info btn-sm btn-block" target="_blank" id="summary-login-as-client"
href="{{ route('customer.Login', ['userid' => $customer->id]) }}">
<img src="{{ asset('images/clientlogin.png') }}"> Login as Client
<i data-lucide="log-in" class="mr-2"></i>
Login as Client
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
@@ -77,50 +80,61 @@
<h4 class="title">Invoices/Billing</h4>
<!--Box info-->
<div class="summary__box">
<table class="table table-borderless">
<tbody>
<tr>
<th scope="row">Invoice Paid</th>
<td>{{ $customer->invoices_status_count_1 }}
(@money($customer->invoices_status_1)
đ)
</td>
<div class="table-responsive">
<table class="table table-borderless table-sm">
<tbody>
<tr>
<th scope="row">Invoice Paid</th>
<td class="text-success font-weight-bold">
<span class="badge badge-success">{{ $customer->invoices_status_count_1 }}</span>
(@money($customer->invoices_status_1) đ)
</td>
</tr>
<tr>
<th scope="row">Invoice UnPaid</th>
<td>{{ $customer->invoices_status_count_0 }}
(@money($customer->invoices_status_0)
đ)
</td>
</tr>
<tr>
<th scope="row">Total</th>
<td>@money($customer->invoices_status_0 + $customer->invoices_status_1) đ</td>
</tr>
</tbody>
</table>
</tr>
<tr>
<th scope="row">Invoice UnPaid</th>
<td class="text-warning font-weight-bold">
<span class="badge badge-warning">{{ $customer->invoices_status_count_0 }}</span>
(@money($customer->invoices_status_0) đ)
</td>
</tr>
<tr class="border-top">
<th scope="row" class="font-weight-bold">Total</th>
<td class="font-weight-bold text-primary">@money($customer->invoices_status_0 + $customer->invoices_status_1) đ</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="clients-summary__box">
<h4 class="title">Recent Emails</h4>
<div class="summary__box">
@if($customer->mail->count())
<table class="table table-borderless">
<tbody>
@foreach($customer->mail->take(4)->all() as $item)
<tr>
<td>
<a href="{{ route('customer.email', ['userid' => $userid, 'email_id' => $item->id]) }}"
target="_blank">{{ $item->created_at }}
- {{ $item->subject }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="table-responsive">
<table class="table table-borderless table-sm table-hover">
<tbody>
@foreach($customer->mail->take(4)->all() as $item)
<tr>
<td>
<a class="text-decoration-none" href="{{ route('customer.email', ['userid' => $userid, 'email_id' => $item->id]) }}"
target="_blank">
<div class="d-flex flex-column">
<small class="text-muted">{{ $item->created_at }}</small>
<span class="text-dark">{{ $item->subject }}</span>
</div>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@else
<p class="text-center m-0">No recent Email</p>
<div class="text-center py-3">
<i data-lucide="mail-open" class="text-muted mb-2" style="width: 48px; height: 48px;"></i>
<p class="text-muted mb-0">No recent Email</p>
</div>
@endif
</div>
</div>
@@ -132,26 +146,36 @@
<h4 class="title">Products/Services</h4>
<!--Box info-->
<div class="summary__box">
<table class="table table-borderless">
<tbody>
<tr>
<th scope="row">VPS/Server</th>
<td>{{ $customer->vps_count}}</td>
</tr>
<tr>
<th scope="row">Hosting</th>
<td>{{ $customer->hosting_count }}</td>
</tr>
<tr>
<th scope="row">Domain</th>
<td>{{ $customer->domain_count }}</td>
</tr>
<tr>
<th scope="row">Support Tickets</th>
<td>{{ $customer->ticket_count }}</td>
</tr>
</tbody>
</table>
<div class="table-responsive">
<table class="table table-borderless table-sm">
<tbody>
<tr>
<th scope="row">VPS/Server</th>
<td>
<span class="badge badge-primary">{{ $customer->vps_count}}</span>
</td>
</tr>
<tr>
<th scope="row">Hosting</th>
<td>
<span class="badge badge-info">{{ $customer->hosting_count }}</span>
</td>
</tr>
<tr>
<th scope="row">Domain</th>
<td>
<span class="badge badge-success">{{ $customer->domain_count }}</span>
</td>
</tr>
<tr>
<th scope="row">Support Tickets</th>
<td>
<span class="badge badge-warning">{{ $customer->ticket_count }}</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--File-->
@@ -159,46 +183,58 @@
<h4 class="title">Files</h4>
<div class="summary__box">
@if($customer->file->count())
<table class="table table-borderless">
<tbody>
@foreach($customer->file->all() as $item)
<tr>
<td>
<a href="{{ $item->file_url }}" download
target="_blank">{{ $item->filename }}</a>
</td>
<td class="text-right">
<button data-id="{{ $item->id }}"
class="btn btn-outline-secondary p-1 border-0 btn-remove__file">
<i class="fas fa-trash"></i>
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="table-responsive">
<table class="table table-borderless table-sm table-hover">
<tbody>
@foreach($customer->file->all() as $item)
<tr>
<td>
<a class="text-decoration-none d-flex align-items-center" href="{{ $item->file_url }}" download target="_blank">
<i data-lucide="file" class="mr-2 text-primary"></i>
<span>{{ $item->filename }}</span>
</a>
</td>
<td class="text-right">
<button data-id="{{ $item->id }}"
class="btn btn-outline-danger btn-sm p-1 btn-remove__file">
<i data-lucide="trash-2"></i>
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@else
<p class="text-center m-0">No files uploaded</p>
<div class="text-center py-3">
<i data-lucide="file-text" class="text-muted mb-2" style="width: 48px; height: 48px;"></i>
<p class="text-muted mb-0">No files uploaded</p>
</div>
@endif
</div>
<div class="box-add__file mt-2">
<a onclick="$('.box-add__input').removeClass('d-none')" class="cursor-point pointer-event">
<img alt="Add File" src="{{ asset('images/add.png') }}"> Add File
</a>
<div class="box-add__input d-none mt-2">
<div class="summary__box p-2">
<div class="row">
<div class="col-md-12">
<label for="input-file">File:</label>
<input type="text" class="form-control mt-2" id="input-file" name="file">
<div class="box-add__file mt-3">
<button type="button" class="btn btn-outline-success btn-sm" onclick="$('.box-add__input').toggleClass('d-none')">
<i data-lucide="plus" class="mr-2"></i>
Add File
</button>
<div class="box-add__input d-none mt-3">
<div class="card border-light">
<div class="card-body p-3">
<div class="form-group mb-3">
<label for="input-file" class="form-label">File:</label>
<input type="text" class="form-control form-control-sm" id="input-file" name="file" placeholder="Select a file...">
</div>
<div class="btn-group btn-group-sm" role="group">
<button type="button" class="btn btn-outline-primary btn-open__ckfinder">
<i data-lucide="folder-open" class="mr-1"></i>
Choose File
</button>
<button type="button" class="btn btn-primary btn-save__data">
<i data-lucide="save" class="mr-1"></i>
Save
</button>
</div>
</div>
<button class="btn mt-2 btn-open__ckfinder btn-outline-secondary">
Choose File
</button>
<button class="btn mt-2 btn-save__data btn-outline-secondary">
Save
</button>
</div>
</div>
</div>
@@ -213,13 +249,20 @@
</div>
@else
<div class="alert alert-danger alert-dismissible">
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Customer
<h5 class="mb-0"><i data-lucide="ban" class="icon mr-2"></i> Access Denied - You are not assigned to any Customer
management department</h5>
</div>
@endif
@endsection
@push('scripts')
<script type="text/javascript">
// Initialize Lucide icons
document.addEventListener('DOMContentLoaded', function() {
if (typeof lucide !== 'undefined') {
lucide.createIcons();
}
});
$('.btn-open__ckfinder').click(function () {
CKFinder.popup({
chooseFiles: true,
@@ -18,7 +18,7 @@
<div class="card card-primary card-outline">
<div class="card-header">
@include("administrator.pages.s.block.Sync.Folder")
@include("administrator.pages.block.Sync.Folder")
</div>
<div class="card-body">
<x-datatable id="folderTable" ajax="{{ route('package.folder.datatable') }}" :columns="[
@@ -17,7 +17,7 @@
@if (auth()->guard('admins')->user()->can('manager package module'))
<div class="card card-primary card-outline">
<div class="card-header">
@include('administrator.pages.s.block.Group')
@include('administrator.pages.block.Group')
</div>
<div class="card-body">
<x-datatable id="groupTable" ajax="{{ route('package.group.datatable') }}" :columns="[
@@ -17,7 +17,7 @@
@if(auth()->guard('admins')->user()->can("manager package module"))
<div class="card card-primary card-outline">
<div class="card-header">
@include("administrator.pages.s.block.Sync.Network")
@include("administrator.pages.block.Sync.Network")
</div>
<div class="card-body">
<x-datatable id="networkTable" ajax="{{ route('package.network.datatable') }}" :columns="[
@@ -0,0 +1,69 @@
<!-- Delete Confirmation Modal -->
<div class="modal micromodal-slide" id="deleteModal" aria-hidden="true">
<div class="modal__overlay" tabindex="-1" data-micromodal-close>
<div class="modal__container modal--sm" role="dialog" aria-modal="true" aria-labelledby="deleteModalLabel">
<header class="modal__header bg-primary text-white">
<h6 class="modal__title" id="deleteModalLabel">
<i data-lucide="trash-2" class="w-15px h-15px me-2"></i>
Confirm Delete
</h6>
<button class="modal__close" aria-label="Close modal" data-micromodal-close>
<i data-lucide="x"></i>
</button>
</header>
<main class="modal__content">
<div class="text-center">
<i data-lucide="alert-triangle" class="text-warning mb-3" style="width: 48px; height: 48px;"></i>
<h6 class="mb-2">Are you sure?</h6>
<p class="text-muted small mb-1">Delete OS Version:</p>
<p class="fw-bold mb-2"><span id="deleteItemName"></span></p>
<p class="text-danger small mb-0">This action cannot be undone!</p>
</div>
</main>
<footer class="modal__footer">
<button type="button" class="btn btn-outline-secondary btn-sm me-2" data-micromodal-close>
<i data-lucide="x" class="me-1"></i>
Cancel
</button>
<form id="deleteForm" method="POST" class="d-inline">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-primary btn-sm">
<i data-lucide="trash-2" class="me-1"></i>
Delete
</button>
</form>
</footer>
</div>
</div>
</div>
@push('custom-scripts')
<script>
document.addEventListener('DOMContentLoaded', function() {
function initializeModal() {
if (typeof ModalManager !== 'undefined') {
window.showDeleteModal = function(id, name) {
// Update modal content
const nameElement = document.getElementById('deleteItemName');
const formElement = document.getElementById('deleteForm');
if (nameElement && formElement) {
nameElement.textContent = name;
formElement.action = `/administrator/package/version/remove-os-version/${id}`;
ModalManager.show('deleteModal');
} else {
console.error('Modal elements not found');
}
};
} else {
console.warn('ModalManager not available, retrying...');
setTimeout(initializeModal, 100);
}
}
setTimeout(initializeModal, 50);
});
</script>
@endpush
@@ -17,14 +17,15 @@
@if (auth()->guard('admins')->user()->can('manager package module'))
<div class="card card-primary card-outline">
<div class="card-header">
<a href="{{ route('package.version.create') }}" class="btn btn-outline-secondary">
<i class="fas fa-plus"></i> Add New Version OS
<a href="{{ route('package.version.create') }}" class="btn btn-outline-primary">
<i data-lucide="plus" class="mr-2"></i> Add New Version OS
</a>
</div>
<div class="card-body">
<x-datatable id="osVerisionTable" ajax="{{ route('package.version.datatable') }}" :columns="[
['key' => 'version', 'label' => 'Version'],
['key' => 'os_group', 'label' => 'OS Group'],
['key' => 'template_id', 'label' => 'Template'],
['key' => 'status', 'label' => 'Status'],
['key' => 'action', 'label' => 'Action'],
]" />
@@ -33,12 +34,33 @@
</div>
@else
<div class="alert alert-danger alert-dismissible">
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Module Package
<h5 class="mb-0"><i data-lucide="ban" class="icon mr-2"></i> Access Denied - You are not assigned to any Module Package
management department</h5>
</div>
@endif
<!-- Include Delete Modal -->
@include('administrator.pages.package.version.datatable.modal')
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function() {
// Initialize Lucide icons
if (typeof lucide !== 'undefined') {
lucide.createIcons();
}
// Re-initialize icons when DataTable draws
$('#osVerisionTable').on('draw.dt', function() {
if (typeof lucide !== 'undefined') {
lucide.createIcons();
}
});
});
</script>
@endpush
@push('plugin-scripts')
<script src="{{ asset('build/plugins/jquery/jquery.min.js') }}"></script>
<script src="{{ asset('build/plugins/select2/select2.min.js') }}"></script>