<?php session_start(); ?>
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Editar Estudiante</title>
    <link rel="stylesheet" href="<?php echo URL_PATH; ?>/public/css/form.css">
    <link rel="stylesheet" href="<?php echo URL_PATH; ?>/public/css/admin.css">
    <link rel="stylesheet" href="<?php echo URL_PATH; ?>/public/colors.css">
    <link rel="stylesheet" href="<?php echo URL_PATH; ?>/public/menu.css">
    <link rel="stylesheet" href="<?php echo URL_PATH; ?>/public/app.css">
    <style>
      
    </style>
</head>
<body>
    <?php include APP_PATH .'/views/components/navbar.php'; ?>
    
    <div class="main-content">
        <div class="form-container">
            <h1 class="page-title">Editar Estudiante</h1>
            
            <div class="form-card">
                <div class="form-header">
                    <h3>Información del Estudiante</h3>
                </div>
                <form action="<?php echo URL_PATH; ?>/Student/update" method="POST">
                    <div class="form-group">
                        <label for="email">Codigo Estudiante</label>
                        <input type="text" id="codigo" name="codigo" placeholder="codigo" value="<?php echo $data['students'][0]['CodigoEstudiante']; ?>">
                    </div>
                    <div class="form-group">
                        <label for="email">Nombre</label>
                        <input type="text" id="text " name="nombre" placeholder="nombre" value="<?php echo $data['students'][0]['Nombre']; ?>">
                    </div>

                    <div class="form-group">
                        <label for="role">Estado Academico</label>
                        <select id="role" name="estado_academico">
                            <?php foreach ($data['estados'] as $estado): ?>
                                <option value="<?php echo $estado['EstadoAcademicoId']; ?>"><?php echo $estado['NombreEstado']; ?></option>
                            <?php endforeach; ?>
                        </select>
                    </div>

                    <div class="form-group">
                        <label for="country">Programa</label>
                        <select id="country" name="programa">
                            <?php foreach ($data['programas'] as $programa): ?>
                                <option value="<?php echo $programa['ProgramaId']; ?>"><?php echo $programa['Nombre']; ?></option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="role">Acuerdo</label>
                        <select id="role" name="acuerdo">
                            <?php foreach ($data['acuerdos'] as $acuerdo): ?>
                                <option value="<?php echo $acuerdo['AcuerdoId']; ?>"><?php echo $acuerdo['NombreAcuerdo']; ?></option>
                            <?php endforeach; ?>
                        </select>
                    </div>


                    <div class="form-submit">
                        <button type="submit" class="btn-submit">
                            Enviar
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <?php include APP_PATH .'/views/components/footer.php'; ?>
    <script>
        // Apenas carga la página
        document.addEventListener("DOMContentLoaded", function() {
            document.getElementById("codigo").readOnly = true;
        });
    </script>
</body>
</html>
