<?php

require_once("../includes/clase_sesion.php");
$sesion = new sesion(); // inicio la sesion
require_once("../includes/MySQL.php");
$academia = new Servidor_Base_Datos(AC_CONN_HOST, AC_CONN_USER, AC_CONN_PASS, AC_CONN_DB . "" . $sesion->get('anio'));

$sede = $_GET['sede'];
$ban = isset($_GET["opt"]) ? $_GET["opt"] : 0;
$wh = ' and view_datos_grupos.cod_sede=' . $sede;
$sql = 'SELECT DISTINCT view_datos_grupos.cod_jornada as cdjorn, view_datos_grupos.nom_jornada as nomjor FROM view_datos_grupos where 1=1';

switch ($ban) {
    case 1:
        $wh .= " and view_datos_grupos.cod_director=" . $_GET["cdir"];
        break;
    default:
        
        break;
}

$sql = $sql . $wh;

$academia->instruccion($sql);
while ($reg = $academia->extraer_registro()) {
    echo "<option value='" . $reg['cdjorn'] . "'>" . $reg['nomjor'] . "</option>";
}
$academia->liberar();
$academia->cerrar();
?>