Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
boa tarde pessoal é o seguinte to com problema na paginação na primeira pagian ela vem direitinho, os resultados na ordem q eu quero, porém quando passo para a segunda pagian ele diz q as variaveis, q eu to pegando (buscn, honorarios, estado, etc..) estao vazias, alguem ai tem alguma ideia do q fazer?? segue o script abaixo
<?php
ini_set("display_errors", true);
error_reporting(E_ALL);
// A sessão precisa ser iniciada em cada página diferente
if (!isset($_SESSION)) session_start();
$nivel_necessario = 2;
// Verifica se não há a variável da sessão que identifica o usuário
if (!isset($_SESSION['UsuarioEmail']) OR ($_SESSION['UsuarioNivel'] < $nivel_necessario)) {
// Destrói a sessão por segurança
session_destroy();
// Redireciona o visitante de volta pro login
header("Location: [http://localhost/login.php"](http://localhost/login.php)); exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>localhost - Resultado de Busca</title>
<link href="IP.css" rel="stylesheet" type="text/css" />
<link href="[http://localhost/estilos.css"](http://localhost/estilos.css) rel="stylesheet" type="text/css">
<style type="text/css"></style>
<script language="javascript" type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="js/combo.js"></script>
<script language="javascript" type="text/javascript" src="js/hon.js"></script>
</head>
<body>
<p class="Font"> </p>
<div align="center">
<table width="1000" border="0" bgcolor="#FFFFFF">
<tr align="center">
<td><table width="990" border="0">
<tr>
<td>
<?php
include 'http://localhost/includes/cabecalho1.php'
?></td>
</tr>
</table></td>
</tr>
<tr align="center">
<td><table width="990" align="center" border="0" bgcolor="#FFFFFF">
<tr>
<td width="130" valign="top">
<?php
include 'http://localhost/includes/menuEsquerdo.php'
?></td>
<td width="8" bgcolor="#F3F3F3"> </td>
<td width="526" align="center" valign="top"><table width="430" border="0">
<tr>
<th align="center" class="tituloHome3" scope="col"> Resultado Pesquisa por Consultor</th>
</tr>
</table>
<table width="430" border="0">
<tr>
<th align="center" nowrap class="textoHome1" scope="col">
<?php
include 'conexao.php';//error_reporting(0);
$p = $_POST['p'];
$buscn = $_POST['buscn'];
$honorarios = $_POST['honorarios'];
$estado = $_POST['estado'];
$atuacao = $_POST['atuacao'];
$op = $_POST['op'];
if($op === 'acessos'){
$ordem = 'DESC';
}else{
$ordem = 'ASC';
}$p = 1;
}if($buscn > $honorarios AND $buscn > $estado){
$sql_select = "SELECT * FROM td_consultores WHERE nome LIKE '%$buscn%' ORDER BY $op $ordem LIMIT $inicio, $qnt";
}$sql_select = "SELECT * FROM td_consultores WHERE honorarios = '$honorarios' ORDER BY $op $ordem LIMIT $inicio, $qnt";
}$sql_select = "SELECT * FROM td_consultores WHERE uf = '$estado' ORDER BY $op $ordem LIMIT $inicio, $qnt";
}$sql_select = "SELECT * FROM td_consultores WHERE atuacao1 LIKE '$atuacao' OR atuacao2 LIKE '$atuacao' OR atuacao3 LIKE '$atuacao' OR atuacao4 LIKE '$atuacao' OR atuacao5 LIKE '$atuacao' ORDER BY $op $ordem LIMIT $inicio, $qnt";
}$sql_select = "SELECT * FROM td_consultores ORDER BY $op $ordem LIMIT $inicio, $qnt";
}//
while($array = mysql_fetch_array($sql_query)) {
//
$nome = $array["nome"];
$atuacao1 = $array["atuacao1"];
$atuacao2 = $array["atuacao2"];
$atuacao3 = $array["atuacao3"];
$atuacao4 = $array["atuacao4"];
$atuacao5 = $array["atuacao5"];
$hon = $array["honorarios"];
$id = $array["id"];
$uf = $array["uf"];
$cidade = $array["cidade"];$sql = mysql_query('SELECT * FROM foto_perfil WHERE id = '.$id.' ') or die(mysql_error());
$resultado = mysql_fetch_array($sql);
$img = $resultado['foto'];
echo "<table width='400' border='1'>
<tr>
<th width='100' valign='top' scope='col'><table width='101' height='111' border='0' align='enter'>
<tr>
<th width='100' align='center' scope='col'><p class='style8'><img src=../../../sistema/pa_in_co/upfotos/uploadfotos/".$img." /></p></th>
</tr>
</table></th>
<th width='290' align='center' valign='top' scope='col'><table width='290' border='0'>
<tr>
<th width='41' align='left' class='tituloHome1' scope='col'>Nome</th>
<th width='239' align='left' class='textoHome1' scope='col'>".$nome."</th>
</tr>
</table>
<table width='290' border='0'>
<tr>
<th align='left' class='tituloHome1' scope='col'>Areas de Atuação</th>
</tr>
</table>
<table width='290' border='0'>
<tr>
<th align='left' class='textoHome1' scope='col'>".$atuacao1."</th>
</tr>
</table>
<table width='290' border='0'>
<tr>
<th align='left' class='textoHome1' scope='col'>".$atuacao2."</th>
</tr>
</table>
<table width='290' border='0'>
<tr>
<th align='left' class='textoHome1' scope='col'>".$atuacao3."</th>
</tr>
</table>
<table width='290' border='0'>
<tr>
<th align='left' class='textoHome1' scope='col'>".$atuacao4."</th>
</tr>
</table>
<table width='290' border='0'>
<tr>
<th align='left' class='textoHome1' scope='col'>".$atuacao5."</th>
</tr>
</table>
<table width='290' border='0'>
<tr>
<th width='82' align='left' class='tituloHome1' scope='col'>Honorarios</th>
<th width='198' align='left' class='textoHome1' scope='col'>".$hon."</th>
</tr>
</table>
<table width='290' border='0'>
<tr>
<th width='46' align='left' class='tituloHome1' scope='col'>Estado</th>
<th width='47' align='left' class='textoHome1' scope='col'>".$uf."</th>
<th width='49' align='left' class='tituloHome1' scope='col'>Cidade</th>
<th width='130' align='left' class='textoHome1' scope='col'>".$cidade."</th>
</tr>
</table>
<table width='290' border='0'>
<tr>
<th align='center' valign='top' bgcolor='#CCCCCC' class='tituloHome1' scope='col'> <p class='textoHome05'><a href='[http://localhost/sistema/pa_in_co/perfil/visuc.php?id=".$id."'](http://localhost/sistema/pa_in_co/perfil/visuc.php?id=) class='textoHome05'>Visualizar Perfil</a></p></th>
</tr>
</table></th>
</tr>
</table>";
}echo "<br />";
//
if($buscn > $honorarios AND $buscn > $estado){
$sql_select_all = "SELECT * FROM td_consultores WHERE nome LIKE '%$buscn%'";
}$sql_select_all = "SELECT * FROM td_consultores WHERE honorarios = '$honorarios'";
}$sql_select_all = "SELECT * FROM td_consultores WHERE uf = '$estado'";
}$sql_select = "SELECT * FROM td_consultores WHERE atuacao1 LIKE '$atuacao' OR atuacao2 LIKE '$atuacao' OR atuacao3 LIKE '$atuacao' OR atuacao4 LIKE '$atuacao' OR atuacao5 LIKE '$atuacao'";
}$sql_select_all = "SELECT * FROM td_consultores";
}echo "<a href='buscc.php?p=1' target='_self'>primeira pagina</a> ";echo "<a href='buscc.php?p=".$i."' target='_self'>".$i."</a> ";
}
}echo "<a href='buscc.php?p=".$i."' target='_self'>".$i."</a> ";
}
}echo "<a href='buscc.php?p=".$pags."' target='_self'>ultima pagina</a> ";
?>
<br>
<br>
<br>
<br>
<table width="430" border="0">
<tr>
<th scope="col"><input name="Submit" type="submit" class="sair" onClick="document.location='http://localhost/sistema/pa_in_co/perfil/bcon.php';" id="button" value="Voltar para pagina de Busca"/></th>
</tr>
</table></th>
</tr>
</table></td>
<td width="10" bgcolor="#F3F3F3"><p> </p> </td>
<td width="299" valign="top"><?php include 'http://localhost/includes/barraDireita.php' ?></td>
</tr>
</table></td>
</tr>
<tr align="center">
<td bgcolor="#F3F3F3"><?php include 'http://localhost/includes/rodape1.php' ?></td>
</tr>
</table>
</div>
</body>
</html>
obs: eu preciso organizar ou por DESC ou por ASC por isso akela parte la, sem isso ai funciona normal, mas com da problema =/ se alguem tive uma ideia ai eu aceito, to me quebrando com isso :(
Carregando comentários...