<?php
	include ("../inc/koneksi.php");
	include('../inc/password.php');
	
	//$tanggal = date("d-m-Y");
	//$id_lapor = rand();
	$no_laporan = mysql_real_escape_string($_POST['no_laporan']);
	$respon = mysql_real_escape_string($_POST['respon']);
	//$lokasi = mysql_real_escape_string($_POST['lokasi']);
	//$komentar = mysql_real_escape_string($_POST['komentar']);

	//cari id
	$status = "Selesai";

	//upload foto
	$temp_foto = explode(".", $_FILES["foto"]["name"]);
	$newfilefoto = generateRandomString() . '.' . end($temp_foto);
	move_uploaded_file($_FILES["foto"]["tmp_name"], "../tagor-user/images/tabaos/" . $newfilefoto);

	$wrong = "";

	//update laporan
	$query = "UPDATE laporan SET respone = '$respon', status = '$status', foto_sesudah='$newfilefoto' WHERE id_lapor = '$no_laporan'";		
	mysql_query($query) or die (mysql_error());

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

?>