<?php
include 'koneksi.php';

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $id_pemesanan = $_POST['id_pemesanan'];
    $id_kurir = $_POST['id_kurir'];

    $query = "UPDATE tbl_pemesanan 
              SET status = 'Sedang Dijemput', id_kurir = '$id_kurir' 
              WHERE id_pemesanan = '$id_pemesanan'";

    if (mysqli_query($koneksi, $query)) {
        header("Location: order_kurir.php?berhasil=1");
    } else {
        echo "Gagal memperbarui status.";
    }
}
?>
