<?php 
    include '../koneksi.php';
    include '../cari_notrans.php';

    $takunt_d      = $_POST['takunt_d'];
    $takunt_k      = $_POST['takunt_k'];
    $tket        = $_POST['tket'];
    $toleh       = $_POST['toleh'];
    $tpokok      = $_POST['tjumlah'];

    $tr        = 'MM';
    $td        = '10';
    $ttgl      = $_POST['ttgl'];
    $tkdc      = $_POST['tkdc'];

    $nol=0;
    $no='';

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

    ///////////             MENYIMPAN KE TABEL KAS
    $query = mysqli_query($mysqli, "INSERT INTO kas (tanggal,notrans,kdc,keterangan,tr,td,jumlah,masuk,noperk,oleh,jam) 
                                    VALUES('$ttgl','$kode3','$tkdc','$tket','$tr','$td','$nominal','$nol','$takunt_d','$toleh',(now()) )")
                                    or die('Ada kesalahan pada query insert : '.mysqli_error($mysqli));
    ///////////             MENYIMPAN KE TABEL JOR DEBET
    $query = mysqli_query($mysqli, "INSERT INTO jor (tanggal,notrans,kdc,keterangan,tr,td,debet,noperk) 
                                    VALUES('$ttgl','$kode3','$tkdc','$tket','$tr','$td','$nominal','$takunt_d' )")
                                    or die('Ada kesalahan pada query insert : '.mysqli_error($mysqli));
    ///////////             MENYIMPAN KE TABEL JOR DEBET
    $query = mysqli_query($mysqli, "INSERT INTO jor (tanggal,notrans,kdc,keterangan,tr,td,kredit,noperk) 
                                    VALUES('$ttgl','$kode3','$tkdc','$tket','$tr','$td','$nominal','$takunt_k' )")
                                    or die('Ada kesalahan pada query insert : '.mysqli_error($mysqli));                                    
    header("location:!!_memmo_trans.php");
