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

	$id = $_POST['id'];
	$nama = $_POST['nama'];
	$ket = $_POST['ket'];
	
	//$ikan1 = $_POST['ikan'];
	//$ikan = implode(',', (array)$ikan1);
	
	//$karang1 = $_POST['karang'];
	//$karang = implode(',', (array)$karang1);
	
	$wrong = "";
	
	//upload foto
	//$temp_foto = explode(".", $_FILES['foto']['name']);
	//$newfilefoto = generateRandomString() . '.' . end($temp_foto);
	//move_uploaded_file($_FILES['foto']['tmp_name'], "../img/bahari/" . $newfilefoto);

	//simpan ke dalam mhs
	$query = "UPDATE ikan SET nama_ikan = '$nama', 
								keterangan = '$ket'
								WHERE id = '$id'";		
	mysql_query($query) or die (mysql_error());


	if($wrong == "")
		$url = "index.php?act=ikan_input&ket=berhasil";
	else
		$url = "index.php?act=ikan_input&ket=$wrong";

	echo "<script language=\"javascript\">
		window.location='../$url';
	</script>";

?>