<?php
include "../../inc/inc.koneksi.php";

$table	="akun_bp";
$nobb 	=$_POST[tnobb];
$noakun=$_POST[tnoakun];
$naakun=$_POST[tnaakun];
$kode	=$_POST[tkode];
$tahun	=$_POST[ttahun];

$sql 	= mysql_query("SELECT * FROM $table WHERE noakun= '$noakun'");
$row	= mysql_num_rows($sql);
if ($row>0){
	$input	= "UPDATE $table SET naakun='$naakun',lastupdate=now() WHERE noakun= '$noakun'";
	mysql_query($input);								
	echo "Data sukses diubah.";
}
else{
	$input = "INSERT INTO $table (noakun,naakun,nobb,kode,tahun) VALUES('$noakun','$naakun','$nobb','$kode','$tahun')";
	mysql_query($input);
	echo "Data sukses disimpan";
}	
?>
