<?php require_once('Connections/cn.php'); ?>
<?php
	$cedula=$_GET['cedula'];

	mysql_select_db($database_cn, $cn);
	mysql_query ("SET NAMES 'utf8'");
 	$sql = "select apellidos, nombres from alumnos where cedula='$cedula'";

	$rs=mysql_query($sql, $cn);
	$row = mysql_fetch_assoc($rs);
	$reg=mysql_num_rows($rs);
	
	if ($reg != 0)
	 {
	 ?>
	 <script type="text/javascript">
		window.parent.document.form1.apellidos.value='<?php echo $row["apellidos"]; ?>';
		window.parent.document.form1.nombres.value='<?php echo $row["nombres"]; ?>';
	 </script>
	 <?php
	 }
	 else{
	     ?>
	 <script type="text/javascript">
	    msj="Cédula <<<?php echo $cedula; ?>>> no existe";
		alert(msj);
		window.parent.document.form1.cedula.focus();
		window.parent.document.form1.cedula.value="";
	 </script>
	 <?php
	 
	 }
?>