
<?php $__env->startSection('extra_css'); ?>
<style type="text/css">

/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* Hide default HTML checkbox */
.switch input {display:none;}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.custom .nav-link.active {

    background-color: #21bc6c !important;
}

</style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection("breadcrumb"); ?>
<li class="breadcrumb-item"><?php echo app('translator')->get('menu.settings'); ?></li>
<li class="breadcrumb-item active"><?php echo app('translator')->get('menu.api_settings'); ?></li>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="row">
  <div class="col-md-12">
    <div class="card card-success">
      <div class="card-header">
        <h3 class="card-title"><?php echo app('translator')->get('menu.api_settings'); ?>
        </h3>
      </div>
      <div class="card-body">
        <?php if(count($errors) > 0): ?>
        <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; ?>

        <div>
          <ul class="nav nav-pills custom">
            <li class="nav-item"><a href="#general" data-toggle="tab" class="nav-link active"> <?php echo app('translator')->get('menu.general_settings'); ?> <i class="fa"></i></a></li>
            <li class="nav-item"><a href="#firebase" data-toggle="tab" class="nav-link"> <?php echo app('translator')->get('fleet.firebase_settings'); ?> <i class="fa"></i></a></li>
            <li class="nav-item"><a href="#serverkey" data-toggle="tab" class="nav-link"> <?php echo app('translator')->get('fleet.app_notification'); ?> <i class="fa"></i></a></li>
            <li class="nav-item"><a href="#maps" data-toggle="tab" class="nav-link"> <?php echo app('translator')->get('fleet.maps'); ?> <i class="fa"></i></a></li>
          </ul>
        </div>
      <div class="row">
        <div class="col-md-12">
          <div class="tab-content card-body">
            <div class="tab-pane active" id="general">
              <?php echo Form::open(['url' => 'admin/api-settings','files'=>true,'method'=>'post']); ?>


              <div class="row">
                <div class="form-group col-md-3">
                  <h6><?php echo Form::label('api',__('fleet.api'),['class'=>"form-label"]); ?>

                    
                  </h6>
                  <label class="switch">
                  <input type="checkbox" class="api" id="api" name="name[api]" value="1"  <?php if(Hyvikk::api('api') == "1"): ?> checked <?php endif; ?>>
                  <span class="slider round"></span>
                  </label>
                </div>

                <?php if(Hyvikk::api('api') == "1"): ?>
                <div class="form-group col-md-3">
                  <h6><?php echo Form::label('google_api',__('fleet.google_places_api'),['class'=>"form-label"]); ?> 
                    <a data-toggle="modal" data-target="#myModal2"><i class="fa fa-info-circle fa-lg" aria-hidden="true"  style="color: #8639dd"></i></a> <br>
                    <strong class="text-muted">(<a href="https://docs.listingprowp.com/knowledgebase/how-to-get-map-working-with-google-api-key/" target="blank"><?php echo app('translator')->get('fleet.api_guide'); ?></a>)</strong>
                  </h6>
                  <label class="switch">
                  <input type="checkbox" name="name[google_api]" value="1" <?php if(Hyvikk::api('google_api') == "1"): ?> checked <?php endif; ?>>
                  <span class="slider round"></span>
                  </label>
                </div>

                <div class="form-group col-md-3">
                  <h6><?php echo Form::label('anyone_register',__('fleet.anyone_register'),['class'=>"form-label"]); ?> </h6>
                  <label class="switch">
                  <input type="checkbox" name="name[anyone_register]" value="1" <?php if(Hyvikk::api('anyone_register') == "1"): ?> checked <?php endif; ?>>
                  <span class="slider round"></span>
                  </label>
                </div>

                <div class="form-group col-md-3">
                  <h6><?php echo Form::label('driver_review',__('fleet.driver_review'),['class'=>"form-label"]); ?>

                    <a data-toggle="modal" data-target="#myModal3"><i class="fa fa-info-circle fa-lg" aria-hidden="true"  style="color: #8639dd"></i></a>
                  </h6>
                  <label class="switch">
                  <input type="checkbox" name="name[driver_review]" value="1" <?php if(Hyvikk::api('driver_review') == "1"): ?> checked <?php endif; ?>>
                  <span class="slider round"></span>
                  </label>
                </div>

                <div class="form-group col-md-12">
                  <?php echo Form::label('region_availability',__('fleet.region_availability'),['class'=>"form-label"]); ?>

                  <?php echo Form::text('name[region_availability]',
                  Hyvikk::api('region_availability'),['class'=>"form-control"]); ?>

                </div>

                <div class="form-group col-md-4">
                  <?php echo Form::label('max_trip',__('fleet.max_trip'),['class'=>"form-label"]); ?>

                  <div class="input-group mb-3">
                  <div class="input-group-prepend">
                  <span class="input-group-text"><i class="fa fa-clock-o"></i></span></div>
                  <?php echo Form::number('name[max_trip]',Hyvikk::api('max_trip'),['class'=>"form-control trip","required"]); ?>

                  </div>
                </div>

                <div class="form-group col-md-4">
                  <?php echo Form::label('booking',__('fleet.booking'),['class'=>"form-label"]); ?>

                  <div class="input-group mb-3">
                    <div class="input-group-prepend">
                    <span class="input-group-text"><i class="fa fa-calendar-check-o"></i></span></div>
                    <?php echo Form::number('name[booking]',Hyvikk::api('booking'),['class'=>"form-control",'required']); ?>

                  </div>
                </div>
                <div class="form-group col-md-4">
                  <?php echo Form::label('cancel',__('fleet.cancel'),['class'=>"form-label"]); ?>

                  <div class="input-group mb-3">
                    <div class="input-group-prepend">
                    <span class="input-group-text"><i class="fa fa-calendar-times-o"></i></span>
                    </div>
                    <?php echo Form::number('name[cancel]',Hyvikk::api('cancel'),['class'=>"form-control"]); ?>

                  </div>
                </div>
                <?php endif; ?>
              </div>

              <div class="col-md-2">
                <div class="form-group">
                  <input type="submit" class="form-control btn btn-success api_btn" value="<?php echo app('translator')->get('fleet.save'); ?>" />
                </div>
              </div>

              <?php echo Form::close(); ?>

            </div>

            <div class="tab-pane" id="firebase">
              <?php echo Form::open(['url' => 'admin/firebase-settings','files'=>true,'method'=>'post']); ?>

              <div class="row">
                <div class="form-group col-md-12">
                  <?php echo Form::label('db_url',__('fleet.db_url'),['class'=>"form-label"]); ?>

                  <a data-toggle="modal" data-target="#myModal5"><i class="fa fa-info-circle fa-lg" aria-hidden="true"  style="color: #8639dd"></i></a>
                  <?php echo Form::text('db_url',
                  Hyvikk::api('db_url'),['class'=>"form-control",'required','placeholder'=>'for example: https://PROJECT.firebaseio.com']); ?>

                </div>
                
                <div class="col-md-12" style="font-size:20px" >
               
                  <h4><?php echo app('translator')->get('fleet.fcf'); ?> </h4>
                  <h6 class="text-uppercase"><a href="<?php echo e(asset('assets/samples/firebase_credentials.json')); ?>" download><?php echo app('translator')->get('fleet.fsf'); ?></a></h6>
                <ul style="margin-bottom: 1rem;">
                  <li><?php echo app('translator')->get('fleet.gtf'); ?></li>
                  <li><?php echo app('translator')->get('fleet.yp'); ?></li>
                  <li><?php echo app('translator')->get('fleet.ps'); ?></li>
                  <li><?php echo app('translator')->get('fleet.sa'); ?></li>
                  <li><?php echo app('translator')->get('fleet.gnpk'); ?></li>
                  <li><?php echo app('translator')->get('fleet.tgf'); ?>Fleet\Framework\Storage\Firebase\Firebase_credentials.Json <?php echo app('translator')->get('fleet.rtff'); ?></li>
                </ul>
                
                
                </div>
                <div class="col-md-6">
                  <button type="submit" class="btn btn-success" style="margin-right: 10px"><?php echo app('translator')->get('fleet.test'); ?></button>
                </div>
                <?php echo Form::close(); ?>

              </div>
            </div>

            <div class="tab-pane" id="serverkey">
              <?php echo Form::open(['url' => 'admin/store-key','files'=>true,'method'=>'post']); ?>

              <div class="row">
                <div class="form-group col-md-12">
                  <?php echo Form::label('server_key',__('fleet.legacy_key'),['class'=>"form-label"]); ?>

                  <a data-toggle="modal" data-target="#myModal4"><i class="fa fa-info-circle fa-lg" aria-hidden="true"  style="color: #8639dd"></i></a>
                  <?php echo Form::text('server_key',
                  Hyvikk::api('server_key'),['class'=>"form-control",'required']); ?>

                </div>
                <div class="col-md-6">
                  <button type="submit" class="btn btn-success" style="margin-right: 10px"><?php echo app('translator')->get('fleet.test'); ?></button>
                </div>
                <?php echo Form::close(); ?>

              </div>
            </div>
            <div class="tab-pane" id="maps">
              <?php echo Form::open(['url' => 'admin/store-api','files'=>true,'method'=>'post']); ?>

              <div class="row">
                <div class="form-group col-md-12">
                  <?php echo Form::label('api_key',__('fleet.google_maps'),['class'=>"form-label"]); ?>

                  <a data-toggle="modal" data-target="#myModal6"><i class="fa fa-info-circle fa-lg" aria-hidden="true"  style="color: #8639dd"></i></a>
                  <?php echo Form::text('api_key',
                  Hyvikk::api('api_key'),['class'=>"form-control",'required']); ?>

                </div>
                <div class="col-md-6">
                  <button type="submit" id="test_api" class="btn btn-success" style="margin-right: 10px"><?php echo app('translator')->get('fleet.test'); ?></button>
                </div>
                <?php echo Form::close(); ?>

              </div>
              <hr>
              <div class="row" style="margin-top: 20px">
                <div class="col-md-12">
                  <div class="form-group">
                    <h6 class="text-danger"> <strong><?php echo app('translator')->get('fleet.important_Notes'); ?>:</strong></h6>
                    <ol class="text-muted">
                      <li><?php echo app('translator')->get('fleet.gma'); ?> <a href="https://developers.google.com/maps/gmp-india-migration#action" target="_blank"><?php echo app('translator')->get('fleet.Read_More'); ?></a></li>
                      <li><?php echo app('translator')->get('fleet.ymcb'); ?> <strong><a href="<?php echo e(asset('assets/images/billing-Account.png')); ?>"><?php echo app('translator')->get('fleet.gmp'); ?></a></strong> <?php echo app('translator')->get('fleet.tuma'); ?>.</li>
                      <li><?php echo app('translator')->get('fleet.iusm'); ?> <strong>"Success"</strong>, <?php echo app('translator')->get('fleet.imtgaw'); ?></li>
                      <li><?php echo app('translator')->get('fleet.stm'); ?> <strong> <?php echo app('translator')->get('fleet.paga'); ?></strong> <?php echo app('translator')->get('fleet.afe'); ?> <a href="https://console.developers.google.com/" target="_blank"><?php echo app('translator')->get('fleet.visit_here'); ?></a></li>
                      <li><?php echo app('translator')->get('fleet.yccga'); ?> - <a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank"><?php echo app('translator')->get('fleet.giah'); ?></a> </li>
                      <li><strong><?php echo app('translator')->get('fleet.em'); ?></strong> <?php echo app('translator')->get('fleet.information'); ?> <a href="https://developers.google.com/maps/documentation/javascript/error-messages" target="_blank"><?php echo app('translator')->get('fleet.ah'); ?></a></li>
                    </ol>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- Modal 1-->
