<?php
include('../include/config.php');
error_reporting(0);
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');
$yr=$date->format('Y');
$month=$date->format('M');

$months='';

if(isset($_POST['pno']))
{
$cnt=addslashes($_POST['pno']);
$query2=mysqli_query($con,"UPDATE payment SET Approved='Yes' where Pay_No='$cnt'");
if($query2)
{
$msggg="approved payroll No: ".$cnt;
$sql3=mysqli_query($con,"INSERT INTO activity(user,Action,Tim,Dat,shortmsg,Month)values('$iduser','$msggg','$timenow','$timenow2','save','$month')");
if($sql3)
{ 

}
echo "yes";
}else
{
echo "An error occured while trying to remove the record.";
}
}
?>