示例#1
0
function ChangeAlbunsPage($var, $action)
{
    $marca = $_SESSION['marca'];
    $categoria = $_SESSION['categoria'];
    $albuns = GetAlbunsByMarca($marca['id'], $categoria['id']);
    $init = $_SESSION['albumIndex'];
    if ($var == 0) {
        $var = CalculateAggregateVar($init, $action);
    }
    $index = $init + $var;
    $m = $index + 10;
    $n = count($albuns);
    $c = 0;
    $retval = "";
    for ($i = $index; $i < $n && $i < $m; $i++) {
        if ($c == 10) {
            break;
        }
        $prefix = "";
        if ($c == 0) {
            $prefix = 'margin-left: 15px;';
        }
        $retval .= "<div class='span2' style='z-index: 100; width: 80px; height: 120px; position: relative; margin-top: 20px; margin-right: 40px; " . $prefix . "'>\n\t\t\t<a href='arquivos.php?album=" . $albuns[$i]['id'] . "'>\n\t \t\t\t<div class='span4 offset7' style='z-index: 9999; position: absolute; display: block; margin-top: 45px;'>\n\t \t\t\t\t<img src='" . $_SESSION['categoriasImagePrefix'] . $categoria['imagem'] . "' />\n\t \t\t\t</div>\n\t \t\t\t<img  src='img/pasta.png' />\n\t \t\t\t<p align='center' class='btn btn-link' style='padding-left: 5px;'>" . $albuns[$i]['nome'] . "</p>\n \t\t\t</a>\n\t\t</div>";
        $c++;
    }
    $_SESSION['albumIndex'] = $index;
    if ($action == "prev" || $action == "next") {
        $nextPage = ceil(($index + 1) / 10);
    } else {
        $nextPage = $action;
    }
    $pagination = UpdatePagiation($nextPage, $n, "albuns");
    echo $retval . "|" . $pagination;
    return;
}
										<button class="btn btn-small btn-primary" type="button">Agregar álbum</button>

									</a>

									

									<div class="row-fluid" style="padding-top: 10px;">

										<ul class="unstyled">

										<?php 
    //
    // LISTA ALBUNS DA CATEGORIA
    //
    $albuns = GetAlbunsByMarca($marca_id, $cat_id);
    $m = count($albuns);
    if ($m == 0) {
        echo "<div class='alert alert-block'>No hay álbumes creados.</div>";
    }
    for ($j = 0; $j < $m; $j++) {
        $nome_album = $albuns[$j]['nome'];
        $id_album = $albuns[$j]['id'];
        ?>

											<li class="lista-control">

												<div class="alert alert-info">

												<ul class="unstyled">
示例#3
0
			            		<?php 
    $c++;
}
?>

		                	</div>

		                </div>

		             	

		              	<div class="span10 inline" style="margin-bottom: 80px;" id="albuns-lista">
	
		              		<?php 
$albuns = GetAlbunsByMarca($marca['id'], $categoria['id']);
if (!isset($_SESSION['albumIndex'])) {
    $_SESSION['albumIndex'] = 0;
}
$index = $_SESSION['albumIndex'];
$n = count($albuns);
if ($n == 0) {
    echo "<div class='alert alert-info'>No hay álbun agregado.</div>";
}
$c = 0;
for ($i = $index; $i < $n; $i++) {
    if ($c == 10) {
        break;
    }
    ?>
								<div class="span2" style="z-index: 100; width: 80px; height: 120px; position: relative; margin-top: 20px; margin-right: 40px;