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

mysql_select_db($database_cn, $cn);
mysql_query ("SET NAMES 'utf8'");
// Para tomar los datos del alumno
$sql = "SELECT id_alumno FROM alumnos WHERE cedula='$cedula'";
$rs = mysql_query($sql, $cn) or die(mysql_error());
$row = mysql_fetch_assoc($rs);
$id_alumno= $row["id_alumno"];

// Realizo la consulta de la Tabla materias filtrando con la carrera que se seleccion�.
$sql_pensum = "Select pensum From carreras_alumno where carreras_alumno.id_alumno = '$id_alumno' and status='ACTIVA'";

$rst_pensum = mysql_query($sql_pensum, $cn) or die(mysql_error());
//$row_materias = mysql_fetch_assoc($rst_materias);
$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["pensum"];		
			$array_selected2[$code]=  $pensum["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>";
}

?>