JustPaste.it
User avatar
@anonymous · May 24, 2011

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));

// now that we're in the specialized content file for this block type,
// we'll include this block type's class, and pass the block to it, and get
// the content

$ih = Loader::helper("image");
$textHelper = Loader::helper("text");
?>
<style>
#mainform div.title {
4px;
padding:4px;
background:#eee;
display:inline-block;
}
img.ccm-output-thumbnail {
position:absolute;
top:10px;
left:5px;
background:#fff;
border:1px solid #dadada;
padding:5px;
}
.thumbnail img.ccm-output-thumbnail {
border:1px solid #dadada;
}
.thumbnail img.ccm-output-thumbnail:hover {
border:1px solid #aaaaaa;
}
#mainform {
padding:8px;
text-align: center;
zoom: 1;
overflow: visible;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
padding-right: 10px;
padding-left: 10px;
border: 1px solid #999;
color: black;
background: #F3F3F3;
background-image: -moz-linear-gradient(top,white,#EBEBEB);
background-image: -webkit-gradient(linear,left top,left bottom,from(white),to(#EBEBEB));
filter: progid:DXImageTransform.Microsoft.Gradient(startColorStr=white,endColorStr=#EBEBEB);
outline: 0;
-moz-box-shadow: 0 0 3px #999;
-webkit-box-shadow: 0 0 3px #999;
box-shadow: 0 0 3px #999;
}
.eachlisting {
8px;
width: auto;
border: 1px solid #dadada;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
position: relative;
min-height: 150px;
height:150px;
}
.eachlisting:hover {
border-color: #999;
outline: 0;
-moz-box-shadow: 0 0 3px #999;
-webkit-box-shadow: 0 0 3px #999;
box-shadow: 0 0 3px #999;
}
.listingright {
padding: 10px 10px 10px 180px;
width: auto;
position: static;
}
.listingleft {
position:relative;
}
</style>

<div id="mainform">
<h4>Search Housing Options</h4>
<form action="#" id="filteringlink" method="POST">
<div class="title">
<div>Property Type</div>
<select name="propertytype" class="select">
<option>Show All</option>
<option <? if ($_POST['propertytype']== 'Apartment') {echo "selected";} ?>>Apartment</option>
<option <? if ($_POST['propertytype']== 'Duplex') {echo "selected";} ?>>Duplex</option>
<option <? if ($_POST['propertytype']== 'Mobile Home') {echo "selected";} ?>>Mobile Home</option>
<option <? if ($_POST['propertytype']== 'Multi Family Home') {echo "selected";} ?>>Multi Family Home</option>
<option <? if ($_POST['propertytype']== 'Single Family Home') {echo "selected";} ?>>Single Family Home</option>
<option <? if ($_POST['propertytype']== 'Townhouse') {echo "selected";} ?>>Townhouse</option>
</select>
</div>
<div class="title">
<div>Price Range</div>
<select name="pricerange" class="select">
<option>Show All</option>
<option <? if ($_POST['pricerange']== '$500 and below') {echo "selected";} ?>>$500 and below</option>
<option <? if ($_POST['pricerange']== '$500 to $750') {echo "selected";} ?>>$500 to $750</option>
<option <? if ($_POST['pricerange']== '$750 to $1200') {echo "selected";} ?>>$750 to $1200</option>
<option <? if ($_POST['pricerange']== '$1200 and above') {echo "selected";} ?>>$1200 and above</option>
</select>
</div>
<div class="title">
<div>Bedroom/s</div>
<select name="bedrooms" class="select">
<option>Show All</option>
<option <? if ($_POST['bedrooms']== '1') {echo "selected";} ?>>1</option>
<option <? if ($_POST['bedrooms']== '2') {echo "selected";} ?>>2</option>
<option <? if ($_POST['bedrooms']== '3') {echo "selected";} ?>>3</option>
<option <? if ($_POST['bedrooms']== '4+') {echo "selected";} ?>>4+</option>
</select>
</div>
<div class="title">
<div>Bathroom/s</div>
<select name="bathrooms" class="select">
<option>Show All</option>
<option <? if ($_POST['bathrooms']== '1') {echo "selected";} ?>>1</option>
<option <? if ($_POST['bathrooms']== '1.5') {echo "selected";} ?>>1.5</option>
<option <? if ($_POST['bathrooms']== '2') {echo "selected";} ?>>2</option>
<option <? if ($_POST['bathrooms']== '2.5') {echo "selected";} ?>>2.5</option>
<option <? if ($_POST['bathrooms']== '3') {echo "selected";} ?>>3</option>
</select>
</div>
<input name="submit" class="submit" type="submit" value="Search" />
</form>
<?php
if(!$previewMode && $controller->rss) {
$btID = $b->getBlockTypeID();
$bt = BlockType::getByID($btID);
$uh = Loader::helper('concrete/urls');
$rssUrl = $controller->getRssUrl($b);?>
<div class="rssIcon">
<a href='' target="_blank"><img src="<?php echo $uh->getBlockTypeAssetsURL($bt, 'rss.png')?>" width="14" height="14" /></a>
</div>
<link href='' rel="nofollow" type="application/rss+xml" title="<?php echo $controller->rssTitle?>" />
<?php } ?>
</div>

<?php
if (count($cArray) > 0) { ?>
<div class="ccm-page-list">
<?php
$pt == 'Show All';
$pr == 'Show All';
$br == 'Show All';
$ba == 'Show All';

if (isset($_POST['submit'])) {
$pt = $_POST['propertytype'];
$pr = $_POST['pricerange'];
$br = $_POST['bedrooms'];
$ba = $_POST['bathrooms'];
}

for ($i = 0; $i < count($cArray); $i++ ) {
$cobj = $cArray[$i];
$title = $cobj->getCollectionName();
$propertytype = $cobj->getAttribute('propertytype');
$pricerange = $cobj->getAttribute('pricerange');
$bedrooms = $cobj->getAttribute('bedrooms');
$bathrooms = $cobj->getAttribute('bathrooms');

if (($propertytype == $pt or $pt == 'Show All') and ($pricerange == $pr or $pr == 'Show All') and ($bedrooms == $br or $br == 'Show All') and ($bathrooms == $ba or $ba == 'Show All')) { ?>
<div class="eachlisting" id="listing-<?php echo $i;?>">
<div class="listingleft">
<?php
$logo = $cobj->getAttribute('pageListThumbnail');
if($logo) { ?><div class="thumbnail"><?php $ih->outputThumbnail($logo, 150,150, $title);?></div><?php }?>
</div>
<div class="listingright">
<h3 class="ccm-page-list-title">
<?php
$th = Loader::helper('concrete/urls');
$bt = $b->getBlockTypeObject(); ?>
<a id="<?php echo $cobj->getCollectionID()?>" class="button eachlistinglink hastipsy" target="_blank" title="<?php echo t('All Details')?>" href=''><?php echo $title;?></a>
</h3>
<h4>
<?php echo t('Details');?>
</h4>
<p>This <b><?php echo $propertytype;?></b> is in<b> <?php echo $pricerange;?></b> price range.<br>
<b><?php echo $bedrooms;?></b> bedroom/s, <b><?php echo $bathrooms;?></b> bathroom/s.</p>
<div class="ccm-page-list-description">
<?php
if(!$controller->truncateSummaries)
{
echo $cobj->getCollectionDescription();
} else {
echo $textHelper->shorten($cobj->getCollectionDescription(),$controller->truncateChars);
} ?>
</div>
</div>
</div>

<?php }
} ?>
</div>
<?php } ?>

<script type="text/javascript">
$(function() {
$('a.eachlistinglink').each(function() {
$(this).unbind();
$(this).click(function() {
var url = $(this).attr('href');
jQuery.fn.dialog.open({
href: url,
modal: false,
title: $(this).attr('title')
});
return false;
});
});
});
</script>