
<form role="form" id="form-edit-discount">
    <div class="form-body">
        <input type="hidden" name="id" value="{{ $discount->id }}">

        <div class="row">
            <div class="col-md-12">
                <div class="text-center" style="margin-top: 15px; line-height: 34px">
                    <div class="alert alert-warning">
                        <span id="report"><strong>Chú ý: Nếu tạo dữ liệu đã tồn tại trước đó, dữ liệu cũ sẽ được ghi đè.
<br>
                                Các hóa đơn sẽ được áp dụng giảm giá sau thời điểm cập nhật thành công


                            </strong></span>
                    </div>
                </div>
            </div>
            <div class="col-md-12">
                <div class="form-group">
                    <label>Chọn nhà</label>
                    <div class="mt-checkbox-inline">
                        @php $hostelArr = $discount->hostels->pluck('id')->toArray(); @endphp

                        <label class="mt-checkbox">
                            <input type="checkbox" class="check-all"> Tất cả
                            <span></span>
                        </label>

                        @foreach($hostels as $hostel)
                            <label class="mt-checkbox">
                                <input type="checkbox" @if(in_array($hostel->id, $hostelArr)) checked @endif name="hostel_id[]" value="{{ $hostel->id }}"> {{ $hostel->name }}
                                <span></span>
                            </label>
                        @endforeach
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                    <label>Chọn tháng</label>
                    <input class="form-control monthpicker" name="date" value="{{ $discount->date->format('m/Y') }}">
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label>Số tiền giảm</label>
                    <input class="form-control price-r" name="discount" value="{{ number_format($discount->discount, 0, '.', '.') }}">
                </div>
            </div>
        </div>
    </div>
</form>