Jump to content


Photo

Erro Na Mostra De Dados Do Banco


  • Faça o login para participar
4 replies to this topic

#1 murillodocarmo

murillodocarmo

    Novato no fórum

  • Usuários
  • 7 posts
  • Sexo:Não informado

Posted 25/04/2005, 17:42

E aew pessoal, :)
comprei um script pronto de um sistema de imobiliária,
mas o sistema de busca o menu com as categorias
não estão funcionando, sendo que os dois trabalham
em cima da search.php.
Se alguem tiver interesse em dar uma olhada no código
e tentar dara uma solução entre em contato que eu envio
o script sem custo nenhum.
Gostaria também de transformar esse script, que é de
uma imobiliária on-line em um site de uma imobiliária comum,
tirando assim do site os recursos de cadastro de corretores,
a tempo e o custo da postagem do imóvel, e algums outros recursos
que não são interessantes para o site duma imobiliária 'comum'.

aí vai a imagem do script:

Posted Image

se alguem tem interesse é só entrar em contato. :huh:

Edição feita por: murillodocarmo, 26/04/2005, 11:12.


#2 <? thales ?>

<? thales ?>

    Nossa vida é desperdiçada pelos detalhes...Simplifique, Simplifi

  • Banidos
  • PipPipPipPipPipPip
  • 551 posts
  • Sexo:Não informado
  • Localidade:Belo Horizonte
  • Interesses:Programar&lt;br&gt;Estou tentando ser um Hacker&lt;br&gt;Gosto de mulheres

Posted 25/04/2005, 18:04

Qual o erro?
NITRØ
--------------------
Foi mau galera

#3 murillodocarmo

murillodocarmo

    Novato no fórum

  • Usuários
  • 7 posts
  • Sexo:Não informado

Posted 25/04/2005, 18:07

olha <? thales ?>,
ele não apresenta erros aparentes,
mas ela dá o aviso de Nenhum resultado encontrado!,
mesmo com imóveis cadastrados nas categorias. :(

#4 The bLk

The bLk

    Doutor

  • Usuários
  • 761 posts
  • Sexo:Masculino
  • Localidade:Curitiba - PR

Posted 25/04/2005, 18:18

Tem como postar o código do search.php?

Creio que só este código não há problema, se puder postar fica mais fácil de identificar o erro...

:)

#5 murillodocarmo

murillodocarmo

    Novato no fórum

  • Usuários
  • 7 posts
  • Sexo:Não informado

Posted 26/04/2005, 07:44

aí vai o código do search.php: :P

<?
require_once("conn.php");
require_once("includes.php");

$query = array();

if(!empty($_GET[c]))
{
	$query[] = "re_listings.CategoryID = '$_GET[c]' ";
}

if(!empty($_GET[s]))
{
	$query[] = "re_listings.SubcategoryID = '$_GET[s]' ";
}

if(!empty($_GET[AgentID]))
{
	$query[] = "re_listings.AgentID = '$_GET[AgentID]' ";
}

if(!empty($_GET[search_country]))
{
	$query[] = "re_listings.country = '$_GET[search_country]' ";
}

if(!empty($_GET[search_state]))
{
	$query[] = "re_listings.state = '$_GET[search_state]' ";
}

if(!empty($_GET[search_city]))
{
	$query[] = "re_listings.city = '$_GET[search_city]' ";
}

if(!empty($_GET[search_PropertyType]))
{
	$query[] = "re_listings.PropertyType = '$_GET[search_PropertyType]' ";
}

if(!empty($_GET[MinPrice]))
{
	$query[] = "re_listings.price >= '$_GET[MinPrice]' ";
}

if(!empty($_GET[MaxPrice]))
{
	$query[] = "re_listings.price <= '$_GET[MaxPrice]' ";
}

if(!empty($_GET[rooms1]))
{
	$query[] = "re_listings.rooms >= '$_GET[rooms1]' ";
}

