public function actionValida() { $_REQUEST["XTPlantillaOpcion"] = 2; $localindex = new feindexModel(); $nombre_usuario = XTUtils::Request("usrnombre"); $clave = XTUtils::Request("usrpass"); $fila = $localindex->ValidaUsuarioEmpleado($nombre_usuario, $clave); if ($fila != null) { XTUtils::setSession("EMPUSERID", $fila["id_persona"]); XTUtils::setSession("EMPTIPONOMBRE", $fila["nombre_cargo"]); XTUtils::setSession("EMPAVATAR", $fila["avatar_persona"]); XTUtils::setSession("EMPNOMBRE_COMPLETO", "{$fila["persona_ncn"]}"); } header("Location: index.php"); }
<thead> <tr> <th scope="col" class="rounded-company">#</th> <th scope="col" class="rounded-company"> <input type="checkbox" id="todos" name="todos" onchange="seleccionar_check(this.checked,'tablaform')"> </th> <th scope="col" class="rounded">Tabla</th> <th scope="col" class="rounded">Vistas</th> <th scope="col" class="rounded"> </th> </tr> </thead> <?php for ($i = 0; $i < count($listado); $i++) { $fila = $listado[$i]; $estilofila = $i % 2 == 0 ? 'row0' : 'row1'; $i_item_pos = XTUtils::Request("xtpagcon") == '' ? 1 : XTUtils::Request("xtpagcon"); $i_item_pos = $i + 1 + ($i_item_pos - 1) * XTRECORD_x_PAGES; ?> <tr class="<?php echo $estilofila; ?> "> <td><?echo $i_item_pos?></td> <th scope="col" class="rounded-company"> <input type="checkbox" id="tabla_$i" name="tabla[]" value="<?php echo $fila[table_name]; ?> "> </th> <td><b><?php echo $fila[table_name];
static function Paginacion($total_registros, $parametros = array()) { $config = XTConfig::singleton(); $xtcom = XTUtils::Request("xtcom"); $app = XTUtils::Request("app"); $accion = XTUtils::Request("accion"); $pagina = $parametros["pagina"]; $params = $parametros["params"]; $sFileName = $parametros["url"]; $sFileName = $sFileName == "" ? "index.php" : $sFileName; $pagina = $pagina == "" ? XTUtils::Request("xtpagcon") : $pagina; $tam_paginacion = $parametros["tam_paginacion"]; $params = "&{$params}"; $pagina = $pagina == "" ? "1" : $pagina; if ($tam_paginacion == "") { $registros = XTRECORD_x_PAGES; } else { $registros = $tam_paginacion; } $total_paginas = ceil($total_registros / $registros); $sFileName = "{$sFileName}?app={$app}&xtcom={$xtcom}&accion={$accion}"; echo "<table class='paging-table' style='width:100%'>"; echo "<tfoot>\n"; echo "<tr>"; echo ' <th valign="middle" >'; if ($total_registros) { echo "<div style='float:left'> Total Registros: {$total_registros}</div><div style='float:right'>"; if ($pagina - 1 > 0) { echo "<a style=\"color:#2c4d79;text-decoration :none\" href='" . $sFileName . "&xtpagcon=" . ($pagina - 1) . $params . "'>Anterior</a> "; } if ($total_paginas < 10) { for ($i = 1; $i <= $total_paginas; $i++) { if ($pagina == $i) { echo "<strong style=\"font-size:14px\">" . $pagina . "</strong> "; } else { echo "<a style=\"color:#2c4d79\" href='" . $sFileName . "&xtpagcon=" . $i . $params . "'>{$i}</a> "; } } } if ($pagina + 1 <= $total_paginas) { echo " <a style=\"color:#2c4d79;text-decoration :none\" href='" . $sFileName . "&xtpagcon=" . ($pagina + 1) . $params . "'>Siguiente</a>"; } echo "</div>"; } echo "</th>"; echo "</tr>"; echo "<tfoot>\n"; echo "</table>"; }