<?php // CMS Database $db = DB::get('cms'); // IDX Object $idx = Util_IDX::getIdx(); // Database Object $db_idx = Util_IDX::getDatabase(); // Search Mode (refine|quicksearch) $mode = $this->config('mode') ? $this->config('mode') : 'refine'; // Button Text (string) $button = $this->config('button') ? $this->config('button') : Lang::write('IDX_SEARCH_REFINE_BUTTON'); // Panels Supplied $panels = $this->config('panels'); // Use IDX Defaults $defaults = $this->config('defaults'); $defaults = isset($defaults) ? $defaults : true; // Agent, Create / Edit Saved Search $backend_user = Auth::get(); $backend_user = $backend_user->isValid() ? $backend_user : false; if (!empty($backend_user) && !empty($_REQUEST['lead_id'])) { $lead = $db->fetch("SELECT `id`, `first_name`, `last_name` FROM `users` WHERE `id` = " . $db->quote($_REQUEST['lead_id']) . ";"); } $oldRequest = $_REQUEST; // Load Saved Search if (!empty($_REQUEST['saved_search_id'])) { // Select IDX Search $search = $db->fetch("SELECT * FROM `" . TABLE_SAVED_SEARCHES . "` WHERE `id` = " . $db->quote($_REQUEST['saved_search_id']) . ";"); // Saved Search global $saved_search; $saved_search = $search;
foreach ($panels as $panel) { // Skip location panels and map tools if (in_array($panel->getId(), array('type', 'city', 'price', 'area', 'zip', 'county', 'subdivision', 'school_district', 'polygon', 'radius', 'bounds'))) { continue; } // Make status & dom panel select inputs if (in_array($panel->getId(), array('status', 'dom'))) { $panel->setFieldType('Select'); } // Remove placeholder from DOM panel if (in_array($panel->getId(), array('dom'))) { $panel->setFieldOptions(array('placeholder' => false)); } // Update placeholder for Location panel if ($panel->getId() === 'location') { $panel->setPlaceholder('City, ' . Locale::spell('Neighborhood') . ', Address, ' . Locale::spell('ZIP') . ' or ' . Lang::write('MLS') . ' Number'); } // Don't allow collapsing $panel->setToggle(false); // Display panel in rows if ($col++ % 4 === 0 && $col > 1) { echo '</div><div class="row">'; } $panel->setPanelClass($panel->getPanelClass() . ' col x3'); $panel->display(); } echo '</div>'; } ?> </div>
<?php /* Listing Details */ $_DETAILS = array(); /* Add To Collection */ $_DETAILS[] = array('heading' => 'Essential Information', 'fields' => array(array('value' => 'ListingMLS', 'title' => Lang::write('MLS_NUMBER')), array('value' => 'ListingPrice', 'title' => 'Price', 'format' => 'us_currency'), array('value' => 'NumberOfBedrooms', 'title' => 'Bedrooms'), array('value' => 'NumberOfBathrooms', 'title' => 'Bathrooms'), array('value' => 'NumberOfBathsFull', 'title' => 'Full Baths'), array('value' => 'NumberOfBathsHalf', 'title' => 'Half Baths'), array('value' => 'NumberOfSqFt', 'title' => 'Square Footage', 'format' => 'number_format'), array('value' => 'DescriptionSqFt', 'title' => 'Square Footage'), array('value' => 'NumberOfAcres', 'title' => 'Acres', 'format' => 'number_format2'), array('value' => 'YearBuilt', 'title' => 'Year Built'), array('value' => 'ListingType', 'title' => 'Type'), array('value' => 'ListingSubType', 'title' => 'Sub-Type'), array('value' => 'ListingStyle', 'title' => 'Style'), array('value' => 'ListingStatus', 'title' => 'Status'))); /* Add To Collection */ $_DETAILS[] = array('heading' => 'Community Information', 'fields' => array(array('value' => 'Address', 'title' => 'Address'), array('value' => 'AddressArea', 'title' => 'Area'), array('value' => 'AddressSubdivision', 'title' => 'Subdivision'), array('value' => 'AddressCity', 'title' => 'City'), array('value' => 'AddressCounty', 'title' => 'County'), array('value' => 'AddressState', 'title' => 'State'), array('value' => 'AddressZipCode', 'title' => 'Zip Code'))); /* Add To Collection */ $_DETAILS[] = array('heading' => 'Amenities', 'fields' => array(array('value' => 'DescriptionAmenities', 'title' => 'Amenities'), array('value' => 'DescriptionUtilities', 'title' => 'Utilities'), array('value' => 'DescriptionFeatures', 'title' => 'Features'), array('value' => 'NumberOfParkingSpaces', 'title' => 'Parking Spaces'), array('value' => 'DescriptionParking', 'title' => 'Parking'), array('value' => 'NumberOfGarages', 'title' => '# of Garages'), array('value' => 'DescriptionGarages', 'title' => 'Garages'), array('value' => 'DescriptionView', 'title' => 'View'), array('value' => 'IsWaterfront', 'title' => 'Is Waterfront', 'format' => 'enum_YN'), array('value' => 'DescriptionWaterfront', 'title' => 'Waterfront'), array('value' => 'HasPool', 'title' => 'Has Pool', 'format' => 'enum_YN'), array('value' => 'DescriptionPool', 'title' => 'Pool'))); /* Add To Collection */ $_DETAILS[] = array('heading' => 'Interior', 'fields' => array(array('value' => 'DescriptionInterior', 'title' => 'Interior'), array('value' => 'DescriptionInteriorFeatures', 'title' => 'Interior Features'), array('value' => 'DescriptionAppliances', 'title' => 'Appliances'), array('value' => 'DescriptionHeating', 'title' => 'Heating'), array('value' => 'DescriptionCooling', 'title' => 'Cooling'), array('value' => 'HasBasement', 'title' => 'Has Basement', 'format' => 'enum_YN'), array('value' => 'DescriptionBasement', 'title' => 'Basement'), array('value' => 'HasFireplace', 'title' => 'Fireplace', 'format' => 'enum_YN'), array('value' => 'NumberOfFireplaces', 'title' => '# of Fireplaces'), array('value' => 'DescriptionFireplace', 'title' => 'Fireplaces'), array('value' => 'NumberOfStories', 'title' => '# of Stories'), array('value' => 'DescriptionStories', 'title' => 'Stories'))); /* Add To Collection */ $_DETAILS[] = array('heading' => 'Exterior', 'fields' => array(array('value' => 'DescriptionExterior', 'title' => 'Exterior'), array('value' => 'DescriptionExteriorFeatures', 'title' => 'Exterior Features'), array('value' => 'DescriptionLot', 'title' => 'Lot Description'), array('value' => 'DescriptionWindows', 'title' => 'Windows'), array('value' => 'DescriptionRoofing', 'title' => 'Roof'), array('value' => 'DescriptionConstruction', 'title' => 'Construction'), array('value' => 'DescriptionFoundation', 'title' => 'Foundation'))); /* Add To Collection */ $_DETAILS[] = array('heading' => 'School Information', 'fields' => array(array('value' => 'SchoolDistrict', 'title' => 'District'), array('value' => 'SchoolElementary', 'title' => 'Elementary'), array('value' => 'SchoolMiddle', 'title' => 'Middle'), array('value' => 'SchoolHigh', 'title' => 'High'))); /* Add To Collection */ $_DETAILS[] = array('heading' => 'Additional Information', 'fields' => array(array('value' => 'ListingDOW', 'title' => 'Days on Website'), array('value' => 'DescriptionZoning', 'title' => 'Zoning'), array('value' => 'IsForeclosure', 'title' => 'Foreclosure', 'format' => 'enum_YN'), array('value' => 'IsShortSale', 'title' => 'Short Sale', 'format' => 'enum_YN'), array('value' => 'IsBankOwned', 'title' => 'RE / Bank Owned', 'format' => 'enum_YN'), array('value' => 'DescriptionHOAFees', 'title' => 'HOA Fees'), array('value' => 'DescriptionHOAFeesFrequency', 'title' => 'HOA Fees Freq.')));
$db_settings = DB::settings('users'); $db_users = new Database_MySQLImproved($db_settings['hostname'], $db_settings['username'], $db_settings['password'], $db_settings['database']); // User Session $user = User_Session::get(); // Auto-Login User from $_GET['uid'] (If not logged into the backend) $authuser = Auth::get(); if (empty($authuser) || !$authuser->isValid()) { if (!empty($_GET['uid'])) { $_GET['uid'] = trim($_GET['uid']); if (Validate::guid($_GET['uid'])) { $lead = $db_users->fetchQuery("SELECT * FROM `" . TABLE_USERS . "` WHERE `guid` = GuidToBinary('" . $db_users->cleanInput($_GET['uid']) . "') LIMIT 1;"); } else { if (Validate::sha1($_GET['uid'])) { $lead = $db_users->fetchQuery("SELECT * FROM `" . TABLE_USERS . "` WHERE SHA1(UPPER(`email`)) = '" . $db_users->cleanInput($_GET['uid']) . "' LIMIT 1;"); } } if (!empty($lead)) { $user->setUserId($lead['id']); } } } // Validate User $user->validate(); // Set userTrackID $userTrackID = $user->user_id() > 0 ? $user->user_id() : false; // Meta Information $page_title = Lang::write('IDX_MAIN_PAGE_TITLE'); $meta_desc = Lang::write('IDX_MAIN_META_DESCRIPTION'); $meta_keyw = Lang::write('IDX_MAIN_META_KEYWORDS'); // Profile end $timer_common->stop();
echo '<input type="hidden" name="lead_id" value="' . $lead['id'] . '">'; } } elseif (!empty($_REQUEST['create_search']) && !empty($backend_user) && !empty($lead)) { echo '<input type="hidden" name="create_search" value="true">'; echo '<input type="hidden" name="lead_id" value="' . $lead['id'] . '">'; } ?> <div class="btnset search-toggle"> <a class="btn" href="#">Show Search Options</a> </div> <div class="fieldset row-1 mobile-hidden" id="toggled-options"> <div class="field ac-input"> <input type="text" name="search_universal" placeholder="SEARCH BY CITY, AREA, NEIGHBORHOOD, ADDRESS, SCHOOL, ZIP, OR <?php echo Lang::write('MLS_NUMBER'); ?> " autocomplete="off"> </div> <?php // REWMOD Laurel 2015/03/27 - updating markup structure to move search dropdowns into labels ?> <div id="dropdown-wrapper" class="dropdown-wrapper"> <div class="dropdown-contain" data-rel="#dropdown-type"> <span class="dropdown-label">Type <i class="icon"></i></span> <div class="dropdown type" id="dropdown-type"> <div class="colset"> <div class="col">