Yohohohohohooho | Sanrei Aya
Sanrei Aya


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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/elvh3918/public_html/pmm/storage/framework/views/96bfa53068d10f0742c74cf96ad3aa36.php
<?php $__env->startSection('modal-addnew-service-type'); ?>
    <div class="modal fade" id="modal_addnew_service_type">
        <div class="modal-dialog modal-xl">
            <div class="modal-content">
                <form id="form_input_service_type">
                    <?php echo csrf_field(); ?>

                    <div class="modal-header">
                        <h4 class="modal-title text-capitalize">add new service type</h4>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body">
                        <div class="card-body">
                            <div class="row">
                                <div class="col mb-3">
                                    <label class="form-label" for="addnew_service_type_name">Name<span class="text-danger">*</span></label>
                                    <input type="text"
                                        class="form-control"
                                        id="addnew_service_type_name" name="addnew_service_type_name" placeholder="Name" value=""
                                        required
                                    />
                                </div>
                            </div>

                            <div class="row">
                                <div class="col mb-3">
                                    <label class="form-label" for="addnew_service_type_description">Description</label>
                                    <textarea name="addnew_service_type_description" id="addnew_service_type_description" class="form-control" rows="3" placeholder="Description"></textarea>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col">
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" id="addnew_service_type_is_active"
                                            name="addnew_service_type_is_active" checked />
                                        <label for="addnew_service_type_is_active" class="form-check-label ml-1">Active</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer d-flex justify-content-start justify-content-md-end d-print-none">
                        <button class="btn btn-primary mr-2" type="submit" onclick='buttonSpin("btn_save_service_type", "spinner-border spinner-border-sm")'>
                            <i id="btn_save_service_type" class="fa fa-save"></i>
                            <span class="ml-2">Save</span>
                        </button>

                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    </div>
                </form>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-style-modal-addnew-service-type'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-script-modal-addnew-service-type'); ?>
    <script src="<?php echo e(asset('assets/plugins/file/file-exists.js')); ?>"></script>

    <script>
        function addServiceType() {
            if (!document.getElementById('tenant_id').value) {
                alert('Tenant need value!');
                return;
            }

            document.getElementById('addnew_service_type_name').value = "";
            document.getElementById('addnew_service_type_description').value = "";
            document.getElementById('addnew_service_type_is_active').checked = true;

            $('#modal_addnew_service_type').modal('toggle');
        }

        $(document).on('submit','#form_input_service_type',function(e){
            e.preventDefault();
            let form_data = Object.fromEntries(Array.from(new FormData(this)));
            var form = new FormData();
            form.append('name', form_data['addnew_service_type_name']);
            form.append('description', form_data['addnew_service_type_description']);
            form.append('tenant_id', document.getElementById('tenant_id').value);
            form.append('is_active', form_data['addnew_service_type_is_active']);
            
            $.ajax({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                url:'<?php echo e(env('APP_URL')); ?>' + "/api/trans/create/service-type",
                dataType: "json",
                method:'post',
                data : form,
                cache:false,
                contentType: false,
                processData: false,
                
                beforeSend: function() {

                },
                complete: function() {
                    buttonSpin("btn_save_service_type", "fa fa-save");
                },
                success: function(res) {
                    if (res.message == 'store success') {
                        document.getElementById('trans_type').value = res.value.name;
                        $('#modal_addnew_service_type').modal('hide');
                    } else {
                        document.getElementById("addnew_service_type_name").classList.remove("is-invalid");

                        if (res.value.name) {
                            document.getElementById("addnew_service_type_name").classList.add("is-invalid");
                        }
                    }

                    loadToastr(res.message);
                },
                error: function(xhr, error) {
                    buttonSpin("btn_save_service_type", "fa fa-save");
                    alert(error);
                    return;
                }
            });
        });
    </script>
<?php $__env->stopSection(); ?><?php /**PATH /home/elvh3918/public_html/pmm/resources/views/content/trans/maintenance/partials/modal/addnew/service_type.blade.php ENDPATH**/ ?>

Yohohohohohooho | Sanrei Aya