Exemplo n.º 1
0
function index($columnas, $vista, $modulo, $bol = false)
{
    $res = pg_query("select * from {$vista}");
    $nfilas = pg_num_rows($res);
    $npags = ceil($nfilas / FPP);
    extract(recoger_parametros($columnas, $modulo, $npags));
    $params = compact('columnas', 'columna', 'criterio', 'orden', 'sentido', 'npag');
    formulario_busqueda($params);
    list($where, $pqp) = filtro($columnas, $columna, $criterio);
    $res = pg_query_params("select * from {$vista}\n                             where {$where}\n                          order by {$orden} {$sentido}\n                          limit " . FPP . "\n                          offset " . FPP . "*({$npag}-1)", $pqp);
    $params['npags'] = $npags;
    $params['res'] = $res;
    generar_resultado($params, $bol);
    if (!$bol) {
        ?>
        <a href="insertar.php"><input type="button" value="Insertar" /></a><?php 
    }
    if (es_admin()) {
        volver();
    }
}
<?php

require_once './initSmarty.php';
require_once './datos.php';
try {
    session_start();
    if (isset($_SESSION['usuario'])) {
        $smarty->assign('nombreUsuario', get_nombre_usuario());
        $smarty->assign('admin', es_admin());
        $smarty->assign('movimientos', get_movimientos_cuenta(0, 8, 0));
        $smarty->assign('id', $_GET['cuenta']);
        agregar_ingreso_seccion(date('Y-m-d'), get_nombre_usuario(), 'Detalle de cuenta', 'Cuenta ' . $_GET['cuenta']);
        $smarty->display('detalleCuenta.tpl.html');
    } else {
        header('location: ./index.php');
    }
} catch (Exception $ex) {
    echo $ex->getMessage();
}
Exemplo n.º 3
0
    echo ucwords(strtolower($usuario["nombre"]));
    ?>
</h2>

<ul class="perfil">
	<li><?php 
    echo ucfirst(strtolower($usuario["email"]));
    ?>
</li>
	<li><?php 
    echo ucfirst(strtolower($usuario["nick"]));
    ?>
</li>
	
		<?php 
    if (es_admin($usuario["nick"])) {
        ?>
 
					<li><a href="admin.php">Panel de administración</a></li>
					<?php 
    }
    ?>
	</li>
</ul>

<?php 
    if (isset($_GET["errores"])) {
        $error = $_GET["errores"];
    }
    $errores = [];
    include "includes/formulario_foto.php";