
<?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=AIzaSyACN6X3jKtb7n_klX-0DHKpePbi0wSUhhk&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">New Shipment</h2>-->
        <form action="<?php echo e(url('/admin/store_shipment')); ?>" 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" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Sender Phone Number</label>
                    <input type="text" name="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" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Sender Address</label>
                    <input type="text" name="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" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Receiver Phone Number</label>
                    <input type="text" name="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" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Receiver Address</label>
                    <input type="text" name="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" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
    <label>Tracking Number</label>
    <input type="text" name="tracking_number" class="form-control" value="<?php echo e($trackingNumber); ?>" readonly required>
</div>

            </div>
            <div class="row">
                <div class="col-md-4 form-group">
                    <label>Quantity</label>
                    <input type="number" name="quantity" class="form-control" required>
                </div>
                <div class="col-md-4 form-group">
                    <label>Weight (kg)</label>
                    <input type="text" name="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">Air</option>
                        <option value="Sea">Sea</option>
                        <option value="Land">Land</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">Shipment Registered</option>
                        <option value="Shipment Out For Delivery">Out For Delivery</option>
                        <option value="Shipment On Hold">On Hold</option>
                        <option value="Shipment In Transit">In Transit</option>
                        <option value="Shipment Cancelled">Cancelled</option>
                        <option value="Shipment Returned">Returned</option>
                        <option value="Shipment Delivered">Delivered</option>
                    </select>
                </div>
                <div class="col-md-6 form-group">
                    <label>Current Location</label>
                    <input type="text" name="current_location" class="form-control" required>
                    <input type="hidden" name="latitude" id="latitude">
                    <input type="hidden" name="longitude" id="longitude">
                </div>
            </div>
            <div class="row">
                <div class="col-md-6 form-group">
                    <label>Shipping Cost</label>
                    <input type="text" name="shipping_cost" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Insurance Cost</label>
                    <input type="text" name="insurance_cost" class="form-control" required>
                </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" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Origin Country</label>
                    <input type="text" name="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" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Destination Country</label>
                    <input type="text" name="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" 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" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Pickup Time</label>
                    <input type="time" name="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" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Departure Time</label>
                    <input type="time" name="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" class="form-control" required>
                </div>
                <div class="col-md-6 form-group">
                    <label>Expected Delivery Time</label>
                    <input type="time" name="expected_delivery_time" class="form-control" required>
                </div>
            </div>
            
            <div class="form-group">
                <label>Additional Comments</label>
                <textarea name="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/add-shipment.blade.php ENDPATH**/ ?>