<div id="myModal1" class="modal fade" role="dialog">
  <div class="modal-dialog" role="document">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title"><?php echo app('translator')->get('fleet.api'); ?></h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
        <p><?php echo app('translator')->get('fleet.api_info'); ?></p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo app('translator')->get('fleet.close'); ?></button>
      </div>
    </div>
  </div>
</div>
<!-- Modal 1-->

<!-- Modal 2-->
<div id="myModal2" class="modal fade" role="dialog">
  <div class="modal-dialog" role="document">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title"><?php echo app('translator')->get('fleet.google_places_api'); ?></h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
        <p><?php echo app('translator')->get('fleet.google_places_api_info1'); ?></p>
        <p><?php echo app('translator')->get('fleet.google_places_api_info2'); ?></p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo app('translator')->get('fleet.close'); ?></button>
      </div>
    </div>
  </div>
</div>
<!-- Modal 2-->

<!-- Modal 3-->
<div id="myModal3" class="modal fade" role="dialog">
  <div class="modal-dialog" role="document">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title"><?php echo app('translator')->get('fleet.driver_review'); ?></h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
        <p><?php echo app('translator')->get('fleet.driver_review_info'); ?></p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo app('translator')->get('fleet.close'); ?></button>
      </div>
    </div>
  </div>
