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

$table	="gol_akun";
$nokel	=$_POST['tnokel'];
$nogol	=$_POST['tnogol'];
$nagol	=$_POST['tnagol'];
$kode	=$_POST['tkode'];

if($nokel=='1')
	$nakel='AKTIVA';
else if($nokel=='2')
	$nakel='HUTANG';
else if($nokel=='3')
	$nakel='MODAL';
else if($nokel=='4')
	$nakel='PENDAPATAN';
else if($nokel=='5')
	$nakel='BIAYA';
else $nakel='NON USAHA';
	
$sql = mysql_query("SELECT * FROM $table WHERE nogol= '$nogol'");
$row	= mysql_num_rows($sql);
if ($row>0){
	$input	= "UPDATE $table SET nagol='$nagol',kode='$kode',lastupdate=now() WHERE nogol= '$nogol'";
	mysql_query($input);								
	echo "Data Sukses diubah.";
}
else{
	$input = "INSERT INTO $table (nogol,nagol,nokel,nakel,kode,lastupdate) VALUES('$nogol','$nagol','$nokel','$nakel','$kode',now())";
	mysql_query($input);
	echo "Data sukses disimpan";
}
?>