<?php
include '../config.php';

$member_id = $_POST['memberid'];

 $sql ="SELECT * FROM storeNotification WHERE member_id = '$member_id'";
$result  = mysqli_query($conn,$sql);
if (mysqli_num_rows($result)) 
{
	$NotificationList = array();
	while ($row = mysqli_fetch_assoc($result)) 
	{
    	$temp = ["cotent"=>$row['cotent'],"title"=>$row['title'],"created_time"=>$row['created_at'],"profile_picture"=>$row['profile_picture']];
    	array_push($NotificationList, $temp);

	}
	$sql ="SELECT * FROM storeNotification WHERE member_id = '$member_id' AND status='Active'";
    $result  = mysqli_query($conn,$sql);
    $newnotification= mysqli_num_rows($result);
    

	
	
	$response = ["status"=>"success","Notificationlist"=>$NotificationList,"NewNotificationCount"=>$newnotification];
}
else
{
		$response = ["status"=>"failure"];

}
echo json_encode($response);





?>