";
	echo "";
		$k=$k+1;
		echo "$k";
	echo " | ";
	echo "";
		$fot='reg'.$idd;
       	echo "  ";
    		echo "$tra $nom $pat $mat ";
	echo " | ";	
	echo ""; //-- MATERIAS
		echo "";
		echo "";
		echo "Grupo";
		echo " | ";
		echo "";
		echo "Sigla";
		echo " | ";
		echo "";
		echo "Nombre de la materia";
		echo " | ";
		echo "";
		echo "Nivel";
		echo " | ";
		echo " ";
		echo "";
	 include("../../conecta.php");
	 $carr_asig=pg_exec("select * 
	 from dct_asignaciones 
	 where id_docente='$idd'  
	 and id_gestion='$ges' 
	 and id_periodo='$per' 
	 and id_programa='$idc' 
	 and estado='1' 
	 and estado_registro='A' 
	 order by id_materia,id_grupo ASC");
        $fil=pg_numrows($carr_asig);
    		for($y=0;$y<$fil;$y++)
    		{
		$idm=pg_result($carr_asig,$y,2);
		$idg=pg_result($carr_asig,$y,3);
	 		include("conexion.php");
			$materi=pg_exec("select * from pln_materias where id_materia=$idm and tipo='S'");
        		$fi2=pg_numrows($materi);
    			if($fi2!='')
			{
				for($x=0;$x<$fi2;$x++)
    				{
			   	$sig=pg_result($materi,$x,1);
			   	$nma=pg_result($materi,$x,2);
			   	$niv=pg_result($materi,$x,9);
				}
			}else
			{
			$sig='';$nma='';$niv='';$idg='';
			}
		echo "";
		echo "";
		echo "$idg";
		echo " | ";
		echo "";
		echo "$sig";
		echo " | ";
		echo "";
		echo "$nma";
		echo " | ";
		echo "";
		echo "$niv";
		echo " | ";
		echo " ";
		}
		echo " ";
	echo " | ";
    }
echo "