<form role="form" id="form-edit-room"> <div class="form-body"> <div class="row"> <input type="hidden" name="id" value="<?php echo e($room->id); ?>"> <div class="col-md-6"> <div class="form-group"> <label>Tên phòng <span class="required" aria-required="true"> (*) </span></label> <input type="text" class="form-control" name="name" value="<?php echo e($room->name); ?>"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Tầng / khu / dãy <span class="required" aria-required="true"> (*) </span></label> <input type="text" class="form-control" name="block_name" value="<?php echo e($room->block_name); ?>"> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label>Giá phòng <span class="required" aria-required="true"> (*) </span></label> <input type="text" class="form-control price-r" name="price" value="<?php echo e(number_format($room->price, 0, '.', '.')); ?>"> </div> </div> <div class="col-md-4"> <div class="form-group"> <label>Diện tích (m2) <span class="required" aria-required="true"> (*) </span></label> <input type="text" class="form-control" name="size" value="<?php echo e($room->size); ?>"> </div> </div> <div class="col-md-4"> <div class="form-group"> <label>Số người phù hợp <span class="required" aria-required="true"> (*) </span></label> <input type="number" class="form-control" name="max_renters" value="<?php echo e($room->max_renters); ?>"> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Tiền cọc</label> <input type="text" class="form-control price-r" name="deposit" value="<?php echo e(number_format($room->deposit, 0, '.', '.')); ?>"> </div> </div> <?php if($room->hostel->type_rent == \App\Models\Hostel::TYPE_RENT_ALL): ?> <div class="col-md-6"> <label>Ngày phòng sẽ trống </label> <div class="input-group"> <input type="text" class="form-control datepicker" name="date_available" <?php if(!empty($room->date_available)): ?> value="<?php echo e(\Carbon\Carbon::createFromFormat('Y-m-d', $room->date_available)->format('d/m/Y')); ?>" <?php else: ?> value="" <?php endif; ?>> <span class="input-group-btn"> <button class="btn blue set-empty" type="button">Xóa</button> </span> </div> </div> <?php endif; ?> </div> <div class="row" style="margin-top: 10px"> <div class="col-md-12"> <label>Tiện ích</label> <div class="row"> <?php $roomAmenities = $room->amenities->pluck('id')->toArray();?> <?php $__currentLoopData = $amenities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $amenity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="col-md-3"> <label class="mt-checkbox mt-checkbox-outline" style="width: 100%"> <input <?php if(in_array($amenity->id, $roomAmenities)): ?> checked <?php endif; ?> type="checkbox" name="amenities[]" value="<?php echo e($amenity->id); ?>"> <?php if(!empty($amenity->web_image)): ?> <img src="/files/<?php echo e($amenity->web_image); ?>" class="svg" style="max-height: 18px; max-width: 18px; margin-right: 3px"> <?php else: ?> <img src="/frontend3/amenity.svg" class="svg" style="max-height: 18px; max-width: 18px; margin-right: 3px"> <?php endif; ?> <?php echo e($amenity->name); ?> <span></span> </label> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <div class="text-center"> <hr style="border-top: 1px dashed"> <p>Nếu phòng của bạn có tiện ích không xuất hiện trong danh sách. Hãy ấn nút "Bổ sung tiện ích" để thêm</p> <button class="btn btn-success" id="btn-add-amenity-room">Bổ sung tiện ích</button> </div> <div class="row"> <div class="col-md-12"> <div class="row" id="user_amenities"> </div> </div> </div> <hr style="border-top: 1px solid"> <?php
                    $images = DB::table('room_images')->where('room_id', $room->id)->get(); ?> <?php if($images->count() > 0): ?> <div class="row" style="margin-top: 10px"> <div class="col-md-12"> <label>Hình ảnh</label> <div class="row" id="room_images"> <?php $__currentLoopData = $images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="col-sm-6 col-md-3"> <a href="javascript:;" class="thumbnail"> <i class="fa fa-trash btn-delete-room-image" data-id="<?php echo e($image->id); ?>" style="position: absolute; top: 0px; right: 0px; padding: 10px 10px; font-size: 18px; margin-right: 15px; background: red; color: white"></i> <img src="/files/<?php echo e($image->image); ?>" alt="100%x180" style="height: 180px; width: 100%; display: block;" > </a> <select class="form-control" name="image-types[<?php echo e($image->id); ?>][]"> <option <?php if($image->type == \App\Models\Room::IMAGE_LIVING_ROOM): ?> selected <?php endif; ?> value="<?php echo e(\App\Models\Room::IMAGE_LIVING_ROOM); ?>">Ảnh phòng khách </option> <option <?php if($image->type == \App\Models\Room::IMAGE_BED_ROOM): ?> selected <?php endif; ?> value="<?php echo e(\App\Models\Room::IMAGE_BED_ROOM); ?>">Ảnh phòng ngủ </option> <option <?php if($image->type == \App\Models\Room::IMAGE_KITCHEN): ?> selected <?php endif; ?> value="<?php echo e(\App\Models\Room::IMAGE_KITCHEN); ?>">Ảnh nhà bếp </option> <option <?php if($image->type == \App\Models\Room::IMAGE_OTHER): ?> selected <?php endif; ?> value="<?php echo e(\App\Models\Room::IMAGE_OTHER); ?>">Vị trí khác </option> </select> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> </div> </div> <?php endif; ?> <div class="text-center" style="margin-top: 15px"> <p>Hãy chọn ít nhất 1 hình ảnh thật về phòng của bạn để tin đăng phòng hấp dẫn hơn và giúp người tìm trọ thấy được ảnh phòng của bạn</p> <button class="btn btn-success" id="btn-add-image-room">Bổ sung ảnh phòng</button> <hr style="border-top: 1px dashed"> </div> <div class="row"> <div class="col-md-12"> <div class="row" id="room_images"> </div> </div> </div> </div> </div> </div> </form>