<form role="form" id="form-edit-hostel-post-crawl-item">
    <input type="hidden" name="id" value="<?php echo e($hostel->id); ?>">
    <div class="form-body">
        <div class="row">
            <div class="col-md-8">
                <div class="form-group">
                    <label>Tên nhà <span class="required" aria-required="true"> (*) </span></label>
                    <input type="text" class="form-control" placeholder="" name="title" value="<?php echo e($hostel->title); ?>">
                </div>
            </div>
            <div class="col-md-4">

                <div class="form-group">
                    <label>Loại nhà <span class="required" aria-required="true"> (*) </span></label>
                    <?php $hostelTypes = \App\Models\HostelType::all(); ?>
                    <select class="form-control" name="type">
                        <?php $__currentLoopData = $hostelTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $hostelType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option <?php if($hostel->type == $hostelType->id): ?> selected=""
                                    <?php endif; ?> value="<?php echo e($hostelType->id); ?>"><?php echo e($hostelType->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                    </select>
                </div>

            </div>
        </div>
        <div class="row">
            <div class="col-md-6">

                <div class="form-group">
                    <label>Chủ sở hữu <span class="required" aria-required="true"> (*) </span></label>
                    <input type="text" class="form-control" name="user_post" value="<?php echo e($hostel->user_post); ?>">
                </div>
            </div>
            <div class="col-md-6">

                <div class="form-group">
                    <label>Số điện thoại <span class="required" aria-required="true"> (*) </span></label>
                    <input type="text" class="form-control" name="user_post_phone" value="<?php echo e($hostel->user_post_phone); ?>">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">
                    <label>Địa chỉ <span class="required" aria-required="true"> (*) </span></label>
                    <input type="text" class="form-control" name="address" value="<?php echo e($hostel->address); ?>">
                    <span class="help-block"> (Không nhập địa chỉ Phường, Xã, Tỉnh, Thành phố) </span>
                </div>
            </div>
        </div>
        <div class="row">

            <div class="col-md-4">

                <div class="form-group">
                    <label>Tỉnh / TP <span class="required" aria-required="true"> (*) </span></label>
                    <select class="form-control select2" name="province_id" id="province_id">
                        <?php $__currentLoopData = $provinces; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $province): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option <?php if($province->provinceid == $hostel->province_id): ?> selected <?php endif; ?>
                            value="<?php echo e($province->provinceid); ?>"><?php echo e($province->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                    </select>
                </div>
            </div>
            <div class="col-md-4">

                <div class="form-group">
                    <label>Quận / Huyện <span class="required" aria-required="true"> (*) </span></label>
                    <select class="form-control select2" name="district_id" id="district_id">

                        <?php if(!empty($hostel->province_id)) {
                            $districts = DB::table('district')->where('provinceid', $hostel->province_id)->get();
                        } else {
                            $districts = null;
                        }?>

                        <?php if(!empty($districts)): ?>
                            <option value="" selected disabled>Quận / Huyện</option>
                            <?php $__currentLoopData = $districts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $district): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option <?php if($district->districtid == $hostel->district_id): ?> selected=""
                                        <?php endif; ?> value="<?php echo e($district->districtid); ?>"><?php echo e($district->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php else: ?>
                            <option value="" selected disabled>Quận / Huyện</option>
                        <?php endif; ?>

                    </select>
                </div>
            </div>
            <div class="col-md-4">

                <div class="form-group">
                    <label>Phường / Xã <span class="required" aria-required="true"> (*) </span></label>
                    <select class="form-control select2" name="ward_id" id="ward_id">
                        <?php if(!empty($hostel->district_id)) {
                            $wards = DB::table('ward')->where('districtid', $hostel->district_id)->get();
                        } else {
                            $wards = null;
                        }?>

                        <?php if(!empty($wards)): ?>

                            <option value="" selected disabled>Xã / Phường</option>
                            <?php $__currentLoopData = $wards; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ward): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option <?php if($ward->wardid == $hostel->ward_id): ?> selected=""
                                        <?php endif; ?> value="<?php echo e($ward->wardid); ?>"><?php echo e($ward->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php else: ?>
                            <option value="" selected disabled>Xã / Phường</option>
                        <?php endif; ?>
                    </select>
                </div>
            </div>
        </div>
    </div>
    <ul class="nav nav-tabs">
        <li class="active">
            <a href="#edit_tab_1_3" data-toggle="tab" aria-expanded="false"> Vị trí trên bản đồ </a>
        </li>
        <li>
            <a href="#edit_tab_1_4" data-toggle="tab" aria-expanded="false"> Hình ảnh </a>
        </li>
        <li>
            <a href="#edit_tab_1_5" data-toggle="tab" aria-expanded="false"> Mô tả chi tiết </a>
        </li>

    </ul>
    <div class="tab-content">
        <div class="tab-pane fade in active" id="edit_tab_1_3">
            <button class="btn btn-success" type="button" id="btn-get-current-position-edit"
                    style="margin-top: 10px; margin-bottom: 10px">Lấy tọa độ hiện tại
            </button>
            <label class="control-label" style="display: inline-block; margin-left: 15px; margin-right: 15px">Hoặc nhập
                vị trí tương đối xung quanh</label>
            <div class="form-group" style="display: inline-block; width: 300px">
                <input type="text" class="form-control" id="query_place_edit">
            </div>
            <div id="map_edit">

            </div>
            <input type="hidden" name="lat" id="lat-e" value="<?php echo e($hostel->lat); ?>">
            <input type="hidden" name="lng" id="lng-e" value="<?php echo e($hostel->lng); ?>">
        </div>
        <div class="tab-pane fade" id="edit_tab_1_4">
            

            
            
            
            
            
            <?php
                $images = \App\Models\HostelPostCrawlMedia::query()->where('hostel_post_crawl_id', $hostel->id)->get(); ?>

            <div class="row">
                <div class="col-md-12">
                    <div class="row" id="hostel_images_list">

                        <?php if($images->count() > 0): ?>
                            <?php $__currentLoopData = $images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="col-sm-6 col-md-3" style="margin-top: 15px">
                                    <i class="fa fa-trash btn-delete-hostel-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>
                                    <a href="javascript:;" class="thumbnail"
                                       style="width: 100%; height: 179px; background-image: url('<?php echo e($image->media); ?>');
                                               background-size: contain; background-repeat: no-repeat">
                                        
                                        
                                        
                                    </a>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                    </div>

                </div>
            </div>


            <div class="row">
                <div class="col-md-12">
                    <div class="row" id="hostel_images">
                    </div>
                </div>
            </div>
        </div>
        <div class="tab-pane fade" id="edit_tab_1_5">
            <textarea class="form-control ckeditor" name="content" rows="6"><?php echo $hostel->content; ?></textarea>
        </div>
    </div>

</form>