

<?php $__env->startSection('title', trans('booking.page_title')); ?>

<?php 
$isMobileApp = session('isMobileApp');
 ?>

<?php if($isMobileApp): ?>
    <?php $__env->startSection('bodyClass', 'skin-blue booking-panel '. ( isset($_COOKIE['eto_state_sidebar_collapse']) ? 'sidebar-collapse' : '' ) .' fixed hold-transition'); ?>
<?php endif; ?>

<?php $__env->startSection('header'); ?>
    <link rel="stylesheet" href="<?php echo e(asset_url('plugins','bootstrap-datetimepicker/bootstrap-datetimepicker.min.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset_url('plugins','jquery-intl-tel-input/css/intlTelInput.min.css')); ?>?_dc=<?php echo e(config('app.timestamp')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset_url('plugins','form-validation/formValidation.min.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset_url('css','booking.css')); ?>?_dc=<?php echo e(config('app.timestamp')); ?>">

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


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

    <?php if($isMobileApp): ?>
    <style>
    body.booking-panel {
      padding: 0;
    }
    .footer-branding, .language-switcher-booking {
      display:none !important;
    }
    .navbar-static-top:not(.eto-navbar-horizontal-nav) .navbar-custom-menu-user,
    .eto-sidebar-menu-logout,
    .logout-container {
        display: none !important;
    }
    @media (max-width:540px) {
      .v2-steps-step {
        display: table;
        width: 30%;
        padding: 4px 10px 4px 28px;
      }
      .v2-steps {
        margin-right: 0px;
      }
      .v2-steps-title {
        display: inline-block !important;
        line-height: 28px !important;
        font-size: 12px !important;
      }
      .v2-steps-lang,
      .v2-steps-name {
        display: none !important;
      }
    }
    <?php if( !config('site.branding') ): ?>
      .sidebar {
          padding-bottom: 0px;
      }
      .copyright-box {
          display: none !important;
      }
    <?php endif; ?>
    </style>

    <?php 
    $userId = (int)session('etoUserId', 0);
    $userName = '';
    $userSince = '';
    $userAvatar = asset_url('images','placeholders/avatar.png');

    if ($userId) {
        $model = \App\Models\Customer::select('id', 'name', 'created_date', 'avatar')
            ->where('id', $userId)
            ->where('site_id', config('site.site_id') )
            ->first();

        if (!empty($model->id)) {
            $userId = (int)$model->id;
            $userName = (string)$model->name;
            $userAvatar = $model->getAvatarPath();
            $userSince = trans('driver/account.member_since') .' '. \Carbon\Carbon::parse($model->created_date)->diffForHumans(null, true, false, 2);
        }
    }
     ?>

    <div class="wrapper eto-wrapper-booking-list">
      <header class="main-header">
        <nav class="navbar navbar-static-top <?php if( session('clientType') == 'etoengine-customer' && version_compare(session('clientVersion'), '1.5.0', '<=')): ?> eto-navbar-horizontal-nav <?php endif; ?>">
          <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only"><?php echo e(trans('driver/index.toggle_navigation')); ?></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <div class="navbar-custom-menu navbar-custom-menu-horizontal">
            <ul class="nav navbar-nav">
              <!--<li><a href="<?php echo e(route('customer.index')); ?>#booking/list"><span><?php echo e(trans('frontend.js.panel_Bookings')); ?></span></a></li>-->
              <!--<li><a href="<?php echo e(route('customer.index')); ?>#booking/new"><span><?php echo e(trans('frontend.js.panel_NewBooking')); ?></span></a></li>-->
              <li><a href="<?php echo e(route('customer.index')); ?>#user"><span><?php echo e(trans('frontend.js.panel_Profile')); ?></span></a></li>
            <ul>
          </div>
          <span class="main-page-title"><?php echo e(trans('frontend.js.panel_NewBooking')); ?></span>
          <div class="navbar-custom-menu navbar-custom-menu-user">
            <ul class="nav navbar-nav">
              <li class="dropdown user user-menu">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                  <img src="<?php echo e($userAvatar); ?>" class="user-image" alt="">
                  <span class="hidden-xs"><?php echo e($userName); ?></span>
                </a>
                <ul class="dropdown-menu">
                  <li class="user-header">
                    <p><?php echo e($userName); ?><small><?php echo e($userSince); ?></small></p>
                  </li>
                  <li class="user-footer">
                    <div class="pull-left">
                      <a href="<?php echo e(route('customer.index')); ?>#user" class="btn btn-default btn-flat">
                        <span><?php echo e(trans('frontend.js.panel_Profile')); ?></span>
                      </a>
                    </div>
                    <div class="pull-right logout-container">
                      <a href="<?php echo e(route('customer.index')); ?>#logout" class="btn btn-default btn-flat">
                        <span><?php echo e(trans('frontend.js.panel_Logout')); ?></span>
                      </a>
                    </div>
                  </li>
                </ul>
              </li>
            </ul>
          </div>
        </nav>
      </header>
      <aside class="main-sidebar"> <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"> <span class="icon-toggle"></span> </a>
        <section class="sidebar">
          <div class="user-panel">
            <div class="pull-left image">
                <img src="<?php echo e($userAvatar); ?>" class="img-circle" alt="">
            </div>
            <div class="pull-left info">
              <p style="max-width:120px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; <?php if(config('app.locale_switcher_enabled')): ?> margin: 0 0 5px 0; <?php else: ?> margin: 10px 0 0 0;  <?php endif; ?>"><?php echo e($userName); ?></p>
              <?php if(config('app.locale_switcher_enabled')): ?>
                  <div class="user-panel-locale">
                    <div class="btn-group">
                      <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                        <span class="eto-language-name"><?php echo e(config('app.locales')[app()->getLocale()]['native']); ?></span>
                        <span class="caret"></span>
                      </button>
                      <ul class="dropdown-menu">
                        <?php $__currentLoopData = config('app.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
                            <?php if( in_array($lang, config('app.locale_active')) ): ?>
                              <li><a href="<?php echo e(route('locale.change', $lang)); ?>" class="clearfix">
                                  <img src="<?php echo e(asset_url('images','flags/'. $lang .'.png')); ?>" class="eto-language-flag">
                                  <span class="eto-language-name"><?php echo e($language['native']); ?></span>
                              </a></li>
                            <?php endif; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
                      </ul>
                    </div>
                  </div>
              <?php endif; ?>
            </div>
          </div>
          <ul class="sidebar-menu">
            <li class="eto-sidebar-menu-bookings"><a href="<?php echo e(route('customer.index')); ?>#booking/list"><span><?php echo e(trans('frontend.js.panel_Bookings')); ?></span></a></li>
            <li class="eto-sidebar-menu-booking-new active"><a href="<?php echo e(route('customer.index')); ?>#booking/new"><span><?php echo e(trans('frontend.js.panel_NewBooking')); ?></span></a></li>
            <li class="eto-sidebar-menu-profile"><a href="<?php echo e(route('customer.index')); ?>#user"><span><?php echo e(trans('frontend.js.panel_Profile')); ?></span></a></li>
            <li class="eto-sidebar-menu-logout mobile-logout-hide"><a href="<?php echo e(route('customer.index')); ?>#logout"><span><?php echo e(trans('frontend.js.panel_Logout')); ?></span></a></li>
          </ul>
          <div class="copyright-box">
            <?php echo e(trans('common.powered_by')); ?> <a href="https://easytaxioffice.com" target="_blank">EasyTaxiOffice</a>
          </div>
        </section>
      </aside>
      <div class="content-wrapper">
        <section class="content">
    <?php endif; ?>

    <div class="eto-main-container">
        <div class="language-switcher-booking">
            <?php echo $__env->make('partials.language_switcher', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        </div>

        <div id="etoCompleteContainer">
            <div class="loadingContainer">
                <i class="ion-ios-loop fa fa-spin loadingProgress"></i>
                <div class="loadingText"><?php echo e(trans('common.loading')); ?>.</div>
            </div>
        </div>

        <?php echo $__env->make('partials.branding', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    </div>

    <?php if($isMobileApp): ?>
        </section>
      </div>
    </div>
    <?php endif; ?>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('footer'); ?>
    <script src="<?php echo e(asset_url('plugins','jquery-cookie/jquery.cookie.js')); ?>?_dc=<?php echo e(config('app.timestamp')); ?>"></script>
    <script src="<?php echo e(asset_url('plugins','moment/moment-with-locales.min.js')); ?>"></script>
    <script src="<?php echo e(asset_url('plugins','moment/moment-timezone-with-data.min.js')); ?>"></script>
    <script src="<?php echo e(asset_url('plugins','typeahead/typeahead.bundle.min.js')); ?>"></script>
    <script src="<?php echo e(asset_url('plugins','bootstrap-datetimepicker/bootstrap-datetimepicker.min.js')); ?>"></script>
    <script src="<?php echo e(asset_url('plugins','combodate/combodate.js')); ?>"></script>
    <script src="<?php echo e(asset_url('plugins','jquery-intl-tel-input/js/intlTelInput-jquery.min.js')); ?>?_dc=<?php echo e(config('app.timestamp')); ?>"></script>
    <script src="<?php echo e(asset_url('plugins','form-validation/formValidation.min.js')); ?>"></script>
    <script src="<?php echo e(asset_url('plugins','form-validation/formValidation-bootstrap.min.js')); ?>"></script>

    <?php if($isMobileApp): ?>
    <script src="<?php echo e(asset_url('plugins','jquery-slimscroll/jquery.slimscroll.min.js')); ?>"></script>
    <script src="<?php echo e(asset_url('plugins','fastclick/fastclick.min.js')); ?>"></script>
    <script src="<?php echo e(asset_url('js','app.js')); ?>?_dc=<?php echo e(config('app.timestamp')); ?>"></script>
    <?php endif; ?>

    <script>
    var ETOLang = <?php echo json_encode(trans('frontend.js')); ?>;
    var ETOBookingType = '<?php echo e(request()->get('bookingType')); ?>';
    </script>

    <?php if(file_exists(asset_path('uploads','custom/js/'. app()->getLocale() .'/override_'. app()->getLocale() .'.js'))): ?>
        <script src="<?php echo e(asset_url('uploads','custom/js/'. app()->getLocale() .'/override_'. app()->getLocale() .'.js')); ?>?_dc=<?php echo e(config('app.timestamp')); ?>"></script>
    <?php endif; ?>

    <script src="//maps.googleapis.com/maps/api/js?v=3&key=<?php echo e(config('site.google_maps_javascript_api_key')); ?>&libraries=places&language=<?php echo e(app()->getLocale()); ?>"></script>

    <script src="<?php echo e(asset_url('js','booking.js')); ?>?_dc=<?php echo e(config('app.timestamp')); ?>"></script>

    <?php 
    parse_str(urldecode(request()->getQueryString()), $urlParams);
    $urlParams = json_encode($urlParams);

    $redirectUrl = config('site.url_booking');
    $currentUrl = url()->current();
    $loadCheck = 0;

    if ($redirectUrl && $currentUrl) {
        $url1 = parse_url($redirectUrl, PHP_URL_HOST) . parse_url($redirectUrl, PHP_URL_PATH);
        $url2 = parse_url($currentUrl, PHP_URL_HOST) . parse_url($currentUrl, PHP_URL_PATH);

        if ($url1 == $url2) {
            $loadCheck = 1;
        }
    }
     ?>

    <script>
    $(document).ready(function() {
        var loadETO = 0;

        <?php if( session('isMobileApp') || request('no_redirect') || config('site.embed') == 0 || $loadCheck ): ?>
            loadETO = 1;
            $.cookie('eto_redirect_booking_url', window.location.href, {path: EasyTaxiOffice.cookiePath, secure: EasyTaxiOffice.cookieSecure, same_site: EasyTaxiOffice.cookieSameSite});
            // $.removeCookie('eto_redirect_booking_url', {path: EasyTaxiOffice.cookiePath, secure: EasyTaxiOffice.cookieSecure, same_site: EasyTaxiOffice.cookieSameSite});
        <?php endif; ?>

        if (!loadETO) {
            var pUrl = '<?php echo e(config('site.url_booking')); ?>';
            var pUrlWithoutHash = pUrl;
            var pUrlHash = '';

            if( pUrl ) {
                var type = pUrl.split('#');
                if( type.length > 1 ) {
                    pUrlWithoutHash = type[0];
                    pUrlHash = type[1];
                }
            }

            var cUrl = window.location.href ? window.location.href : '';
            var cUrlWithoutHash = cUrl;
            var cUrlHash = '';

            if( cUrl ) {
                var type = cUrl.split('#');
                if( type.length > 1 ) {
                    cUrlWithoutHash = type[0];
                    cUrlHash = type[1];
                }
            }

            if( top === self && <?php echo e(config('site.embed')); ?> == 1 && pUrlWithoutHash && cUrlWithoutHash && pUrlWithoutHash != cUrlWithoutHash ) {
                $.cookie('eto_redirect_booking_url', cUrl, {path: EasyTaxiOffice.cookiePath, secure: EasyTaxiOffice.cookieSecure, same_site: EasyTaxiOffice.cookieSameSite});
                window.location.href = pUrl;
            }
            else {
                var rUrl = $.cookie('eto_redirect_booking_url') ? $.cookie('eto_redirect_booking_url') : '';
                var rUrlWithoutHash = rUrl;
                var rUrlHash = '';

                if( rUrl ) {
                    var type = rUrl.split('#');
                    if( type.length > 1 ) {
                        rUrlWithoutHash = type[0];
                        rUrlHash = type[1];
                    }
                }

                if( rUrlWithoutHash && cUrlWithoutHash && rUrlWithoutHash != cUrlWithoutHash ) {
                    // $.removeCookie('eto_redirect_booking_url', {path: EasyTaxiOffice.cookiePath, secure: EasyTaxiOffice.cookieSecure, same_site: EasyTaxiOffice.cookieSameSite});
                    window.location.href = rUrl;
                }
                else {
                    if( rUrlHash ) {
                        window.location.hash = rUrlHash;
                    }
                    loadETO = 1;
                }
            }
        }

        if (loadETO) {
            etoApp({
                debug: <?php echo e(config('app.debug') ? 1 : 0); ?>,
                customerURL: 'customer',
                urlParams: <?php echo $urlParams; ?>

            });
        }
    });
    </script>
<?php $__env->stopSection(); ?>

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