<?php  
session_start();
if(!isset($_SESSION['atcrmsuloginsesion']))
	{
		header('Location: index.php');
		return;
	}
	if($_SESSION['atcrmsutype']!='Superuser'){
			header('Location: index.php');
		return;
	}
	
	include("connect.php");	header("Access-Control-Allow-Origin: *");
	
	$eve = "select * from res_disposition_master where brmid=1";
	$re = mysqli_query($conn, $eve);
	
	
	$response = array();
	$posts = array();
	
	$result="0";
	
	if(mysqli_num_rows($re) > 0)
	{
		$i=1;
		while($rt = mysqli_fetch_assoc($re))
		{
			 	$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>";
				//$tdelete="<a href='Projectdelete.php?id=".$rt['dmid']."' > Delete </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;
				//$cdelete="<a href='customeredit.php?id=$bumid' onClick=\"return confirm('are you sure you want to delete??');\">Delete</a>";
				
				$disposition=$rt['disposition'];
				$disposition=htmlspecialchars($disposition);
				
				
				
				$posts[] = array('dmid'=> $i, 'catedit'=> $catedit, 'catdelete'=> $catdelete, 'disposition'=> $disposition, 'op'=> $op);
				
				$i++;
	
		}
		 
		$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);	
?>