<?php $__env->startSection('content'); ?>
    <div class="container-fluid">
        <!-- start page title -->
        <div class="d-flex justify-content-between mt-2 mb-2">
            <h2>
                Edit Place
            </h2>
            <ol class="breadcrumb m-0">
                
                
            </ol>
        </div>
        <!-- end page title -->

        <?php if($errors->any()): ?>
            <div class="alert alert-danger">
                <strong>Whoops!</strong> There were some problems with your input.<br><br>
                <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="card">
            <div class="card-body">
                <!-- command bar -->
                <div class="d-flex justify-content-between">
                    <div>
                        <a href="javascript:history.back()" class="btn btn-primary mb-2">
                            กลับ
                        </a>
                    </div>
                </div>
                <!-- end command bar -->
                <form action="<?php echo e(route('places.update', $place->id)); ?>" method="POST" enctype="multipart/form-data">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('PUT'); ?>

                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            <div class="form-group">
                                <strong>name</strong>
                                <input type="text" name="name" value="<?php echo e($place->name); ?>" class="form-control"
                                    placeholder="Enter Name">
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            <div class="form-group">
                                <strong>address</strong>
                                <input type="text" name="address" value="<?php echo e($place->address); ?>" class="form-control"
                                    placeholder="Enter Address">
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            <div class="form-group">
                                <strong>description</strong>
                                <textarea class="form-control" name="description"
                                    placeholder="Enter Description"><?php echo e($place->description); ?></textarea>
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12">
                            <div class="form-group">
                                <strong>Image:</strong>
                                <input type="file" name="image" class="form-control" placeholder="Post Image">
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            <div class="form-group">
                                <strong>image_url</strong>
                                <input type="text" name="image_url" value="<?php echo e($place->image_url); ?>" class="form-control"
                                    placeholder="Enter Image Url">
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            <div class="form-group">
                                <strong>google_place_id</strong>
                                <input type="text" name="google_place_id" value="<?php echo e($place->google_place_id); ?>"
                                    class="form-control" placeholder="Enter Google Place Id">
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            <div class="form-group">
                                <strong>google_url</strong>
                                <input type="text" name="google_url" value="<?php echo e($place->google_url); ?>"
                                    class="form-control" placeholder="Enter Google Url">
                            </div>
                        </div>
                        
                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            <div class="form-group">
                                <strong>province</strong>
                                <select class="form-select" name="province_id">
                                    <option>เลือกจังหวัด</option>
                                    <?php $__currentLoopData = $provinces; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $province): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($province->id); ?>"
                                            <?php if($province->id == $place->province_id): ?> selected <?php endif; ?>>
                                            <?php echo e($province->name_th); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            <div class="form-group">
                                <strong>latitude</strong>
                                <input type="numeric" name="latitude" value="<?php echo e($place->latitude); ?>"
                                    class="form-control" placeholder="Enter Latitude">
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            <div class="form-group">
                                <strong>longitude</strong>
                                <input type="numeric" name="longitude" value="<?php echo e($place->longitude); ?>"
                                    class="form-control" placeholder="Enter Longitude">
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            <div class="form-group">
                                <strong>types</strong>
                                <input type="text" name="types" value="<?php echo e($place->types); ?>" class="form-control"
                                    placeholder="Enter Types">
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            is_trending <br>
                            <input type="radio" id="is_trending" name="is_trending" value="1"
                                <?php echo e($place->is_trending == '1' ? 'checked' : ''); ?>> Active</label>

                            <input type="radio" id="is_trending" name="is_trending" value="0"
                                <?php echo e($place->is_trending == '0' ? 'checked' : ''); ?>> Inactive</label>

                        </div>

                        <div class="col-xs-12 col-sm-12 col-md-12 mb-2">
                            active <br>
                            <input type="radio" id="active" name="active" value="1"
                                <?php echo e($place->active == '1' ? 'checked' : ''); ?>> Active</label>

                            <input type="radio" id="active" name="active" value="0"
                                <?php echo e($place->active == '0' ? 'checked' : ''); ?>> Inactive</label>

                        </div>

                        <div class="col-xs-12 col-sm-12 col-md-12 text-center">
                            <button type="submit" class="btn btn-primary">Submit</button>
                        </div>
                    </div>


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

    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.base', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/lebest5/public_html/resources/views/pages/places/edit.blade.php ENDPATH**/ ?>