Listing does not complete all lines

Asked

Viewed 34 times

0

I have a problem when it comes to making a list. There are hours that normal list and there are hours that does not show all lines

inserir a descrição da imagem aqui

In this image above shows 7 lines more would have to show 15. the problem is that if I update the page has normal load hours and there are hours that appears only 3 lines

I don’t know if there’s anything related to server memory or something like that what might that be?

below put my code

<?php 
include"../assets/verifica.php";
include"../assets/config.php";

$nivelnasessao = $_SESSION["nivel"];
if (in_array("$nivelnasessao", $nivel_aceito_adm)) { // Pega os niveis aceitos no config.php essa variavel esta la 


$id_transfer = $_SESSION["id_transfer"];
$id_prod = $_GET["id"];
$cat = $_GET["cat"];
//$nome_get = $_GET["nome"];
$id_cliente = $_GET["id_cliente"];


if ($cat == 's'){
    $voltar = 'produto_servico.php';
}elseif ($cat == 'e'){
    $voltar = 'produto_eventos.php';
}elseif ($cat == 't'){
    $voltar = 'produtos.php';
}





if (empty($_GET['id_cliente'])) {
$regra = "";
}else{
$regra = "AND reservado_a = '$id_cliente'";
}

$sql = "SELECT nome FROM produtos Where id_transfer = '$id_transfer' and id_produtos = '$id_prod'  ";
$resultado = mysql_query($sql) or die( mysql_error());
while ($row_solicitacoes = mysql_fetch_assoc($resultado)) {

$nomeprod = $row_solicitacoes['nome'];

}

?>
<!DOCTYPE html>
<!--[if !IE]><!--><html class="fluid top-full sticky-top"><!-- <![endif]-->
<head><title><?echo $title?></title>
<?php
    function codificacao($string) {
        return mb_detect_encoding($string.'x', 'UTF-8, ISO-8859-1');
    }
?>

	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
	
	<link rel="stylesheet" href="../assets/css/admin/module.admin.page.tables.min.css" />
  <script src="../assets/components/library/modernizr/modernizr.js?v=v2.1.0"></script>

<style>
/*//////////////////////////////Auto Complete///////////////////////////////////////////////*/
 .tt-hint,.country,.city,.clientes  {
 	border: 1px solid #CCCCCC;
    border-radius: 1px 1px 1px 1px;
    font-size: 18px;
    height: 28px;
    line-height: 30px;
    outline: medium none;
    padding: 8px 12px;
    width: 100%;
}

.tt-dropdown-menu {
    text-align: left;
  width: 300px;
  margin-top: 5px;
  padding: 8px 12px;
  background-color: #fff;
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px 8px 8px 8px;
  font-size: 15px;
  color: #111;
  background-color: #F1F1F1;
}
/*//////////////////////////////Trocar Imagem Radio///////////////////////////////////////////////*/
</style>

<script type="text/javascript" src="../files/includes/auto_compl/js/jquery.js"></script> 
<script type="text/javascript" src="../files/includes/auto_compl/js/bootstrap.js"></script> 
<script type="text/javascript" src="../files/includes/auto_compl/js/typeahead.js"></script> 



<script type="text/javascript"> 
$(document).ready(function() {
$('input.clientes').typeahead({
  name: 'clientes',
  remote : '../files/includes/auto_compl/clientes.php?query=%QUERY'
});
})



function validarForm1() { 
var nome = document.form1.nome.value; 
var idade = document.form1.idade.value; 
if ((nome == null) || (nome == '')){ 
alert('O campo nome é obrigatório!'); 
} 
if ((idade == null) || (idade == '')){ 
alert('O campo idade é obrigatório!'); 
} 
} 

function validarForm2() { 
var nome = document.form2.nome.value; 
var idade = document.form2.idade.value; 
if ((nome == null) || (nome == '')){ 
alert('O campo nome é obrigatório!'); 
} 
if ((idade == null) || (idade == '')){ 
alert('O campo idade é obrigatório!'); 
} 
} 


function validarForm3() { 
var nome = document.form3.nome.value; 
var idade = document.form3.idade.value; 
if ((nome == null) || (nome == '')){ 
alert('O campo nome é obrigatório!'); 
} 
if ((idade == null) || (idade == '')){ 
alert('O campo idade é obrigatório!'); 
} 
} 
</script> 


</head>
<body class="">
<div class="container-fluid fluid menu-left">
<div id="wrapper">
<!-- Menu -->
<?
include"menu_n.php";
?><br /><br /><br />

<div class="innerAll">
<div class="row">
<div class="col-md-12">
<div class="widget widget-heading-simple widget-body-white">

<?php
$sql = "SELECT id,nome_fan FROM fornecedores Where id_transfer = '$id_transfer'  AND master = 'master' ";
$resultado = mysql_query($sql) or die( mysql_error());
while ($row_solicitacoes = mysql_fetch_assoc($resultado)) {
 $id_for = $row_solicitacoes['id'];
$nome_fan = $row_solicitacoes['nome_fan']; 
}
?>

<div class="row">
<form id="form3" action="produto_tarifario_cad_edit_master.php" method="get" name="">
<div class="col-md-6">
&nbsp;&nbsp;&nbsp;<h4><?echo $nomeprod?></h4>
</div>
<div class="col-md-5" style="text-align: right;">
<input type="hidden" name="id" value="<?echo $id_prod?>" />
<input type="hidden" name="cat" value="<?echo $cat?>" />
<input type="hidden" name="nome" value="<?echo $nomeprod?>" />
<input type="text" name="id_cliente" autocomplete="false" value="" class="clientes" placeholder="Cliente"  />

</div>
<div class="col-md-1" style="text-align: left;">
<table>
<tr>
<td>
<input type="submit" name="" class="btn btn-block btn-default" value="Filtrar" />
</td>
<td>
<a href="<?echo $voltar?>" class="btn btn-block btn-danger ">Voltar</a>
</td>
</tr>
</table>
</div>
</form>

</div>


<form id="form1" action="acao.php" method="POST">    

<?php
$nomep = $_GET['nome'];           
$cat33 = $_GET['cat'];           
?>

<input type="hidden" name="acao" value="add_tar_master" /> 
<input type="hidden" name="tipo" value="<?echo $cat33?>" />       
<input type="hidden" name="nomeprod" value="<?echo $nomep?>" />       
<input type="hidden" name="id_transfer" value="<?php echo $id_transfer?>" /> 
<input type="hidden" name="id_prod" value="<?php echo $id_prod?>" /> 
<input type="hidden" name="for" value="<?php echo $id_for?>" />       

 

<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$(function () {
    var divContent = $('#formulario');
    var botaoAdicionar = $('a[data-id="1"]');
    var i = 1;

    //Ao clicar em adicionar ele cria uma linha com novos campos
    $(botaoAdicionar).click(function () {
        $('<div class="conteudoIndividual"><table cellspacing="0" style="width: 100%;">'+
'<tr>'+
<?php if($cat <> 's'){?>

'<td style="width: 200px;">Fornecedores: <select class="form-control" name="forne[]" >'+
'<option value="null">Todos</option>'+
<?php
$sql = "SELECT id,nome_fan FROM fornecedores Where id_transfer = '$id_transfer' order by nome_fan";
$resultado = mysql_query($sql) or die( mysql_error());
while ($row_solicitacoes = mysql_fetch_assoc($resultado)) {
 $id_for = $row_solicitacoes['id'];
$nome_fan = $row_solicitacoes['nome_fan']; 
?>

'<option value="<?echo $id_for?>"><?echo $id_for?><?echo $nome_fan?></option>'+
<?}?>
'</select></td>'+


'<td style="width: 300px;">Tarifa Negociada: <select class="form-control" name="reservado[]" >'+
'<option value="null">Todos</option>'+
<?php
$sql = " 
SELECT e.id_empresa, e.logo ,e.nome_fan FROM acessos AS a

           LEFT JOIN empresas AS e
           ON a.id_empresa = e.id_empresa
           where  a.id_transfer = '$id_transfer' 



UNION
          SELECT id_viajantes,logo,nome    FROM viajantes Where id_transfer = '$id_transfer' order by nome_fan";
$resultado = mysql_query($sql) or die( mysql_error());
while ($row_solicitacoes = mysql_fetch_assoc($resultado)) {
 $id_empresa = $row_solicitacoes['id_empresa'];
$nome_fan = $row_solicitacoes['nome_fan']; 
?>

'<option value="<?echo $id_empresa?>"><?echo $nome_fan?></option>'+
<?}?>
'</select></td>'+


'<td style="width: 150px;">Ve&iacute;culo: <select class="form-control" name="vei[]>'+
'<option value=""></option>'+
'<option value="">Outros</option>'+
'<option value="Sedan">Sedan</option>'+
'<option value="Van">Van</option>'+
'<option value="Suv">Suv</option>'+
'<option value="Mini-Van">Mini-Van</option>'+
'<option value="Micro-Onibus">Micro-Onibus</option>'+
'<option value="Onibus">Onibus</option>'+
'</select></td>'+
'<td style="width: 150px;">Extra: <select class="form-control" name="extra[]" >'+
'<option value="Normal">Normal</option>'+
'<option value="Blindado">Blindado</option>'+
'<option value="Adaptado">Adaptado</option>'+
'</select></td>'+
<?php }else{echo"";}?>



'<td>Validade Inicial:<input type="date" class="form-control"  name="ini[]" value="2018-01-01"  /></td>'+
'<td>Validade Final:<input type="date" class="form-control"  name="venc[]"  value="2018-12-31"/></td>'+
'<td><input type="checkbox" name="jump[]" value="1" /></td>'+
'<td style="width: 80px;">Moeda&nbsp;<select name="moeda[]" class="form-control">'+
'<option value="Reais">R$</option>'+
'<option value="Dolares">US$</option>'+
'<option value="Euros">€</option>'+
'</select></td><td style="width: 150px;">Valor:<input type="text" class="form-control" name="valor[]"  placeholder="Valor" /></td>'+




'<td><br><a href="#" class="linkRemover">   <span class="label label-danger"> X </span></a></td>'+
'</tr>'+




'</table>'+
'</div>').appendTo(divContent);
        $('#removehidden').remove();
        i++;
        $('<input type="hidden" name="quantidadeCampos" value="' + i + '" id="removehidden">').appendTo(divContent);
    });

    //Cliquando em remover a linha é eliminada
    $('#formulario').on('click', '.linkRemover', function () {
        $(this).parents('.conteudoIndividual').remove();
        i--;
    });
});
});//]]> 

