<?php 
    include '../koneksi.php';
    include '../fungsi_indotgl.php';
    
    $noang  = $_POST['noang'];
    $kdk    = $_POST['tkdk'];
    $kdc    = $_POST['tkdc'];
    $kab    = $_POST['tkab'];
    $oleh   = $_POST['toleh'];
    
    $nama   = $_POST['nama'];
    $alamat = $_POST['alamat'];
    $kdkec  = $_POST['xkdkec'];

    $ktp    = $_POST['ktp'];
    $kk     = $_POST['kk'];

    $tgle   = $_POST['tgl'];
    $hp     = $_POST['hp'];


    $jam    = date('d-m-Y  H:i:s'); //kombinasi jam dan tanggal
    
    $nol=0;
    $no='';
 
//$cek = mysqli_query($koneksi,"select * from anggota where ktp='$ktp' AND hapus<>'HAPUS' ");
//$c = mysqli_num_rows($cek);
//if($c == 0){
          
    $query = mysqli_query($mysqli, "INSERT INTO anggota (angg_no,tglmasuk,nama,tpt_tgl_lhr,umur,alamat,kec,kab,ktp,kk,hp,kdc) 
                                    VALUES('$noang','$tgle','$nama','$tpt','$umur','$alamat','$kecam','$kabup','$ktp','$kk','$hp',$kdc')")
                                    or die('Ada kesalahan pada query insert : '.mysqli_error($mysqli));
                                    
    header("location:angg_rkp_adm.php");

//}else{
//	$siapa = mysqli_fetch_assoc($cek);
//	$cs = $siapa['nama'];
//	$ca = $siapa['alamat'];
//	header("location:angg_rkp_adm_tambah.php?siapa=".$cs.' '.$ca."&alert=duplikat");
//}
    