|
Server : LiteSpeed System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : elvh3918 ( 1528) PHP Version : 8.2.31 Disable Function : mail Directory : /home/elvh3918/public_html/pmm/storage/framework/views/ |
<?php $__env->startSection('navbar'); ?>
<!-- Navbar -->
<div class="navbar">
<div class="container">
<div class="logo">
<a href="<?php echo e(route('guest.dashboard', $customer_id)); ?>">
<?php if(Auth::user()->model_type == 'App\Models\Bussiness'): ?>
<?php if(isset(Auth::user()->model->image)): ?>
<?php if(Auth::user()->model->image != null && file_exists(public_path('storage/' . config('app.dir_file_buss') . '/' . Auth::user()->model->image))): ?>
<img src=<?php echo e(config('app.url') . '/storage/' . config('app.dir_file_buss') . '/' . Auth::user()->model->image); ?> class="card-img-top" style="width: 120px;">
<?php else: ?>
<span class="text-capitalize font-weight-bold text-purple" style="font-size: 20px"><?php echo e(Auth::user()->model->name); ?></span>
<?php endif; ?>
<?php else: ?>
<span class="text-capitalize font-weight-bold text-purple" style="font-size: 20px"><?php echo e(Auth::user()->model->name); ?></span>
<?php endif; ?>
<?php elseif(Auth::user()->model_type == 'App\Models\Master\Tenant'): ?>
<span class="text-capitalize font-weight-bold text-purple" style="font-size: 20px"><?php echo e($customer ? $customer[0]->tenant->name : 'Tenant'); ?></span>
<?php elseif(Auth::user()->model_type == 'App\Models\Master\Customer'): ?>
<span class="text-capitalize font-weight-bold text-purple" style="font-size: 20px"><?php echo e($customer ? $customer[0]->tenant->name : 'Customer'); ?></span>
<?php endif; ?>
</a>
</div>
<div class="hamburger" id="hamburger">
<div></div>
<div></div>
<div></div>
</div>
<div class="menu" id="menu">
<?php if($customer_id != 0): ?>
<a href="<?php echo e(route('guest.dashboard', $customer_id)); ?>" class="<?php echo e(request()->routeIs('guest.dashboard') ? 'active' : ''); ?>">Dashboard</a>
<a href="<?php echo e(route('guest.history', $customer_id)); ?>" class="<?php echo e(request()->routeIs('guest.history') ? 'active' : ''); ?>">History</a>
<a href="<?php echo e(route('guest.report', [$customer_id, 0, '-', '-', 'null'])); ?>" class="<?php echo e(request()->routeIs('guest.report') ? 'active' : ''); ?>">Report</a>
<?php endif; ?>
<!-- Notifications Dropdown Menu -->
<ul class="order-1 order-md-3 navbar-nav navbar-no-expand ml-auto">
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="far fa-user"></i>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<span class="dropdown-header">
<?php if(Auth::user()->model_type == 'App\Models\Master\Customer'): ?>
<?php echo e(Auth::user()->model->name); ?>
<?php else: ?>
Customers
<?php endif; ?>
</span>
<?php if(Auth::user()->model_type != 'App\Models\Master\Customer'): ?>
<?php $__currentLoopData = $customer; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if($data->maintenance_count != 0): ?>
<div class="dropdown-divider"></div>
<a href="<?php echo e(route('guest.dashboard', $data->id)); ?>" class="dropdown-item <?php echo e($query_customer ? ($query_customer->id == $data->id ? 'bg-dark' : '') : ''); ?>"
>
<i class="fas fa-user mr-2"></i><?php echo e($data->tenant->code); ?> - <?php echo e($data->name); ?>
<span class="float-right text-sm"><?php echo e($data->maintenance_count); ?> visit</span>
</a>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item dropdown-footer" onclick="openCustomer()">See All Customers</a>
<?php endif; ?>
<?php if(Auth::user()->model_type == 'App\Models\Master\Customer'): ?>
<div class="dropdown-divider"></div>
<a href="<?php echo e(route('logout')); ?>"
onclick="event.preventDefault(); document.getElementById('logout-form').submit();"
class="dropdown-item dropdown-footer bg-danger">
Logout
</a>
<form method="POST" id="logout-form" action="<?php echo e(route('logout')); ?>">
<?php echo csrf_field(); ?>
</form>
<?php endif; ?>
</div>
</li>
</ul>
</div>
</div>
</div>
<!-- /.navbar -->
<!-- modal -->
<div class="modal fade" id="modal_customer">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title text-capitalize">customer</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<table id="tbl-customer" class="table table-sm table-bordered">
<thead>
<tr>
<th class="text-center" hidden>ID</th>
<th class="text-center">Data</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="modal-footer d-flex justify-content-start justify-content-md-end d-print-none">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-style-guest-nav'); ?>
<link rel="stylesheet" href="<?php echo e(asset('assets/plugins/datatables-bs4/css/dataTables.bootstrap4.css')); ?>">
<link rel="stylesheet" href="<?php echo e(asset('assets/plugins/datatables-buttons/css/buttons.bootstrap4.css')); ?>">
<style>
/* Navbar container */
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #f9f9f9;
padding: 10px 20px;
border-bottom: 1px solid #ddd;
}
.logo {
color: #333;
font-size: 20px;
font-weight: bold;
}
/* Menu links */
.menu {
display: flex;
gap: 15px;
}
.menu a {
color: #333;
text-decoration: none;
padding: 8px 12px;
border-radius: 5px;
transition: 0.3s;
}
.menu a:hover {
background-color: #eaeaea;
}
.menu a.active {
background-color: #007bff;
color: white;
}
/* Hamburger */
.hamburger {
display: none;
flex-direction: column;
cursor: pointer;
}
.hamburger div {
width: 25px;
height: 3px;
background-color: #333;
margin: 4px 0;
transition: 0.3s;
}
/* Responsive */
@media (max-width: 768px) {
.menu {
display: none;
flex-direction: column;
width: 100%;
background-color: #f9f9f9;
border-top: 1px solid #ddd;
}
.menu a {
text-align: center;
border-top: 1px solid #eee;
}
.menu.active {
display: flex;
}
.hamburger {
display: flex;
}
}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-script-guest-nav'); ?>
<script src="<?php echo e(asset('assets/plugins/datatables/dataTables.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables/dataTables.bootstrap4.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/dataTables.buttons.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/buttons.bootstrap4.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/buttons.print.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/jszip.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/buttons.html5.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/datatables-buttons/js/buttons.colVis.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/file/file-exists.js')); ?>"></script>
<script>
const hamburger = document.getElementById('hamburger');
const menu = document.getElementById('menu');
const links = document.querySelectorAll('.menu a');
hamburger.addEventListener('click', () => {
menu.classList.toggle('active');
});
new DataTable('#tbl-customer', {
columns: [
{
data: 'id',
name: 'id',
targets: 0,
className: 'dt-body-left',
visible: false,
},
{
data: 'data',
name: 'data',
targets: 1,
className: 'dt-body-left'
}
]
});
function openCustomer() {
var tenant_id=0;
var auth = <?php echo json_encode(Auth::user()); ?>;
if (auth.model_type == 'App\\Models\\Bussiness') {
tenant_id=0;
} else if (auth.model_type == 'App\\Models\\Master\\Tenant' || auth.model_type == 'App\\Models\\Master\\Customer') {
tenant_id=auth.model_id;
}
var table = new DataTable('#tbl-customer');
table.clear().draw();
$('#modal_customer').modal('toggle');
$.ajax({
dataType: 'json',
type: "GET",
url: '<?php echo e(env('APP_URL')); ?>' + "/api/global/open/customer-by-tenant/" + tenant_id,
success: function(res) {
if (res.length > 0) {
const arr = res.map(col => {
return {
id: col.id,
data: showDetailCustomer(col),
}
})
table.rows.add(arr).draw();
}
},
error: function(xhr, status, error) {
alert(error);
return;
}
});
}
function showDetailCustomer(data) {
var html ="";
html +='<div class="container my-2">';
html +='<div class="row">';
html +='<div class="col-3 mb-2">';
if (data.image) {
var url = '<?php echo e(config('app.url')); ?>' + '/storage/' + '<?php echo e(config('app.dir_file_customer')); ?>' + '/' + data.image;
if (fileExists(url)) {
html +='<img src=' + url + ' class="rounded">';
} else {
html +='<img src=<?php echo e(asset(config("app.img_not_found"))); ?> class="rounded">';
}
} else {
html +='<img src=<?php echo e(asset(config("app.img_not_found"))); ?> class="rounded">';
}
html +='</div>';
html +='<div class="col-9 mb-2">';
html +='<div class="row">';
html +='<div class="col-3 border-bottom">';
html +='<span class="text-capitalize">tenant</span>';
html +='</div>';
html +='<div class="col-9 border-bottom">';
var tenant = data.tenant ? data.tenant.name : '';
html +='<span class="text-capitalize">: ' + tenant + '</span>';
html +='</div>';
html +='</div>';
html +='<div class="row">';
html +='<div class="col-3 border-bottom">';
html +='<span class="text-capitalize">name</span>';
html +='</div>';
html +='<div class="col-9 border-bottom">';
var name = data.name ? data.name : '';
html +='<span class="text-capitalize">: ' + data.name + '</span>';
html +='</div>';
html +='</div>';
html +='<div class="row">';
html +='<div class="col-3 border-bottom">';
html +='<span class="text-capitalize">phone</span>';
html +='</div>';
html +='<div class="col-9 border-bottom">';
var phone = data.phone ? data.phone : '';
html +='<span class="text-capitalize">: ' + data.phone + '</span>';
html +='</div>';
html +='</div>';
html +='<div class="row">';
html +='<div class="col-3 border-bottom">';
html +='<span class="text-capitalize">email</span>';
html +='</div>';
html +='<div class="col-9 border-bottom">';
var email = data.email ? data.email : '';
html +='<span class="text-capitalize">: ' + email + '</span>'
html +='</div>';
html +='</div>';
html +='<div class="row">';
html +='<div class="col-3 border-bottom">';
html +='<span class="text-capitalize">address</span>';
html +='</div>';
html +='<div class="col-9 border-bottom">';
var address = data.address ? data.address : '';
html +='<span class="text-capitalize">: ' + address + '</span>';
html +='</div>';
html +='</div>';
html +='<div class="row">';
html +='<div class="col-3 border-bottom">';
html +='<span class="text-capitalize">descript.</span>';
html +='</div>';
html +='<div class="col-9 border-bottom">';
var description = data.description ? data.description : '';
html +='<span class="text-capitalize">: ' + description + '</span>';
html +='</div>';
html +='</div>';
html +='</div>';
html +='</div>';
html +='<div class="row rounded" style="background-color: #F5F5F5;">';
html +='<div class="col-md-6 mb-2">';
html +='<div class="d-flex justify-content-md-start justify-content-center p-1">';
html +='<small class="text-muted text-capitalize mt-2">last updated: ' + data.created_at + '</small>';
html +='</div>';
html +='</div>';
html +='<div class="col-md-6 mb-2">';
html +='<div class="d-flex justify-content-md-end justify-content-center p-1">';
html +='<button type="button" class="text-capitalize btn btn-dark btn-sm mt-2" onclick="selectModalCustomer(`' + encodeURIComponent(JSON.stringify(data)) + '`)"><i class="fa fa-arrow-right mr-2"></i>select</button>';
html +='</div>';
html +='</div>';
html +='</div>';
html +='</div>';
return html;
}
function selectModalCustomer(data) {
$('#modal_customer').modal('hide');
data = JSON.parse(decodeURIComponent(data));
window.location.href = '<?php echo e(env('APP_URL')); ?>' + "/guest/dashboard/" + data.id;
}
</script>
<?php $__env->stopSection(); ?><?php /**PATH /home/elvh3918/public_html/pmm/resources/views/layouts/panels/guest/navbar.blade.php ENDPATH**/ ?>