<?php $__env->startSection('content'); ?>

    <main>
        <!-- Start header -->
    <?php echo $__env->make('web.pages.components.banner', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

        <!-- Start contact-pg -->
        <section class="contact-pg section">
            <div class="container">
                <div class="row mt-5 justify-content-evenly">
                    <div class="col-lg-4">
                        <div class="contact_box">
                            <h1 class="title text-uppercase text-white mb-5">
                                <?php echo e(__('web.drop_in_our_shop')); ?>

                            </h1>
                            <form>
                                <div class="form-group mb-5">
                                    <select onchange="selectBranch(this)" class="form-control form-select">
                                        <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($row->id); ?>"><?php echo e($row->title); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </form>
                            <div class="contact_data">
                                <p class="data">
                                    <i class="fa-solid fa-location-dot"></i> <span id="address"><?php echo e($branches[0]->address); ?></span>
                                </p>
                                <p class="data">
                                    <i class="fa-solid fa-envelope"></i> <span id="email"><?php echo e($branches[0]->email); ?></span>
                                </p>
                                <p class="data">
                                    <i class="fa-solid fa-phone"></i> <span id="phone"><?php echo e($branches[0]->phone); ?></span>
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-7">
                        <div class="map_box">
                            <iframe width="100%" id="map" height="700" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="<?php echo e($branches[0]->map); ?>"><a href="https://www.maps.ie/distance-area-calculator.html">measure area map</a></iframe>
                        </div>
                    </div>
                </div>
                <div class="contact_inner">
                    <h1 class="title mb-5 text-uppercase"><b><?php echo e(__('web.send_message')); ?></b></h1>
                    <form method="post" action="<?php echo e(route('contacting')); ?>" onsubmit="formAction(this)">
                        <?php echo csrf_field(); ?>
                        <div class="row">
                            <div class="col-lg-4">
                                <div class="form-group">
                                    <input type="text" name="name" class="form-control" placeholder="<?php echo e(__('visitorMessages.name')); ?>*" />
                                </div>
                            </div>
                            <div class="col-lg-4">
                                <div class="form-group">
                                    <input type="number" name="phone"  class="form-control" placeholder="<?php echo e(__('visitorMessages.phone')); ?>*" />
                                </div>
                            </div>
                            <div class="col-lg-4">
                                <div class="form-group">
                                    <input type="email" name="email" class="form-control" placeholder="<?php echo e(__('visitorMessages.email')); ?>" />
                                </div>
                            </div>
                            <div class="col-lg-12">
                                <div class="form-group">
                                    <textarea name="message" class="form-control" placeholder="<?php echo e(__('web.write_to_us')); ?>" rows="5"></textarea>
                                </div>
                            </div>
                            <div class="col-lg-12">
                                <button type="submit" class="butn border_butn mt-4 px-5 py-3"><b><?php echo e(__('web.submit')); ?></b></button>
                            </div>

                        </div>
                    </form>
                </div>
            </div>
        </section>
    </main>

<?php $__env->startSection('inject_js'); ?>
    <script>
        let url_branch = "<?php echo e(route('branch')); ?>"
        function selectBranch(elem)
        {
            let branch_id = $(elem).val()

            $.ajax({
                url : url_branch,
                type : 'GET',
                data : 'branch_id='+branch_id,
                success:function(data)
                {
                    $('#phone').html(data.phone);
                    $('#email').html(data.email);
                    $('#address').html(data.address);
                    $('#map').attr('src',data.map);
                }
            })
        }
    </script>
<?php $__env->stopSection(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('web.layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Applications/MAMP/htdocs/cupncone/resources/views/web/pages/pages/contactus.blade.php ENDPATH**/ ?>