<?php
$tp_nomgrup=$sesion->getVar('configuracion.nombres_grupos');
$mayus_nom=$sesion->getVar('configuracion.format_nom');
$sql='SELECT
			lcase(aca_estudiantes.apellido1_est) as ape1_est,
			lcase(aca_estudiantes.apellido2_est) as ape2_est,
			lcase(aca_estudiantes.nombre1_est) as nom1_est,
			lcase(aca_estudiantes.nombre2_est) as nom2_est,
			aca_estudiantes.fechnacimiento_est,
			aux_tipos_identificacion.nom_tipoiden,
			aca_estudiantes.numedocumento_est,
			if(aca_estudiantes.genero_est="M","Masculino","Femenino") as genero,
			aca_estudiantes.direccion_est,
			aca_estudiantes.telefono_est,
			aca_estudiantes.celular_est,
			aca_estudiantes.mail_est,
			(SELECT CONCAT(aux_mpios.nom_mpio," - ", aux_cen_poblados.nom_poblado) FROM aux_cen_poblados INNER JOIN aux_mpios ON aux_cen_poblados.cod_mpio = aux_mpios.cod_mpio where aux_cen_poblados.cod_cen_poblado=aca_estudiantes.municiresidencia_est) as mpiorec,
			view_datos_grupos.nom_grado,
			view_datos_grupos.'.$tp_nomgrup.' as nom_grup,
			view_datos_grupos.nom_sede,
			view_datos_grupos.nom_jornada
			FROM
			aca_estudiantes
			INNER JOIN aca_estudiantesxgrupos ON aca_estudiantesxgrupos.cod_estudiante = aca_estudiantes.cod_estudiante
			INNER JOIN view_datos_grupos ON aca_estudiantesxgrupos.cod_grupo = view_datos_grupos.cod_grupo
			INNER JOIN aux_tipos_identificacion ON aca_estudiantes.tipodocumento_est = aux_tipos_identificacion.ide_tipoiden
			WHERE aca_estudiantes.numedocumento_est='.$sesion->get('ac_identidad').' LIMIT 1';
		
		//echo $sql;
		$academia = bootstrap::initBd($sesion->get('anio'));
		$academia->instruccion($sql);
		$dtsEst=$academia->extraer_registro();	
?>
<script type="text/javascript">
$(function(){
	$('#TbhvEst').tabs({  
        border:false, 
		tabPosition:'left',  
    });  
});
</script>

