<?php
include "koneksi.php";
$response = array();
if(isset($_POST['id_administrator']) && isset($_POST['nama_administrator']) && isset($_POST['username']) && isset($_POST['password'])){
	$id_administrator = $_POST['id_administrator'];
	$nama_administrator = $_POST['nama_administrator'];
	$username = $_POST['username'];
	$password = $_POST['password'];
	$sql = "UPDATE administrator SET nama_administrator='".$nama_administrator."', username='".$username."',
	password='".$password."' WHERE id_administrator='".$id_administrator."'";
	$result = mysqli_query($koneksi, $sql);
	if($result){
		$response["success"] = $id_administrator;
		$response["message"] = "Profil Berhasil Disimpan";
		echo json_encode($response);
	} else {
		$response["success"] = 0;
		$response["message"] = "Profil Gagal Disimpan";
		echo json_encode($response);
	}
} else {
	$response["success"] = 0;
	$response["message"] = "Profil Gagal Disimpan Param=null";
	echo json_encode($response);
}
?>
