prepare("SELECT * FROM resi WHERE nomor_resi=?"); $stmt->bind_param("s", $nomor_resi); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { $status = "berhasil"; $pesan = "Resi valid, akses dibuka"; echo "\nVALID"; } else { $status = "gagal"; $pesan = "Nomor resi tidak ditemukan"; echo "\nINVALID DATABASE"; } } else { echo "\nBARCODE / OCR GAGAL"; } // ======================= // SIMPAN LOG // ======================= $fotoWeb = "/smart-drop-point/public/" . $targetFile; $stmtLog = $conn->prepare(" INSERT INTO log_akses ( nomor_resi, status, pesan, foto_path ) VALUES ( ?, ?, ?, ? ) "); $stmtLog->bind_param( "ssss", $nomor_resi, $status, $pesan, $fotoWeb ); $stmtLog->execute(); echo "\nLOG TERSIMPAN"; ?>