<?php 
    include '../koneksi.php';
    
    $tid        = $_POST['id'];
    $tperk      = $_POST['nama'];
    $tnosub     = $_POST['nosub'];
    //$tkdu       = $_POST['kdu'];
    $tkdu       = '1';
    $tnoak      = $_POST['noak'];

              $klp = mysqli_query($koneksi, "SELECT kd AS tkd_klp FROM n_kode_3 WHERE kd='$tnosub' LIMIT 1");
                list($tkd_klp) = mysqli_fetch_array($klp);
              $count3 = mysqli_num_rows($kaw);   
              
    $ttawald        = $_POST['tawald'];
    $ttawalk        = $_POST['tawalk'];
    $ttanggar       = $_POST['tanggar'];    
    
	$nominal_d = str_replace("Rp.", "", $ttawald);
	$nominal_d = str_replace(".", "", $nominal_d);
	$nominal_d = str_replace(",", "", $nominal_d);   
	
	$nominal_k = str_replace("Rp.", "", $ttawalk);
	$nominal_k = str_replace(".", "", $nominal_k);
	$nominal_k = str_replace(",", "", $nominal_k);   

	$nominal_a = str_replace("Rp.", "", $ttanggar);
	$nominal_a = str_replace(".", "", $nominal_a);
	$nominal_a = str_replace(",", "", $nominal_a);  
    /////////// 
    mysqli_query($koneksi, "UPDATE nawal SET ry='$tnoak',perk='$tperk',klp='$tkd_klp', nosub='$tnosub' , kdu='$tkdu', awald='$nominal_d', awalk='$nominal_k', anggar='$nominal_a'  WHERE id='$tid'")or die(mysqli_errno());
    
    header("location:kode_akunt_new.php");
?>