?>

<div class="container">
    <?php 
$conn = dbConnect();
echo '<h3>Eventos creados</h3>';
echo '<hr>';
$sql = "SELECT * FROM usuario WHERE id={$idUsuario}";
$resultado = mysqli_query($conn, $sql);
if ($resultado) {
    $usuario = mysqli_fetch_assoc($resultado);
    $tipoUsuario = $usuario['tipo'];
    if ($tipoUsuario == 'Administrador') {
        header('Location: gestionEventos.php');
    }
    cargarBotonesMiCuenta($tipoUsuario);
    ?>
        <script>document.getElementById("buttonEventosCreados").className += " active";</script>
        <table class="table table-striped">
    	<thead>
    	    <tr>
    		<th class="col20">Nombre</th>
    		<th class="col10">Ubicación</th>
    		<th class="col10">Fecha</th>
    		<th class="col10">Precio</th>
    		<th class="col10">Asistentes</th>
    		<th class="col10"></th>
    	    </tr>
    	</thead>
    	<tbody>
		<?php 
<?php

$seccion = "";
include 'header.php';
include_once './libs/myLib.php';
if (!isset($_SESSION['idUsuario'])) {
    session_start();
}
if (isset($_SESSION['idUsuario'])) {
    $idUsuario = $_SESSION['idUsuario'];
} else {
    header('Location: index.php');
}
?>

<div class="container">
    <h3>Mi cuenta</h3>
    <hr>
    <?php 
$conn = dbConnect();
$sql = "SELECT * FROM usuario WHERE id={$idUsuario}";
$resultado = mysqli_query($conn, $sql);
if ($resultado) {
    $usuario = mysqli_fetch_assoc($resultado);
    cargarBotonesMiCuenta($usuario['tipo']);
}
?>
</div>

<?php 
include 'footer.php';