<?php 
    $xbulan  = $_GET['bulan'];
    $xtahun  = $_GET['tahun'] ;
    $xkas    = $_GET['kas'] ;
            //////////////////////////////////////////////////////////////////////////// 
        $oleh = $_SESSION['id_kar'];
        $kdc = $_SESSION['kdc'];
        $tabel_tujuan = "cmob_trans_".$oleh."_".$kdc;
        $tabel_asal = "cmob_trans";
            //////////////////////////////////////////////////////////////////////////// 
            
            $cbrg = mysqli_query($koneksi,"SELECT * FROM cmob_brg Where kd='$xkas' ");
            while($d = mysqli_fetch_array($cbrg)){
                $xkd     =$d['kd'];
                $xkode   =$d['kode'];
                $xnama   =$d['nama'];

                $query = mysqli_query($koneksi, "INSERT INTO $tabel_tujuan (kd,nama,kode) 
                                        VALUES('$xkd','$xnama','$xkode') ")
                                        or die('Ada kesalahan pada query insert : '.mysqli_error($koneksi)); 
            } 
    
    
    header("location:at_penyusutan_2.php?xbulan=$tbln&xtahun=$tthn&xkas=$xkas");        
exit;
?>

