<?php $__env->startSection('page-title', "User " . $user->full_name); ?>

<?php $__env->startSection('content'); ?>
    <style>
        .google-map {
            padding-top: 100%;
            position: relative;
            width: 600px;
            height: 400px;
        }

        .map {
            height: 400px;
            width: 400px;
        }

        .google-map iframe {
            height: 80%;
            width: 80%;
            left: 0;
            top: 0;
            position: absolute;
        }
    </style>
    <!--begin::Content container-->
    <div id="kt_app_content_container" class="app-container container-xxl">
        <?php echo $__env->make('components.success-msg', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        <?php echo $__env->make('components.error-msg', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        <div class="card mb-10">
            <div class="card-body pt-9 pb-0">
                <!--begin::Details-->
                <div class="d-flex flex-wrap flex-sm-nowrap mb-6">
                    <!--begin::Wrapper-->
                    <div class="flex-grow-1">
                        <!--begin::Head-->
                        <div class="d-flex justify-content-between align-items-start flex-wrap mb-2">
                            <!--begin::Details-->
                            <div class="d-flex flex-column">
                                <!--begin::Status-->
                                <div class="d-flex align-items-center mb-1">
                                    <a href="#" class="text-gray-800 text-hover-primary fs-2 fw-bold me-3">User <?php echo e(\App\Models\User::getDecryptedData($user->full_name)); ?></a>
                                    <?php if($session->end_date == null): ?>
                                        <span class="badge badge-light-success me-auto"><?php echo app('translator')->get("Active"); ?></span>
                                    <?php else: ?>
                                        <span class="badge badge-light-danger me-auto"><?php echo app('translator')->get("Finished"); ?></span>
                                    <?php endif; ?>

                                </div>
                                <!--end::Status-->
                                <!--begin::Description-->
                                <div class="d-flex flex-wrap fw-semibold mb-4 fs-5 text-gray-400">Session Date <?php echo e($session->created_at != null ? $session->start_date->format('Y-m-d'):'N/A'); ?></div>
                                <!--end::Description-->
                            </div>
                            <!--end::Details-->
                            <!--begin::Actions-->
                            <div class="d-flex mb-4">


                            </div>
                            <!--end::Actions-->
                        </div>
                        <!--end::Head-->
                        <!--begin::Info-->
                        <div class="d-flex flex-wrap justify-content-start">
                            <!--begin::Stats-->
                            <div class="d-flex flex-wrap">
                                <!--begin::Stat-->
                                <div class="border border-gray-300 border-dashed rounded min-w-125px py-3 px-4 me-6 mb-3">
                                    <!--begin::Number-->
                                    <div class="d-flex align-items-center">
                                        <div class="fs-4 fw-bold">





                                            <?php echo e($session->start_date != null ? $session->start_date->format('H:i:s'):"N/A"); ?>

                                        </div>
                                    </div>
                                    <!--end::Number-->
                                    <!--begin::Label-->
                                    <div class="fw-semibold fs-6 text-gray-400">
                                        <?php echo app('translator')->get("Start Time"); ?>
                                    </div>
                                    <!--end::Label-->
                                </div>
                                <!--end::Stat-->
                                <!--begin::Stat-->
                                <div class="border border-gray-300 border-dashed rounded min-w-125px py-3 px-4 me-6 mb-3">
                                    <!--begin::Number-->
                                    <div class="d-flex align-items-center">
                                        <div class="fs-4 fw-bold">
                                            
                                            
                                            
                                            
                                            
                                            <?php echo e($session->end_date != null ? $session->end_date->format('H:i:s'):"N/A"); ?>

                                        </div>
                                    </div>
                                    <!--end::Number-->
                                    <!--begin::Label-->
                                    <div class="fw-semibold fs-6 text-gray-400">
                                        <?php echo app('translator')->get("End Time"); ?>
                                    </div>
                                    <!--end::Label-->
                                </div>
                                <!--end::Stat-->


                            </div>
                            <!--end::Stats-->
                        </div>
                        <!--end::Info-->
                    </div>
                    <!--end::Wrapper-->
                </div>
                <!--end::Details-->
                <div class="separator"></div>

            </div>
        </div>

        <!--begin::Card-->
        <div class="row">
            <div class="col-md-6">
                <div class="card">
                    <!--begin::Card header-->
                    <div class="card-header">
                        <!--begin::Card header-->
                        <div class="card-title fs-3 fw-bold"><?php echo app('translator')->get("Start Location"); ?></div>
                        <!--end::Card header-->
                    </div>
                    <!--end::Card header-->
                    <!--begin::Card body-->
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-6">
                                <div id="map" class="map"></div>



                            </div>
                        </div>
                    </div>
                    <!--end::Card body-->
                </div>
            </div>
            <div class="col-md-6">
                <div class="card">
                    <!--begin::Card header-->
                    <div class="card-header">
                        <!--begin::Card header-->
                        <div class="card-title fs-3 fw-bold"><?php echo app('translator')->get("End Location"); ?></div>
                        <!--end::Card header-->
                    </div>
                    <!--end::Card header-->
                    <!--begin::Card body-->
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-6">
                                <div id="map2" class="map"></div>



                            </div>
                        </div>
                    </div>
                    <!--end::Card body-->
                </div>
            </div>
        </div>

        <!--end::Card-->
    </div>
    <!--end::Content container-->
<?php $__env->stopSection(); ?>
<?php $__env->startPush('page-script'); ?>
    <script type="text/javascript">
        function initMap() {
            const myLatLng = { lat: <?php echo $startLocation[0]; ?>, lng: <?php echo $startLocation[1]; ?> };
            const myLatLng2 = { lat: <?php echo $endLocation[0]; ?>, lng: <?php echo $endLocation[1]; ?> };
            <?php if($session->start_location != null): ?>
            const map = new google.maps.Map(document.getElementById("map"), {
                zoom: 18,
                center: myLatLng,
            });
            const marker1 = new google.maps.Marker({
                position: myLatLng,
                map,
                title: "Start Location",
            });
            <?php endif; ?>

            // map.addMarker(marker1);
            <?php if($session->end_location != null): ?>
                const map2 = new google.maps.Map(document.getElementById("map2"), {
                    zoom: 18,
                    center: myLatLng2,
                });

                var marker = new google.maps.Marker({
                    position: myLatLng2,
                    map: map2,
                    title: 'Hello World!'
                });
            <?php endif; ?>

            // const marker2 = new google.maps.Marker({
            //     position: myLatLng2,
            //     map2,
            //     title: "End Location",
            // });

            // map2.addMarker(marker2);

        }

        window.initMap = initMap;
    </script>

    <script type="text/javascript"
            src="https://maps.google.com/maps/api/js?key=<?php echo e(env('GOOGLE_MAP_KEY')); ?>&callback=initMap" ></script>

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

<?php echo $__env->make('layouts.vertical.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\work\techbithub\AAH\aah-hr-site\resources\views/users/view-session.blade.php ENDPATH**/ ?>