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

$table	="akun_bb";
$nogol	=$_POST[nogol];
$noakun=$_POST[noakun];
$naakun=$_POST[naakun];
$level	=$_POST[level];
$kode	=$_POST[kode];
$tahun	=$_POST[tahun];
$nosub	=substr($noakun,0,3);

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