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

$kode = $_POST['kode'];
$text = "SELECT max(nokwit) as no_akhir FROM no_kwitansi";
$sql  = mysql_query($text);
$row = mysql_num_rows($sql);

if ($row>0){	
	mysql_query("UPDATE no_kwitansi SET nokwit='$kode'");
}else{	
	mysql_query("INSERT INTO no_kwitansi (nokwit) VALUES('$kode')");
}
?>