<div id="TbhvEst" class="easyui-tabs" style="width:900px;height:650px">
	<div title="Información Básica" style="padding:10px">
		<table border="0" align="center" class="table table-bordered table-condensed valing-top" >
			<tr>
				<td colspan="2" ><span class="tit1"><?php echo $dtsLang['globals']['tip_doc'] ?></span>
					<div><?php echo $dtsEst['nom_tipoiden'] ?></div></td>
				<td><span class="tit1"><?php echo $dtsLang['globals']['num_doc'] ?></span>
					<div><?php echo $dtsEst['numedocumento_est'] ?></div></td>
				<td colspan="2"><span class="tit1"><?php echo $dtsLang['globals']['fec_nac'] ?></span>
					<div><?php echo $dtsEst['fechnacimiento_est'] ?></div></td>
			</tr>
			<tr>
				<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['pri_ape'] ?></span>
					<div><?php echo formatoPalabras($dtsEst['ape1_est'],$mayus_nom) ?></div></td>
				<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['seg_ape'] ?></span>
					<div><?php echo formatoPalabras($dtsEst['ape2_est'],$mayus_nom) ?></div></td>
				<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['pri_nom'] ?></span>
					<div><?php echo formatoPalabras($dtsEst['nom1_est'],$mayus_nom) ?></div></td>
				<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['seg_nom'] ?></span>
					<div><?php echo formatoPalabras($dtsEst['nom2_est'],$mayus_nom) ?></div></td>
				<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['sexo'] ?></span>
					<div>
						<div class="tit2">
							<input name="txt_genero_est" type="radio" value="M" <?php echo trim($dtsEst['genero'])=='M' ? 'checked="checked"' : ''  ?> />
							<?php echo $dtsLang['globals']['sexo_h'] ?>
							<input name="txt_genero_est" type="radio" id="radio5" value="F" <?php echo trim($dtsEst['genero'])=='F' ? 'checked="checked"' : ''  ?> />
							<?php echo $dtsLang['globals']['sexo_m'] ?> </div>
					</div></td>
			</tr>
		</table>
		<table align="center" class="table table-bordered table-condensed valing-top">
			<thead>
				<tr>
					<th colspan="3" align="center"><?php echo $dtsLang['globals']['info_matricula'] ?></th>
				</tr>
			</thead>
			<tr>
				<td><span class="tit1"><?php echo $dtsLang['globals']['name_sede'] ?></span>
					<div><?php echo ucwords($dtsEst['nom_sede']) ?></div></td>
				<td><span class="tit1"><?php echo $dtsLang['globals']['name_jornada'] ?></span>
					<div><?php echo ucwords($dtsEst['nom_jornada']) ?></div></td>
				<td><span class="tit1"><?php echo $dtsLang['globals']['grupo'] ?></span>
					<div><?php echo $dtsEst['nom_grado'] ." ". $dtsEst['nom_grup'] ?></div></td>
			</tr>
		</table>
		<table align="center" class="table table-bordered table-condensed valing-top " >
			<tr class="ui-widget-header" >
				<td colspan="3" align="center"><?php echo $dtsLang['globals']['dt_nacimiento'] ?></td>
			</tr>
			<tr class="tit1">
				<td align="left" ><?php echo $dtsLang['globals']['dpto'] ?>
					<div>
						<select name="txtdptonac" class="tit2" id="txtdptonac" style="width:160px">
						</select>
					</div></td>
				<td align="left"><?php echo $dtsLang['globals']['mpio'] ?>
					<div>
						<select name="txtmpionac" class="tit2" id="txtmpionac" style="width:160px">
						</select>
					</div></td>
				<td align="left"><?php echo $dtsLang['globals']['pob'] ?>
					<div>
						<select name="txtpobnac" class="tit2" id="txtpobnac" style="width:160px">
						</select>
					</div></td>
			</tr>
			<tr>
				<td colspan="3" align="center" class="ui-widget-header"><?php echo $dtsLang['globals']['documento'] ?></td>
			</tr>
			<tr>
				<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['pais'] ?></span>
					<div>
						<select name="txtpais" class="tit2" id="txtpais" style="width:160px" >
							<?php
				$cmps="cod_pais,nom_pais";
				$ord='ORDER BY nom_pais ASC';
				$tabla="aux_pais";
				$cmpcnd="";
				$default=empty($lugexpedoc_est) ? $dtsLang['default']['pais'] : substr($lugexpedoc_est,0,3);
				mostrar_cont_selec($cmps, $tabla,$cmpcnd, $ord,$default,false,'',0);
			?>
						</select>
					</div></td>
				<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['dpto'] ?></span>
					<div>
						<select name="txtdpto" class="tit2" id="txtdpto" style="width:160px" >
						</select>
					</div></td>
				<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['mpio'] ?></span>
					<div>
						<select name="txtmpio" class="tit2" id="txtmpio" style="width:160px">
						</select>
					</div></td>
			</tr>
			<tr class="tit1">
				<td colspan="3" align="center" class="ui-widget-header"><?php echo $dtsLang['globals']['dt_corre'] ?></td>
			</tr>
			<tr>
				<td colspan="3" align="center" class="tit2"><table width="100%" border="0" cellpadding="2">
						<tr>
							<td align="left" class="tit1"><?php echo $dtsLang['globals']['pais'] ?>
								<div>
									<select name="txtpaiscor" class="tit2" id="txtpaiscor" style="width:160px">
										<?php
			$cmps="cod_pais,nom_pais";
			$ord='ORDER BY nom_pais ASC';
			$tabla="aux_pais";
			$cmpcnd="";
			$default=empty($lugcorespondencia) ? $dtsLang['default']['pais'] : substr($lugcorespondencia,0,3);
			mostrar_cont_selec($cmps, $tabla,$cmpcnd, $ord,$default,false,'',0);
			?>
									</select>
								</div></td>
							<td align="left" class="tit1"><?php echo $dtsLang['globals']['dpto'] ?>
								<div>
									<select name="txtdptocor" class="tit2" id="txtdptocor" style="width:160px">
									</select>
								</div></td>
							<td align="left" class="tit1"><?php echo $dtsLang['globals']['mpio'] ?>
								<div>
									<select name="txtmpiocor" class="tit2" id="txtmpiocor" style="width:160px">
									</select>
								</div></td>
							<td align="left" class="tit1"><?php echo $dtsLang['globals']['pob'] ?>
								<div>
									<select name="txtpobcor" class="tit2" id="txtpobcor" style="width:160px">
									</select>
								</div></td>
							<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['zona'] ?></span><span class="estilo2">
								<div class="tit2">
									<input name="txt_zon_est" type="radio" value="1" <?php echo trim($zon_est)=='1' ? 'checked="checked"' : ''  ?> />
									<?php echo $dtsLang['globals']['zona_u'] ?>
									<input name="txt_zon_est" type="radio" id="radio" value="2" <?php echo trim($zon_est)=='2' ? 'checked="checked"' : ''  ?> />
									<?php echo $dtsLang['globals']['zona_r'] ?></div>
								</span></td>
						</tr>
						<tr>
							<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['celular'] ?></span>
								<div>
									<input name="txt_celular_est" type="text" class="tit2" id="txt_celular_est" size="15" maxlength="12" value="<?php echo $celular_est ?>" />
								</div></td>
							<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['telefono'] ?></span>
								<div>
									<input name="txt_telefono_est" type="text" class="tit2" id="txt_telefono_est" size="20" maxlength="15" value="<?php echo $telefono_est ?>" />
								</div></td>
							<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['direccion'] ?></span>
								<div>
									<input name="txt_direccion_est" type="text" class="tit2" id="txt_direccion_est" size="28" value="<?php echo $direccion_est ?>"/>
								</div></td>
							<td align="left"><span class="tit1"><?php echo $dtsLang['globals']['mail'] ?></span>
								<div>
									<input name="txt_mail_est" type="text" class="tit2" id="txt_mail_est" size="28"  value="<?php echo $mail_est ?>" />
								</div></td>
							<td align="left">&nbsp;</td>
						</tr>
					</table></td>
			</tr>
			<tr>
				<td colspan="3" align="center" class="tit2"><table width="100%" border="0" align="left">
						<tr>
							<td colspan="2"><div class="tit1">Imagen Avatar:</div></td>
						</tr>
						<tr>
							<td width="10%"><img src="<?php echo ($foto_est!='') ? 'img_avatar/'.$foto_est : 'img_avatar/avatar.png' ?>" alt="user" width="61" height="72" /></td>
							<td width="90%"><input name="fileToUpload" type="file" id="fileToUpload" size="50" />
								<input type="hidden" name="txtext" id="txtext" /></td>
						</tr>
					</table></td>
			</tr>
		</table>
	</div>
	<div title="My Documents" style="padding:10px">
		<ul class="easyui-tree" data-options="animate:true">
		</ul>
	</div>
	<div title="Help" data-options="iconCls:'icon-help'" style="padding:10px"> </div>
</div>
