<?php

// Load Module's Default Controller
$controller = $this->locateFile('module.php', __FILE__);
if (!empty($controller)) {
    require_once $controller;
}
// Property Type
$type = IDX_Panel::get('Type', array('showTitle' => false, 'toggle' => false));
// Price Range
$price = IDX_Panel::get('Price', array('showTitle' => false, 'toggle' => false));
// Search by City
$city = IDX_Panel::get('City');
// Search by Area
$area = IDX_Panel::get('Area', array('placeholder' => false));
// Search by County
$county = IDX_Panel::get('County', array('placeholder' => false));
// Search by Subdivision
$subd = IDX_Panel::get('Subdivision');
// Search by Zip Code
$zip = IDX_Panel::get('Zip');
// Search by School District
$school = IDX_Panel::get('SchoolDistrict');
		</div>

		<div class="v1-1" style="clear: both;">
			<span class="advanced-link">Need More Options? Try our <a href="/idx/search_form.html">Advanced Search</a></span>
		</div>

		<div id="map-draw-controls" class="hidden">
		<?php 
// Search by Polygon
$polygon = IDX_Panel::get('Polygon');
echo '<div id="field-polygon">' . $polygon->getMarkup() . '</div>';
// Search by Radius
$radius = IDX_Panel::get('Radius');
echo '<div id="field-radius">' . $radius->getMarkup() . '</div>';
// Search by Bounds
$bounds = IDX_Panel::get('Bounds');
echo '<div id="field-bounds">' . $bounds->getMarkup() . '</div>';
?>
		</div>

	</div>

	<div id="main_types" class="menu hidden">
		<header>
			<h4>Property Type</h4>
			<div class="btnset"><a class="close btn"><i class="icon-remove"></i></a></div>
		</header>
		<?php 
$type->display();
?>
	</div>
        $after = array_diff_assoc($panels, $before);
        $search['split'] += count($after);
    }
} elseif (!empty($defaults)) {
    // Load idx defaults for current feed
    $search = $db->fetch("SELECT `criteria` FROM `rewidx_defaults` WHERE `idx` IN (" . $db->quote(Settings::getInstance()->IDX_FEED) . ", '') ORDER BY `idx` DESC LIMIT 1;");
    // Unserialize Search Criteria
    $criteria = unserialize($search['criteria']);
    if (!empty($criteria)) {
        $_REQUEST = array_merge($criteria, $_REQUEST);
    }
}
// Load Panels
foreach ($panels as $id => $panel) {
    // IDX_Panel, Use As-Is.
    if ($panel instanceof IDX_Panel) {
        continue;
    }
    // Panel Options
    $open = $panel['display'];
    $closed = $panel['collapsed'];
    $hidden = $panel['hidden'];
    // Load IDX Panel
    $panel = !empty($open) || !empty($hidden) ? IDX_Panel::get($id, array_merge($panel, array('closed' => !empty($closed) ? true : false, 'hidden' => !empty($hidden) ? true : false, 'fieldType' => $panel['fieldType']))) : false;
    // Require Panel
    if (!empty($panel)) {
        $panels[$id] = $panel;
    } else {
        unset($panels[$id]);
    }
}
 /**
  * Display Builder Panels
  * @param Page $page
  * @return void
  */
 public function display(Page &$page)
 {
     // Add IDX Builder Javascript
     $this->addJavascript($page);
     // Add Missing IDX Panels
     IDX_Panel::displayMissing($this->panels, $_REQUEST);
     // Do not split
     if (is_null($this->split)) {
         $list = array($this->panels);
     } else {
         // Split Panels
         $list = array(array_slice($this->panels, 0, $this->split), array_slice($this->panels, $this->split));
     }
     // Display Panels
     foreach ($list as $i => $panels) {
         // Advanced Panels
         $advanced = $i === 1;
         if (!empty($advanced)) {
             echo '<div class="idx-panels advanced" style="background: #F1F5F8; padding: 10px;">';
             echo '<h2><span class="ui-icon ui-icon-minusthick" style="float: left; margin: 2px 3px 0 0;"></span> More Search Options</h2>';
             echo '<div class="advanced-panels">';
         } else {
             echo '<div class="idx-panels">';
         }
         // Display Panels
         foreach ($panels as $panel) {
             if (isset($this->toggle)) {
                 $panel->setToggle($this->toggle);
             }
             $panel->display();
         }
         // Advanced Panels
         if (!empty($advanced)) {
             echo '</div>';
             echo '</div>';
         } else {
             echo '</div>';
         }
     }
 }
							<?php 
echo IDX_Panel::get('Acres')->display();
?>
						
						</div>
						
						<div class="panels Features"> 
							
							<?php 
echo IDX_Panel::get('Features')->display();
?>
							<?php 
echo IDX_Panel::get('Bedrooms')->display();
?>
							<?php 
echo IDX_Panel::get('Bathrooms')->display();
?>
							
						</div>
						
						<div class="panels Waterfront">
							
							! Custom Waterfront Stuff Goes Here !
							
						</div>
					
					</div>
			
					<div class="criteria-box"><!-- ^_^v --></div>
					
					<div class="btnset">