• 0
Sign in to follow this  
Weslley17w

Como listar produtos

Question

2 answers to this question

Recommended Posts

  • 0


<?php

//lista

$StatusInicial = !isset($_GET['status'])?'active':$_GET['status'];

$TotalPaginas = 20;

$PaginaAtual = isset($_GET['pgn'])?$_GET['pgn']:'0';

$anuncios = $meli->get('/users/'.$_SESSION['id_mercadolivre'].'/items/search', array('access_token' => $_SESSION['access_token'], 'orders' =>'stop_time_desc','limit'=>$TotalPaginas,'offset'=>$PaginaAtual, 'status'=>$StatusInicial));

?>

 

<a href="anuncios.php?pgn=<?php echo $PaginaAtual;?>&status=active" class="btn btn-default<?php echo ($StatusInicial=='active')?' active':'';?>">Ativos</a>

<a href="anuncios.php?pgn=<?php echo $PaginaAtual;?>&status=paused" class="btn btn-default<?php echo ($StatusInicial=='paused')?' active':'';?>">Pausados</a>

<a href="anuncios.php?pgn=<?php echo $PaginaAtual;?>&status=closed" class="btn btn-default<?php echo ($StatusInicial=='closed')?' active':'';?>">Finalizados</a>

<a href="anuncios.php?pgn=<?php echo $PaginaAtual;?>&status=" class="btn btn-default<?php echo ($StatusInicial=='')?' active':'';?>">Todos</a>

 

<?php print_r($anuncios);?>

 

<ul class="pagination">

<?php for($i=0;$i<=($NumPaginas-1);$i++){?>

<li class="<?php echo ($PaginaAtual==$i)?'active':'';?>"><a href="anuncios.php?pgn=<?php echo ($i);?>&status=<?php echo $StatusInicial;?>"><?php echo ($i+1);?> <span class="sr-only">(atual)</span></a></li>

<?php } ?>

</ul>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this