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

$table	="teller";

$kodetl	=$_POST[kodetl];
$jenis	=$_POST[jenis];
$tanki	=$_POST[tanki];
$angkatl=$_POST[angkatl];

$sql = mysql_query("SELECT * FROM $table WHERE kode_tl= '$kodetl'");
$row= mysql_num_rows($sql);
if ($row>0){
	$input	= "UPDATE $table SET jenis='$jenis',tanki='$tanki',angka_tl='$angkatl',lastupdate=now() WHERE kode_tl='$kodetl'";
	mysql_query($input);								
	echo "Data teller $kodetl Sukses diubah.";
}
else{
	$input = "INSERT INTO $table (kode_tl,jenis,tanki,angka_tl) VALUES('$kodetl','$jenis','$tanki','$angkatl')";
	mysql_query($input);
	echo "Data sukses disimpan";
}	
?>