<?php
include('../include/config.php');
session_start();
$iduser=$_SESSION['user_idd'];
$date = new DateTime("now", new DateTimeZone('Africa/Nairobi') );
$timenow=$date->format('Y-m-d H:i:s');
$timenow2=$date->format('Y-m-d');
$month=$date->format('M');
//error_reporting(0);
 
 if(isset($_POST['id'])) 
 {
$id =addslashes($_POST['id']); 
$lev =addslashes($_POST['lev']);
$aces =addslashes($_POST['aces']);

$sql=mysqli_query($con,"UPDATE users SET Level='$lev', Aces='$aces' WHERE userid='$id'");
if($sql)
{
$msgg='updated one of users system access data';
$sql3=mysqli_query($con,"INSERT INTO activity(user,Action,Tim,Dat,shortmsg,Month)values('$iduser','$msgg','$timenow','$timenow2','update','$month')");
if($sql3)
{ }
echo "success";
}else
{
echo "Unable to update data";	
}	
 }
 ?>