<div class="row">
    <div class="col-2">
       <b>Anesthesia</b> &nbsp;&nbsp;
    </div>
    <div class="col-2 text-nowrap">
        <?php
            $anes = isset($case->anesthesia) ? $case->anesthesia : [];
            $is_na = '';
            if (count($anes) == 0 && @$case->anesthesia == '') {
                $is_na = 'checked';
            }
        ?>
        <button type="button" class="btn btn-checkbox btn-label waves-effect waves-light btn-sm" id="btn_anesthesia">
            <i class="ri-checkbox-blank-line label-icon align-middle fs-16 me-2 text-light"></i>
            None Anesthesia
        </button>
    </div>
   <div class="row">

       <?php $__currentLoopData = isset($procedure->anesthesia) ? $procedure->anesthesia : []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $box): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
           <?php
               $is_checked_anes = in_array($box, $anes) ? 'checked' : '';
           ?>
           <div class="col-4">
               <input type = "checkbox"
               name = "anesthesia"
               class = "form-check-input savejson_checkbox ck-val savejson"
               id= "anesthesia<?php echo e($box); ?>"
               value= "<?php echo e($box); ?>" <?php echo e($is_checked_anes); ?>>
               <label class="ms-3" for="anesthesia<?php echo e($box); ?>">&nbsp;<?php echo e($box); ?></label>
           </div>
       <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
   </div>
    <div class="col-12">
        <input class="form-control autotext savejson" id="anesthesiaother" placeholder="Other Anesthesia" type="text"
            autocomplete="off" value="<?php echo e(@$case->anesthesiaother); ?>" />
    </div>
    <div class="col-12">&nbsp;</div>
</div>

<script type="text/javascript">
    $("#btn_anesthesia").click(function() {
        $("input[name='anesthesia']").prop("checked", false);
        $("#anesthesiaother").val("None Anesthesia");
        $("#anesthesiaother").focus();
        $.post('<?php echo e(url('api/jquery')); ?>', {
            event: 'savejson_checkbox2',
            idhtml: 'anesthesia',
            value: [],
            table: 'tb_case',
            idname: 'case_id',
            id: '<?php echo e($cid); ?>',
            procedure: '<?php echo e($procedure->code); ?>',
        }, function(data, status) {});
    });

    $('.ck-val').on('click', function () {
        let name = $(this).attr('name')
        if(name == 'anesthesia'){
            let other = $(`#${name}other`).val()
            if(other.includes('No')){
                $(`#${name}other`).val('')
            }
        }
    })
</script>
<?php /**PATH D:\laragon\htdocs\screening\resources\views/case/component/sub/anesthesia.blade.php ENDPATH**/ ?>