예제 #1
0
<?php

session_start();
if (isset($_SESSION['registrado'])) {
    require_once "clases/AccesoDatos.php";
    require_once "clases/usuarios.php";
    $arrayUsuario = usuarios::TraerUsuarios();
    ?>
<!--
<script type="text/javascript">
$("#content").css("width", "900px");
</script>
-->
<table class="table" style=" background-color: beige;">
	<thead>
		<tr>
			<th>Editar</th><th>Borrar</th><th>Nombre</th><th>Correo</th><th>Clave</th><th>Tipo</th><th>Foto</th>
		</tr>
	</thead>
	<tbody>

		<?php 
    foreach ($arrayUsuario as $usuarios) {
        echo "<tr>\n\t\t\t<td><a onclick='EditarUSUARIO({$usuarios->id})' class='btn btn-warning'> <span class='glyphicon glyphicon-pencil'>&nbsp;</span>Editar</a></td>\n\t\t\t";
        if ($usuarios->tipo == "admin") {
            echo "<td><a onclick='BorrarUSUARIO({$usuarios->id})' class='btn btn-danger'> <span class='glyphicon glyphicon-trash'>&nbsp;</span>Borrar</a></td>";
        } else {
            echo "<td> </td>";
        }
        echo "\n\t\t\t<td>{$usuarios->nombre}</td>\n\t\t\t<td>{$usuarios->correo}</td>\n\t\t\t<td>{$usuarios->clave}</td>\n\t\t\t<td>{$usuarios->tipo}</td>\n\t\t\t<td><img src=Fotos/{$usuarios->foto} heigth=80 width=80></td> \n\t\t\t<td>{$usuarios->id}</td>\n\n\t\t</tr>";
    }