<?php
// Include the database connection file
session_start();
include "menuadmin.php";
include 'config.php';


if (isset($_POST['update'])) 
{
	$kodeuser=$_POST['ikduser'];
    $nama=addslashes($_POST['inama']);
	$userguru=addslashes($_POST['iuser']);
	$pass=addslashes($_POST['ipass']);
	$madrasah=addslashes($_POST['imadrasah']);
	
	
	

		// Update the database table
		$result = mysqli_query($mysqli, "UPDATE `user` SET `nama`='$nama',`userguru`='$userguru',`password`='$pass',`madrasah`='$madrasah' WHERE `Iduser`='$kodeuser'");
		
		// Display success message
		echo "<p><font color='green'>Data updated successfully!</p>";
		echo "<br> ";
		header("location:guru.php?ed=1");
		
	}
