
<?php $__env->startSection('panel'); ?>
    <div class="row gy-4">
        <div class="col-xl-12">
            <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Shipment Form</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDNVzZNgHXTxzNM81a4Ju-e8cRtGM1Dhgt&libraries=places"></script>
    <style>
        body {
            background-color: #f8f9fa;
        }
        .container {
            max-width: 800px;
            margin-top: 20px;
            background: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
        }
        .form-group label {
            font-weight: bold;
        }
    </style>
</head>
<body>
    <div class="container">
        <h2 class="text-center mb-4">Update Shipment</h2>
        <form action="<?php echo e(url('admin/update-shipment-post', $shipment->id)); ?>" method="POST">
            <?php echo csrf_field(); ?>
            <h4 style="color: #0d6efd;">Sender Information</h4>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Sender Name</label>
                    <input type="text" name="sender_name" value="<?php echo e($shipment->sender_name); ?>" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Sender Phone Number</label>
                    <input type="text" name="sender_phone_number" value="<?php echo e($shipment->sender_phone_number); ?>" class="form-control" required>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Sender Email</label>
                    <input type="email" name="sender_email" value="<?php echo e($shipment->sender_email); ?>" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Sender Address</label>
                    <input type="text" name="sender_address" value="<?php echo e($shipment->sender_address); ?>" class="form-control" required>
                </div>
            </div>
            
            <h4 style="color: #0d6efd;">Receiver Information</h4>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Receiver Name</label>
                    <input type="text" name="receiver_name"  value="<?php echo e($shipment->receiver_name); ?>" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Receiver Phone Number</label>
                    <input type="text" name="receiver_phone_number" value="<?php echo e($shipment->receiver_phone_number); ?>" class="form-control" required>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Receiver Email</label>
                    <input type="email" name="receiver_email" value="<?php echo e($shipment->receiver_email); ?>" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Receiver Address</label>
                    <input type="text" name="receiver_address" value="<?php echo e($shipment->receiver_address); ?>" class="form-control" required>
                </div>
            </div>
            
            <h4 style="color: #0d6efd;">Shipment Details</h4>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Shipment Name</label>
                    <input type="text" name="shipment_name" value="<?php echo e($shipment->shipment_name); ?>" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Tracking Number</label>
                    <input type="text" name="tracking_number" value="<?php echo e($shipment->tracking_number); ?>" class="form-control" required>
                </div>
            </div>
            <div class="row">
                <div class="col-md-4 form-group">
                    <label>Quantity</label>
                    <input type="number" name="quantity" value="<?php echo e($shipment->quantity); ?>" class="form-control" required>
                </div>
                <div class="col-md-4 form-group">
                    <label>Weight (kg)</label>
                    <input type="text" name="weight" value="<?php echo e($shipment->weight); ?>" class="form-control" required>
                </div>
                <div class="col-md-4 form-group">
                    <label>Shipping Mode</label>
                    <select name="shipping_mode" class="form-control">
                        <option value="Air Transport" <?php echo e($shipment->shipping_mode == 'Air Transport' ? 'selected' : ''); ?>>Air Transport</option>
                        <option value="Road Transport" <?php echo e($shipment->shipping_mode == 'Road Transport' ? 'selected' : ''); ?>>Road Transport</option>
                        <option value="Sea Transport" <?php echo e($shipment->shipping_mode == 'Sea Transport' ? 'selected' : ''); ?>>Sea Transport</option>
                    </select>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Status</label>
                    <select name="status" class="form-control">
                        <option value="Shipment Registered" <?php echo e($shipment->status == 'Shipment Registered' ? 'selected' : ''); ?>>Shipment Registered</option>
            <option value="Shipment Out For Delivery" <?php echo e($shipment->status == 'Shipment Out For Delivery' ? 'selected' : ''); ?>>Shipment Out For Delivery</option>
            <option value="Shipment On Hold" <?php echo e($shipment->status == 'Shipment On Hold' ? 'selected' : ''); ?>>Shipment On Hold</option>
            <option value="Shipment In Transit" <?php echo e($shipment->status == 'Shipment In Transit' ? 'selected' : ''); ?>>Shipment In Transit</option>
            <option value="Shipment Cancelled" <?php echo e($shipment->status == 'Shipment Cancelled' ? 'selected' : ''); ?>>Shipment Cancelled</option>
            <option value="Shipment Delivered" <?php echo e($shipment->status == 'Shipment Delivered' ? 'selected' : ''); ?>>Shipment Delivered</option>
                    </select>
                </div>
                <div class="col-md-6 form-group">
                    <label>Current Location</label>
                    <input type="text" name="current_location" value="<?php echo e($shipment->current_location); ?>" class="form-control" required>
                    <input type="hidden" name="latitude" id="latitude">
                    <input type="hidden" name="longitude" id="longitude">
                </div>
            </div>
            
            <h4 style="color: #0d6efd;">Schedule & Delivery</h4>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Origin City</label>
                    <input type="text" name="origin_city" value="<?php echo e($shipment->origin_city); ?>" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Origin Country</label>
                    <input type="text" name="origin_country" value="<?php echo e($shipment->origin_country); ?>" class="form-control" required>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Destination City</label>
                    <input type="text" name="destination_city" value="<?php echo e($shipment->destination_city); ?>" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Destination Country</label>
                    <input type="text" name="destination_country" value="<?php echo e($shipment->destination_country); ?>" class="form-control" required>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Delivery Address</label>
                    <input type="text" name="delivery_address" value="<?php echo e($shipment->delivery_address); ?>" class="form-control" required>
                </div>
               
            </div>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Pickup Date</label>
                    <input type="date" name="pickup_date" value="<?php echo e($shipment->pickup_date); ?>" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Pickup Time</label>
                    <input type="time" name="pickup_time" value="<?php echo e($shipment->pickup_time); ?>" class="form-control" required>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Departure Date</label>
                    <input type="date" name="departure_date" value="<?php echo e($shipment->departure_date); ?>" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Departure Time</label>
                    <input type="time" name="departure_time" value="<?php echo e($shipment->departure_time); ?>" class="form-control" required>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Expected Delivery Date</label>
                    <input type="date" name="expected_delivery_date" value="<?php echo e($shipment->expected_delivery_date); ?>" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Expected Delivery Time</label>
                    <input type="time" name="expected_delivery_time" value="<?php echo e($shipment->expected_delivery_time); ?>" class="form-control" required>
                </div>
            </div>
            
            <div class="form-group">
                <label>Additional Comments</label>
                <textarea name="comments" value="<?php echo e($shipment->comments); ?>" class="form-control" rows="3"></textarea>
            </div>
            
            <div class="text-center mt-4">
                <button type="submit" class="btn btn-primary">Submit Shipment</button>
            </div>
        </form>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
    function initAutocomplete() {
        const input = document.getElementById('current_location');
        const autocomplete = new google.maps.places.Autocomplete(input);

        // When a place is selected from the autocomplete suggestions
        autocomplete.addListener('place_changed', function () {
            const place = autocomplete.getPlace();

            if (place.geometry) {
                // Get latitude and longitude from the selected place
                const latitude = place.geometry.location.lat();
                const longitude = place.geometry.location.lng();

                // Set the values in the hidden input fields
                document.getElementById('latitude').value = latitude;
                document.getElementById('longitude').value = longitude;
            }
        });
    }

    // Initialize autocomplete once the page is loaded
    google.maps.event.addDomListener(window, 'load', initAutocomplete);
</script>
</body>
</html>

        </div>

    </div>

    

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

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/psyczwng/opscourier.com/core/resources/views/admin/update-shipment.blade.php ENDPATH**/ ?>