<?php
require_once('includes/load.php'); // Memuat file load.php

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $resi_id = $_POST['id'];
    $barcode = $_POST['barcode'];

    // Simpan barcode di tabel resi_barcodes
    $stmt = $db->prepare("INSERT INTO resi_barcodes (resi_id, barcode) VALUES (?, ?)");
    if ($stmt->bind_param('is', $resi_id, $barcode) && $stmt->execute()) {
        echo 'Barcode berhasil disimpan.';
    } else {
        echo 'Gagal menyimpan barcode.';
    }
}
?>