if(!empty($_GET[rooms2]))
{
	$query[] = "re_listings.rooms <= '$_GET[rooms2]' ";
}

if(!empty($_GET[bath1]))
{
	$query[] = "re_listings.bathrooms >= '$_GET[bath1]' ";
}

if(!empty($_GET[bath2]))
{
	$query[] = "re_listings.bathrooms <= '$_GET[bath2]' ";
}

if(!empty($_GET[before]))
{
	$MyDate = strtotime("-$_GET[before]");
	$query[] = "re_listings.DateAdded >= '$MyDate' ";
}

if(!empty($_GET[school]))
{
	$query[] = "re_listings.NearSchool = 'y' ";
}

if(!empty($_GET[transit]))
{
	$query[] = "re_listings.NearTransit = 'y' ";
}

if(!empty($_GET[park]))
{
	$query[] = "re_listings.NearPark = 'y' ";
}

if(!empty($_GET[ocean_view]))
{
	$query[] = "re_listings.OceanView = 'y' ";
}

if(!empty($_GET[lake_view]))
{
	$query[] = "re_listings.LakeView = 'y' ";
}

if(!empty($_GET[mountain_view]))
{
	$query[] = "re_listings.MountainView = 'y' ";
}

if(!empty($_GET[ocean_waterfront]))
{
	$query[] = "re_listings.OceanWaterfront = 'y' ";
}

if(!empty($_GET[lake_waterfront]))
{
	$query[] = "re_listings.LakeWaterfront = 'y' ";
}

if(!empty($_GET[river_waterfront]))
{
	$query[] = "re_listings.RiverWaterfront = 'y' ";
}

if(!empty($query))
{
	$MyQuery = implode(" and ", $query);

	$MyQuery = "and ".$MyQuery;
}


////////////////////////////////////////////////////////////
//////////  order by

$order = array();

if(!empty($_GET[orderby]))
{
	$MyOrder = explode("|", $_GET[orderby]);

	while(list(,$ov) = each($MyOrder))
	{
  if($ov == "DateAdded")
  {
  	$order[] = " re_listings.DateAdded desc ";
  }
  
  if($ov == "Price")
  {
  	$order[] = " re_listings.Price asc ";
  }
  
  if($ov == "address")
  {
  	$order[] = " re_listings.address asc ";
  }

	}
}
else
{
	if(!empty($_GET[p]))
	{
  $order[] = " re_listings.Price asc ";
	}

	if(!empty($_GET[r]))
	{
  $order[] = " re_listings.rooms asc, re_listings.bathrooms asc, re_listings.garage asc ";
	}

	if(!empty($_GET[city]))
	{
  $order[] = " re_listings.city, re_listings.address, re_listings.state ";
	}

}


if(count($order) > '0')
{
	$MyOrder = implode(", ", $order);

}

if(empty($MyOrder))
{
	$MyOrder = " order by re_agents.PriorityLevel desc, re_listings.DateAdded desc";
}
else
{
	$MyOrder = " order by re_agents.PriorityLevel desc, $MyOrder";
}


if(!empty($_GET[Start]))
{
	$Start = $_GET[Start];
}
else
{
	$Start = '0';
}

$ByPage = '20';

$q1 = "select * from re_listings, re_agents, re_priority where re_listings.AgentID = re_agents.AgentID and re_agents.PriorityLevel = re_priority.PriorityLevel and re_agents.AccountStatus = 'active' $MyQuery $MyOrder limit $Start, $ByPage ";

$qnav = "select * from re_listings, re_agents where re_listings.AgentID = re_agents.AgentID $MyQuery";

$r1 = mysql_query($q1) or die(mysql_error());
$lrows = mysql_num_rows($r1);

