<?php
session_start();
require_once 'classes/MainMenu.php';
require_once 'classes/Template.php';
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Alumnos - Error  ☠️</title>
        <?php Template::getCSS(); ?>
        <style>            
        .display-4 { word-wrap: break-word;}
        button:has(+ .collapse.show) { border-radius: 0.25rem 0.25rem 0 0; color: var(--gray); background: var(--gray-25); }
        .card { border-radius: 0 0.25rem 0.25rem 0.25rem; border-width: 2px; }
        </style>
    </head>
    <body>
        <?php $menuObj = new MainMenu(0, -1, -1, null);
        $menuObj->printMenu('',true); ?>
        <main class="container-fluid marco">            
            <div class="row justify-content-center">
                <img id="errorImg" class="col-sm-3" src="img/nico_error.svg" />
                <div class="col-sm-9 d-flex flex-column">                    
                    <div class="display-4 text-center p-2 mb-3"><?php if (isset($_SESSION['msg'])) print_r($_SESSION['msg']); else echo '¡Lo sentimos!<br>Se presentó un problema, por favor inténtalo más tarde.' ?></div>                
                    <a class="btn btn-azul1 display-6" href="index.php"><i class="ing-regresar mr-1 small"></i>Regresar a la página principal</a>
                </div>
                <div class="col-sm-12 mt-4">
                    <button class="btn btn-gris small" type="button" data-toggle="collapse" data-target="#collapseError" aria-expanded="false" aria-controls="collapseError"><i class="ing-ojo mr-1"></i>Ver Detalle del Error</button>
                    <div class="collapse" id="collapseError">
                        <div class="card card-body"><?php if (isset($_SESSION['error'])) print_r($_SESSION['error']); else echo 'Sin detalle' ?></div>
                    </div>
                </div>
            </div>
        </main>
        <div style="isolation: isolate;">
        <?php Template::footer(); ?>
        </div>
        <?php Template::getJS(); ?>
    </body>
</html>
<?php session_destroy();