

<?php $__env->startSection('styles'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

    <?php if(session()->has('error')): ?>
        <div class="alert alert-danger"><?php echo e(session()->get('error')); ?></div>
    <?php endif; ?>
    <?php if(session()->has('success')): ?>
        <div class="alert alert-success"><?php echo e(session()->get('success')); ?></div>
    <?php endif; ?>
    <?php if(count($errors) > 0): ?>
        <div class="alert alert-danger">
            <ul>
                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li><?php echo e($error); ?></li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </div>
    <?php endif; ?>
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN SAMPLE FORM PORTLET-->
            <div class="portlet light bordered">
                <div class="portlet-title">
                    <div class="caption font-red-sunglo">
                        <i class="icon-settings font-red-sunglo"></i>
                        <span class="caption-subject bold uppercase"> Thiết lập mẫu hóa đơn (sẽ được hiển thị ở chân hóa đơn)</span>
                    </div>
                </div>
                <div class="portlet-body form">
                    <form role="form" action="<?php echo e(url('admin2/setting/create-voucher')); ?>" method="POST">
                        <?php echo csrf_field(); ?>

                        <div class="form-body">
                            <div class="form-group">
                                <label>Chọn nhà</label>
                                <select class="form-control" id="hostels" name="hostel_id">
                                    <?php $__currentLoopData = $hostels; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $hostel): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option <?php if($hostel->id == $hostelId): ?> selected
                                                <?php endif; ?> value="<?php echo e($hostel->id); ?>"><?php echo e($hostel->name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                            <div class="form-group">
                                <textarea class="form-control ckeditor" name="voucher"
                                          rows="20"><?php if($voucher): ?> <?php echo $voucher; ?> <?php endif; ?></textarea>
                            </div>
                        </div>
                        <div class="form-actions">
                            <button type="submit" class="btn blue">Lưu</button>
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </div>

<?php $__env->stopSection(); ?>

<?php $__env->startPush('scripts'); ?>

    <script>

        $('.ckeditor').ckeditor({
            height: '500px',
            tabSpaces: 4
        });

        $('#hostels').change(function () {
            window.location = "<?php echo e(url('admin2/setting/voucher?hostel_id=')); ?>" + $(this).val();
        });
    </script>

<?php $__env->stopPush(); ?>
<?php echo $__env->make('admin2', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>