<div class="main">
<div>
<div class="panel">
<?php query_posts('cat=8');
while (have_posts()) : the_post(); ?>
<div class="panel-heading">
<a href="#"><h3><?php the_title() ?></h3></a>
</div>
<div class="panel-collapse">
<div class="panel-body">
<?php the_content(); ?>
</div>
</div>
<?php endwhile; wp_reset_query(); ?>
</div>
</div>
</div>
var flat = document.getElementById('flat');
var metro = document.getElementById('metro');
var items_el = document.getElementById('items');
var filter = function() {
var items = items_el.getElementsByClassName('item');
for (var i = 0; i < items.length; i++) {
if ((flat.value == 'all' || flat.value == items[i].dataset.color) &&
(metro.value == 'all' || metro.value == items[i].dataset.shape)) {
items[i].style.display = 'block';
} else {
items[i].style.display = 'none';
}
}
};
flat.addEventListener("change", filter);
metro.addEventListener("change", filter);
$result = mysql_query("SELECT *, 'unix_timestamp(now(date))' as 'dt' FROM city WHERE `regionid`='".$_POST["region"]."'");
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
require_once("connect.php");
require_once'functions.php';
$res = mysql_query(" SELECT DATE_FORMAT(FROM_UNIXTIME(), showDate($time)) ");
$result = mysql_query("SELECT * FROM city WHERE `regionid`='".$_POST["region"]."'");
while ($row = mysql_fetch_array($result,$res))
{
echo "<div class='infoFlat'>";
echo "<h3 value='".$row["id"]."'>".$row["metro"]."</h3>";
echo "<h3 value='".$row["id"]."'>".$row["name"]."</h3>";
echo "<p value='".$row["id"]."'>".$row["texts"]."</p>";
echo "<p value='".$row["id"]."'>".showDate($row["dt"])."</p>"; // <===========
echo "<p value='".$row["id"]."'>".$row["price"]."</p>";
echo "</div>";
}
}