<?php
    $shipment = $shipment ?? null;
?>
<div class="form-row">
    <div class="field">
        <label>Tracking number</label>
        <input name="tracking_number" value="<?php echo e(old('tracking_number', $shipment->tracking_number ?? '')); ?>" placeholder="Leave blank to auto-generate">
    </div>
    <div class="field">
        <label>Service</label>
        <select name="service_id">
            <option value="">—</option>
            <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $service): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($service->id); ?>" <?php if(old('service_id', $shipment->service_id ?? '') == $service->id): echo 'selected'; endif; ?>><?php echo e($service->name); ?></option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
    </div>
</div>
<div class="form-row">
    <div class="field">
        <label>Status</label>
        <select name="status" required>
            <?php $__currentLoopData = $statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($key); ?>" <?php if(old('status', $shipment->status ?? 'pending') === $key): echo 'selected'; endif; ?>><?php echo e($label); ?></option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
    </div>
    <div class="field">
        <label>Current location</label>
        <input name="current_location" value="<?php echo e(old('current_location', $shipment->current_location ?? '')); ?>">
    </div>
</div>
<h3>Sender</h3>
<div class="form-row">
    <div class="field"><label>Name</label><input name="sender_name" value="<?php echo e(old('sender_name', $shipment->sender_name ?? '')); ?>" required></div>
    <div class="field"><label>Email</label><input type="email" name="sender_email" value="<?php echo e(old('sender_email', $shipment->sender_email ?? '')); ?>"></div>
</div>
<div class="form-row">
    <div class="field"><label>Phone</label><input name="sender_phone" value="<?php echo e(old('sender_phone', $shipment->sender_phone ?? '')); ?>"></div>
    <div class="field"><label>Address</label><input name="sender_address" value="<?php echo e(old('sender_address', $shipment->sender_address ?? '')); ?>"></div>
</div>
<div class="form-row">
    <div class="field"><label>Origin city</label><input name="origin_city" value="<?php echo e(old('origin_city', $shipment->origin_city ?? '')); ?>" required></div>
    <div class="field"><label>Origin country</label><input name="origin_country" value="<?php echo e(old('origin_country', $shipment->origin_country ?? '')); ?>" required></div>
</div>
<h3>Receiver</h3>
<div class="form-row">
    <div class="field"><label>Name</label><input name="receiver_name" value="<?php echo e(old('receiver_name', $shipment->receiver_name ?? '')); ?>" required></div>
    <div class="field"><label>Email</label><input type="email" name="receiver_email" value="<?php echo e(old('receiver_email', $shipment->receiver_email ?? '')); ?>"></div>
</div>
<div class="form-row">
    <div class="field"><label>Phone</label><input name="receiver_phone" value="<?php echo e(old('receiver_phone', $shipment->receiver_phone ?? '')); ?>"></div>
    <div class="field"><label>Address</label><input name="receiver_address" value="<?php echo e(old('receiver_address', $shipment->receiver_address ?? '')); ?>"></div>
</div>
<div class="form-row">
    <div class="field"><label>Destination city</label><input name="destination_city" value="<?php echo e(old('destination_city', $shipment->destination_city ?? '')); ?>" required></div>
    <div class="field"><label>Destination country</label><input name="destination_country" value="<?php echo e(old('destination_country', $shipment->destination_country ?? '')); ?>" required></div>
</div>
<h3>Package</h3>
<div class="form-row">
    <div class="field"><label>Description</label><input name="package_description" value="<?php echo e(old('package_description', $shipment->package_description ?? '')); ?>"></div>
    <div class="field"><label>Consignment no</label><input name="consignment_no" value="<?php echo e(old('consignment_no', $shipment->consignment_no ?? 'Accessway Express Courier')); ?>"></div>
</div>
<div class="form-row">
    <div class="field"><label>Service type</label><input name="service_type" value="<?php echo e(old('service_type', $shipment->service_type ?? 'Parcel')); ?>"></div>
    <div class="field"><label>Delivery mode</label><input name="delivery_mode" value="<?php echo e(old('delivery_mode', $shipment->delivery_mode ?? 'COURIER')); ?>"></div>
</div>
<div class="form-row">
    <div class="field"><label>Weight (kg)</label><input type="number" step="0.01" name="weight_kg" value="<?php echo e(old('weight_kg', $shipment->weight_kg ?? '')); ?>"></div>
    <div class="field"><label>Pieces</label><input type="number" name="pieces" value="<?php echo e(old('pieces', $shipment->pieces ?? 1)); ?>"></div>
</div>
<div class="form-row">
    <div class="field"><label>Progress %</label><input type="number" min="0" max="100" name="progress_percent" value="<?php echo e(old('progress_percent', $shipment->progress_percent ?? 0)); ?>"></div>
    <div class="field"><label>Ship date</label><input type="date" name="ship_date" value="<?php echo e(old('ship_date', optional($shipment->ship_date ?? null)->format('Y-m-d'))); ?>"></div>
</div>
<div class="form-row">
    <div class="field"><label>Expected delivery</label><input type="date" name="expected_delivery" value="<?php echo e(old('expected_delivery', optional($shipment->expected_delivery ?? null)->format('Y-m-d'))); ?>"></div>
    <div class="field"><label>Arrival date/time</label><input type="datetime-local" name="arrival_at" value="<?php echo e(old('arrival_at', optional($shipment->arrival_at ?? null)->format('Y-m-d\TH:i'))); ?>"></div>
</div>
<div class="field"><label>Notes</label><input name="notes" value="<?php echo e(old('notes', $shipment->notes ?? '')); ?>"></div>
<div class="field"><label>Tracking notice / comment</label><textarea name="comment"><?php echo e(old('comment', $shipment->comment ?? '')); ?></textarea></div>
<?php /**PATH C:\Users\owner\Videos\NEWCOURIER\resources\views/admin/shipments/_form.blade.php ENDPATH**/ ?>