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

 <main>
        <!--start about header-->
        <section class="pg-header contact-header">
            <div class="text text-center">
                <h4 class="mb-0">اتصل بنا</h4>
            </div>
        </section>
        <!--start contact pg-->
        <section class="contact-pg">
            <div class="container">
                <div class="row">
                    <div class="branches-carousel owl-carousel owl-theme">
                        <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="item">
                            <div class="text">
                                <h6 class="mb-3"><?php echo e($row->name); ?></h6>
                                <p><b> العنوان:</b><?php echo e($row->address); ?>  </p>
                                <p><b> الهاتف:</b> <?php echo e($row->phone); ?></p>
                                <p><b>أقسام الفرع:</b> 
                                <?php $__currentLoopData = specialties($row->id); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php if($key != '0'): ?>-<?php endif; ?><?php echo e($key->name); ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </p>
                                <a href="#map<?php echo e($row->id); ?>" id="loc1">المزيد</a>
                            </div>
                            <div class="map" id="map<?php echo e($row->id); ?>">
                                <iframe width="100%" height="200" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?width=100%25&amp;height=600&amp;hl=en&amp;q=mansoura%20egypt+(My%20Business%20Name)&amp;t=&amp;z=14&amp;ie=UTF8&amp;iwloc=B&amp;output=embed"></iframe>
                            </div>
                        </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>

                </div>
                <div class="row mt-5">
                    <div class="col-lg-12 m-auto">
                          <?php if($errors->any()): ?>
      <div class="alert alert-danger">
          <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; ?>
   <?php if(Session::has('success')): ?>
<p class="alert <?php echo e(Session::get('alert-class', 'alert-success')); ?>"><?php echo e(Session::get('success')); ?></p>
<?php endif; ?>
                        <div class="contact-inner">
                            <div class="text text-center">
                                <h4>تواصل معنا بشكل أسرع</h4>
                                <p>يمكنك إرسال شكوي أو إقتراح وسيتم التواصل معك</p>
                            </div>
                            <form id="formcontacts" method="post" onsubmit="contacts()" action="<?php echo e(url('/contacts')); ?>">
                                <?php echo csrf_field(); ?>
                                 <div id="success" style="display : none" class="alert alert-success">
                           
                        </div>
                        <div id="error" style="display : none" class="alert alert-danger">
                           
                        </div>
                                <div class="row">
                                    <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                                        <div class="form-group">
                                            <input name="name" class="form-control" placeholder="الإسم">
                                        </div>
                                    </div>
                                    <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                                        <div class="form-group">
                                            <input name="email" class="form-control" placeholder="البريد الالكتروني">
                                        </div>
                                    </div>
                                    <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                                        <div class="form-group">
                                            <input name="phone" class="form-control" placeholder="رقم الهاتف">
                                        </div>
                                    </div>
                                    <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                                        <div class="form-group">
                                            <input name="subject" class="form-control" placeholder="الموضوع">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                        <div class="form-group">
                                            <textarea name="message" rows="7" class="form-control" placeholder="رسالتك"></textarea>
                                        </div>
                                    </div>
                                    <button type="submit" class="submit-btn">إرسال</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </main>
   
   <?php $__env->startPush('js'); ?>
   <script>
        function contacts(){
        event.preventDefault(); 
       var action = $('#formcontacts').attr('action');
       var urls = action;
       var dataform = $('#formcontacts').serialize();
     
      $.ajax({
          url : urls,
          type: 'POST',              
          data: dataform,
          success:function(data)
          {
           
              $('#error').css("display", "none");
              $('#success').css("display", "block");
            $('#success').html('تم ارسال رسالتك بنجاح');
             location.reload();
             
          }
          ,error:function(data) {
             
              $('#success').css("display", "none");
              $('#error').html('');
    $('#error').css("display", "block");
   
   $.each(data.responseJSON.errors, function(value) {
     $('#error').append('<div class="col-12">'+value+'</div');
     
     
 }); 
 
}
        })
        }
    </script>
   <?php $__env->stopPush(); ?>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('web.layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/omaralyomhost/public_html/green_apple/resources/views/web/pages/contact.blade.php ENDPATH**/ ?>