<?php
include("../connect.php");
$response = array();
if(isset($_POST['manager_id']))
{
	$manager_id = $_POST['manager_id'];
	$select_notification = mysqli_query($con,"select * from tbl_notification_history where manager_id='$manager_id' order by notification_id DESC");
	
	$notifications=array();
	if(mysqli_num_rows($select_notification)>0)
	{     
		while($fetch_notification=mysqli_fetch_assoc($select_notification))
		{
			$notifications['notification_id'] = $fetch_notification['notification_id'];
			$notifications['admin_id'] = $fetch_notification['admin_id'];
			$notifications['manager_id'] = $fetch_notification['admin_id'];
			$notifications['agent_id'] = $fetch_notification['agent_id'];
			$notifications['title'] = $fetch_notification['title'];
			$notifications['message'] = $fetch_notification['message'];
			$notifications['date'] = $fetch_notification['date'];
			$notifications['time'] = $fetch_notification['time'];

			$response['notifications'][]=$notifications;
		}
	}
	else
	{
		$response['notifications'][]=$notifications;
	}

	$response['success']=1;	
	$response['details']="Data Success";
}
else
{
	$response['success']=0;
	$response['details']="Required fields missing";
}
echo json_encode($response);
?> 