<?php


include './../koneksi.php';
include ('./../cek_login.php');
ini_set('display_errors',1);
error_reporting(E_ALL);


if(isset($_POST['kode_akun']) AND isset($_POST['nama_akun'])) {
   


$kode_akun        = $_POST['kode_akun'];
$nama_akun          = $_POST['nama_akun'];


$cek = mysqli_num_rows(mysqli_query($koneksi,"SELECT k_akun FROM kode_akun WHERE k_akun ='$kode_akun' "));
    if ($cek > 0){
    /*echo '<script>window.alert("NIM yang anda masukan sudah ada")
    Window.location="./laporan/form_register.php"</script>';*/
    echo "Data yang ada Simpan Sudah ada,bisa dicek...!!! ";
       
    }else {

mysqli_query($koneksi,'INSERT INTO
kode_akun(k_akun,n_akun)
VALUES (

"' . $kode_akun . '",
"' . $nama_akun . '"



)'
)
or die(mysqli_errno($koneksi).':'.mysqli_error($koneksi));
    /*echo '<script>window.alert("DATA SUDAH DISIMPAN")
    window.location="./home?url=pendaftaran"</script>';*/
    echo "Data Berhasil Disimpan";

    }
    
    
 }   

?>

