@extends('admin.layouts.app')
@section('title', 'Edit Order #'.$order->order_number)
@section('content')
<div class="card" style="max-width:600px">
    <div class="card-header">Edit Order #{{ $order->order_number }}</div>
    <form action="{{ route('admin.orders.update', $order) }}" method="POST">
        @csrf @method('PUT')
        <div class="form-row">
            <div class="form-group">
                <label>Status</label>
                <select name="status" class="form-control">
                    @foreach(['pending','processing','completed','declined','cancelled'] as $s)
                        <option value="{{ $s }}" {{ $order->status == $s ? 'selected' : '' }}>{{ ucfirst($s) }}</option>
                    @endforeach
                </select>
            </div>
            <div class="form-group">
                <label>Payment Status</label>
                <select name="payment_status" class="form-control">
                    @foreach(['pending','paid','failed','refunded'] as $s)
                        <option value="{{ $s }}" {{ $order->payment_status == $s ? 'selected' : '' }}>{{ ucfirst($s) }}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="form-group">
            <label>Admin Notes</label>
            <textarea name="notes" class="form-control">{{ old('notes', $order->notes) }}</textarea>
        </div>
        <button type="submit" class="btn btn-primary">Update Order</button>
    </form>
</div>
@endsection
