<?php
	session_start();
    $id_usuario = $_SESSION['idusuario'];   
	include ("conex.php");		
	$consulta = mysqli_query($conn,"SELECT e.idempresa, e.ruc, e.razon_social
							FROM tbi_empresa as e								
							WHERE e.condicion = 1 ORDER BY e.razon_social ASC");
	$tabla = "";
	
	while($row = mysqli_fetch_array($consulta)){			
			
			//$eliminar = '<a href=\"actionDelete_cl.php?id='.$row['idempresa'].'\" onclick=\"return confirm(\'¿Seguro que desea eliminar?\')\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Eliminar\" class=\"btn btn-danger\"><i class=\"fa fa-trash\" aria-hidden=\"true\"></i></a>';
			$eliminar= '<a id=\"btnnotifi'.$row['idempresa'].'\" data-idempre=\"'.$row['idempresa'].'\" data-toggle=\"modal\" data-target=\"#diagnostico_m\" title=\"Eliminar\" class=\"btn btn-danger\"><i class=\"fa fa-trash\"aria-hidden=\"true\"></i></a>';
					
			$tabla.='{
				"ruc":"'.utf8_encode($row['ruc']).'",				
				"razon":"'.$row['razon_social'].'",
				"accion":"'.$eliminar.'"
				},';			
	}

	$tabla = substr($tabla,0, strlen($tabla) - 1);
	echo '{"data":['.$tabla.']}';	
?>

