function obtenerCorreosDirecciones($direcciones)
{
    $ids = transformarArray($direcciones, ",");
    //Abrir la conexión
    $conex = DataBase::getInstance();
    $consulta = "SELECT CORREO from DIRECCIONES_ASIGNACION where ID_DIRECCION IN ({$ids})";
    //echo $consulta;
    $stid = oci_parse($conex, $consulta);
    if (!$stid) {
        $e = oci_error($conex);
        trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
    }
    // Realizar la lógica de la consulta
    //ocibindbyname($stid, ':ids', $ids);
    $r = oci_execute($stid);
    if (!$r) {
        $e = oci_error($stid);
        trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
    }
    $array = array();
    while ($fila = oci_fetch_array($stid, OCI_ASSOC + OCI_RETURN_NULLS)) {
        $it = new ArrayIterator($fila);
        while ($it->valid()) {
            array_push($array, $it->current());
            $it->next();
        }
    }
    //Libera los recursos
    oci_free_statement($stid);
    // Cierra la conexión Oracle
    oci_close($conex);
    return $array;
}
//motivos
if (isset($_POST['motivos']) && !empty($_POST['motivos']) && count($_POST['motivos']) != 0) {
    $motivos = $_POST['motivos'];
    if ($boo) {
        $sql .= " AND ";
    }
    $sql .= "fmq.ID_MOTIVO IN(" . transformarArray($motivos, ",") . ")";
    $boo = TRUE;
}
//procedente
if (isset($_POST['status']) && !empty($_POST['status']) && count($_POST['status']) != 0) {
    $status = $_POST['status'];
    if ($boo) {
        $sql .= " AND ";
    }
    $sql .= "dj.ESTATUS_DENUNCIA IN(" . transformarArray($status, ",") . ")";
    $boo = TRUE;
}
/*
	Reviso fechas
	BETWEEN '16/08/15' and '17/08/15'
*/
$fechaInicio = $_POST['fechaInicio'];
$fechaFin = $_POST['fechaFin'];
if (!empty($_POST['fechaInicio']) && !empty($_POST['fechaFin'])) {
    /*if( strtotime($_POST['fechaInicio'])> strtotime($_POST['fechaFin']) )
    		{
    			$fechaInicio = date("d-m-Y", strtotime($fechaFin));
    			$fechaFin = date("d-m-Y", strtotime($fechaInicio));
    		}else
    		{