</script>

<a href="#" data-id="1" style="text-align: left;" id="adicionarCampo"><span class="label label-success"> + Adicionar Tarifário</span></a>
   <br />
<div id="formulario"></div>
            
            <br />

<input type="submit" name="tar" value="Gravar" class="btn btn-block btn-primary btn-icon glyphicons home" style="width: 50%;" />            
</form>


<hr />
<div class="row">
<div class="col-md-12">
<?php
$nomep = $_GET['nome'];           
$cat33 = $_GET['cat'];           
?>
<form id="form2"  name="teste" action="acao.php?form=edit_tar_master" method="post" >  	
                     <input type="hidden" name="for" value="<?php echo $id_for?>" />
                     <input type="hidden" name="nomeprod" value="<?php echo $nomep?>" />
                     <input type="hidden" name="id_prod" value="<?php echo $id_prod?>" />
                     <input type="hidden" name="tipo" value="<?echo $cat33?>" /> 
                     <input type="hidden" name="id_cliente" value="<?echo $id_cliente?>" />
                     
<table  class="table table-bordered table-primary"   ">
<tr>
<td>Cod</td>
<td>Forne</td>
<td style="width: 17%;" >Tarifa Negociada</td>
<?php
if($cat <> 's'){?>
<td style="width: 8%;">Veiculo</td>
<?}else{?>

<?}?>
<td>Extra</td>
<td>Valor</td>
<td>Validade  ( Inicio e Fim )</td>
<td>Jump</td>
<td>Site</td>
<td>Promo</td>
<td>Del</td>
</tr>  