</div>
<!-- Modal 3-->

<!-- Modal 3-->
<div id="myModal4" class="modal fade" role="dialog">
  <div class="modal-dialog" role="document">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title"><?php echo app('translator')->get('fleet.legacy_key'); ?></h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
        <p><?php echo app('translator')->get('fleet.legacy_key_info'); ?></p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo app('translator')->get('fleet.close'); ?></button>
      </div>
    </div>
  </div>
</div>

<div id="myModal5" class="modal fade" role="dialog">
  <div class="modal-dialog" role="document">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title"><?php echo app('translator')->get('fleet.db_url'); ?></h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
        <p><?php echo app('translator')->get('fleet.db_url_info'); ?></p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo app('translator')->get('fleet.close'); ?></button>
      </div>
    </div>
  </div>
</div>

<div id="myModal6" class="modal fade" role="dialog">
  <div class="modal-dialog" role="document">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title"><?php echo app('translator')->get('fleet.google_maps'); ?></h4>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
      </div>
      <div class="modal-body">
        <p><?php echo app('translator')->get('fleet.google_maps_info'); ?></p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo app('translator')->get('fleet.close'); ?></button>
      </div>
    </div>
  </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
<script type="text/javascript">
  $(".api_btn").on("click",function(){
    // alert($(".trip").val());
    if (($(".trip").val())<1) {
        alert("Maximum Time a Trip can Go(in Days) must be greater than or equal to 1");
        return false;
    }else{
      return true;
    }
  });
