<?php
include "../../inc/inc.koneksi.php";
$kode=$_POST[kode];

$text	= "SELECT max(noakun) as no_akhir FROM akun_bb WHERE nogol='$kode' ORDER BY noakun";
$sql 	= mysql_query($text);
$data 	= mysql_fetch_array($sql);
$no 	= $data['no_akhir'];

if($no==''){
	$data['nomor']	= $kode.'1';
	echo json_encode($data);
}else{
	$kode = substr($no, 0, 3);
	$no_akhir = (int) substr($no, 3, 2);
	$no_akhir++;
	$noakun = $kode.sprintf("%02s",$no_akhir);
	$data['nomor']	= $noakun;
	echo json_encode($data);
}
?>