<?php
include "koneksi.php";
$response = array();
$response["data"] = array();
$query=mysqli_query($koneksi, "SELECT h.id_hasil as id_hasil, h.tahun as tahun, k.nama_karyawan as nama_karyawan,
	k.jabatan as jabatan, h.nilai as nilai FROM hasil h, karyawan k WHERE h.id_karyawan=k.id_karyawan ORDER BY h.tahun DESC");
while ($row = mysqli_fetch_array($query)){
	$output = array();
	$output["id_hasil"]=$row["id_hasil"];
	$output["nama_karyawan"]=$row["nama_karyawan"];
	$output["jabatan"]=$row["jabatan"];
	$output["tahun"]=$row["tahun"];
	$output["nilai"]=$row["nilai"];
	array_push($response["data"], $output);
}
echo json_encode($response);
?>
