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

        <?php if($message = Session::get('success')): ?>
            <div class="alert alert-success">
                <p><?php echo e($message); ?></p>
            </div>
        <?php endif; ?>

        <div class="card">
            <div class="card-body">
                <!-- command bar -->
                <div class="d-flex justify-content-between">
                    <div>
                        <a class="btn btn-success mb-2" href="<?php echo e(route('places.create')); ?>">
                            <i class="mdi mdi-plus-thick"></i> new place
                        </a>
                    </div>

                </div>
                <!-- end command bar -->
                <table class="table">
                    <thead>
                        <tr class="text-center">
                            
                            <th>id</th>
                            <th>name_th</th>
                            <th>address</th>
                            <th>description</th>
                            <th>image_url</th>
                            <th>google_place_id</th>
                            <th>google_url</th>
                            <th>province_id</th>
                            <th>latitude</th>
                            <th>longitude</th>
                            <th>types</th>
                            <th>rating</th>
                            <th>active</th>
                            <th>command</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__empty_1 = true; $__currentLoopData = $places; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $place): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>
                                
                                <td class="text-center">
                                    <a href="<?php echo e(route('places.show', $place->id)); ?>"><?php echo e($place->id); ?></a>
                                </td>
                                <td><?php echo e($place->name); ?></td>
                                <td><?php echo e(Str::limit($place->address, 64)); ?></td>
                                <td><?php echo e(Str::limit($place->description, 64)); ?></td>
                                <td><img src="<?php echo e($place->image_url); ?>" , width="125">
                                </td>
                                <td><?php echo e($place->google_place_id); ?></td>
                                <td><?php echo e($place->google_url); ?></td>
                                <td class="text-center">
                                    <?php if($place->provinces): ?>
                                        <?php echo e($place->provinces->name_th); ?>

                                    <?php endif; ?>
                                </td>
                                <td class="text-center"><?php echo e($place->latitude); ?></td>
                                <td class="text-center"><?php echo e($place->longitude); ?></td>
                                <td class="text-center"><?php echo e($place->types); ?></td>
                                <td class="text-center"><?php echo e($place->rating); ?></td>
                                <td class="text-center"><?php echo e($place->active); ?></td>
                                <td class="text-center">
                                    <form action="<?php echo e(route('places.destroy', $place->id)); ?>" method="POST">
                                        <a href="<?php echo e(route('places.show', $place->id)); ?>">Show</a> <br>
                                        <a href="<?php echo e(route('places.edit', $place->id)); ?>">Edit</a>
                                        <?php echo csrf_field(); ?>
                                        <?php echo method_field('DELETE'); ?>
                                        <button type="submit" class="btn btn-danger">Delete</button>
                                    </form>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="14">ไม่มีรายการให้แสดง</td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
                
                <div class="d-flex justify-content-between">
                    
                    <div>
                        <?php echo e($places->links('pagination.paginate')); ?>

                    </div>
                    <div>
                        หน้าที่ <?php echo e($places->currentPage()); ?> จาก <?php echo e($places->lastPage()); ?>

                    </div>
                </div>
            </div>
        </div>
        <!-- end table -->
    </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/modules/places/index.blade.php ENDPATH**/ ?>