0
So I have a page that shows a total of 8 Divs per pagination, these Divs have little information inside, they have 2 button that allows you to delete and have more information about what is inside the div than in the case and the data of a phone number, the problem and the following, of those 8 Divs I can see the first 2 normally: I say see the information of the number, but in the other 6 appears the same information that is inside the second div... I think the problem and in the if more can not solve, follows the code:
<?php
include_once("../conn/conexao.php");//faz a conexao com o banco de dados
//verifica a página atual caso seja informada na URL, senão atribui como 1ª página
$pagina = (isset($_GET['pagina']))? $_GET['pagina'] : 1;
//seleciona todos os itens da tabela
$cmd = "select * from tb_numeros";
$produtos = mysqli_query($conexao, $cmd);
//conta o total de itens
$total = mysqli_num_rows($produtos);
//seta a quantidade de itens por página, neste caso, 2 itens
$registros = 8;
//calcula o número de páginas arredondando o resultado para cima
$numPaginas = ceil($total/$registros);
//variavel para calcular o início da visualização com base na página atual
$inicio = ($registros*$pagina)-$registros;
//seleciona os itens por página
$cmd = "select * from tb_numeros limit $inicio,$registros";
$produtos = mysqli_query($conexao, $cmd);
$total = mysqli_num_rows($produtos);
//exibe os produtos selecionados
echo "<div class='container'>
<div class='row pricing text-center'>
<div class='col-md-3'>
<div class='well'>
";
$cont=0;
while ($produto = mysqli_fetch_array($produtos)){
if (($cont%8)==0):
echo "<h3><b>".$produto['numero']."</b></h3>
<hr>
<p>Chip: ".$produto['nchip']."</p>
<hr>
<p>IMEI: ".$produto['imei']."</p>
<hr>
<div class='col-xs-6'>
<a href='#' class='btn btn-danger btn-block'><span class='glyphicon glyphicon-trash'></span></a></div>
<div class='col-xs-6'><a href='#info' data-toggle='modal' class='btn btn-success btn-block'><span class='glyphicon glyphicon-plus'></span> Info</a></div>
<div class='modal fade' id='info' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button>
<h3 class='modal-title' id='lineModalLabel' align='center'>Dados do Telefone</h3>
<div class='modal-body'>
<div class='form-group'>
<div class='col-xs-12'><center>
<label for='exampleInputPassword1'>Funcionário</label></center>
<input type='text' name='funcionario' class='form-control' value=".$produto['funcionario']." style='text-align: center;' readonly='readonly' id='letras' required>
<br></div>
</div>
<div class='form-group'>
<div class='col-xs-4'><center>
<label for='exampleInputPassword1'>Número</label></center>
<input type='text' name='numero' class='form-control' id='exampleInputPassword1' value=".$produto['numero']." style='text-align: center;' readonly='readonly' >
</div>
</div>
<div class='form-group'>
<div class='col-xs-2'><center>
<label for='exampleInputPassword1'>RCA</label></center>
<input type='text' name='rca' class='form-control' id='exampleInputPassword1' value=".$produto['rca']." style='text-align: center;' maxlength='4' readonly='readonly' onkeypress='return SomenteNumero(event)' required>
</div>
</div>
<div class='form-group'>
<div class='col-xs-6'><center>
<label for='exampleInputPassword1'>Região</label></center>
<input type='text' name='regiao' class='form-control' id='exampleInputPassword1' value=".$produto['regiao']." style='text-align: center;' readonly='readonly' required>
<br></div>
</div>
<div class='form-group'>
<div class='col-xs-6'><center>
<label for='exampleInputPassword1'>Número Chip</label></center>
<input type='text' name='nchip' class='form-control' id='exampleInputPassword1' value=".$produto['nchip']." style='text-align: center;' readonly='readonly' >
</div>
</div>
<div class='form-group'>
<div class='col-xs-6'><center>
<label for='exampleInputPassword1'>IMEI</label></center>
<input type='text' name='imei' class='form-control' id='exampleInputPassword1' value=".$produto['imei']." style='text-align: center;' readonly='readonly' >
<br></div>
</div>
<div class='form-group'>
<div class='col-xs-12'><center>
<label for='exampleInputPassword1'>Cadastrado Por</label></center>
<input type='text' name='usuario' class='form-control' id='exampleInputPassword1' value=".$produto['usuario']." style='text-align: center;' readonly='readonly' >
<br></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
";
else :
echo"<div class='col-md-3'>
<div class='well'>
<h3><b>".$produto['numero']."</b></h3>
<hr>
<p>Chip: ".$produto['nchip']."</p>
<hr>
<p>IMEI: ".$produto['imei']."</p>
<hr>
<div class='col-xs-6'>
<a href='#' class='btn btn-danger btn-block'><span class=' glyphicon glyphicon-trash'></span></a></div>
<div class='col-xs-6'><a href='#info2' data-toggle='modal' class='btn btn-success btn-block'><span class='glyphicon glyphicon-plus'></span> Info</a></div>
<div class='modal fade' id='info2' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'><span aria-hidden='true'>×</span><span class='sr-only'>Close</span></button>
<h3 class='modal-title' id='lineModalLabel' align='center'>Dados do Telefone</h3>
<div class='modal-body'>
<div class='form-group'>
<div class='col-xs-12'><center>
<label for='exampleInputPassword1'>Funcionário</label></center>
<input type='text' name='funcionario' class='form-control' value=".$produto['funcionario']." style='text-align: center;' readonly='readonly' id='letras' required>
<br></div>
</div>
<div class='form-group'>
<div class='col-xs-4'><center>
<label for='exampleInputPassword1'>Número</label></center>
<input type='text' name='numero' class='form-control' id='exampleInputPassword1' value=".$produto['numero']." style='text-align: center;' readonly='readonly' >
</div>
</div>
<div class='form-group'>
<div class='col-xs-2'><center>
<label for='exampleInputPassword1'>RCA</label></center>
<input type='text' name='rca' class='form-control' id='exampleInputPassword1' value=".$produto['rca']." style='text-align: center;' maxlength='4' readonly='readonly' onkeypress='return SomenteNumero(event)' required>
</div>
</div>
<div class='form-group'>
<div class='col-xs-6'><center>
<label for='exampleInputPassword1'>Região</label></center>
<input type='text' name='regiao' class='form-control' id='exampleInputPassword1' value=".$produto['regiao']." style='text-align: center;' readonly='readonly' required>
<br></div>
</div>
<div class='form-group'>
<div class='col-xs-6'><center>
<label for='exampleInputPassword1'>Número Chip</label></center>
<input type='text' name='nchip' class='form-control' id='exampleInputPassword1' value=".$produto['nchip']." style='text-align: center;' readonly='readonly' >
</div>
</div>
<div class='form-group'>
<div class='col-xs-6'><center>
<label for='exampleInputPassword1'>IMEI</label></center>
<input type='text' name='imei' class='form-control' id='exampleInputPassword1' value=".$produto['imei']." style='text-align: center;' readonly='readonly' >
<br></div>
</div>
<div class='form-group'>
<div class='col-xs-12'><center>
<label for='exampleInputPassword1'>Cadastrado Por</label></center>
<input type='text' name='usuario' class='form-control' id='exampleInputPassword1' value=".$produto['usuario']." style='text-align: center;' readonly='readonly' >
<br></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
";
endif;
$cont++;
}for($i = 1; $i < $numPaginas + 1; $i++) {
echo "<div class='row'>
<div class='text-center'><ul class='pagination pagination-large'>
<li><a href='visualizarn.php?pagina=$i'>".$i."</a></li></ul></div></div> ";
}
echo"
</div>
";
?>
it will be easier to insert the html press F12 and search should have some div putting hierarchy on the other
– Marcos Brinner
-I don’t understand...
– Ferb