max('code'); $noUrutAkhir=sprintf("%06s", 1); $noUrutAwal = 'JFK'; $noUrutAkhirString = $noUrutAkhir; if($noUrutAkhir2){ $noUrutAkhir = substr($noUrutAkhir2, 3, 6); // $noUrutAwal = substr($noUrutAkhir2, 0, 3); $noUrutAkhirString = sprintf("%06s", abs($noUrutAkhir + 1)); } return $noUrutAwal . $noUrutAkhirString; } }