<?php require_once('Connections/cn.php'); ?>
<?php
// header("Content-Type:text/html; charset=UTF-8");
header("Content-Type:text/html; charset=utf-8");
$carrera= $_REQUEST["id"];

mysql_select_db($database_cn, $cn);
mysql_query ("SET NAMES 'utf8'");

// Realizo la consulta de la Tabla materias filtrando con la carrera que se seleccion�.
$sql_pensum = "Select nro_pensum from pensum where id_carrera = '$carrera' and status='VIGENTE'";

$rst_pensum = mysql_query($sql_pensum, $cn) or die(mysql_error());
$total_rows_pensum = mysql_num_rows($rst_pensum);  

if($total_rows_pensum >0)
{
	$array_selected1 = array(0=>"SELECCIONE...");
	$array_selected2 = array(0=>"0");
	$code=1;
	while($pensum = mysql_fetch_assoc($rst_pensum))
		{
		
			$array_selected1[$code] = $pensum["nro_pensum"];		
			$array_selected2[$code]=  $pensum["nro_pensum"];	
			$code += 1;
		}
}		

// Bucle para cargar el número de pensum en el combo.
for ($i=0; $i<count($array_selected1);$i++){
	echo "<option value=".$array_selected1[$i].">".$array_selected1[$i]."</option>";
}

?>