
<?php
 
 include_once('conexao.php');
 include_once('DAO/DAOgrupo.php');
 $Daogrupo  = new Daogrupo();	
	
	$result =  $Daogrupo->Listargrupo();
		
		foreach($result as $row){
			
			$json[] = array(
				$row["grp_cd"],
				$row["grp_ds"], 
				
		
				date("d/m/Y H:i", strtotime($row["grp_dt_cadastro"])),
				 

				'<a href="view-grupo.php?acao=editar&grp_cd='.$row["grp_cd"].'" data-toggle="tooltip" title="Editar">
				<button type="button" class="btn btn-info btn-sm"><span class="ft-edit-2" aria-hidden="true"></span></button>
				</a>
			 
				<a href="javascript:void(0)" onclick="deletar_registro('."'".$row["grp_cd"]."'".','."'".$row["grp_ds"]."'".')" data-toggle="tooltip" title="Excluir" > 
				<button type="button" class="btn btn-danger btn-sm"><span class="ft-trash-2" aria-hidden="true"></span></button>
				</a>'
			);
		}
		$response = array();

		$response['aaData'] = $json;
		echo json_encode($response);

     
?>


                                   


