<?php 
    session_start();
    include '../koneksi.php';
    include '../fungsi_indotgl.php';
    include '../cari_notrans.php';

    $noang  = $_POST['noang'];
    $kdk    = $_POST['tkdk'];
    $kab    = $_POST['tkab'];
    $oleh   = $_POST['toleh'];
    
    $nama   = $_POST['nama'];
    $alamat = $_POST['alamat'];

    $kel    = $_POST['kel'];
    $kec    = $_POST['kec'];
    $kab    = $_POST['kab'];

    $tgle   = date("Y/m/d");
    $hp     = $_POST['hp'];
    $rt     = $_POST['rt'];
    $rw     = $_POST['rw'];

    $jam    = date('d-m-Y  H:i:s'); //kombinasi jam dan tanggal
    
    $nol=0;
    $no='';

    $query = mysqli_query($koneksi, "INSERT INTO anggota (angg_no,tglmasuk,nama,alamat,kel,kec,kab,hp,rt,rw,oleh,jam) 
                                    VALUES('$noang','$tgle','$nama','$alamat','$kel','$kec','$kab','$hp','$rt','$rw','$oleh','$jam')")
                                    or die('Ada kesalahan pada query insert : '.mysqli_error($mysqli));

/////////// BUAT KODE UNIK
include '../buat_kode_unik.php';
///////////////////////////// KODE UNIK SELESAI                                    
    header("location:@_angg_tgl_sd_tgl.php");
    
    
    
