• User

    paginazione a 3 colonne

    ciao ho fatto una paginazione, però vorrei farla a 3 colonne, sapete come si fa?

    COLONNA1_________COLONNA2_________COLONNA3

    RECORD1__________RECORD2__________RECORD3
    RECORD4__________RECORD5__________RECORD6
    RECORD7__________RECORD8__________RECORD9

    [PHP]
    <div class="posts"> <?php$risperpag = 40;

    $limit = $risperpag * $_GET['p'] - $risperpag;
    $query_archivio="SELECT c_art_marca.* FROM c_art_marca ORDER BY c_art_marca.nome_marca ASC LIMIT ".$limit.",".$risperpag; $mysql_query_archivio=mysql_query($query_archivio, $conn);while($row=mysql_fetch_array($mysql_query_archivio)){?> <article class="post post-tp-17"> <h3 class="title-5"><a href="<?=$PHP_SELF?>?idartmarca=<?=$row['id_art_marca']?>&pagina=3"><?=strtoupper($row['nome_marca']);?></a></h3><div class="meta-tp-2"><div class="date"><span><?=$row['data_ins_adm']?> / <?=$row['ora_ins_adm']?></span></div><div class="category"><a href=""><i class="li_user"></i><span>data / ora inserimento</span></a></div></div> </article>
    <?php}?>
    </div> <?php
    $querytotale = mysql_query("SELECT c_art_marca.* FROM c_art_marca ORDER BY c_art_marca.nome_marca ASC");
    $ristot = mysql_num_rows($querytotale);

    $npag = ceil($ristot / $risperpag);

    $p = $_GET['p'];?> <!-- Page nav --><div class="page-nav">
    <?=($p!=1?'<a href="index_admin_ins_marchi2.php?p='.($p-1).'&menu=marchi" class="pn-item"><i class="page-nav-prev-ic"></i></a>':'')?>
    <? for($i=1;$i<=$npag;$i++){
    if($p==$i){ echo '<span class="pn-item current mb-pt-hide"> '.$i.' </span>'; }else{ echo '<a href="index_admin_ins_marchi2.php?p='.$i.'&menu=marchi" class="pn-item mb-pt-hide"> '.$i.' </a>'; }
    }?>
    <?=($p!=$npag?'<a href="index_admin_ins_marchi2.php?p='.($p+1).'&menu=marchi" class="pn-item"><i class="page-nav-next-ic"></i></a>':'')?>
    </div> <!-- Page nav END -->
    [/PHP]

     <div class="posts">
    

    <?php

    $risperpag = 40;

    $limit = $risperpag * $_GET['p'] - $risperpag;

    $query_archivio="SELECT c_art_marca.*
    FROM c_art_marca
    ORDER BY c_art_marca.nome_marca ASC
    LIMIT ".$limit.",".$risperpag;

    $mysql_query_archivio=mysql_query($query_archivio, $conn);
    while($row=mysql_fetch_array($mysql_query_archivio)){
    ?>

       <article class="post post-tp-17"> 
    

    <h3 class="title-5"><a href="<?=$PHP_SELF?>?idartmarca=<?=$row['id_art_marca']?>&pagina=3"><?=strtoupper($row['nome_marca']);?></a></h3>
    <div class="meta-tp-2">
    <div class="date"><span><?=$row['data_ins_adm']?> / <?=$row['ora_ins_adm']?></span></div>
    <div class="category"><a href=""><i class="li_user"></i><span>data / ora inserimento</span></a></div>
    </div>
    </article>

    <?php
    }
    ?>

        </div>
    

    <?php

    $querytotale = mysql_query("SELECT c_art_marca.*
    FROM c_art_marca
    ORDER BY c_art_marca.nome_marca ASC");

    $ristot = mysql_num_rows($querytotale);

    $npag = ceil($ristot / $risperpag);

    $p = $_GET['p'];
    ?>
    <!-- Page nav -->
    <div class="page-nav">

    <?=($p!=1?'<a href="index_admin_ins_marchi2.php?p='.($p-1).'&menu=marchi" class="pn-item"><i class="page-nav-prev-ic"></i></a>':'')?>

    <? for($i=1;$i<=$npag;$i++){

    if($p==$i){
    echo '<span class="pn-item current mb-pt-hide"> '.$i.' </span>';
    }else{
    echo '<a href="index_admin_ins_marchi2.php?p='.$i.'&menu=marchi" class="pn-item mb-pt-hide"> '.$i.' </a>';
    }

    }
    ?>

    <?=($p!=$npag?'<a href="index_admin_ins_marchi2.php?p='.($p+1).'&menu=marchi" class="pn-item"><i class="page-nav-next-ic"></i></a>':'')?>

    </div>
    <!-- Page nav END -->