fix: Modify PHP to create User Table#37
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the admin users page (adminpanel_users.php) to adjust the rendered “users table” (user listing) and its columns.
Changes:
- Reformats
adminpanel_users.phpand modifies the users listing table header. - Attempts to add additional user fields (e.g., “Correo”) to the listing output.
- Introduces new table-row rendering content in the users loop.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <td><a href="javascript:void(0)" | ||
| onclick="go( 'adminpanel_edituser.php?user=<?=base64_encode($usuarios[$i]->usuario_id)?>' );return false">{{$usuarios[$i]->usuario_alias}}</a></td> | ||
| <td>{{getTipoUsuario($usuarios[$i]->usuario_tipo)}}</td> | ||
| <td>{{$usuarios[$i]->usuario_correo}}</td> | ||
| <td>{{$usuarios[$i]->usuario_telefono}}</td> | ||
| <td>{{$usuarios[$i]->usuario_direccion}}</td> | ||
| <td>{{count($userPonencias)}}</td> | ||
| <td>{{(trim($usuarios[$i]->usuario_ultimoacceso) != "" ? $usuarios[$i]->usuario_ultimoacceso : $_i18n["notavailable"])}}</td> |
There was a problem hiding this comment.
The row markup mixes Blade-style output tags ({{ ... }} / {{$...}}) inside a plain PHP template. In this codebase, user fields are rendered with PHP short echo tags (e.g., <?=$usuarios[$i]->usuario_alias?>). As written, the table will literally print the curly braces instead of the user data.
| <tr class="" id="ARTICLE_COLLECTION_SELECTION_<?=$i?>"> | ||
| <td></td> | ||
| <td><input value="true" | ||
| name="COLLECTION_SELECTION_<?=$i?>.<?=base64_encode($usuarios[$i]->usuario_id)?>" | ||
| onclick="cbTbl.selectOne(this); updateDeleteButtons(this);" | ||
| type="checkbox"></td> | ||
| <td><a href="javascript:void(0)" | ||
| onclick="go( 'adminpanel_edituser.php?user=<?=base64_encode($usuarios[$i]->usuario_id)?>' );return false">{{$usuarios[$i]->usuario_alias}}</a></td> | ||
| <td>{{getTipoUsuario($usuarios[$i]->usuario_tipo)}}</td> | ||
| <td>{{$usuarios[$i]->usuario_correo}}</td> | ||
| <td>{{$usuarios[$i]->usuario_telefono}}</td> | ||
| <td>{{$usuarios[$i]->usuario_direccion}}</td> | ||
| <td>{{count($userPonencias)}}</td> | ||
| <td>{{(trim($usuarios[$i]->usuario_ultimoacceso) != "" ? $usuarios[$i]->usuario_ultimoacceso : $_i18n["notavailable"])}}</td> | ||
| <td></td> | ||
| <td><input value="true" | ||
| name="COLLECTION_SELECTION_<?=$i?>.<?=base64_encode($usuarios[$i]->usuario_id)?>" | ||
| onclick="cbTbl.selectOne(this); updateDeleteButtons(this);" | ||
| type="checkbox"></td> | ||
| <td><a href="javascript:void(0)" |
There was a problem hiding this comment.
This <tr> currently contains two separate sets of cells/checkboxes (one using {{...}} and then the original <?=...?> version), plus extra columns (correo/telefono/direccion) that don't align with the header. This will break the table layout and likely the delete-selection logic (duplicate COLLECTION_SELECTION_... inputs per row). Remove the duplicated block and ensure each row outputs exactly one checkbox and the same number/order of <td> cells as the header.
| <tr> | ||
| <th id="header"></th> | ||
| <th id="header" style="width: 3%"><input value="" name="select_all" | ||
| onclick="cbTbl.selectAll(this); updateDeleteButtons(this);" | ||
| type="checkbox"></th> | ||
| <th id="header" style="width: 30%"><?=$_i18n["name"]?></th> | ||
| <th id="header">Tipo</th> | ||
| <th id="header">Correo</th> | ||
| <th id="header"><?=$_i18n["lastaccess"]?></th> | ||
| </tr> |
There was a problem hiding this comment.
The column headers were changed to include "Correo", but the header no longer matches the data being rendered (the row still includes ponencias count and now also telefono/direccion). Update the <th> set to match the final columns you want to display, and ensure the bottom/upper colspan values remain consistent with the column count.
| <?php | ||
| $usuarios = $db->get_results("select * from usuarios where usuario_tipo <> 1" ); | ||
| ?> | ||
| <form id="list" name="deleteItems" | ||
| action="adminpanel_process.php?sale=<?=base64_decode($values["cid"])?>" | ||
| method="post"> |
There was a problem hiding this comment.
PR title/description indicate "create User Table", but this change only alters the admin users listing markup and does not create/modify any database table (e.g., schema in install/update.php). If the goal is schema creation, the PR needs to include the corresponding DDL/migration; otherwise, please update the PR description/title to reflect that this is a UI/table rendering change.
Automated fix by CoderOps.
Swarm: swarm50
Task: Modify PHP to create User Table