<?php
include "../../inc/inc.koneksi.php";
$text	= "SELECT max(kode_jab) as no_akhir FROM jabatan";
$sql 	= mysql_query($text);
$row	= mysql_num_rows($sql);
if ($row>0){
	$data=mysql_fetch_array($sql);	
		$no = $data['no_akhir'];
		$no_akhir = (int) substr($no, 0, 2);
		$no_akhir++;
		$kode = sprintf("%02s",$no_akhir);
		$data['nomor']	= $kode;
		echo json_encode($data);
}else{
	$data['nomor']	= '01';
	echo json_encode($data);
}
?>