<?php require_once('Connections/cn.php'); ?>
<?php
	$id_materia=$_GET['id_materia'];
	$id_carrera=$_GET['id_carrera'];
	$id_correquisito=$_GET['id_correquisito'];
	mysql_select_db($database_cn, $cn);
	mysql_query ("SET NAMES 'utf8'");
 	$sql = "select * from correquisitos where id_carrera='$id_carrera' and id_materia='$id_materia' and id_correquisito='$id_correquisito'";
 	$rs=mysql_query($sql, $cn);
	$reg=mysql_num_rows($rs);
	if ($reg != 0)
	 {
	 ?>
	 <script type="text/javascript">
	 	 msj="Correquisito "+'<?php echo $id_materia; ?>' +" ya existe"
	 	alert(msj);
		window.parent.document.addco.id_materia.focus();
		window.parent.document.addco.id_materia.value=0;
	 </script>
	 <?php
	 }
?>