[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Фильтрация по ценам
TUDEAL
Всем привет, очень срочно нужна помощь с фильтрацией по ценам, целый день просидел, гуглил и ничего не нашел подходящего...
Помогите, кому не сложно...

Вот как выглядит моя страница поиска...

<?
if(isset($_POST['realtor'])){$realtor=$_POST['realtor'];}if($realtor==''){unset($realtor);}
if(isset($_POST['object'])){$object=$_POST['object'];}if($object==''){unset($object);}
if(isset($_POST['sector'])){$sector=$_POST['sector'];}if($sector==''){unset($sector);}
if(isset($_POST['street'])){$street=$_POST['street'];}if($street==''){unset($street);}
if(isset($_POST['etaj'])){$etaj=$_POST['etaj'];}if($etaj=='' or $etaj=='Этаж'){unset($etaj);}
if(isset($_POST['rooms'])){$rooms=$_POST['rooms'];}if($rooms=='' or $rooms=='Комнат'){unset($rooms);}
if(isset($_POST['size'])){$size=$_POST['size'];}if($size==''){unset($size);}
if(isset($_POST['sot'])){$sot=$_POST['sot'];}if($sot==''){unset($sot);}
if(isset($_POST['status'])){$status=$_POST['status'];}if($status=='' or $status=='Статус'){unset($status);}
if(isset($_POST['min'])){$min=$_POST['min'];}if($min==''){unset($min);}
if(isset($_POST['mix'])){$mix=$_POST['mix'];}if($max==''){unset($max);}
?>
<?


if(isset($realtor) or isset($object) or isset($sector) or isset($street) or isset($rooms) or isset($etaj) or isset($size) or isset($sot) or isset($status))
{
$search = mysql_query("SELECT * FROM object WHERE (realtor LIKE '%".$realtor."%' and object LIKE '%".$object."%' and sector LIKE '%".$sector."%' and street LIKE '%".$street."%' and rooms LIKE '%".$rooms."%' and etaj LIKE '%".$etaj."%' and size_o LIKE '%".$size."%' and sot LIKE '%".$sot."%' and status LIKE '%".$status."%') ORDER by realtor DESC LIMIT 10");
}
else
{
$search = mysql_query("SELECT * FROM object");
}
$m_s = mysql_fetch_array($search);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<
html>
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<
title>База данных риелторской организации</title>
<
link href="tamplate/style.css" rel="stylesheet" type="text/css">
</
head>

<
body>
<
table width="1165" border="0" align="center" cellpadding="0" cellspacing="0">
<
tr>
<
td height="90" class="header"><img src="tamplate/header.png" width="400" height="80"></td>
</
tr>
<
tr>
<
td height="30" class="menu"><a href="search.php" id="menu_link">Поиск</a> <a href="add.php" id="menu_link">Добавить объект</a> <a href="edit.php" id="menu_link">Изменить</a> <a href="del.php" id="menu_link">Удалить</a> <a href="realtors.php" id="menu_link">Риелторы</a></td>
</
tr>
<
tr>
<
td height="150" valign="top" class="search"><form action="" method="post" name="form1" class="form_search">
<
input name="realtor" type="text" id="textfield2" size="30" maxlength="255" placeholder="Ф.И.О Риелтора">
<
input name="object" type="text" id="textfield2" size="30" maxlength="255" placeholder="Объект">
<
input name="sector" type="text" id="textfield3" size="30" maxlength="255" placeholder="Район">
<
input name="street" type="text" id="textfield4" size="30" maxlength="255" placeholder="Адрес">
<
p>
<
select name="etaj" id="select">
<
option value="" selected>Этаж</option>
<
option value="1">1</option>
<
option value="2">2</option>
<
option value="3">3</option>
<
option value="4">4</option>
<
option value="5">5</option>
<
option value="6">6</option>
<
option value="7">7</option>
<
option value="8">8</option>
<
option value="9">9</option>
<
option value="10">10</option>
<
option value="11">11</option>
<
option value="12">12</option>
<
option value="13">13</option>
<
option value="14">14</option>
<
option value="15">15</option>
<
option value="16">16</option>
<
option value="17">17</option>
<
option value="18">18</option>
<
option value="19">19</option>
<
option value="20">20</option>
<
option value="21">21</option>
<
option value="22">22</option>
<
option value="23">23</option>
<
option value="24">24</option>
<
option value="25">25</option>
</
select>
<
select name="rooms" id="select3">
<
option value="" selected>Комнат</option>
<
option value="1">1</option>
<
option value="2">2</option>
<
option value="3">3</option>
<
option value="4">4</option>
<
option value="5">5</option>
<
option value="6">6</option>
<
option value="7">7</option>
</
select>
<
input name="size" type="text" id="textfield4" size="30" maxlength="255" placeholder="Площадь">
<
input name="sot" type="text" id="textfield4" size="30" maxlength="255" placeholder="Участок (соток) для дома">
<
input name="min" type="text" id="textfield24" size="8" maxlength="40" placeholder="Цена(от)">
<
input name="max" type="text" id="textfield24" size="9" maxlength="40" placeholder="Цена(до)">
<
select name="status">
<
option value="Статус">Статус</option>
<
option value="В продаже">В продаже</option>
<
option value="Продано">Продано</option>
<
option value="Под авансом">Под авансом</option>
<
option value="Снято">Снято</option>
</
select>
</
p>
<
p><input type="submit" value="Отправить"></p>
</
form></td>
</
tr>
<
tr>
<
td class="content"><table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">

<
table width='1000' border='0' cellspacing='0' cellpadding='0' align="center">
<
tr>
<
td width='50' align='center' class="search_title">ID</td>
<
td width='267' align='center' class="search_title">Адрес</td>
<
td width='133' align='center' class="search_title">Цена</td>
<
td width='90' align='center' class="search_title">Комнат</td>
<
td width='138' align='center' class="search_title">Площадь</td>
<
td width='202' align='center' class="search_title">Этаж/Этажность</td>
<
td width='120' align='center' class="search_title">Статус</td>
</
tr>
</
table>

<?
do
printf("

<table width='1000' border='0' cellspacing='0' cellpadding='0' id='search' align='center'>
<tr>
<td width='50' align='center'><strong>%s</strong></td>
<td><strong style='margin-left:10px'>%s</strong></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td width='50'> </td>
<td width='267'><a style='margin-left:10px'>%s</a></td>
<td width='133' align='center'><strong>%s</strong></td>
<td width='90' align='center'><strong>%s</strong></td>
<td width='138' align='center'><strong>%s</strong></td>
<td width='202' align='center'><strong>%s</strong></td>
<td width='120' align='center'><strong style='color:red'>%s</strong></td>
</tr>
<tr>
<td> </td>
<td><a style='margin-left:10px'><em>Риелтор:</em><strong> %s</strong></a></td>
<td colspan='2'><p><em>Тип дома:</em><strong> %s</strong></p></td>
<td colspan='3' rowspan='4' align='left' valign='top'><p><em>Дополнительно:</em><strong> %s</strong></p></td>
</tr>
<tr>
<td> </td>
<td><a style='margin-left:10px'><em>Владелец:</em><strong> %s</strong></a></td>
<td colspan='2'><em>Материал дома:</em><strong> %s</strong></td>
</tr>
<tr>
<td> </td>
<td><a style='margin-left:10px'><em>Документы:</em><strong> %s</strong></a></td>
<td colspan='2'><em>Район:</em><strong> %s</strong></td>
</tr>
<tr>
<td> </td>
<td><a style='margin-left:10px'><em>Дата внесения:</em><a class='date'> %s</a></a></td>
<td colspan='2'><em>Посредник:</em><strong> %s</strong></td>
</tr>
</table>

"
,$m_s['id'],$m_s['street'],$m_s['object'],$m_s['price'].' '.$m_s['valuta'],$m_s['rooms'],$m_s['size_o'].'/'.$m_s['size_z'].'/'.$m_s['size_k'],$m_s['etaj'],$m_s['status'],$m_s['realtor'],$m_s['typeh'],$m_s['comments'].$m_s['filed_1'].' '.$m_s['filed_2'].' '.$m_s['filed_3'].' '.$m_s['filed_4'].' '.$m_s['filed_5'].' '.$m_s['filed_6'].' '.$m_s['filed_7'].' '.$m_s['filed_8'].' '.$m_s['filed_9'].' '.$m_s['filed_10'].' '.$m_s['filed_11'].' '.$m_s['filed_12'],$m_s['contact_u'].' '.$m_s['phone'],$m_s['materio'],$m_s['document'],$m_s['sector'],$m_s['date_add'],$m_s['who']);
while($m_s = mysql_fetch_array($search))
?>


</table>
</
td>
</
tr>
</
table>
</
body>
</
html>
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.