<div class="row resoponsiveRow">
    <?php include APPPATH.'views/backend/users/inc/leftsidebar.php'; ?>
    <div class="col-md-8">
        <div class="row ">
            <div class="col-md-8">
                <div class="card">
                    <div class="card-header">
                        <h4><?= __("shipping_delivery_configuration");?></h4>
                    </div>
                    <form action="<?= base_url("admin/restaurant/shipping_config_update");?>" method="post" id="shipping_config_form">
                        <div class="card-body min-h-150 d-flex align-center justify-content-center">
                            <?= csrf();?>
                            <div class="deliveyTheme justify-center">
                                <div class="form-group text-center mb-0 d-flex gap-10 flex-wrap">
                                    <label class="custom-radio"> 
                                        <input type="radio" name="delivery_config"
                                            value="default" onchange="this.form.submit()" <?= isset(restaurant()->is_area_delivery) && restaurant()->is_area_delivery == 0 && isset(restaurant()->is_radius) && restaurant()->is_radius == 0 ?"checked" : "" ;?>  > <?= lang('default');?>
                                    </label>

                                    <label class="custom-radio "> 
                                        <input type="radio" name="delivery_config"
                                            value="is_area_delivery" onchange="this.form.submit()" <?= isset(restaurant()->is_area_delivery) && restaurant()->is_area_delivery==1?"checked" : "" ;?>>
                                        <?= lang('delivery_area');?>
                                    </label>

                                    <label class="custom-radio "> 
                                        <input type="radio" name="delivery_config"
                                            value="is_radius" onchange="this.form.submit()" <?= isset(restaurant()->is_radius) && restaurant()->is_radius==1?"checked" : "" ;?> >
                                        <?= lang('radius_base_delivery_settings');?>
                                    </label>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <?php if(isset(restaurant()->is_radius) && restaurant()->is_radius == 1 ):?>
                    <?php include VIEWPATH . 'backend/users/delivery_settings.php' ?>
                <?php elseif(isset(restaurant()->is_area_delivery) && restaurant()->is_area_delivery == 1): ?>
                    <?php include VIEWPATH . 'backend/restaurant/delivery_area.php' ?>
                <?php else: ?>
                    <div class="card mt-50">
                        <form action="<?= base_url('admin/restaurant/delivery_charge_in_update') ?>" method="post">
                            <div class="card-body">
                            <?= csrf();?>
                                <div class="form-group">
                                    <label for=""><?= lang('delivery_charge'); ?></label>
                                    <input type="text" name="delivery_charge_in" class="form-control" value="<?= !empty(restaurant()->delivery_charge_in) ? restaurant()->delivery_charge_in : 0; ?>">
                                </div>
                            </div>
                            
                            <div class="card-footer">
                                <button class="btn btn-secondary d-block w_100 py-10"><?= lang('submit');?></button>
                            </div>
                        </form>
                    </div>
                <?php endif; ?>

            </div>
        </div>
    </div>
</div>