

<?php $__env->startSection('head'); ?>
    <style>
        form {
            width: 100%;
            max-width: 500px;
            margin: 0 auto;
        }

        label {
            display: block;
            margin-top: 20px;
        }

        input,
        textarea {
            width: 100%;
            padding: 10px;
            margin-top: 5px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }

        input[type="submit"] {
            margin-top: 20px;
            background-color: green;
            color: white;
        }
    </style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="container">
    <form action="<?php echo e(route('evenst.store')); ?>" method="POST">
        <?php echo csrf_field(); ?>
        <label for='numero'><?php echo e(__('Numero Billet')); ?></label>
                <input type='text' class='form-control' id='numero' name='numero'>
        <div class="row">
            <div class="col-md-6">

          

                <label for='title'><?php echo e(__('Titre Event')); ?></label>
                <input type='text' class='form-control' id='title' name='title'>

                <label for="vehicle"><?php echo e(__('Vehicle')); ?></label>
                <select name="vehicule" id="vehicule" class="form-select">
                        <option value="" selected disabled>Select Matricule Véhicule</option>
                        <?php $__currentLoopData = $chauffeurs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $chauffeur): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($chauffeur->id); ?>"><?php echo e($chauffeur->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>

                <label for="driver1"><?php echo e(__('Chauffeur 1')); ?></label>
                <input type='text' class='form-control' id='driver1' name='chauffeur1'>

                <label for="telephone1"><?php echo e(__('Telephone 1')); ?></label>
                <input type='text' class='form-control' id='telephone1' name='telephone1'>

                <label for="driver2"><?php echo e(__('Chauffeur 2')); ?></label>
                <input type='text' class='form-control' id='driver2' name='chauffeur2'>

                <label for="telephone2"><?php echo e(__('Telephone 2')); ?></label>
                <input type='text' class='form-control' id='telephone2' name='telephone2'>
                <label for="startTime"><?php echo e(__('Début')); ?></label>
                <input type='time' class='form-control' id='startTime' name='heure_debut'>
                <label for="endTime"><?php echo e(__('Fin Prévue')); ?></label>
                <input type='time' class='form-control' id='endTime' name='heure_fin'>

       


            </div>

            <div class="col-md-6">
          
                <label for="address"><?php echo e(__('Addresse')); ?></label>
                <input type='text' class='form-control' id='address' name='adresse'>

                <label for="clientAddress"><?php echo e(__('Client Addresse')); ?></label>
                <input type='text' class='form-control' id='clientAddress' name='adresseclient'>

                <label for="date"><?php echo e(__('Date')); ?></label>
                <input type='date' class='form-control' id='date' name='date'>



                <label for="clientName"><?php echo e(__('Client Nom')); ?></label>
                <input type='text' class='form-control' id='clientName' name='nom'>

                <label for="clientPhoneNumber"><?php echo e(__('Client Numero Telephone')); ?></label>
                <input type='text' class='form-control' id='clientPhoneNumber' name='numero_telephone'>
                <label for="email"><?php echo e(__('Client Email')); ?></label>
                <input type='text' class='form-control' id='email' name='email'>
                <label for="travelReason"><?php echo e(__('Motif Deplacement')); ?></label>
                <input type='text' class='form-control' id='travelReason' name='motif_deplacement'>


                <label for="passengerCount"><?php echo e(__('Nombre Passengers')); ?></label>
                <input type='number' class='form-control' id='passengerCount' name='nbr_passagers'>

            </div>
        </div>

        <div class="row mt-3" style="
    float: right;">
            <div class="col-md-12">
                <input type="submit" value="Confirmé" class="btn btn-success" />
            </div>
        </div>
    </form>
</div>

<script>

const urlParams = new URLSearchParams(window.location.search);


const dateParam = urlParams.get('date');


const dateField = document.getElementById('date');

if (dateParam) {
  dateField.value = dateParam;
} else {
  console.error('Date parameter is missing in the URL');
}




function getParameterByName(name, url) {
            if (!url) url = window.location.href;
            name = name.replace(/[\[\]]/g, '\\$&');
            var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
                results = regex.exec(url);
            if (!results) return null;
            if (!results[2]) return '';
            return decodeURIComponent(results[2].replace(/\+/g, ' '));
        }

        var eventDataString = getParameterByName('event');

        if (eventDataString) {
       
            var eventData = JSON.parse(eventDataString);

       
            document.getElementById('title').value = eventData.title;
            document.getElementById('start').value = eventData.start;
            document.getElementById('end').value = eventData.end;
            document.getElementById('description').value = eventData.extendedProps.description;
    
        } else {
            console.error('No event data found in the query parameter.');
        }
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\Toby\Desktop\cabs\resources\views/schedule/add.blade.php ENDPATH**/ ?>