Ir para conteúdo
Fórum Script Brasil

mistermind

Membros
  • Total de itens

    7
  • Registro em

  • Última visita

Sobre mistermind

mistermind's Achievements

0

Reputação

  1. ESSA E DA PARTE QUE EU QUERO que FUNCIONE para cadastrar o produto é usado ShortDesc no formulario de cadastro, para mostrar o produto usa esse $a1[shortDesc] , como faço para que esse textfield busque no banco de dados? <? require_once("busca_principal.php");?> <form method=POST action="busca_avancada.php"> <div align="left"> </div> <table width=100% align=center bgcolor="#F4F4F4"> <tr> <td width="99"> <p> não FUCIONA <label>teste <input type="text" name="palavras" id="palavras" /> </label> ESSA BUSCA </p> <p> COMO que FA&Ccedil;O PRA FUNCIONAR </p> <p><br> </p> </td> </tr> <tr> <td><p><strong>Em:</strong></p> <p> <?=$AgentsMenu?> <br> </p> <p> <?=$CityMenu?> </p> <p>&nbsp; </p> <p> <?=$StateMenu?> </p> <p>&nbsp;</p></td> </tr> <tr> <td height="25"> <input type=submit name=s1 value="Buscar"></td> </tr> </table> </form> </div></td> </tr> <tr> <td><p> <?=$Account?> <?=$Categories?> </p></td> </tr> </table></td> <td width="564" valign="top"><div align="center"> <table width="491" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="479"><div align="center"></div></td> </tr> <tr> <td height="100%"><div align="center"> <p> ESSA E DA BUSCA busca_principal.php <? require_once("configuracao_mysql.php"); if(isset($_POST[s1])) { if(!empty($_POST[cat])) { $CatInfo = explode("|", $_POST[cat]); $c = $CatInfo[0]; if($CatInfo[1] > '0') { $s = $CatInfo[1]; } } if(!empty($_POST[search_country])) { $search_country = $_POST[search_country]; } if(!empty($_POST[search_state])) { $state = $_POST[search_state]; } if(!empty($_POST[search_city])) { $search_city = $_POST[search_city]; } if(!empty($_POST[search_PropertyType])) { $search_PropertyType = $_POST[search_PropertyType]; } if(!empty($_POST[MinPrice])) { $MinPrice = $_POST[MinPrice]; } if(!empty($_POST[MaxPrice])) { $MaxPrice = $_POST[MaxPrice]; } if(!empty($_POST[MinRooms])) { $rooms1 = $_POST[MinRooms]; } if(!empty($_POST[MaxRooms])) { $rooms2 = $_POST[MaxRooms]; } if(!empty($_POST[MinBath])) { $bath1 = $_POST[MinBath]; } if(!empty($_POST[MaxBath])) { $bath2 = $_POST[MaxBath]; } if(!empty($_POST[AgentID])) { $agent = $_POST[AgentID]; } if(!empty($_POST[old])) { $before = $_POST[old]; } if(!empty($_POST[NearSchool])) { $school = $_POST[NearSchool]; } if(!empty($_POST[NearTransit])) { $transit = $_POST[NearTransit]; } if(!empty($_POST[NearPark])) { $park = $_POST[NearPark]; } if(!empty($_POST[OceanView])) { $ocean_view = $_POST[OceanView]; } if(!empty($_POST[LakeView])) { $lake_view = $_POST[LakeView]; } if(!empty($_POST[MountainView])) { $mountain_view = $_POST[MountainView]; } if(!empty($_POST[OceanWaterfront])) { $ocean_waterfront = $_POST[OceanWaterfront]; } if(!empty($_POST[LakeWaterfront])) { $lake_waterfront = $_POST[LakeWaterfront]; } if(!empty($_POST[RiverWaterfront])) { $river_waterfront = $_POST[RiverWaterfront]; } $url = "buscador.php?c=$c&s=$s&search_country=$_POST[search_country]&search_state=$_POST[search_state]&search_city=$_POST[search_city]&search_PropertyType=$_POST[search_PropertyType]&MaxPrice=$MaxPrice&MinPrice=$MinPrice&rooms1=$rooms1&rooms2=$rooms2&bath1=$bath1&bath2=$bath2&AgentID=$agent&before=$before&school=$school&transit=$transit&park=$park&ocean_view=$ocean_view&lake_view= $lake_view&mountain_view=$mountain_view&ocean_waterfront=$ocean_waterfront&lake_waterfront=$lake_waterfront&river_waterfront=$river_waterfront"; header("location:$url"); exit(); } require_once("includes.php"); /* //create the category menu $CategoryMenu = "<select name=cat>\n\t<option value=\"\"></option>\n\t"; $q1 = "select * from re2_categories order by CategoryName"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $CategoryMenu .= "<option value=\"$a1[CategoryID]|0\">$a1[CategoryName]</option>\n\t"; //get the subcategories $q2 = "select * from re2_subcategories where CategoryID = '$a1[CategoryID]' order by SubcategoryName "; $r2 = mysql_query($q2) or die(mysql_error()); while($a2 = mysql_fetch_array($r2)) { $CategoryMenu .= "<option value=\"$a1[CategoryID]|$a2[SubcategoryID]\">$a1[CategoryName] - $a2[SubcategoryName]</option>\n\t"; } } } $CategoryMenu .= "</select>\n"; */ //create the state menu $StateMenu = "<select name=search_state>\n\t<option value=\"\">Todos os Estados</option>\n\t"; $q1 = "select distinct state from re2_listings order by state"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $StateMenu .= "<option value=\"$a1[state]\">$a1[state]</option>\n\t"; } } $StateMenu .= "</select>\n"; //create the city menu $CityMenu = "<select name=search_city>\n\t<option value=\"\">Todas as Cidades</option>\n\t"; $q1 = "select distinct city from re2_listings order by city"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $CityMenu .= "<option value=\"$a1[city]\">$a1[city]</option>\n\t"; } } $CityMenu .= "</select>\n"; //create the country menu $CountryMenu = "<select name=search_country>\n\t<option value=\"\">Todos os países</option>\n\t"; $q1 = "select distinct country from re2_listings order by country"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $CountryMenu .= "<option value=\"$a1[country]\">$a1[country]</option>\n\t"; } } $CountryMenu .= "</select>\n"; //create the PropertyType menu $TypeMenu = "<select name=search_PropertyType>\n\t<option value=\"\">Todos os tipos</option>\n\t"; $q1 = "select distinct PropertyType from re2_listings order by PropertyType"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $TypeMenu .= "<option value=\"$a1[PropertyType]\">$a1[PropertyType]</option>\n\t"; } } $TypeMenu .= "</select>\n"; //create the Price Minimum menu $MinPrice = "<select name=MinPrice>\n\t<option value=\"\">Mínimo</option>\n\t"; $q1 = "select distinct Price from re2_listings order by Price asc"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $prices .= "<option value=\"$a1[Price]\">R$ $a1[Price]</option>\n\t"; } } $MinPrice .= $prices."</select>\n"; //create the max price menu $MaxPrice = "<select name=MaxPrice>\n\t<option value=\"\">Máximo</option>\n\t"; $MaxPrice .= $prices."</select>\n"; //bedrooms $MinBed = "<select name=MinRooms>\n\t<option value=\"\">Mínimo</option>\n\t"; for($i = '0'; $i <= '20'; $i++) { $bed .= "<option value=\"$i\">$i</option>\n\t"; } $MinBed .= $bed."</select>\n"; $MaxBed = "<select name=MaxRooms>\n\t<option value=\"\">Máximo</option>\n\t"; $MaxBed .= $bed."</select>\n"; //bathrooms $MinBath = "<select name=MinBath>\n\t<option value=\"\">Mínimo</option>\n\t"; for($i = '0'; $i <= '10'; $i++) { $bath .= "<option value=\"$i\">$i</option>\n\t"; } $MinBath .= $bath."</select>\n"; $MaxBath = "<select name=MaxBath>\n\t<option value=\"\">Máximo</option>\n\t"; $MaxBath .= $bath."</select>\n"; //agents menu $q1 = "select AgentID, FirstName, LastName from re2_agents order by FirstName, LastName"; $r1 = mysql_query($q1) or die(mysql_error()); $AgentsMenu = "<select name=AgentID>\n\t<option value=\"\">Todos os agentes</option>\n\t"; if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $AgentsMenu .= "<option value=\"$a1[AgentID]\">$a1[FirstName] $a1[LastName]</option>\n\t"; } } $AgentsMenu .= "</select>\n"; ?> ESSA E DA BUSCA busca_avancada.php <? require_once("configuracao_mysql.php"); if(isset($_POST[s1])) { if(!empty($_POST[cat])) { $CatInfo = explode("|", $_POST[cat]); $c = $CatInfo[0]; if($CatInfo[1] > '0') { $s = $CatInfo[1]; } } if(!empty($_POST[search_country])) { $search_country = $_POST[search_country]; } if(!empty($_POST[search_state])) { $state = $_POST[search_state]; } if(!empty($_POST[search_city])) { $search_city = $_POST[search_city]; } if(!empty($_POST[search_PropertyType])) { $search_PropertyType = $_POST[search_PropertyType]; } if(!empty($_POST[MinPrice])) { $MinPrice = $_POST[MinPrice]; } if(!empty($_POST[MaxPrice])) { $MaxPrice = $_POST[MaxPrice]; } if(!empty($_POST[MinRooms])) { $rooms1 = $_POST[MinRooms]; } if(!empty($_POST[MaxRooms])) { $rooms2 = $_POST[MaxRooms]; } if(!empty($_POST[MinBath])) { $bath1 = $_POST[MinBath]; } if(!empty($_POST[MaxBath])) { $bath2 = $_POST[MaxBath]; } if(!empty($_POST[AgentID])) { $agent = $_POST[AgentID]; } if(!empty($_POST[old])) { $before = $_POST[old]; } if(!empty($_POST[NearSchool])) { $school = $_POST[NearSchool]; } if(!empty($_POST[NearTransit])) { $transit = $_POST[NearTransit]; } if(!empty($_POST[NearPark])) { $park = $_POST[NearPark]; } if(!empty($_POST[OceanView])) { $ocean_view = $_POST[OceanView]; } if(!empty($_POST[LakeView])) { $lake_view = $_POST[LakeView]; } if(!empty($_POST[MountainView])) { $mountain_view = $_POST[MountainView]; } if(!empty($_POST[OceanWaterfront])) { $ocean_waterfront = $_POST[OceanWaterfront]; } if(!empty($_POST[LakeWaterfront])) { $lake_waterfront = $_POST[LakeWaterfront]; } if(!empty($_POST[RiverWaterfront])) { $river_waterfront = $_POST[RiverWaterfront]; } $url = "buscador.php?c=$c&s=$s&search_country=$_POST[search_country]&search_state=$_POST[search_state]&search_city=$_POST[search_city]&search_PropertyType=$_POST[search_PropertyType]&MaxPrice=$MaxPrice&MinPrice=$MinPrice&rooms1=$rooms1&rooms2=$rooms2&bath1=$bath1&bath2=$bath2&AgentID=$agent&before=$before&school=$school&transit=$transit&park=$park&ocean_view=$ocean_view&lake_view=$lake_view&mountain_view= $mountain_view&ocean_waterfront=$ocean_waterfront&lake_waterfront=$lake_waterfront&river_waterfront=$river_waterfront"; header("location:$url"); exit(); } require_once("includes.php"); /* //create the category menu $CategoryMenu = "<select name=cat>\n\t<option value=\"\"></option>\n\t"; $q1 = "select * from re2_categories order by CategoryName"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $CategoryMenu .= "<option value=\"$a1[CategoryID]|0\">$a1[CategoryName]</option>\n\t"; //get the subcategories $q2 = "select * from re2_subcategories where CategoryID = '$a1[CategoryID]' order by SubcategoryName "; $r2 = mysql_query($q2) or die(mysql_error()); while($a2 = mysql_fetch_array($r2)) { $CategoryMenu .= "<option value=\"$a1[CategoryID]|$a2[SubcategoryID]\">$a1[CategoryName] - $a2[SubcategoryName]</option>\n\t"; } } } $CategoryMenu .= "</select>\n"; */ //create the state menu $StateMenu = "<select name=search_state>\n\t<option value=\"\">Todos os Estados</option>\n\t"; $q1 = "select distinct state from re2_listings order by state"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $StateMenu .= "<option value=\"$a1[state]\">$a1[state]</option>\n\t"; } } $StateMenu .= "</select>\n"; //create the city menu $CityMenu = "<select name=search_city>\n\t<option value=\"\">Todas as Cidades</option>\n\t"; $q1 = "select distinct city from re2_listings order by city"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $CityMenu .= "<option value=\"$a1[city]\">$a1[city]</option>\n\t"; } } $CityMenu .= "</select>\n"; //create the country menu $CountryMenu = "<select name=search_country>\n\t<option value=\"\">Todos os países</option>\n\t"; $q1 = "select distinct country from re2_listings order by country"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $CountryMenu .= "<option value=\"$a1[country]\">$a1[country]</option>\n\t"; } } $CountryMenu .= "</select>\n"; //create the PropertyType menu $TypeMenu = "<select name=search_PropertyType>\n\t<option value=\"\">Todos os tipos</option>\n\t"; $q1 = "select distinct PropertyType from re2_listings order by PropertyType"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $TypeMenu .= "<option value=\"$a1[PropertyType]\">$a1[PropertyType]</option>\n\t"; } } $TypeMenu .= "</select>\n"; //create the Price Minimum menu $MinPrice = "<select name=MinPrice>\n\t<option value=\"\">Mínimo</option>\n\t"; $q1 = "select distinct Price from re2_listings order by Price asc"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $prices .= "<option value=\"$a1[Price]\">R$ $a1[Price]</option>\n\t"; } } $MinPrice .= $prices."</select>\n"; //create the max price menu $MaxPrice = "<select name=MaxPrice>\n\t<option value=\"\">Máximo</option>\n\t"; $MaxPrice .= $prices."</select>\n"; //bedrooms $MinBed = "<select name=MinRooms>\n\t<option value=\"\">Mínimo</option>\n\t"; for($i = '0'; $i <= '20'; $i++) { $bed .= "<option value=\"$i\">$i</option>\n\t"; } $MinBed .= $bed."</select>\n"; $MaxBed = "<select name=MaxRooms>\n\t<option value=\"\">Máximo</option>\n\t"; $MaxBed .= $bed."</select>\n"; //bathrooms $MinBath = "<select name=MinBath>\n\t<option value=\"\">Mínimo</option>\n\t"; for($i = '0'; $i <= '10'; $i++) { $bath .= "<option value=\"$i\">$i</option>\n\t"; } $MinBath .= $bath."</select>\n"; $MaxBath = "<select name=MaxBath>\n\t<option value=\"\">Máximo</option>\n\t"; $MaxBath .= $bath."</select>\n"; //agents menu $q1 = "select AgentID, FirstName, LastName from re2_agents order by FirstName, LastName"; $r1 = mysql_query($q1) or die(mysql_error()); $AgentsMenu = "<select name=AgentID>\n\t<option value=\"\">Todos os agentes</option>\n\t"; if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $AgentsMenu .= "<option value=\"$a1[AgentID]\">$a1[FirstName] $a1[LastName]</option>\n\t"; } } $AgentsMenu .= "</select>\n"; require_once("templates/HeaderTemplate.php"); require_once("templates/AdvancedSearchTemplate.php"); if(!ereg("index.php", $_SERVER[SCRIPT_NAME])) { require_once("templates/FooterTemplate.php"); } ?> ESSE DO buscador.php <? require_once("configuracao_mysql.php"); require_once("includes.php"); $query = array(); if(!empty($_GET[c])) { $query[] = "re2_listings.CategoryID = '$_GET[c]' "; } if(!empty($_GET[s])) { $query[] = "re2_listings.SubcategoryID = '$_GET[s]' "; } if(!empty($_GET[AgentID])) { $query[] = "re2_listings.AgentID = '$_GET[AgentID]' "; } if(!empty($_GET[search_country])) { $query[] = "re2_listings.country = '$_GET[search_country]' "; } if(!empty($_GET[search_state])) { $query[] = "re2_listings.state = '$_GET[search_state]' "; } if(!empty($_GET[search_city])) { $query[] = "re2_listings.city = '$_GET[search_city]' "; } if(!empty($_GET[search_PropertyType])) { $query[] = "re2_listings.PropertyType = '$_GET[search_PropertyType]' "; } if(!empty($_GET[MinPrice])) { $query[] = "re2_listings.price >= '$_GET[MinPrice]' "; } if(!empty($_GET[MaxPrice])) { $query[] = "re2_listings.price <= '$_GET[MaxPrice]' "; } if(!empty($_GET[rooms1])) { $query[] = "re2_listings.rooms >= '$_GET[rooms1]' "; } if(!empty($_GET[rooms2])) { $query[] = "re2_listings.rooms <= '$_GET[rooms2]' "; } if(!empty($_GET[bath1])) { $query[] = "re2_listings.bathrooms >= '$_GET[bath1]' "; } if(!empty($_GET[bath2])) { $query[] = "re2_listings.bathrooms <= '$_GET[bath2]' "; } if(!empty($_GET[before])) { $MyDate = strtotime("-$_GET[before]"); $query[] = "re2_listings.DateAdded >= '$MyDate' "; } if(!empty($_GET[school])) { $query[] = "re2_listings.NearSchool = 'y' "; } if(!empty($_GET[transit])) { $query[] = "re2_listings.NearTransit = 'y' "; } if(!empty($_GET[park])) { $query[] = "re2_listings.NearPark = 'y' "; } if(!empty($_GET[ocean_view])) { $query[] = "re2_listings.OceanView = 'y' "; } if(!empty($_GET[lake_view])) { $query[] = "re2_listings.LakeView = 'y' "; } if(!empty($_GET[mountain_view])) { $query[] = "re2_listings.MountainView = 'y' "; } if(!empty($_GET[ocean_waterfront])) { $query[] = "re2_listings.OceanWaterfront = 'y' "; } if(!empty($_GET[lake_waterfront])) { $query[] = "re2_listings.LakeWaterfront = 'y' "; } if(!empty($_GET[river_waterfront])) { $query[] = "re2_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[] = " re2_listings.DateAdded desc "; } if($ov == "Price") { $order[] = " re2_listings.Price asc "; } if($ov == "address") { $order[] = " re2_listings.address asc "; } } } else { if(!empty($_GET[p])) { $order[] = " re2_listings.Price asc "; } if(!empty($_GET[r])) { $order[] = " re2_listings.rooms asc, re2_listings.bathrooms asc, re2_listings.garage asc "; } if(!empty($_GET[city])) { $order[] = " re2_listings.city, re2_listings.address, re2_listings.state "; } } if(count($order) > '0') { $MyOrder = implode(", ", $order); } if(empty($MyOrder)) { $MyOrder = " order by re2_agents.PriorityLevel desc, re2_listings.DateAdded desc"; } else { $MyOrder = " order by re2_agents.PriorityLevel desc, $MyOrder"; } if(!empty($_GET[Start])) { $Start = $_GET[Start]; } else { $Start = '0'; } $ByPage = '10'; $q1 = "select * from re2_listings, re2_agents, re2_priority where re2_listings.AgentID = re2_agents.AgentID and re2_agents.PriorityLevel = re2_priority.PriorityLevel and re2_agents.AccountStatus = 'active' $MyQuery $MyOrder limit $Start, $ByPage "; $qnav = "select * from re2_listings, re2_agents where re2_listings.AgentID = re2_agents.AgentID $MyQuery"; $r1 = mysql_query($q1) or die(mysql_error()); $lrows = mysql_num_rows($r1); if($lrows > '0') { $ListingTable .= "<table align=center width=530 cellspacing=0>\n"; $ListingTable .= "<tr>\n<td width=75>&nbsp;</td>\n\t"; $ListingTable .= "</tr>\n</table>\n\n"; $ListingTable .= "<table align=center width=530 border=0 bordercolor=#336699 rules=rows cellspacing=0>\n"; while($a1 = mysql_fetch_array($r1)) { $ListingTable .= "<tr style=\"border-width:0; border-color:blue\" onMouseOver=\"this.style.background='#F4F4F4'; this.style.cursor='hand'\" onMouseOut=\"this.style.background='white'\" onClick=\"window.open('anuncio.php?id=$a1[ListingID]', '_top')\">\n\t"; $ListingTable .= "<td height=60>"; $ListingTable .= "<table align=center width=\"90%\">\n"; $ListingTable .= "<tr>\n\t<td width=75>"; if(!empty($a1[image])) { $images = explode("|", $a1[image]); $MyImage = $images[0]; $ListingTable .= "<img src=\"fotos_anuncios/$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> $a1[ShortDesc]</b><br>$a1[city], $a1[state]<br>$a1[address], $a1[country]</td>\n\t"; if($a1[garage] > '0') { } $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[ListingID]</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=\"buscador.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"); ?>
  2. Quero modificar esse site e colocar no lugar onde aparece de - até, um textfied que busca a palavra no banco de dados, alguém sabe como faço? De uma olhada http://www.artsvision.com.br/imo
  3. ESTE CODEBOX DA DANDO ERRO AI...VAI AQUI MESMO...DESCULPA AI AMIGO, TA T ENCOMODANDO, beleza...SO QUERO RESOLVE ESSA BUSCA FICO ASSIM NO BUSCADOR.PHP , SERÁ ISSO, DEIXEI O MESMO NOME que você COLOCOU, depois altero <? require_once("configuracao_mysql.php"); require_once("includes.php"); $query = array(); if(!empty($_POST[jnome_do_campo])) { $variavel_nova = $_POST[nome_do_campo]; } $url = "buscador.php?c=$c&s=$s&search_country=$_POST[search_country]&search_state=$_POST[search_state]&search_city=$_POST[search_city]&search_PropertyType=$_POST[search_PropertyType]&MaxPrice=$MaxPrice&MinPrice=$MinPrice&rooms1=$rooms1&rooms2=$rooms2&bath1=$bath1&bath2=$bath2&AgentID=$agent&before=$before&school=$school&transit=$transit&park=$park&ocean_view=$ocean_view&lake_view=$lake_view&mountain_view=$mountain_view&ocean_waterfront=$ocean_waterfront&lake_waterfront=$lake_waterfront&river_waterfront=$river_waterfront&algumcoisa=$variavel_nova"; header("location:$url"); exit(); if(!empty($_GET[c])) { $query[] = "re2_listings.CategoryID = '$_GET[c]' "; } if(!empty($_GET)) { $query[] = "re2_listings.SubcategoryID = '$_GET' "; } E NO PRIMEIRA PAGINA COLOCO O NOME NO TEXTFIELD <? require_once("busca_principal.php");?> <form method=POST action="busca_avancada.php"> <div align="left"> </div> <table width=100% align=center bgcolor="#F4F4F4"> <tr> <td width="99"> <p> não FUCIONA ESSA BUSCA <input name="nome_do_campo" type="text" id="nome_do_campo" /> COMO que FA&Ccedil;O PRA FUNCIONAR </p> <p><br> </p> </td> </tr> <tr> <td><p><strong>Em:</strong><br> <?=$CityMenu?> </p> <p> <?=$AgentsMenu?> </p> <p> <?=$TypeMenu?> </p></td>
  4. essa e da pagina busca principal.php <? require_once("configuracao_mysql.php"); if(isset($_POST[s1])) { if(!empty($_POST[cat])) { $CatInfo = explode("|", $_POST[cat]); $c = $CatInfo[0]; if($CatInfo[1] > '0') { $s = $CatInfo[1]; } } if(!empty($_POST[search_country])) { $search_country = $_POST[search_country]; } if(!empty($_POST[search_state])) { $state = $_POST[search_state]; } if(!empty($_POST[search_city])) { $search_city = $_POST[search_city]; } if(!empty($_POST[search_PropertyType])) { $search_PropertyType = $_POST[search_PropertyType]; } if(!empty($_POST[MinPrice])) { $MinPrice = $_POST[MinPrice]; } if(!empty($_POST[MaxPrice])) { $MaxPrice = $_POST[MaxPrice]; } if(!empty($_POST[MinRooms])) { $rooms1 = $_POST[MinRooms]; } if(!empty($_POST[MaxRooms])) { $rooms2 = $_POST[MaxRooms]; } if(!empty($_POST[MinBath])) { $bath1 = $_POST[MinBath]; } if(!empty($_POST[MaxBath])) { $bath2 = $_POST[MaxBath]; } if(!empty($_POST[AgentID])) { $agent = $_POST[AgentID]; } if(!empty($_POST[old])) { $before = $_POST[old]; } if(!empty($_POST[NearSchool])) { $school = $_POST[NearSchool]; } if(!empty($_POST[NearTransit])) { $transit = $_POST[NearTransit]; } if(!empty($_POST[NearPark])) { $park = $_POST[NearPark]; } if(!empty($_POST[OceanView])) { $ocean_view = $_POST[OceanView]; } if(!empty($_POST[LakeView])) { $lake_view = $_POST[LakeView]; } if(!empty($_POST[MountainView])) { $mountain_view = $_POST[MountainView]; } if(!empty($_POST[OceanWaterfront])) { $ocean_waterfront = $_POST[OceanWaterfront]; } if(!empty($_POST[LakeWaterfront])) { $lake_waterfront = $_POST[LakeWaterfront]; } if(!empty($_POST[RiverWaterfront])) { $river_waterfront = $_POST[RiverWaterfront]; } $url = "buscador.php?c=$c&s=$s&search_country=$_POST[search_country]&search_state=$_POST[search_state]&search_city=$_POST[search_city]&search_PropertyType=$_POST[search_PropertyType]&MaxPrice=$MaxPrice&MinPrice=$MinPrice&rooms1=$rooms1&rooms2=$rooms2&bath1=$bath1&bath2=$bath2&AgentID=$agent&before=$before&school=$school&transit=$transit&park=$park&ocean_view=$ocean_view&lake_view=$lake_view&mountain_view=$mountain_view&ocean_waterfront=$ocean_waterfront&lake_waterfront=$lake_waterfront&river_waterfront=$river_waterfront"; header("location:$url"); exit(); } require_once("includes.php"); /* //create the category menu $CategoryMenu = "<select name=cat>\n\t<option value=\"\"></option>\n\t"; $q1 = "select * from re2_categories order by CategoryName"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $CategoryMenu .= "<option value=\"$a1[CategoryID]|0\">$a1[CategoryName]</option>\n\t"; //get the subcategories $q2 = "select * from re2_subcategories where CategoryID = '$a1[CategoryID]' order by SubcategoryName "; $r2 = mysql_query($q2) or die(mysql_error()); while($a2 = mysql_fetch_array($r2)) { $CategoryMenu .= "<option value=\"$a1[CategoryID]|$a2[SubcategoryID]\">$a1[CategoryName] - $a2[SubcategoryName]</option>\n\t"; } } } $CategoryMenu .= "</select>\n"; */ //create the state menu $StateMenu = "<select name=search_state>\n\t<option value=\"\">Todos os Estados</option>\n\t"; $q1 = "select distinct state from re2_listings order by state"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $StateMenu .= "<option value=\"$a1[state]\">$a1[state]</option>\n\t"; } } $StateMenu .= "</select>\n"; //create the city menu $CityMenu = "<select name=search_city>\n\t<option value=\"\">Todas as Cidades</option>\n\t"; $q1 = "select distinct city from re2_listings order by city"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $CityMenu .= "<option value=\"$a1[city]\">$a1[city]</option>\n\t"; } } $CityMenu .= "</select>\n"; //create the country menu $CountryMenu = "<select name=search_country>\n\t<option value=\"\">Todos os países</option>\n\t"; $q1 = "select distinct country from re2_listings order by country"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $CountryMenu .= "<option value=\"$a1[country]\">$a1[country]</option>\n\t"; } } $CountryMenu .= "</select>\n"; //create the PropertyType menu $TypeMenu = "<select name=search_PropertyType>\n\t<option value=\"\">Todos os tipos</option>\n\t"; $q1 = "select distinct PropertyType from re2_listings order by PropertyType"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $TypeMenu .= "<option value=\"$a1[PropertyType]\">$a1[PropertyType]</option>\n\t"; } } $TypeMenu .= "</select>\n"; //create the Price Minimum menu $MinPrice = "<select name=MinPrice>\n\t<option value=\"\">Mínimo</option>\n\t"; $q1 = "select distinct Price from re2_listings order by Price asc"; $r1 = mysql_query($q1) or die(mysql_error()); if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $prices .= "<option value=\"$a1[Price]\">R$ $a1[Price]</option>\n\t"; } } $MinPrice .= $prices."</select>\n"; //create the max price menu $MaxPrice = "<select name=MaxPrice>\n\t<option value=\"\">Máximo</option>\n\t"; $MaxPrice .= $prices."</select>\n"; //bedrooms $MinBed = "<select name=MinRooms>\n\t<option value=\"\">Mínimo</option>\n\t"; for($i = '0'; $i <= '20'; $i++) { $bed .= "<option value=\"$i\">$i</option>\n\t"; } $MinBed .= $bed."</select>\n"; $MaxBed = "<select name=MaxRooms>\n\t<option value=\"\">Máximo</option>\n\t"; $MaxBed .= $bed."</select>\n"; //bathrooms $MinBath = "<select name=MinBath>\n\t<option value=\"\">Mínimo</option>\n\t"; for($i = '0'; $i <= '10'; $i++) { $bath .= "<option value=\"$i\">$i</option>\n\t"; } $MinBath .= $bath."</select>\n"; $MaxBath = "<select name=MaxBath>\n\t<option value=\"\">Máximo</option>\n\t"; $MaxBath .= $bath."</select>\n"; //agents menu $q1 = "select AgentID, FirstName, LastName from re2_agents order by FirstName, LastName"; $r1 = mysql_query($q1) or die(mysql_error()); $AgentsMenu = "<select name=AgentID>\n\t<option value=\"\">Todos os agentes</option>\n\t"; if(mysql_num_rows($r1) > '0') { while($a1 = mysql_fetch_array($r1)) { $AgentsMenu .= "<option value=\"$a1[AgentID]\">$a1[FirstName] $a1[LastName]</option>\n\t"; } } $AgentsMenu .= "</select>\n"; ?>[/codebox]
  5. estou fazendo um site, mais gostaria de colocar uma busca por palavras , já tem 3 , cidade , agentes e tipos , como faço pra funcionas essa busca de textfield junto com as outras olhem ai <? require_once("busca_principal.php");?> <form method=POST action="busca_avancada.php"> <div align="left"> </div> <table width=100% align=center bgcolor="#F4F4F4"> <tr> <td width="99"> <p> não FUCIONA ESSA BUSCA <input name="busca" type="text" id="busca" /> COMO que FA&Ccedil;O PRA FUNCIONAR </p> <p><br> </p> </td> </tr> <tr> <td><p><strong>Em:</strong><br> <?=$CityMenu?> </p> <p> <?=$AgentsMenu?> </p> <p> <?=$TypeMenu?> </p></td> </tr> <tr> <td height="25"> <input type=submit name=s1 value="Buscar"></td> </tr> </table> </form> </div></td> </tr> <tr> <td><p> <?=$Account?> <?=$Categories?> </p></td> </tr> </table></td> <td width="564" valign="top"><div align="center"> <table width="491" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="479"><div align="center"></div></td> </tr> <tr> <td height="100%"><div align="center"> <p>
  6. alguém tem um script como esse www.soscomercio.com.br , preciso fazer um site como este ...
  7. mistermind

    alguém Sabe ?

    Alguém tem o site como esse, onde posso conseguir---> http://www.soscomercio.com.br
×
×
  • Criar Novo...