if($lrows > '0')
{
	$ListingTable .= "<table align=center width=590 cellspacing=0>\n";
	$ListingTable .= "<tr>\n<td width=75>&nbsp;</td>\n\t";
	
	$ListingTable .= "<td width=200 align=center><a class=BlackLink href=\"search.php?c=$_GET[c]&s=$_GET[s]&AgentID=$_GET[AgentID]&search_city=$_GET[search_city]&search_state=$_GET[search_state]&search_country=$_GET[search_country]&search_PropertyType=$_GET[search_PropertyType]&MinPrice=$_GET[MinPrice]&MaxPrice=$_GET[MaxPrice]&rooms1=$_GET[rooms1]&rooms2=$_GET[rooms2]&bath1=$_GET[bath1]&bath2=$_GET[bath2]&before=$_GET[before]&school=$_GET[school]&transit=$_GET[transit]&park=$_GET[park]&ocean_view=$_GET[ocean_view]&lake_view=$_GET[lake_view]&mountain_view=$_GET[mountain_view]&ocean_waterfront=$_GET[ocean_waterfront]&lake_waterfront=$_GET[lake_waterfront]&river_waterfront=$_GET[river_waterfront]&city=1\">endereço</a></td>\n\t";
	
	$ListingTable .= "<td width=125 align=center><a class=BlackLink href=\"search.php?c=$_GET[c]&s=$_GET[s]&AgentID=$_GET[AgentID]&search_city=$_GET[search_city]&search_state=$_GET[search_state]&search_country=$_GET[search_country]&search_PropertyType=$_GET[search_PropertyType]&MinPrice=$_GET[MinPrice]&MaxPrice=$_GET[MaxPrice]&rooms1=$_GET[rooms1]&rooms2=$_GET[rooms2]&bath1=$_GET[bath1]&bath2=$_GET[bath2]&before=$_GET[before]&school=$_GET[school]&transit=$_GET[transit]&park=$_GET[park]&ocean_view=$_GET[ocean_view]&lake_view=$_GET[lake_view]&mountain_view=$_GET[mountain_view]&ocean_waterfront=$_GET[ocean_waterfront]&lake_waterfront=$_GET[lake_waterfront]&river_waterfront=$_GET[river_waterfront]&r=1\">quar, banh, gara</a></td>\n\t";
	
	$ListingTable .= "<td align=center width=100><a class=BlackLink href=\"search.php?c=$_GET[c]&s=$_GET[s]&AgentID=$_GET[AgentID]&search_city=$_GET[search_city]&search_state=$_GET[search_state]&search_country=$_GET[search_country]&search_PropertyType=$_GET[search_PropertyType]&MinPrice=$_GET[MinPrice]&MaxPrice=$_GET[MaxPrice]&rooms1=$_GET[rooms1]&rooms2=$_GET[rooms2]&bath1=$_GET[bath1]&bath2=$_GET[bath2]&before=$_GET[before]&school=$_GET[school]&transit=$_GET[transit]&park=$_GET[park]&ocean_view=$_GET[ocean_view]&lake_view=$_GET[lake_view]&mountain_view=$_GET[mountain_view]&ocean_waterfront=$_GET[ocean_waterfront]&lake_waterfront=$_GET[lake_waterfront]&river_waterfront=$_GET[river_waterfront]&p=1\">preço</a></td>\n";
	
	$ListingTable .= "</tr>\n</table>\n\n";

	$ListingTable .= "<table align=center width=590 border=1 bordercolor=#993333 rules=rows cellspacing=0>\n";

	while($a1 = mysql_fetch_array($r1))
	{
  $ListingTable .= "<tr style=\"border-width:1; border-color:blue\" onMouseOver=\"this.style.background='#dddddd'; this.style.cursor='hand'\" onMouseOut=\"this.style.background='#ffffff'\" onClick=\"window.open('info.php?id=$a1[ListingID]', '_top')\">\n\t";
  $ListingTable .= "<td height=60>";

  $ListingTable .= "<table align=center width=\"100%\">\n";
  
  $ListingTable .= "<caption align=center><span class=RedLink>Lista $a1[PriorityName]</span></caption>\n";

  $ListingTable .= "<tr>\n\t<td width=75>";

  if(!empty($a1[image]))
  {
  	$images = explode("|", $a1[image]);
  	$MyImage = $images[0];

  	$ListingTable .= "<img src=\"re_images/$MyImage\" width=75 height=60 border=1>";
  }
  else
  {
  	$ListingTable .= "<img src=\"no_image.gif\" border=1>";
  }

  $ListingTable .= "</td>\n\t";

  $ListingTable .= "<td width=225 valign=top><b>Propriedade ID: $a1[ListingID]</b><br>$a1[city], $a1[state]<br>$a1[address], $a1[country]</td>\n\t";
  $ListingTable .= "<td width=100 valign=top>$a1[rooms] qu, $a1[bathrooms] ba";

  if($a1[garage] > '0')
  {
  	$ListingTable .= ", $a1[garage] gr";
  }

  $MyPrice = number_format($a1[Price], 2, ".", "'");

  $ListingTable .= "</td>\n\t<td align=center width=100 valign=top><b>R$$MyPrice</td>\n";

  $ListingTable .= "</tr>\n";

  $ListingTable .= "<tr>\n\t<td colspan=4>$a1[ShortDesc]</td>\n</tr>\n";

  $ListingTable .= "</table>\n\n</td>\n</tr>\n\n";

	}

	$ListingTable .= "</table>";

  $rnav = mysql_query($qnav) or die(mysql_error());
  $rows = mysql_num_rows($rnav);

  	if($rows > $ByPage)
  	{
    $ListingTable .=  "<br><table align=center width=580>";
    $ListingTable .= "<td align=center><font face=verdana size=2> | ";

    $pages = ceil($rows/$ByPage);

    for($i = 0; $i <= ($pages); $i++)
    {
    	$PageStart = $ByPage*$i;
	
    	$i2 = $i + 1;
	
    	if($PageStart == $Start)
    	{
      $links[] = " <span class=RedLink>$i2</span>\n\t ";
    	}
    	elseif($PageStart < $rows)
    	{
      $links[] = " <a class=BlackLink href=\"search.php?Start=$PageStart&c=$_GET[c]&s=$_GET[s]&AgentID=$_GET[AgentID]&search_city=$_GET[search_city]&search_state=$_GET[search_state]&search_country=$_GET[search_country]&search_PropertyType=$_GET[search_PropertyType]&MinPrice=$_GET[MinPrice]&MaxPrice=$_GET[MaxPrice]&rooms1=$_GET[rooms1]&rooms2=$_GET[rooms2]&bath1=$_GET[bath1]&bath2=$_GET[bath2]&before=$_GET[before]&school=$_GET[school]&transit=$_GET[transit]&park=$_GET[park]&ocean_view=$_GET[ocean_view]&lake_view=$_GET[lake_view]&mountain_view=$_GET[mountain_view]&ocean_waterfront=$_GET[ocean_waterfront]&lake_waterfront=$_GET[lake_waterfront]&river_waterfront=$_GET[river_waterfront]&city=$_GET[city]&p=$_GET[p]&r=$_GET[r]\">$i2</a>\n\t ";	
    	}
    }

    $links2 = implode(" | ", $links);
  
    $ListingTable .= $links2;

    $ListingTable .= "| </td>";

    $ListingTable .= "</table><br>\n";

  	}
}
else
{
	$ListingTable = "<br><br><center>Nenhum resultado encontrado!</center>";
}

require_once("templates/HeaderTemplate.php");
require_once("templates/SearchTemplate.php");	
require_once("templates/FooterTemplate.php");

?>

Quem tiver interesse em tentar dar uma ajeitada no código entre em contato que eu passo todo o script sem custo nenhum. :lol: é só dar um toque!

O Administrador Crab_ já tá com o script em mãos e tá dando uma olhada! :lol:

Edição feita por: murillodocarmo, 26/04/2005, 08:11.





1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq