<?php require_once('Connections/conn.php'); ?>
<?php
session_start();
$cedula_usuario=$_SESSION['CEDULA_USUARIO'];
$sede=$_SESSION['SEDE_USUARIO'];

mysql_select_db($database_conn, $conn);
mysql_query ("SET NAMES 'utf8'");
//para tomar el id del alumno
$sql = "SELECT id_alumno,apellidos,nombres FROM alumnos WHERE cedula='$cedula_usuario'";
$rs = mysql_query($sql, $conn) or die(mysql_error());
$row = mysql_fetch_assoc($rs);
$id_alumno= $row['id_alumno'];
$nombres_alumno=$row['apellidos'].', '.$row['nombres'];;

//fin

$query_rstCarreras = "SELECT carreras_alumno.id_carrera, carreras.nombre_carrera FROM carreras_alumno,carreras WHERE carreras_alumno.id_carrera=carreras.id_carrera AND carreras_alumno.id_alumno='$id_alumno' ORDER BY nombre_carrera";
$rstCarreras = mysql_query($query_rstCarreras, $conn) or die(mysql_error());
$row_rstCarreras = mysql_fetch_assoc($rstCarreras);
$totalRows_rstCarreras = mysql_num_rows($rstCarreras);



 session_start();
  if (isset($_GET["order"])) $order = @$_GET["order"];
  if (isset($_GET["type"])) $ordtype = @$_GET["type"];

  if (isset($_POST["filter"])) $filter = @$_POST["filter"];
  if (isset($_POST["filter_field"])) $filterfield = @$_POST["filter_field"];
  $wholeonly = false;
  if (isset($_POST["wholeonly"])) $wholeonly = @$_POST["wholeonly"];

  if (!isset($order) && isset($_SESSION["order"])) $order = $_SESSION["order"];
  if (!isset($ordtype) && isset($_SESSION["type"])) $ordtype = $_SESSION["type"];
  if (!isset($filter) && isset($_SESSION["filter"])) $filter = $_SESSION["filter"];
  if (!isset($filterfield) && isset($_SESSION["filter_field"])) $filterfield = $_SESSION["filter_field"];

?>

<html>
<head>
<title>sadce -- carga de calificaciones</title>
<meta name="generator" http-equiv="content-type" content="text/html">
<style type="text/css">
  body {
    background-color: #FFFFFF;
    color: #004080;
    font-family: Arial;
    font-size: 12px;
  }
  .bd {
    background-color: #FFFFFF;
    color: #004080;
    font-family: Arial;
    font-size: 12px;
  }
  .tbl {
    background-color: #FFFFFF;
  }
  a:link { 
    color: #FF0000;
    font-family: Arial;
    font-size: 12px;
  }
  a:active { 
    color: #0000FF;
    font-family: Arial;
    font-size: 12px;
  }
  a:visited { 
    color: #800080;
    font-family: Arial;
    font-size: 12px;
  }
  .hr {
    background-color: #336699;
    color: #FFFFFF;
    font-family: Arial;
    font-size: 12px;
  }
  a.hr:link {
    color: #FFFFFF;
    font-family: Arial;
    font-size: 12px;
  }
  a.hr:active {
    color: #FFFFFF;
    font-family: Arial;
    font-size: 12px;
  }
  a.hr:visited {
    color: #FFFFFF;
    font-family: Arial;
    font-size: 12px;
  }
  .dr {
    background-color: #FFFFFF;
    color: #000000;
    font-family: Arial;
    font-size: 12px;
  }
  .sr {
    background-color: #FFFFCF;
    color: #000000;
    font-family: Arial;
    font-size: 12px;
  }
</style>
</head>
<body>
<table class="bd" width="100%" align="center"><tr><td class="hr"><h2 align="left">&nbsp;Reporte de Pagos</h2></td></tr></table>
<form name="situacion" method="post" action="">
  <table width="40%" border="0" align="center" id="carga" cellpadding="1" cellspacing="10" style="border:1px solid #ccc;">
    
    <tr>
      <td>Participante:</td>
      <td colspan="5"><label>
        <?php echo htmlspecialchars($nombres_alumno) ?>
      </label></td>
    </tr>
	
    <tr>
      <td width="59"><div align="right">Programa:</div></td>
      <td width="548" colspan="5"><label>
        <select name="id_carrera" id="id_carrera" style="width:350px">
		<option value="0">Seleccione...</option>
          <?php
do {  
?>
          <option value="<?php echo $row_rstCarreras['id_carrera']?>"><?php echo $row_rstCarreras['nombre_carrera']?>&nbsp;(<?php echo $row_rstCarreras['id_carrera']?>)</option>
          <?php
} while ($row_rstCarreras = mysql_fetch_assoc($rstCarreras));
  $rows = mysql_num_rows($rstCarreras);
  if($rows > 0) {
      mysql_data_seek($rstCarreras, 0);
	  $row_rstCarreras = mysql_fetch_assoc($rstCarreras);
  }
?>
        </select>
      </label></td>
    </tr>
    
    <tr>
      <td height="34" colspan="6"><div align="center">
        <label>
        <input name="Enviar" type="button" id="Enviar" value="Consultar" onClick="imprimir_situacion(<?php echo $id_alumno ?>)" >
        </label>
      </div></td>
    </tr>
  </table>
    <div align="center"></div>
  <div align="center"></div>
</form>
<p>&nbsp;</p>
<?php
mysql_free_result($rstCarreras);
?>
</body>
</html>

<script type="text/javascript">
 function imprimir_situacion(id_alumno)
 {
      if(document.situacion.id_carrera.value==0){
			alert("El campo <<Programa>> es obligatorio");
			document.situacion.id_carrera.value==0;
			document.situacion.id_carrera.focus();
			return false;
			}
		
 	url="modelo/class_pdf/pagos_del_alumno.php?carrera="+document.situacion.id_carrera.value+"&id_alumno="+id_alumno;
	window.open(url);
	//window.location=url;
 }
</script>
