
		  	  <tr>
		  	  <!-- ************************************************  EDUCACION PRIMARIA *************************************************************************************** -->
		  	    <td class=fichaden colspan="0" style="font-weight:bold;border-bottom:1px solid #ccc">
		  	    	Infantil y Educaci&oacute;n Primaria
		  	    </td>
		  	  </tr>
		  	  <tr>
		  	  	<td>
<table border="0" cellspacing="0" cellpadding="0" style="width:100%;height:100%">
		  	  			<tr>
		  	  				<td>
			  	  				<table border="0" style="width:100%;margin-bottom:-4">
			  	  					<tr>
					  	  				<td class=fichaden style="background-color:#fea;text-align:center;width:65">Curso</td>
					  	  				<td class=fichaden style="background-color:#fea;text-align:center;width:120">A&ntilde;o Academico</td>
					  	  				<td class=fichaden style="background-color:#fea;text-align:center;width:250">Centro Educativo</td>
					  	  				<td class=fichaden style="background-color:#fea;text-align:center;width:180">Medidas Educativas</td>
					  	  				<td class=fichaden style="background-color:#fea;text-align:center;width:160">Absentismo Escolar</td>
					  	  				<td class=fichaden style="background-color:#fea;text-align:center">Observaciones</td>
					  	  				<td class=fichaden style="background-color:#fea;text-align:center;width:20">&nbsp;</td>
			  	  					<tr>
			  	  				</table>
		  	  				</td>
		  	  			</tr>
					  	  <?php
					  	  	$consultaHistorial=mysql_query("SELECT * FROM historial WHERE idAlumno=".$filaAl['id']." and nivel=0 ORDER BY id", $conexion);
					  	  	$cont=0;
					  	  	while($filaHistorial=mysql_fetch_array($consultaHistorial))
					  	  	{
					  	  ?>
					  	  <tr id=ep<?php echo $cont?>>
		  	  				<td>
		  	  					<table border="0" style="width:100%;margin-bottom:-4">
		  	  						<tr>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:65;">
								  	      <select name="Ep<?php echo $cont?>cur" class=caja style="width:100%">
								  	      <?php
												$consultacur=mysql_query("SELECT * FROM cursos WHERE id=".$filaHistorial['idCurso'],$conexion);
												$filacur=mysql_fetch_array($consultacur);
								  	      ?>
								  	      		<option value="<?php echo $filacur['id']?>"><?php echo $filacur['cursos']?>
								  	      <?php
								  	      	$tipocurso=0;
								  	      	include("rellenarcurso.php")
								  	      ?>
								  	      </select>
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:120">
								  	      <select name="Ep<?php echo $cont?>anio" id="Ep<?php echo $cont?>anio" class=caja style="width:100%" onChange="comprobarOtra('Ep<?php echo $cont?>anio','OtroEp<?php echo $cont?>anio')">
								  	      <?php
												$consultaanio=mysql_query("SELECT * FROM anioacademico WHERE id=".$filaHistorial['idAnio'],$conexion);
												$filaanio=mysql_fetch_array($consultaanio);
								  	      ?>
								  	      		<option value="<?php echo $filaanio['id']?>"><?php echo $filaanio['anioAcademico']?>
								  	      <?php
								  	      	include("rellenaranio.php")
								  	      ?>
								  	      		<option value="Otra">Otra
								  	      </select>
								  	      <input type="text" name="OtroEp<?php echo $cont?>anio" id="OtroEp<?php echo $cont?>anio" class="caja" value="" style="width:100%;display:none">
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:250">
					  	  					<input type="text" name="Ep<?php echo $cont?>centro" maxlength="20" class="caja" value="<?php echo $filaHistorial['centro']?>" style="width:100%">
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:180">
								  	      <select name="Ep<?php echo $cont?>med" id="Ep<?php echo $cont?>med" class=caja style="width:100%" onChange="comprobarOtra('Ep<?php echo $cont?>med','OtroEp<?php echo $cont?>med')">
								  	      <?php
												$consultamed=mysql_query("SELECT * FROM medidaseducativas WHERE id=".$filaHistorial['idMed'],$conexion);
												$filamed=mysql_fetch_array($consultamed);
								  	      ?>
								  	      		<option value="<?php echo $filamed['id']?>"><?php echo $filamed['medidasEducativas']?>
								  	      <?php
								  	      	include("rellenarmed.php")
								  	      ?>
								  	      		<option value="Otra">Otra
								  	      </select>
								  	      <input type="text" name="OtroEp<?php echo $cont?>med" id="OtroEp<?php echo $cont?>med" class="caja" value="" style="width:100%;display:none">
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:160">
								  	      <select name="Ep<?php echo $cont?>abs" id="Ep<?php echo $cont?>abs" class=caja style="width:100%" onChange="comprobarOtra('Ep<?php echo $cont?>abs','OtroEp<?php echo $cont?>abs')">
								  	      <?php
										  		$consultaabs=mysql_query("SELECT * FROM absentismos WHERE id=".$filaHistorial['idAbs'],$conexion);
												$filaabs=mysql_fetch_array($consultaabs);
								  	      ?>
								  	      		<option value="<?php echo $filaabs['id']?>"><?php echo $filaabs['absentismo']?>
								  	      <?php
								  	      	include("rellenarabs.php")
								  	      ?>
								  	      		<option value="Otra">Otra
								  	      </select>
								  	      <input type="text" name="OtroEp<?php echo $cont?>abs" id="OtroEp<?php echo $cont?>abs" class="caja" value="" style="width:100%;display:none">
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center">
					  	  					<a href="javascript:abreVentana('Ep<?php echo $cont?>obs', 'historial')" style="color:#005;font-weight:bold">
					  	  					<?php
												if($filaHistorial['observaciones']!="" || $filaHistorial['observacionesDoc1']!="" || $filaHistorial['observacionesDoc2']!="" || $filaHistorial['observacionesDoc3']!="" || $filaHistorial['observacionesDoc4']!="" || $filaHistorial['observacionesDoc5']!="")
												{
											?>
												<img src="../../imagenes/ojo.png" style="width:25;height:19">
											<?php
												} else
												{
								  	  		?>
								  	  			Incorporar
								  	  		<?php
												}
											?>
								  	  		</a>
					  	  					<input type="hidden" name="Ep<?php echo $cont?>obs" id="Ep<?php echo $cont?>obsTexto" value="<?php echo $filaHistorial['observaciones']?>">
								  	  		<?php
								  	  			for($i=1;$i<6;$i++)
								  	  			{
								  	  		?>
						  	  					<input type="hidden" name="Ep<?php echo $cont?>obsDocumento<?php echo $i?>" id="Ep<?php echo $cont?>obsDocumento<?php echo $i?>" value="<?php echo $filaHistorial['observacionesDoc'.$i]?>">
						  	  					<input type="hidden" name="Ep<?php echo $cont?>obsDocumentoExt<?php echo $i?>" id="Ep<?php echo $cont?>obsDocumentoExt<?php echo $i?>" value="">
						  	  					<input type="hidden" name="Ep<?php echo $cont?>obsDocumentoAntiguo<?php echo $i?>" value="<?php echo $filaHistorial['observacionesDoc'.$i]?>">
									  	  	<?php
								  	  			}
								  	  		?>
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:20"><a href="javascript:confBorrar('<?php echo $filaHistorial['id']?>.<?php echo $filaAl['id']?>',4)" title="Eliminar Fila"><img src="../../imagenes/cruz.gif" style="border:0;width:14;height:14"></a></td>
		  	  						<tr>
		  	  					</table>
		  	  				</td>
		  	  			</tr>
		  	  			  <input type="hidden" name="idEp<?php echo $cont?>" value="<?php echo $filaHistorial['id']?>">
					  	  <?php
					  	  		$cont++;
					  	  	}
					  	  ?>
					  	  <input type="hidden" name="numExistentesEp" value="<?php echo $cont?>">
						  <?php
							$j=$cont; //esta variable nos va a decir cual es el primer elemento de la lista vacia
					  	  	for(;$cont<=10;$cont++)
					  	  	{
					  	  		if($j==$cont)
					  	  		{
					  	  			$display="block";
					  	  		} else
					  	  		{
					  	  			$display="none";
					  	  		}
					  	  ?>
					  	  <tr>
		  	  				<td>
		  	  					<span id=ep<?php echo $cont?> style="display:<?php echo $display?>">
		  	  					<table border="0" style="width:100%;margin-bottom:-4">
		  	  						<tr>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:65;">
								  	      <select name="Ep<?php echo $cont?>cur" class=caja style="width:100%" onchange="document.getElementById('ep<?php echo $cont+1?>').style.display='block'">
								  	      		<option value="0">
								  	      <?php
								  	      	$tipocurso=0;
								  	      	include("rellenarcurso.php")
								  	      ?>
								  	      </select>
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:120">
								  	      <select name="Ep<?php echo $cont?>anio" id="Ep<?php echo $cont?>anio" class="caja" style="width:100%" onChange="comprobarOtra('Ep<?php echo $cont?>anio','OtroEp<?php echo $cont?>anio')">
								  	      		<option value="0">
								  	      <?php
								  	      	include("rellenaranio.php")
								  	      ?>
								  	      		<option value="Otra">Otra
								  	      </select>
								  	      <input type="text" name="OtroEp<?php echo $cont?>anio" id="OtroEp<?php echo $cont?>anio" class="caja" value="" style="width:100%;display:none">
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:250">
					  	  					<input type="text" name="Ep<?php echo $cont?>centro" maxlength="20" class=caja value="" style="width:100%">
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:180">
								  	      <select name="Ep<?php echo $cont?>med" id="Ep<?php echo $cont?>med" class=caja style="width:100%" onChange="comprobarOtra('Ep<?php echo $cont?>med','OtroEp<?php echo $cont?>med')">
								  	      		<option value="0">
								  	      <?php
								  	      	include("rellenarmed.php")
								  	      ?>
								  	      		<option value="Otra">Otra
								  	      </select>
								  	      <input type="text" name="OtroEp<?php echo $cont?>med" id="OtroEp<?php echo $cont?>med" class="caja" value="" style="width:100%;display:none">
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:160">
								  	      <select name="Ep<?php echo $cont?>abs" id="Ep<?php echo $cont?>abs" class=caja style="width:100%" onChange="comprobarOtra('Ep<?php echo $cont?>abs','OtroEp<?php echo $cont?>abs')">
								  	      		<option value="0">
								  	      <?php
								  	      	include("rellenarabs.php")
								  	      ?>
								  	      		<option value="Otra">Otra
								  	      </select>
								  	      <input type="text" name="OtroEp<?php echo $cont?>abs" id="OtroEp<?php echo $cont?>abs" class="caja" value="" style="width:100%;display:none">
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center">
					  	  					<a href="javascript:abreVentana('Ep<?php echo $cont?>obs', 'historial')" style="color:#005;font-weight:bold">Incorporar</a>
					  	  					<input type="hidden" name="Ep<?php echo $cont?>obs" id="Ep<?php echo $cont?>obsTexto" value="">
					  	  					<?php
								  	  			for($i=1;$i<6;$i++)
								  	  			{
								  	  		?>
						  	  					<input type="hidden" name="Ep<?php echo $cont?>obsDocumento<?php echo $i?>" id="Ep<?php echo $cont?>obsDocumento<?php echo $i?>" value="">
						  	  					<input type="hidden" name="Ep<?php echo $cont?>obsDocumentoExt<?php echo $i?>" id="Ep<?php echo $cont?>obsDocumentoExt<?php echo $i?>" value="">
									  	  	<?php
								  	  			}
								  	  		?>
					  	  				</td>
					  	  				<td class=fichaden style="background-color:#ddd;text-align:center;width:20">&nbsp;</td>
		  	  						<tr>
		  	  					</table>
		  	  					</span>
		  	  				</td>
		  	  			</tr>
					  	  <?php
					  	  	}
					  	  ?>
		  	  		</table>
		  	  	</td>
		  	  </tr>