<?
	$sql = "SELECT  
            e.nome_fan,
            id_produtos2,
            fornecedor,
            vei,
            valor,
            inicio,
            extra,
            validade,
            reservado_a,
            padrao,
            site_promocao
            moeda,
            id_empresa,
            
           
            jump,
            
           f.logo AS logof, t.site AS sitet FROM produtos_tarifario AS t
           
           LEFT JOIN fornecedores AS f
           ON f.id = t.fornecedor
           
           LEFT JOIN empresas AS e
           ON e.id_empresa = t.reservado_a
           
          
           
           
           where  t.id_produto = '$id_prod' $regra  ORDER by e.nome_fan ASC         
           ";



$resultado = mysql_query($sql) or die( mysql_error());
while ($linha3 = mysql_fetch_assoc($resultado)) {
           
$nome_fan = $linha3['nome_fan'];           
$cod = $linha3['id_produtos2'];
$for = $linha3['fornecedor'];
$vei = $linha3['vei'];
$valor = $linha3['valor'];
$inicio = $linha3['inicio'];
$extra = $linha3['extra'];
$validade = $linha3['validade'];
$reservado = $linha3['reservado_a'];
$padrao = $linha3['padrao'];
$site = $linha3['sitet'];
if($site == 0){
$checked2 = '';  
}else{
$checked2 = 'checked';  
}

$site_promocao = $linha3['site_promocao'];
if($site_promocao == 'sim'){
$checked3 = 'checked';  
}else{
$checked3 = '';  
}
$moeda = $linha3['moeda']; 

if($moeda == 'Reais')
$sifra = 'R$';
elseif($moeda == 'Dolares')
$sifra = '$';
elseif($moeda == 'Euros'){
$sifra == '€'    ;
}

$logof = $linha3['logof'];
 if ($logof == ''){
$foto = "Todos";
}else{
$foto = "<img src=\"img/fotos/$logof\" style=\"width: 30px;\" />";    
}
 
$id_empresa2 = $linha3['id_empresa'];
$id_viajantes = $linha3['id_viajantes'];
$nome_fan2 = $linha3['nome_fan']; 
$nomev = $linha3['nome']; 

echo $jump = $linha3['jump']; 

if($jump == 1){
    $checkedjump ='checked=""';
}else{
    $checkedjump = '';
}

if($padrao == 1){
    $checked ='checked=""';
}else{
    $checked = '';
}

?>

<tr>
<td><?php echo $cod?><input type="hidden" name="id[]" value="<?php echo $cod?>" /></td>
<td><?php echo $foto?>  </td>      

<td> 
<select name="empresa[]" style="width: 80%;">
<option value="<?echo $id_empresa2.$id_viajantes?>"><?echo$nome_fan2.$nomev?></option>
<option value="null">Todos</option>

<?php

$sql3 = " 
SELECT e.id_empresa, e.logo ,e.nome_fan FROM acessos AS a

           LEFT JOIN empresas AS e
           ON a.id_empresa = e.id_empresa
           where  a.id_transfer = '$id_transfer'  order by nome_fan";
$resultado3 = mysql_query($sql3) or die( mysql_error());
while ($row_solicitacoes = mysql_fetch_assoc($resultado3)) {
$id_empresa = $row_solicitacoes['id_empresa'];
$id_viajantes = $row_solicitacoes['id_viajantes'];
$nome_fan = $row_solicitacoes['nome_fan']; 

echo "<option value='$id_empresa'> $nome_fan</option>";
}?>
</select> 
</td>


<?php
if($cat <> 's'){
?>
<td>   <input type="text" name="vei[]" size="10"  value="<?php echo $vei?>" readonly /></td>
<?}else{
    
}?>
<td><select name="extra[]">
<option value="<?php echo $extra?>"><?php echo $extra?></option>
<option value="Normal">Normal</option>
<option value="Blindado">Blindado</option>
<option value="Adaptado">Adaptado</option>
</select></td>
<td>   
<select name="moeda[]">
<option value="<?php echo $moeda?>"><?php echo $sifra?></option>
<option value="Reais">R$</option>
<option value="Dolares">$</option>
<option value="Euros">€</option>
</select>
<input type="text" name="valor[]" size="5" value="<?php echo $valor?>" /></td>
<td>   <input type="date" name="inicio[]" value="<?php echo $inicio?>" />
       <input type="date" name="fim[]" value="<?php echo $validade?>" />
</td>
<td><input type="checkbox" name="jump[]" <?php echo $checkedjump?> value="1" /></td>


<td>
<select name="site[]">
<option value="<?php echo $site?>"><?php echo $site?></option>
<option value="sim">Sim</option>
<option value="nao">Não</option>
</select>
</td>

<td>
<select name="site_promocao[]">
<option value="<?php echo $site_promocao?>"><?php echo $site_promocao?></option>
<option value="sim">Sim</option>
<option value="nao">Não</option>
</select>
<td>
<a href="acao.php?acao=del_tar&id_tar=<?php echo $cod?>&id=<?echo $id_prod?>&cat=<?echo $cat?>&nome=<?echo $nomeprod?>"><img src="img/del.png" width="20px" /> </a>
</td>
</tr>  
<?
}
?>


</table>
<input type="submit" name="tar" value="Editar Valores" class="btn btn-block btn-primary btn-icon glyphicons home" style="width: 50%;" />              
</form>
</div>
</div>
 

</div>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>

	

	
<?php
      }else{
  echo $erro_nivel;
}     
?>
</body>
</html>

  • Please avoid using the site’s snippet for PHP code. When you create a snippet, you will see that there are only spaces for HTML, Javascript and CSS code. This is because it is only done to reproduce complete examples in these languages. The site does not have a built-in PHP interpreter, so just use code formatting, button {} of the editor.

  • Also, I advise you to elaborate a [mcve]. The code you put in the question seems to be the full code of the page, but probably much of this code isn’t even related to the problem.

  • In my case I put the complete code because any part of it can interfere with my problem. example... if I took out any tag it is already reason for the script to work no matter how crazy it is.. there are no errors in the code

  • Another example if I remove 1 field from the loop it lists normal. seems something connected to memory

  • Dude, divide your code better by snippets.. to help you get better looks better

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.