<?php  
	include "conexion.php";
	include "insertar_log.php";
	$id_aplicacion = "0";

	$datos = " Ingresa a obtener_regimen_fiscal ";	
		insertarLog($datos,$id_aplicacion);

	$sql = "select ";
	$sql .= "id,";
	$sql .= "descripcion ";
	$sql .= "from ";
	$sql .= "cat_regimenfiscal ";

	$sentencia = $conexion->prepare($sql);
	$sentencia->execute();

	$resultado = $sentencia->get_result();
	$cont=0;

	while($fila = $resultado->fetch_assoc())
	{
		$regimen_fiscal["id"]=$fila['id'];
		$regimen_fiscal["descripcion"]=$fila['descripcion'];
		$array[$cont] = $regimen_fiscal;
		$cont++;
	}

	$sentencia->close();

	$datos = " Se obtuvo la información e los regimens fiscales.";	
		insertarLog($datos,$id_aplicacion);

	echo response(0,"OK",$array);


	function response($estatus,$estatus_mensaje,$respuesta){
		header("HTTP/1.1".$estatus);

		$response["estatus"]=$estatus;
		$response["estatus_mensaje"]=$estatus_mensaje;
		$response["respuesta"]=$respuesta;
		
		$json_response = json_encode($response, JSON_UNESCAPED_UNICODE);

		echo $json_response;

	}



?>