<?php
session_start();
require_once __DIR__.'/config/config.php';

$id_kw   = intval($_GET['id_kw']);
$id_user = $_SESSION['id_user'];

$q = $conn->prepare("
    INSERT INTO kwitansi_tmp
    (id_user, nobukti, tanggal, uraian, jumb, satuanb, pengeluaran,
     kode_kegiatan, kode_rekening, npsn)
    SELECT ?, nobukti, tanggal, uraian, jumb, satuanb, pengeluaran,
           kode_kegiatan, kode_rekening, npsn
    FROM kwitansi
    WHERE id_kw = ?
");
$q->bind_param("ii", $id_user, $id_kw);
$q->execute();

header("Location: kwitansi_form.php");
exit;
