<?php
$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');
session_start();
include('../include/config.php');
$iduser= $_SESSION['user_idd'];

$yr=$_SESSION['YEAR'];
$trm=$_SESSION['TERM'];

if(isset($_POST['id'])) 
 {
$id =$_POST['id']; 
$pup =$_POST['pup']; 

$sql=mysqli_query($con,"DELETE FROM feestatement WHERE count='$id'");
if($sql)
{
$msgg='deleted a fee payment record for '.$pup.' - '.$trm.' '.$yr;
$sql3=mysqli_query($con,"INSERT INTO activity(user,Action,Tim,Dat,shortmsg,Month)values('$iduser','$msgg','$timenow','$timenow2','update','$month')");
// if($sql3)
// { }
echo "Fee record successfully deleted";
}else
{
echo "Unable to update data";	
}	
}
?>