<?php $__env->startSection('content'); ?>

<div class="container-fluid px-4">

    <div class="card mt-4">
                   <div class="card-header">
                                  <h1 class=""><?php echo e(__('basicSetup')); ?></h1>
                   </div>

                   <div class="card-body">
                    <p><a href="<?php echo e(asset('assets/pdf_instruction/line.pdf')); ?>" target="_blank"><?php echo e(__('Download Line setup instructions PDF')); ?></a></p>
                     <?php if($errors->any()): ?>
                     <div class="alert alert-danger">
                     
                         <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                         <div><?php echo e($error); ?></div>

                         <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                     </div>
                   

                     <?php endif; ?>

                        <form id="basicSettingForm" action="<?php echo e(url('admin/add-basic-setting')); ?>" method="POST" enctype="multipart/form-data">

                                                 <?php echo csrf_field(); ?>

                                                  <h3 style="margin-top: 20px" class=""><?php echo e(__('LineSetup')); ?></h3>

                                                  <div class="row">
                                                    <div class="mb-3 col-md-6">
                                                        <label  for="line_key" class="form-label"><?php echo e(__('LineApi')); ?></label>
                                                        <input
                                                          type="text"
                                                          class="form-control"
                                                          id="line_key"
                                                          name="line_key"
                                                          value="<?php echo e($basicSetting->line_key); ?>"

                                                        />
                                                      </div>
                                                      <div class="mb-3 col-md-6">
                                                        <label  class="form-label"><?php echo e(__('Liff')); ?></label>
                                                        <input
                                                          type="text"
                                                          class="form-control"
                                                          id="liff_id"
                                                          name="liff_id"
                                                          value="<?php echo e($basicSetting->liff_id); ?>"

                                                        />
                                                      </div>
                                                      <div class="mb-3 col-md-6">
                                                        <label  class="form-label"><?php echo e(__('Bot Id')); ?></label>
                                                        <input
                                                          type="text"
                                                          class="form-control"
                                                          id="bot_id"
                                                          name="bot_id"
                                                          value="<?php echo e($basicSetting->bot_id); ?>"

                                                        />
                                                      </div>
                                               

                                                  </div>

                                                   

                                                    <button type="b_submit" id="updateButton" class="btn btn-primary"><?php echo e(__('updateSetup')); ?></button>





                                  </form>


                   </div>

    </div>

</div>
<div class="modal fade" id="confirmupdate" tabindex="-1" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
    <div class="modal-content">
      
        <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLabel"><?php echo e(__('Warning')); ?></h5>
        </div>

        <div class="modal-body">


            <div class="form-popup-inputs">
                <label style="color: red" for="addNote"><?php echo e(__('warningLine')); ?></label>
            </div>
         

        </div>

        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?php echo e(__('Cancel')); ?></button>
          <a href="javascript:void(0)" onclick="updatesetup()" class="btn btn-primary"><?php echo e(__('updateSetup')); ?></a>
   
            

        </div>

      
    </div>
</div>
</div>
<?php $__env->stopSection(); ?>
<script>
  document.addEventListener('DOMContentLoaded', function() {
    <?php if(isset($basicSetting->line_key) && $basicSetting->line_key  && isset($basicSetting->liff_id) && $basicSetting->liff_id &&isset($basicSetting->bot_id) && $basicSetting->bot_id): ?>
      document.getElementById('updateButton').addEventListener('click', function(e) {
          e.preventDefault(); // Prevent the form from submitting
            var modal = new bootstrap.Modal(document.getElementById('confirmupdate'));
            modal.show();
      });
      <?php endif; ?>
  });
  function updatesetup() {
     
        document.getElementById('basicSettingForm').submit();
        var modal = new bootstrap.Modal(document.getElementById('confirmupdate'));
            modal.hide();

    }
</script>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/xorgeekc/public_html/medishop/resources/views/admin/settings/basicsetting.blade.php ENDPATH**/ ?>