<?php require('classes/main.php'); ?>
<?php require('classes/adminCheck.php'); ?>
<?php require('classes/administration.php'); ?>
<!DOCTYPE html>
<html>
<?php require('common/head.php'); ?>

<body>
    <?php require('common/header.php'); ?>
    <h1>Administración - Especialidades</h1>
    <?php
    $idsubject = isset($_GET['idsubject']) ? (int) $_GET['idsubject'] : 0;
    if($idsubject > 0) {
        echo $main->formOpen('?saveSubjectReferences');
        $subjects = $main->subjects($idsubject); ?>
    <input name="idsubject" type="hidden" class="input" value="<?php echo $idsubject; ?>">
    <div class="input box-radius login-form">
        <div class="form-grp">
            <div class="form-input">
                <span>Referencias de perfil de egreso especialidad</span>
            </div>
        </div>
        <div class="form-grp">
            <div class="form-input">
                <input name="subject" type="text" class="input" placeholder="Especialidad"
                    value="<?php echo isset($subjects[$idsubject]['subject']) ? $subjects[$idsubject]['subject'] : ''; ?>">
            </div>
        </div>
        <div class="form-grp">
            <div class="form-input text-center">
                <input type="button" class="btn btn-return" value="Volver a especialidades"
                    onclick="window.location = '<?php echo $_SERVER['PHP_SELF']?>';">
            </div>
            <div class="form-input text-center">
                <input type="submit" class="btn btn-success" value="Guardar">
            </div>
        </div>
    </div>
    <?php echo $main->formClose(); ?>
    <?php } else {
        $main->header('admin-subject.php');
    } ?>
    <?php require('common/footer.php'); ?>
</body>

</html>