1 | <?php |
2 | |
3 | require_once __DIR__ . "/../lib/php/ejecutaServicio.php"; |
4 | require_once __DIR__ . "/bd/rolConsulta.php"; |
5 | |
6 | ejecutaServicio(function () { |
7 | $lista = rolConsulta(); |
8 | $render = ""; |
9 | foreach ($lista as $modelo) { |
10 | $id = htmlentities($modelo->id); |
11 | $descripcion = htmlentities($modelo->descripcion); |
12 | $render .= |
13 | "<p> |
14 | <label style='display: flex'> |
15 | <input type='checkbox' name='rolIds[]' value='$id'> |
16 | <span> |
17 | <strong>$id</strong> |
18 | <br>$descripcion |
19 | </span> |
20 | </label> |
21 | </p>"; |
22 | } |
23 | return ["roles" => ["innerHTML" => $render]]; |
24 | }); |
25 | |