
<?php
 
 include_once('conexao.php');
 include_once('DAO/DAOfaq.php');
 $Daofaq  = new Daofaq();	
	
	$result =  $Daofaq->Listarfaq();
		
		foreach($result as $row){
			
			$json[] = array(
				$row["faq_id"],
				$row["faq_pergunta"], 
				
		
				date("d/m/Y H:i", strtotime($row["faq_dt_cadastro"])),
				 

				'<a href="view-faq.php?acao=editar&faq_id='.$row["faq_id"].'" 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["faq_id"]."'".','."'".$row["faq_pergunta"]."'".')" 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);

     
?>


                                   


