<a href="index.php?view=index&opt=new" class="btn btn-default"><i class='glyphicon glyphicon-user'></i> Nuevo</a> <a href="javascript:void()" id="selectedall" class="btn btn-default"><i class='glyphicon glyphicon-th-list'></i> Seleccionar todos</a> <a href="javascript:void()" id="delselected" class="btn btn-default"><i class='glyphicon glyphicon-remove'></i> Eliminar seleccionados</a> <br><br> <?php $users = UserData::getAll(); if(count($users)>0){ ?> <div class="box box-primary"> <table class="table table-bordered datatable table-hover"> <thead> <th> </th> <th>Nombre completo</th> <th>Nombre de usuario</th> <th></th> </thead> <?php foreach($users as $user){ ?> <tr id="tr_<?php echo $user->id; ?>"> <!-- Agregamos el ID del usuario en el ID del elemento TR --> <td style="width: 30px; "> <input type="checkbox" id="item_<?php echo $user->id; ?>" class="myitem"> <!-- Agreamos el ID del usuario en el ID del check, ademas una clase --> </td> <td><?php echo $user->name." ".$user->lastname; ?></td> <td><?php echo $user->username; ?></td> <td style="width:120px;"> <a href="index.php?view=index&opt=edit&id=<?php echo $user->id;?>" class="btn btn-warning btn-xs">Editar</a> <a href="index.php?action=users&opt=del&id=<?php echo $user->id;?>" class="btn btn-danger btn-xs">Eliminar</a> </td> </tr> <?php } echo "</table></div>"; }else{ ?> <p class="alert alert-warning">No hay usuarios.</p> <?php } ?>