

<?php $__env->startSection('title'); ?>
    <?php echo e(ucfirst('contact')); ?>

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

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

  <div class="container-fluid">

    
    <div class="row">
      <div class="col-xs-12">

        <section id="message-banner" class="panel panel-primary">
          <header class="panel-heading">
            <h2>
              <?php echo app('translator')->getFromJson('backend.banner-header'); ?>
            </h2>
          </header>
          <?php echo Form::open(['url'=>route('contactSaveBanner'),'method'=>'post','files'=>true, 'class' => 'image-form']); ?>

            <?php echo Form::hidden('id',$banner->id); ?>

            <?php echo Form::hidden('image'); ?>


            <div class="panel-body">
              <?php if(Session::has('message-banner')): ?>
                <div class="alert <?php echo e(Session::get('alert-class')); ?> alert-dismissible" role="alert">
                  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                  <p><?php echo e(Session::get('message-banner')); ?></p>
                </div>
              <?php endif; ?>

              
              <div class="" style="width: 800px; margin: 0 auto 20px auto;">
                <div class="image-cropper" data-height="160" data-width="800" data-exportZoom="2" data-src="<?php echo e(asset($storage_url.'img/contact/'.$banner->media_url)); ?>">
                  <div class="cropit-preview">
                    <div class="caption">
                      <p><?php echo app('translator')->getFromJson('backend.minimum-resolution'); ?> 1600x320 px</p>
                    </div>
                  </div>

                  <div class="controls-wrapper">
                    <div class="rotation-btns">
                      <a class="rotate-ccw-btn"><i class="fa fa-undo"></i></a>
                      <a class="rotate-cw-btn"><i class="fa fa-repeat"></i></a>
                    </div>
                    <div class="slider-wrapper">
                      <i class="fa fa-picture-o" aria-hidden="true"></i>
                      <input type="range" class="cropit-image-zoom-input">
                      <i class="fa fa-picture-o fa-2x" aria-hidden="true"></i>
                    </div>
                  </div>

                  <label for="cropit-image-input" class="btn btn-primary btn-outlined"><?php echo app('translator')->getFromJson('backend.upload'); ?></label>
                  <input type="file" class="cropit-image-input" style="display:none"/>

                  <button title="<?php echo app('translator')->getFromJson('backend.search-on-pixabay'); ?>" type="button" class="btn btn-primary btn-outlined js-pixabay-trigger"><?php echo app('translator')->getFromJson('backend.search-on-pixabay'); ?></button>
                </div>
              </div>
              

              <div class="form-group image-with-preview col-xs-12">
                <div class="row">
                  <?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php 
                      if( count(config('translatable.locales')) > 1 ){
                        $lang_ext = $language;
                        $col = "col-sm-6";
                      }else{
                        $lang_ext = "";
                        $col = "";
                      }
                      if(isset($banner)){
                        $get = $banner->locales()->where('locale',$lang)->first();
                      }else{
                        $get ="";
                      }

                      if(empty($get)){
                        $alt = isset($banner)?$banner->media_desc:"";
                      }else{
                        $alt = $get->media_desc;
                      }
                     ?>
                    <div class="col-xs-12 <?php echo e($col); ?>">
                      <div class="panel panel-info">
                        <div class="panel-heading">
                          <h3><?php echo e($lang_ext); ?></h3>
                        </div>

                        <div class="panel-body">
                          <div class="form-group">
                            <?php echo Form::label('imagealt',__('backend.seo'),['class'=>'control-label']); ?>

                            <div class="<?php echo e($errors->has('imagealt') ? ' has-error' : ''); ?>">
                              <?php echo Form::text('imagealt['.$lang.']',$alt,['class'=>'form-control']); ?>

                              <?php if($errors->has('imagealt')): ?>
                                <span class="help-block">
                                  <strong><?php echo e($errors->first('imagealt')); ?></strong>
                                </span>
                              <?php endif; ?>
                            </div>
                          </div>
                        </div>

                      </div>
                    </div>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  
                </div>
              </div>

            </div>
            <footer class="panel-footer text-center">
              <button type="submit" class="btn btn-primary btn-image-submit"><?php echo app('translator')->getFromJson('backend.update'); ?></button>
            </footer>
          <?php echo Form::close(); ?>

        </section>
      </div>
    </div>
    

    <div class="row">
      
      <div class="col-xs-12">
        <form method="POST" action="<?php echo e(route('saveContactInfo')); ?>">
          <?php echo e(csrf_field()); ?>

          <section id="contact-info" class="panel panel-primary">
            <header class="panel-heading">
              <h2><?php echo app('translator')->getFromJson('backend.contact-info'); ?></h2>
            </header>

            <div class="panel-body">

              <?php if(Session::has('message-contact-info')): ?>
                <div class="alert <?php echo e(Session::get('alert-class')); ?> alert-dismissible" role="alert">
                  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                  <p><?php echo e(Session::get('message-contact-info')); ?></p>
                </div>
              <?php endif; ?>

              <div class="form-group col-xs-12 col-sm-6<?php echo e($errors->has('companyEmail') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-envelope" aria-hidden="true"></i> <?php echo app('translator')->getFromJson('backend.company-email'); ?>
                </label>
                <input type="hidden" name="companyEmailId" value="<?php echo e($companyEmail->id); ?>">
                <input class="form-control" type="email" name="companyEmail" value="<?php echo e($companyEmail->setting_value); ?>">

                <?php if($errors->has('companyEmail')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyEmail')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-6<?php echo e($errors->has('companyPhone') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-phone" aria-hidden="true"></i> <?php echo app('translator')->getFromJson('backend.company-phone'); ?>
                </label>
                <input type="hidden" name="companyPhoneId" value="<?php echo e($companyPhone->id); ?>">
                <input class="form-control" type="text" name="companyPhone" value="<?php echo e($companyPhone->setting_value); ?>">

                <?php if($errors->has('companyPhone')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyPhone')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-6 col-sm-offset-3<?php echo e($errors->has('companyAddress') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-address-book" aria-hidden="true"></i> <?php echo app('translator')->getFromJson('backend.company-address'); ?>
                </label>
                <input type="hidden" name="companyAddressId" value="<?php echo e($companyAddress->id); ?>">
                <input class="form-control" type="text" name="companyAddress" value="<?php echo e($companyAddress->setting_value); ?>">

                <?php if($errors->has('companyAddress')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyAddress')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-6 col-sm-offset-3">
                  <label class="control-label">
                      <i class="fa fa-map-marker" aria-hidden="true"></i> Maps Embed Code
                  </label>
                <fieldset class="gllpLatlonPicker">
                  <input type="hidden" name="companyLatLonId" value="<?php echo e($companyLatLon->id); ?>" />
                  <textarea name="companyMaps" cols="30" rows="10" class="form-control not-tinymce"><?php echo e($companyLatLon->setting_value); ?></textarea>
                </fieldset>
              </div>

            </div>

            <footer class="panel-footer text-center">
              <button type="submit" class="btn btn-primary"><?php echo app('translator')->getFromJson('backend.update'); ?></button>
            </footer>
          </section>
        </form>
      </div>
      

      
      <div class="col-xs-12">
        <form method="POST" action="<?php echo e(route('saveSocmed')); ?>">
          <?php echo e(csrf_field()); ?>


          <section id="socmed" class="panel panel-primary">
            <header class="panel-heading">
              <h2><?php echo app('translator')->getFromJson('backend.social-media-links'); ?></h2>
            </header>

            <div class="panel-body">

              <?php if(Session::has('message-socmed')): ?>
                <div class="alert <?php echo e(Session::get('alert-class')); ?> alert-dismissible" role="alert">
                  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                  <p><?php echo e(Session::get('message-socmed')); ?></p>
                </div>
              <?php endif; ?>

              <div class="form-group col-xs-12 col-sm-4<?php echo e($errors->has('companyFacebook') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-facebook-official" aria-hidden="true"></i> Facebook
                </label>
                <input type="hidden" name="companyFacebookId" value="<?php echo e($companyFacebook->id); ?>">
                <input class="form-control" type="text" name="companyFacebook" value="<?php echo e($companyFacebook->setting_value); ?>" placeholder="Insert link...">

                <?php if($errors->has('companyFacebook')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyFacebook')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-4<?php echo e($errors->has('companyInstagram') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-instagram" aria-hidden="true"></i> Instagram
                </label>
                <input type="hidden" name="companyInstagramId" value="<?php echo e($companyInstagram->id); ?>">
                <input class="form-control" type="text" name="companyInstagram" value="<?php echo e($companyInstagram->setting_value); ?>" placeholder="Insert link...">

                <?php if($errors->has('companyInstagram')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyInstagram')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-4<?php echo e($errors->has('companyTwitter') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-twitter-square" aria-hidden="true"></i> Twitter
                </label>
                <input type="hidden" name="companyTwitterId" value="<?php echo e($companyTwitter->id); ?>">
                <input class="form-control" type="text" name="companyTwitter" value="<?php echo e($companyTwitter->setting_value); ?>" placeholder="Insert link...">

                <?php if($errors->has('companyTwitter')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyTwitter')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-4<?php echo e($errors->has('companyPinterest') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-pinterest" aria-hidden="true"></i> Pinterest
                </label>
                <input type="hidden" name="companyPinterestId" value="<?php echo e($companyPinterest->id); ?>">
                <input class="form-control" type="text" name="companyPinterest" value="<?php echo e($companyPinterest->setting_value); ?>" placeholder="Insert link...">

                <?php if($errors->has('companyPinterest')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyPinterest')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-4<?php echo e($errors->has('companyPath') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-pinterest-square" aria-hidden="true"></i> Path
                </label>
                <input type="hidden" name="companyPathId" value="<?php echo e($companyPath->id); ?>">
                <input class="form-control" type="text" name="companyPath" value="<?php echo e($companyPath->setting_value); ?>" placeholder="Insert link...">

                <?php if($errors->has('companyPath')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyPath')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-4<?php echo e($errors->has('companyLinkedIn') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-linkedin-square" aria-hidden="true"></i> LinkedIn
                </label>
                <input type="hidden" name="companyLinkedInId" value="<?php echo e($companyLinkedIn->id); ?>">
                <input class="form-control" type="text" name="companyLinkedIn" value="<?php echo e($companyLinkedIn->setting_value); ?>" placeholder="Insert link...">

                <?php if($errors->has('companyLinkedIn')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyLinkedIn')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-4<?php echo e($errors->has('companyGooglePlus') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-google-plus" aria-hidden="true"></i> Google+
                </label>
                <input type="hidden" name="companyGplusId" value="<?php echo e($companyGplus->id); ?>">
                <input class="form-control" type="text" name="companyGplus" value="<?php echo e($companyGplus->setting_value); ?>" placeholder="Insert link...">

                <?php if($errors->has('companyGooglePlus')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyGooglePlus')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-4<?php echo e($errors->has('companySnapchat') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-snapchat-square" aria-hidden="true"></i> Snapchat
                </label>
                <input type="hidden" name="companySnapchatId" value="<?php echo e($companySnapchat->id); ?>">
                <input class="form-control" type="text" name="companySnapchat" value="<?php echo e($companySnapchat->setting_value); ?>" placeholder="Insert link...">

                <?php if($errors->has('companySnapchat')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companySnapchat')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-4<?php echo e($errors->has('companyWhatsapp') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-whatsapp" aria-hidden="true"></i> Whatsapp
                </label>
                <input type="hidden" name="companyWhatsappId" value="<?php echo e($companyWhatsapp->id); ?>">
                <input class="form-control" type="text" name="companyWhatsapp" value="<?php echo e($companyWhatsapp->setting_value); ?>" placeholder="Insert number...">

                <?php if($errors->has('companyWhatsapp')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyWhatsapp')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-4<?php echo e($errors->has('companyYoutube') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="fa fa-youtube-play" aria-hidden="true"></i> Youtube
                </label>
                <input type="hidden" name="companyYoutubeId" value="<?php echo e($companyYoutube->id); ?>">
                <input class="form-control" type="text" name="companyYoutube" value="<?php echo e($companyYoutube->setting_value); ?>" placeholder="Insert link...">

                <?php if($errors->has('companyYoutube')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyYoutube')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>

              <div class="form-group col-xs-12 col-sm-4<?php echo e($errors->has('companyLine') ? ' has-error' : ''); ?>">
                <label class="control-label">
                  <i class="" aria-hidden="true"></i> Line
                </label>
                <input type="hidden" name="companyLineId" value="<?php echo e($companyLine->id); ?>">
                <input class="form-control" type="text" name="companyLine" value="<?php echo e($companyLine->setting_value); ?>" placeholder="Insert id...">

                <?php if($errors->has('companyLine')): ?>
                  <span class="help-block">
                    <strong><?php echo e($errors->first('companyLine')); ?></strong>
                  </span>
                <?php endif; ?>
              </div>
            </div>

            <footer class="panel-footer text-right">
              <button type="submit" class="btn btn-primary"><?php echo app('translator')->getFromJson('backend.update'); ?></button>
            </footer>
          </section>

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

    
    <div class="row">
      <div class="col-xs-12">

        <div class="panel panel-primary">

          <div class="panel-heading">
            <h2><?php echo app('translator')->getFromJson('backend.messages'); ?></h2>
          </div>

          <div id="messages" class="panel-body">

            <?php if(Session::has('message-messages')): ?>
              <div class="alert <?php echo e(Session::get('alert-class')); ?> alert-dismissible" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <p><?php echo e(Session::get('message-messages')); ?></p>
              </div>
            <?php endif; ?>

            <div class="table-responsive">
              <table id="messagesTable" class="table table-hover">

                <thead>
                  <tr>
                    <th class="text-center">#</th>
                      <th><?php echo app('translator')->getFromJson('backend.name'); ?></th>
                      <th><?php echo app('translator')->getFromJson('backend.email'); ?></th>
                      <th><?php echo app('translator')->getFromJson('backend.message'); ?></th>
                      <th><?php echo app('translator')->getFromJson('backend.date'); ?></th>
                      <th class="text-center"><?php echo app('translator')->getFromJson('backend.option'); ?></th>
                  </tr>
                </thead>

                <tbody>
                  <?php $__currentLoopData = $messages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr class="<?php echo e(($val->message_status == 1)?'unread':''); ?>">
                      <td class="text-center"><?php echo e($key+1); ?></td>
                        <td><?php echo e($val->message_sender_name); ?></td>
                        <td><?php echo e($val->message_sender_email); ?></td>
                        <td><?php echo e(substr($val->message_sender_content,0,25)); ?> ...</td>
                        <td><?php echo e(date('d/m/Y',strtotime($val->created_at))); ?></td>
                        <td class="text-center">

                          <button class="btn btn-warning" title="<?php echo app('translator')->getFromJson('backend.read-message'); ?>" data-toggle="modal" data-target="#read<?php echo e($val->id); ?>">
                            <?php if($val->message_status == "1"): ?>
                              <i class="fa fa-envelope" aria-hidden="true"></i>
                            <?php else: ?>
                              <i class="fa fa-envelope-open-o" aria-hidden="true"></i>
                            <?php endif; ?>
                          </button>

                          <div id="read<?php echo e($val->id); ?>" class="modal fade modal-message" role="dialog">
                            <div class="modal-dialog">

                              <div class="modal-content text-left">
                                <header class="modal-header">
                                  <?php echo app('translator')->getFromJson('backend.from'); ?> <strong><?php echo e($val->message_sender_name); ?></strong> (<strong><?php echo e($val->message_sender_email); ?></strong>)
                                </header>
                                <div class="modal-body">
                                  <small><?php echo e(date('d/m/Y',strtotime($val->created_at))); ?></small>
                                  <div class="message-content">
                                    <?php echo e($val->message_sender_content); ?>

                                  </div>
                                </div>
                                <div class="modal-footer">
                                  <a href="mailto:<?php echo e($val->message_sender_email); ?>" class="btn btn-primary"><?php echo app('translator')->getFromJson('backend.reply'); ?></a>
                                  <button class="btn btn-default read-message" data-dismiss="modal" data-id="<?php echo e($val->id); ?>"><?php echo app('translator')->getFromJson('backend.cancel'); ?></button>
                                </div>
                              </div>

                            </div>
                          </div>

                          <button title="<?php echo app('translator')->getFromJson('backend.delete-message'); ?>" class="btn btn-danger" data-toggle="modal" data-target="#delete<?php echo e($val->id); ?>"><i class="fa fa-trash" aria-hidden="true"></i></button>

                          <div id="delete<?php echo e($val->id); ?>" class="modal fade" role="dialog">
                            <div class="modal-dialog modal-sm">

                              <form class="" method="post" action="<?php echo e(route('contactDeleteMsg',['id'=>$val->id])); ?>">
                                <?php echo e(method_field('DELETE')); ?>

                                <?php echo e(csrf_field()); ?>

                                <input name="id" value="<?php echo e($val->id); ?>" type="hidden">
                                <div class="modal-content text-center">
                                  <div class="modal-body">
                                    <h3><?php echo app('translator')->getFromJson('backend.delete-message-from'); ?> <strong>'<?php echo e($val->message_sender_name); ?>'</strong> ?</h3>

                                    <button type="submit" class="btn btn-primary"><?php echo app('translator')->getFromJson('backend.delete'); ?></button>
                                    <button class="btn btn-default" data-dismiss="modal"><?php echo app('translator')->getFromJson('backend.close'); ?></button>
                                  </div>
                                </div>
                              </form>

                            </div>
                          </div>
                        </td>
                    </tr>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
    
  </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
<script type="text/javascript">
  $("#messagesTable").DataTable();

  $(".read-message").click(function(){
    $.ajax({
          type: 'post',
          url: '<?php echo e(route("contactReadMsg")); ?>',
          data: {
              '_token': '<?php echo e(csrf_token()); ?>',
              'id': $(this).data('id'),
          },
          success: function(data) {
              location.reload();
          },
      });
  });
</script>

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

<?php echo $__env->make('layouts.masterBackend', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>