|
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/tenant/storage/framework/views/ |
<?php $__env->startSection('title', $breadcrumbs[count($breadcrumbs) - 1]['name']); ?>
<?php $__env->startSection('content'); ?>
<div class="container">
<?php echo $__env->make('components/breadcrumb', ['breadcrumbs' => $breadcrumbs], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="card card-solid">
<form class="form" action="<?php echo e(route('admin.bussiness.update', $query['id'])); ?>" method="POST" enctype="multipart/form-data">
<?php echo csrf_field(); ?>
<div class="card-body">
<ul class="nav nav-pills mb-3">
<li class="nav-item"><a class="nav-link active" href="#tab_basic" data-toggle="tab">Basic Data</a></li>
<li class="nav-item"><a class="nav-link" href="#tab_additional" data-toggle="tab">Additional Info</a></li>
<li class="nav-item"><a class="nav-link" href="#tab_other" data-toggle="tab">Other</a></li>
</ul>
<div class="tab-content">
<div class="active tab-pane" id="tab_basic">
<div class="row">
<div class="col mb-3">
<div id="image-area"></div>
</div>
</div>
<div class="row">
<div class="col-md-4 mb-3">
<label class="form-label" for="code">Code<span class="text-danger">*</span></label>
<input type="text"
class="form-control <?php echo e(count($errors) == 0 ? '' : (count($errors->get('code')) == 0 ? '' : 'is-invalid')); ?>"
id="code" name="code" placeholder="Code" value="<?php echo e(count($errors) == 0 ? $query['code'] : old('code')); ?>"
required />
<?php if (isset($component)) { $__componentOriginalf94ed9c5393ef72725d159fe01139746 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalf94ed9c5393ef72725d159fe01139746 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.input-error','data' => ['messages' => $errors->get('code'),'class' => 'mt-2']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('input-error'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['messages' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($errors->get('code')),'class' => 'mt-2']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalf94ed9c5393ef72725d159fe01139746)): ?>
<?php $attributes = $__attributesOriginalf94ed9c5393ef72725d159fe01139746; ?>
<?php unset($__attributesOriginalf94ed9c5393ef72725d159fe01139746); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalf94ed9c5393ef72725d159fe01139746)): ?>
<?php $component = $__componentOriginalf94ed9c5393ef72725d159fe01139746; ?>
<?php unset($__componentOriginalf94ed9c5393ef72725d159fe01139746); ?>
<?php endif; ?>
</div>
<div class="col-md-8 mb-3">
<label class="form-label" for="name">Name<span class="text-danger">*</span></label>
<input type="text"
class="form-control <?php echo e(count($errors) == 0 ? '' : (count($errors->get('name')) == 0 ? '' : 'is-invalid')); ?>"
id="name" name="name" placeholder="Name" value="<?php echo e(count($errors) == 0 ? $query['name'] : old('name')); ?>"
required />
<?php if (isset($component)) { $__componentOriginalf94ed9c5393ef72725d159fe01139746 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalf94ed9c5393ef72725d159fe01139746 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.input-error','data' => ['messages' => $errors->get('name'),'class' => 'mt-2']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('input-error'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['messages' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($errors->get('name')),'class' => 'mt-2']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalf94ed9c5393ef72725d159fe01139746)): ?>
<?php $attributes = $__attributesOriginalf94ed9c5393ef72725d159fe01139746; ?>
<?php unset($__attributesOriginalf94ed9c5393ef72725d159fe01139746); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalf94ed9c5393ef72725d159fe01139746)): ?>
<?php $component = $__componentOriginalf94ed9c5393ef72725d159fe01139746; ?>
<?php unset($__componentOriginalf94ed9c5393ef72725d159fe01139746); ?>
<?php endif; ?>
</div>
</div>
<div class="row">
<div class="col-md-4 mb-3">
<label class="form-label" for="owner">Owner<span class="text-danger">*</span></label>
<input type="text"
class="form-control <?php echo e(count($errors) == 0 ? '' : (count($errors->get('owner')) == 0 ? '' : 'is-invalid')); ?>"
id="owner" name="owner" placeholder="Owner" value="<?php echo e(count($errors) == 0 ? $query['owner'] : old('owner')); ?>"
required />
<?php if (isset($component)) { $__componentOriginalf94ed9c5393ef72725d159fe01139746 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalf94ed9c5393ef72725d159fe01139746 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.input-error','data' => ['messages' => $errors->get('owner'),'class' => 'mt-2']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('input-error'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['messages' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($errors->get('owner')),'class' => 'mt-2']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalf94ed9c5393ef72725d159fe01139746)): ?>
<?php $attributes = $__attributesOriginalf94ed9c5393ef72725d159fe01139746; ?>
<?php unset($__attributesOriginalf94ed9c5393ef72725d159fe01139746); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalf94ed9c5393ef72725d159fe01139746)): ?>
<?php $component = $__componentOriginalf94ed9c5393ef72725d159fe01139746; ?>
<?php unset($__componentOriginalf94ed9c5393ef72725d159fe01139746); ?>
<?php endif; ?>
</div>
<div class="col-md-4 mb-3">
<label class="form-label" for="email">Email<span class="text-danger">*</span></label>
<input type="email"
class="form-control <?php echo e(count($errors) == 0 ? '' : (count($errors->get('email')) == 0 ? '' : 'is-invalid')); ?>"
id="email" name="email" placeholder="Email" value="<?php echo e(count($errors) == 0 ? $query['email'] : old('email')); ?>"
required />
<?php if (isset($component)) { $__componentOriginalf94ed9c5393ef72725d159fe01139746 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalf94ed9c5393ef72725d159fe01139746 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.input-error','data' => ['messages' => $errors->get('email'),'class' => 'mt-2']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('input-error'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['messages' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($errors->get('email')),'class' => 'mt-2']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalf94ed9c5393ef72725d159fe01139746)): ?>
<?php $attributes = $__attributesOriginalf94ed9c5393ef72725d159fe01139746; ?>
<?php unset($__attributesOriginalf94ed9c5393ef72725d159fe01139746); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalf94ed9c5393ef72725d159fe01139746)): ?>
<?php $component = $__componentOriginalf94ed9c5393ef72725d159fe01139746; ?>
<?php unset($__componentOriginalf94ed9c5393ef72725d159fe01139746); ?>
<?php endif; ?>
</div>
<div class="col-md-4 mb-3">
<label class="form-label" for="phone">Phone<span class="text-danger">*</span></label>
<input type="text"
class="form-control <?php echo e(count($errors) == 0 ? '' : (count($errors->get('phone')) == 0 ? '' : 'is-invalid')); ?>"
id="phone" name="phone" placeholder="Phone" value="<?php echo e(count($errors) == 0 ? $query['phone'] : old('phone')); ?>"
required />
<?php if (isset($component)) { $__componentOriginalf94ed9c5393ef72725d159fe01139746 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalf94ed9c5393ef72725d159fe01139746 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.input-error','data' => ['messages' => $errors->get('phone'),'class' => 'mt-2']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('input-error'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['messages' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($errors->get('phone')),'class' => 'mt-2']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalf94ed9c5393ef72725d159fe01139746)): ?>
<?php $attributes = $__attributesOriginalf94ed9c5393ef72725d159fe01139746; ?>
<?php unset($__attributesOriginalf94ed9c5393ef72725d159fe01139746); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalf94ed9c5393ef72725d159fe01139746)): ?>
<?php $component = $__componentOriginalf94ed9c5393ef72725d159fe01139746; ?>
<?php unset($__componentOriginalf94ed9c5393ef72725d159fe01139746); ?>
<?php endif; ?>
</div>
</div>
</div>
<div class="tab-pane" id="tab_additional">
<div class="row">
<div class="col mb-3">
<label class="form-label" for="address">Address</label>
<textarea name="address" id="address" class="form-control" rows="3" placeholder="Address"><?php echo e(count($errors) == 0 ? $query['address'] : old('address')); ?></textarea>
</div>
</div>
<div class="row">
<div class="col mb-3">
<label class="form-label" for="map">Map</label> <a href="#" onclick="clickOpenMap()"><span class="badge bg-dark my-1 ml-2"><i class="fa fa-folder-open mr-1"></i>Open</span></a>
<textarea name="map" id="map" class="form-control mb-3" rows="3" placeholder="Map Embed"><?php echo e(count($errors) == 0 ? $query['map'] : old('map')); ?></textarea>
<iframe id="iframe_map" class="rounded" height="200" style="width:100%;border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
</div>
</div>
</div>
<div class="tab-pane" id="tab_other">
<div class="row">
<div class="col mb-3">
<label class="form-label" for="description">Description</label>
<textarea name="description" id="description" class="form-control" rows="3" placeholder="Description"><?php echo e(count($errors) == 0 ? $query['description'] : old('description')); ?></textarea>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="d-flex">
<div class="form-check mr-4">
<input class="form-check-input" type="checkbox" id="is_head"
name="is_head"
<?php if($query['is_head'] == 1): ?>
checked
<?php endif; ?>
/>
<label for="is_head" class="form-check-label ml-1">Head Office</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="is_active"
name="is_active"
<?php if($query['is_active'] == 1): ?>
checked
<?php endif; ?>
/>
<label for="is_active" class="form-check-label ml-1">Active</label>
</div>
</div>
</div>
</div>
</div>
<div class="p-2 card-footer d-print-none">
<div class="d-flex justify-between">
<span class="text-muted">Last updated: <?php echo e($query['updated_at']); ?></span>
<button class="btn btn-warning mr-2" type="submit" onclick='buttonSpin("btn_save", "spinner-border spinner-border-sm")'>
<i id="btn_save" class="fa fa-save"></i>
<span class="ml-2">Update</span>
</button>
</div>
</div>
</form>
</div>
</div>
<!--/. container-fluid -->
</section>
<!-- /.content -->
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-style'); ?>
<link rel="stylesheet" href="<?php echo e(asset('assets/plugins/toastr/toastr.min.css')); ?>">
<style>
.dz-preview {
width: 100%;
margin: 0 !important;
height: 100%;
padding: 5px;
position: absolute !important;
top: 0;
}
.dz-photo {
height: 100%;
width: 100%;
overflow: hidden;
border-radius: 12px;
background: #f3f3f3;
}
.dz-thumbnail {
width: 100%;
height: 100%;
object-fit: contain;
}
.dropzone-drag-area {
height: 300px;
position: relative;
padding: 0 !important;
border-radius: 10px;
border: 3px dashed #dbdeea;
}
</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-script'); ?>
<script src="<?php echo e(asset('assets/plugins/toastr/toastr.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/plugins/file/file-exists.js')); ?>"></script>
<script src="<?php echo e(asset('assets/external/load-toastr.js')); ?>"></script>
<script src="<?php echo e(asset('assets/external/button-spin.js')); ?>"></script>
<script>
loadToastr(<?php echo json_encode(Session::get('message')); ?>);
removeImage();
fill_data_image(<?php echo json_encode($query['image']); ?>);
clickOpenMap();
//**** load Image *************************
function clickImage() {
document.getElementById('image').click();
}
$(document).on('change', '.selectImage', function() {
let reader = new FileReader();
reader.onload = (e) => {
$('#image_image').attr('src', e.target.result);
}
reader.readAsDataURL(this.files[0]);
});
function removeImage($delete = false) {
if ($delete == true) {
if (<?php echo json_encode($query['image']); ?> != null) {
delete_image(<?php echo json_encode($query['id']); ?>);
return;
}
}
// reset
document.getElementById("image-area").innerHTML = "";
var html="";
html +='<div class="dropzone-drag-area form-control" id="previews">';
html +='<div class="dz-preview">';
html +='<div class="dz-photo">';
html +=`<img id="image_image" src="<?php echo e(asset(config('app.img_not_found'))); ?>" class="dz-thumbnail">`;
html +='</div>';
html +='</div>';
html +='</div>';
html +='<div class="mt-2 d-flex justify-content-center">';
html +='<input id="image" name="image" type="file" class="form-control selectImage" style="display:none;" />';
html +='<input type="button" class="btn btn-primary mr-2" value="Browse" onclick="clickImage()" />';
html +='<button class="btn btn-danger" type="button" onclick="removeImage(true)">';
html +='<span>Remove</span>';
html +='</button>';
html +='</div>';
$("#image-area").append(html);
}
function fill_data_image(data) {
if (data) {
var url = '<?php echo e(config('app.url')); ?>' + '/storage/' + '<?php echo e(config('app.dir_file_buss')); ?>' + '/' + data;
if (fileExists(url)) {
document.getElementById('image_image').src = url;
} else {
document.getElementById('image_image').src = "<?php echo e(asset(config('app.img_not_found'))); ?>";
}
} else {
document.getElementById('image_image').src = "<?php echo e(asset(config('app.img_not_found'))); ?>";
}
}
function delete_image(id) {
if (confirm('Are you sure?')) {
$.ajax({
dataType: 'json',
type: "GET",
url: '<?php echo e(env('APP_URL')); ?>' + "/api/global/delete/image/buss/" + id,
success: function(res) {
if (res.length > 0) {
if (res == 'success') {
removeImage();
} else if (res == 'not exists') {
alert('Image not exists');
} else if (res == 'not exists') {
alert('Remove failed');
}
}
},
error: function(xhr, status, error) {
alert(error);
return;
}
});
}
}
function clickOpenMap() {
document.getElementById('iframe_map').src = document.getElementById('map').value;
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts/app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/elvh3918/public_html/tenant/resources/views/content/admin/bussiness/edit.blade.php ENDPATH**/ ?>