
<?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.traccar_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('fleet.traccar_settings'); ?>
                    </h3>
                </div>

                <div class="card-body">
                    <?php echo Form::open(['route' => 'traccar_settings.store', 'method' => 'post']); ?>

                    <div class="row">
                        <div class="col-md-6 col-sm-12 mb-2">
                            <h5>  <?php echo app('translator')->get('fleet.traccar_enable'); ?>
                                <a data-toggle="modal" data-target="#myModal9"><i class="fa fa-info-circle fa-lg" aria-hidden="true" style="color: #8639dd"></i></a>
                            </h5>
                        </div>
                        <div class="col-md-6 col-sm-12 mb-2">
                          <label class="switch">
                              <input type="checkbox" name="traccar_enable" value="1" id="traccar_enable"
                                  <?php if(Hyvikk::get('traccar_enable') == 1): ?> checked <?php endif; ?>>
                              <span class="slider round"></span>
                          </label>
                        </div>

                        
                        <div class="traccar_settings_enable col-md-12 col-lg-12"
                            <?php if(Hyvikk::get('traccar_enable') != 1): ?> style="display:none;" <?php endif; ?>>
                            <div class="row">
                                <div class="form-group col-md-6 col-lg-6">
                                    <?php echo Form::label('traccar_server_link', __('fleet.traccar_server_link'), ['class' => 'form-label']); ?>

                                    <?php echo Form::text('traccar_server_link', Hyvikk::get('traccar_server_link') ?? null, [
                                        'class' => 'form-control',
                                        'id' => 'traccar_server_link',
                                        'required' => 'required',
                                    ]); ?>

                                </div>

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

                                    <?php echo Form::text('traccar_username', Hyvikk::get('traccar_username') ?? null, [
                                        'class' => 'form-control',
                                        'id' => 'traccar_username',
                                        'required' => 'required',
                                    ]); ?>

                                </div>

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

                                    <?php echo Form::text('traccar_password', Hyvikk::get('traccar_password') ?? null, [
                                        'class' => 'form-control',
                                        'id' => 'traccar_password',
                                        'required' => 'required',
                                    ]); ?>

                                </div>

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

                                    <?php echo Form::text('traccar_map_key', Hyvikk::get('traccar_map_key') ?? null, [
                                        'class' => 'form-control',
                                        'id' => 'traccar_map_key',
                                        'required' => 'required',
                                    ]); ?>

                                </div>

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

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

                    <div id="myModal9" 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.traccar_enable'); ?></h4>
                                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                                </div>
                                <div class="modal-body">
                                    <p><?php echo app('translator')->get('fleet.traccar_enable_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>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    <script>
        $('#traccar_enable').on('change', function() {
            if ($(this).is(':checked')) {
                $('.traccar_settings_enable').fadeIn();
                $('form').submit();
            } else {
                $('.traccar_settings_enable').fadeOut();
                $('form').submit();
            }
        });
        <?php if(session()->has('message')): ?>
            new PNotify({
                title: 'Success!',
                text: "<?php echo e(session()->get('message')); ?>",
                type: 'info'
            });
        <?php endif; ?>
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home1/onefund1/vehicles.kplcke.co.ke/framework/resources/views/utilities/traccar_settings.blade.php ENDPATH**/ ?>