<?php  
session_start();
	if(!isset($_SESSION['atcrmsuloginsesion']))
	{
		header('Location: index.php');
		return;
	}
	if($_SESSION['atcrmsutype']!='Superuser'){
			header('Location: index.php');
		return;
	}
	$response = array();
	$posts = array();	
	$result="0";
	
	include("connect.php");
	include("connectp.php");

		$query = "select * from res_disposition_master where brmid=:brmid";
		$stmt = $db7->prepare($query);
		$stmt->bindValue(':brmid', "1");
		$stmt->execute();
		if ($stmt->rowCount() > 0)
		{
			$i=1;
			while($rt = $stmt->fetch(PDO::FETCH_ASSOC))
			{
			 	$dmid=$rt['dmid'];
				$catedit="<a href='dispositionedit.php?id=".$rt['dmid']."' data-toggle='tooltip' data-placement='top' title='Edit' class='fa fa-pencil fa-md'>  </a>";
				$catdelete="<a href='dispositiondelete.php?id=".$rt['dmid']."' data-toggle='tooltip' data-placement='top' title='Delete' class='fa fa-trash-o fa-md' onclick='return confirm(&#39;Are you sure you want to delete ?&#39;);'> </a>";
				 $op=$catedit."&nbsp;&nbsp;&nbsp; ".$catdelete;				
				$disposition=$rt['disposition'];
				$disposition=htmlspecialchars($disposition);				
				$posts[] = array('dmid'=> $i++, 'catedit'=> $catedit, 'catdelete'=> $catdelete, 'disposition'=> $disposition, 'op'=> $op);
		}		 
		$response['posts'] = $posts;
		echo stripslashes(json_encode( array('data' => $posts)));
		mysqli_close($conn);
		return;
		}	
   else
	{
		$result="0";
		$msg="Invalid Error";		
		$posts[] = array('p1'=> $result,'p2'=> $msg);	
		$response['posts'] = $posts;
		echo stripslashes(json_encode( array('item' => $posts)));
	}   
	mysqli_close($conn);	
?>