<?php 
} else {
    if (!$cursos) {
        echo "Un error a Ocurrido.\n";
        exit;
    }
    $x = 0;
    while ($row = pg_fetch_assoc($cursos)) {
        $curso_id = $row['id'];
        $usuario_curso_id = $row['usuario_cursos_id'];
        $nom = $row['nombre'];
        $idioma = $row['idioma'];
        $creditos = $row['creditos'];
        $niv = texto_nivel($nivel);
        $idi = texto_idioma($idioma);
        $trClass = fila_color($x);
        ?>
	
				<tr class="<?php 
        echo $trClass;
        ?>
">
					<input type="hidden" name="curso_bd_act_<?php 
        echo $x;
        ?>
" id="curso_bd_act_<?php 
        echo $x;
        ?>
" value="<?php 
        echo $usuario_curso_id;
        ?>
    $nom = $row['nombre'];
    $creditos = $row['creditos'];
    $idi = texto_idioma($row['idioma']);
    $est = texto_estatus($row['estatus']);
    ?>
	<?php 
    if ($row['institucion'] != $institucion && $x != 0) {
        ?>
	<?php 
        $y = 0;
        ?>
						</table>
					</div>
	<?php 
    }
    $trClass = fila_color($y);
    if ($row['institucion'] != $institucion) {
        ?>
					<h3><?php 
        echo $row['institucion'];
        ?>
</h3>
					<div>
						<table cellpadding="1" cellspacing="1" style="width:100%;">
							<tr>
								<th colspan="2"><label><?php 
        echo _("ID");
        ?>
</label></th>
								<th><label><?php 
        echo _("Nombre");