
<?php 
    include '../koneksi.php';
    include '../cari_notrans.php';
    
        $toleh    = $_POST['toleh'];
        $tangg_no = $_POST['tangg_no'];
        $tjumlah  = $_POST['tjumlah'];
        $tgle     = $_POST['ttanggal'];
        $tkdj     = $_POST['tkdj'];
        $tkdc     = $_POST['tkdc'];

	$nominal = str_replace("Rp.", "", $tjumlah);
	$nominal = str_replace(".", "", $nominal);
	$nominal = str_replace(",", "", $nominal); 

        $sql1 = mysqli_query($koneksi, "SELECT perk AS tperk FROM nawal WHERE noperk='$tkredit' ");
                list($tperk) = mysqli_fetch_array($sql1);
                
    $tnama = addslashes($tnama);            
	$tperk = addslashes($tperk);
    $tket = "Penerimaan $tperk dari $tnama, $talamat";

	$tr='KM' ;
	$td='10' ;
	if ($tkredit=='40401') {
	    $unit='01';
	} else {
	    $unit='02';
	}
        /////////// 
    $query = mysqli_query($mysqli, "INSERT INTO anggota_trans_ao (notrans,tanggal,angg_no,kdj,kdc,masuk,ao,oleh,jam) 
                                    VALUES('$kdc','$tgle','$tangg_no','$tkdj','$tkdc','$nominal','$toleh','$toleh',(now()) )")
                                    or die('Ada kesalahan pada query insert : '.mysqli_error($mysqli));
    
   
    
        header("location:tugas_trans_jenis_tgl_sd_tgl.php?kdj=$tkdj ");
        
?>        