</script>
<script type="text/javascript">
$(document).ready(function() {
  <?php if(isset($_GET['tab']) && $_GET['tab']!=""): ?>
  $('.nav-pills a[href="#<?php echo e($_GET['tab']); ?>"]').tab('show')
  <?php endif; ?>
});
</script>
<script type="text/javascript">
  $(window).on('load', function() {

    <?php if(isset($_GET['success']) && $_GET['success'] == 1): ?>
      new PNotify({
        title: 'Success!',
        text: 'Firebase credentials matched.',
        type: 'success',
        delay: 15000
      });
    <?php elseif(isset($_GET['success']) && $_GET['success'] == 0): ?>
      new PNotify({
        title: 'Failed!',
        text: 'Firebase credentials does not matched, Try again!',
        type: 'error',
        delay: 15000
      });
    <?php endif; ?>

    <?php if(isset($_GET['key']) && $_GET['key'] == 1): ?>
      new PNotify({
        title: 'Success!',
        text: 'Legacy server key stored successfully.',
        type: 'success',
        delay: 15000
      });
    <?php elseif(isset($_GET['key']) && $_GET['key'] == 0): ?>
      new PNotify({
        title: 'Failed!',
        text: 'Legacy server key is invalid, Try again!',
        type: 'error',
        delay: 15000
      });
    <?php endif; ?>

    <?php if(isset($_GET['api_key']) && $_GET['api_key'] == 1): ?>

      new PNotify({
        title: 'Success!',
        text: '<?php echo e($_GET["msg"]); ?>',
        type: 'success',
        delay: 15000
      });
    <?php elseif(isset($_GET['api_key']) && $_GET['api_key'] == 0): ?>
      new PNotify({
        title: 'Failed!',
        text: '<?php echo e($_GET["msg"]); ?>',
        type: 'error',
        delay: 5000
      });
    <?php endif; ?>

  });
</script>

<?php if((isset($_GET['test_key']) && $_GET['test_key']!= null) && (isset($_GET['api_key']) && $_GET['api_key'] == 0)): ?>
<script type="text/javascript">
  function initMap() {
    var geocoder = new google.maps.Geocoder();
    geocodeAddress(geocoder);

    // $.get('https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=<?php echo e($_GET['test_key']); ?>',function(data){
    //   console.log("$.get: "+data.status);
    //   if(data.status == "OK"){
    //     alert("$.get: "+data.status);

    //   }
    //   else{
    //     alert("$.get: "+data.error_message);
    //   }
    // });

  }

  function geocodeAddress(geocoder) {
    geocoder.geocode({'location': {lat: 40.714224, lng: -73.961452 }}, function(results, status) {
      // console.log(results);
      // console.log(status);
      if (status === 'OK') {
        // store api key
        $.ajax({
          type: "GET",
          headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },

          url: "<?php echo e(url('admin/ajax-api-store/').'/'.$_GET['test_key']); ?>",

          success: function(data){
            // console.log(data);
            new PNotify({
              title: 'Success!',
              text: 'API key successfully saved',
              type: 'success',
              delay: 15000
            });
          },

          dataType: "json"
        });
      } else {
        alert('Geocode was not successful for the following reason: ' + status);
      }
    });
  }
</script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=<?php echo e($_GET['test_key']); ?>&callback=initMap">
</script>
<?php endif; ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/fwvrhhfw/vms.reservations.albertinehotel.com/framework/resources/views/utilities/api_settings.blade.php ENDPATH**/ ?>