"altos-widgets-stat-table-widget", "description" => "Altos Stat Table"); $control_ops = array ("width" => 300, "id_base" => "altos_widgets_stat_table_widget"); $this->WP_Widget ($control_ops["id_base"], "Altos Stat Table", $widget_ops, $control_ops); /**/ return; } /* Widget display function. This is where the widget actually does something. */ function widget ($args = FALSE, $instance = FALSE) { extract ($args); /**/ global $Altos_Widgets; /**/ $widget_options = (is_array ($instance) && !empty ($instance)) ? $instance : array(); /**/ if ($Altos_Widgets->is_authenticated () && isset ($widget_options["table"])) { $widget_options_table = $Altos_Widgets->get_stat_table($widget_options["st"], $widget_options["cid"], $widget_options["zid"], $widget_options["rt"], $widget_options["ra"], $widget_options["q"])->response; /**/ echo $before_widget . $before_title . $widget_options["title"] . $after_title; /**/ if ($widget_options["l"] == "f") { echo '
| ';
echo ($widget_options["url"]) ? '' : '';
echo $widget_options_table->rollingAverage . ' stats for ' . $widget_options_table->residenceType . ' properties in ' . $widget_options_table->cityName . ', ' . $widget_options_table->state . ' ' . $widget_options_table->zipCode . ' as of ' . $widget_options_table->date; echo ($widget_options["url"]) ? '' : ''; echo ' | ';
echo '|||
|---|---|---|---|
| Median List Price | ' . $widget_options_table->medianPrice . ' | '; echo 'Average List Price | ' . $widget_options_table->meanPrice . ' | '; echo '
| Total Inventory | ' . $widget_options_table->inventory . ' | '; echo 'Price per Square Foot | ' . $widget_options_table->pricePerSquareFoot . ' | '; echo '
| Average Home Size | ' . $widget_options_table->medianSquareFoot . ' | '; echo 'Median Lot Size | ' . $widget_options_table->medianLotSize . ' | '; echo '
| Average # Beds | ' . $widget_options_table->meanBeds . ' | '; echo 'Average # Baths | ' . $widget_options_table->meanBaths . ' | '; echo '
| Homes Absorbed | ' . $widget_options_table->medianAbsorbed . ' | '; echo 'Newly Listed | ' . $widget_options_table->newlyListed . ' | '; echo '
| Days on Market | ' . $widget_options_table->daysOnMarket . ' | '; echo 'Average Age | ' . $widget_options_table->meanAge . ' | '; echo '
| ';
echo ($widget_options["url"]) ? '' : '';
echo $widget_options_table->cityName . ', ' . $widget_options_table->state . ' ' . $widget_options_table->zipCode . ' '; echo $widget_options_table->residenceType . ' '; echo $widget_options_table->date; echo ($widget_options["url"]) ? '' : ''; echo ' | ';
echo '|
|---|---|
| Median List Price | ' . $widget_options_table->medianPrice . ' | '; echo '
| Total Inventory | ' . $widget_options_table->inventory . ' | '; echo '
| Homes Absorbed | ' . $widget_options_table->medianAbsorbed . ' | '; echo '
| Days on Market | ' . $widget_options_table->daysOnMarket . ' | '; echo '
'; echo ''; echo '
'; /**/ echo ''; echo ''; echo '
'; /**/ echo ''; echo ''; echo '
'; /**/ echo ''; echo ''; echo '
'; /**/ echo ''; echo ''; echo '
'; /**/ echo ''; echo ''; } else { $Altos_Widgets->login_form (); } } /* Widget update function. This is where an updated instance is configured/stored. */ function update ($instance = FALSE, $old = FALSE) { global $Altos_Widgets; /**/ $widget_options = stripslashes_deep ($instance); /**/ list ($widget_options["st"], $widget_options["cid"], $widget_options["zid"]) = explode (",", $widget_options["st,cid,zid"]); /**/ $table = $Altos_Widgets->get_stat_table ($widget_options["st"], $widget_options["cid"], $widget_options["zid"], $widget_options["rt"], $widget_options["ra"], $widget_options["q"]); /**/ if ($Altos_Widgets->has_error ($table)) { $Altos_Widgets->print_error_message ($table); return $old; /* Revert to previous options. */ } /**/ $widget_options["table"] = $table; return $widget_options; } } ?>