|
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('modal-technician'); ?>
<div class="modal fade" id="modal_technician">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title text-capitalize">technician</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-technician" 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>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-script-modal-technician'); ?>
<script>
new DataTable('#tbl-technician', {
columns: [
{
data: 'id',
name: 'id',
targets: 0,
className: 'dt-body-left',
visible: false,
},
{
data: 'data',
name: 'data',
targets: 1,
className: 'dt-body-left'
}
]
});
function openTechnician() {
if (!document.getElementById('tenant_id').value) {
alert('Tenant need value!');
return;
}
var table = new DataTable('#tbl-technician');
table.clear().draw();
$('#modal_technician').modal('toggle');
var id = document.getElementById('tenant_id').value;
id = id ? id : 0;
$.ajax({
dataType: 'json',
type: "GET",
url: '<?php echo e(env('APP_URL')); ?>' + "/api/global/open/technician-by-tenant/" + id,
success: function(res) {
if (res.length > 0) {
const arr = res.map(col => {
return {
id: col.id,
data: showDetailTechnician(col.id, col.image, col.name, col.phone, col.email, col.address, col.description, col.is_active, col.tenant, col.created_at),
}
})
table.rows.add(arr).draw();
}
},
error: function(xhr, status, error) {
alert(error);
return;
}
});
}
function showDetailTechnician(id, image, name, phone, email, address, description, is_active, tenant, created_at) {
var html ="";
html +='<div class="container my-2">';
html +='<div class="row">';
html +='<div class="col-3 mb-2">';
if (image) {
var url = '<?php echo e(config('app.url')); ?>' + '/storage/' + '<?php echo e(config('app.dir_file_technician')); ?>' + '/' + 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">name</span>';
html +='</div>';
html +='<div class="col-9 border-bottom">';
var name = name ? name : '';
html +='<span class="text-capitalize">: ' + 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 = phone ? phone : '';
html +='<span class="text-capitalize">: ' + 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 = email ? 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 = address ? 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 = description ? 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: ' + 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="selectModalTechnician(`' + id + '`, `' + image + '`, `' + name + '`, `' + phone + '`, `' + email + '`, `' + address + '`, `' + description + '`, `' + is_active + '`, `' + tenant + '`, `' + created_at + '`)"><i class="fa fa-arrow-right mr-2"></i>select</button>';
html +='</div>';
html +='</div>';
html +='</div>';
html +='</div>';
return html;
}
</script>
<?php $__env->stopSection(); ?><?php /**PATH /home/elvh3918/public_html/pmm/resources/views/content/trans/maintenance/partials/modal/technician.blade.php ENDPATH**/ ?>