"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 ''; echo ''; echo ''; /**/ echo ''; echo ''; echo ''; echo ''; /**/ echo ''; echo ''; echo ''; echo ''; /**/ echo ''; echo ''; echo ''; echo ''; /**/ echo ''; echo ''; echo ''; echo ''; /**/ echo ''; echo ''; echo ''; echo ''; /**/ echo ''; echo ''; echo ''; echo ''; /**/ 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 '
Median List Price' . $widget_options_table->medianPrice . 'Average List Price' . $widget_options_table->meanPrice . '
Total Inventory' . $widget_options_table->inventory . 'Price per Square Foot' . $widget_options_table->pricePerSquareFoot . '
Average Home Size' . $widget_options_table->medianSquareFoot . 'Median Lot Size' . $widget_options_table->medianLotSize . '
Average # Beds' . $widget_options_table->meanBeds . 'Average # Baths' . $widget_options_table->meanBaths . '
Homes Absorbed' . $widget_options_table->medianAbsorbed . 'Newly Listed' . $widget_options_table->newlyListed . '
Days on Market' . $widget_options_table->daysOnMarket . 'Average Age' . $widget_options_table->meanAge . '
'; } else if ($widget_options["l"] == "b") { echo ''; /**/ echo ''; echo ''; echo ''; /**/ echo ''; echo ''; echo ''; /**/ echo ''; echo ''; echo ''; /**/ echo ''; echo ''; echo ''; /**/ echo ''; echo ''; echo ''; /**/ 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 '
Median List Price' . $widget_options_table->medianPrice . '
Total Inventory' . $widget_options_table->inventory . '
Homes Absorbed' . $widget_options_table->medianAbsorbed . '
Days on Market' . $widget_options_table->daysOnMarket . '
'; } /**/ echo $after_widget; } } /* Widget form control function. This is where options are made configurable. */ function form ($instance = FALSE) { global $Altos_Widgets; /**/ $widget_options = (is_array ($instance) && !empty ($instance)) ? $instance : array(); /**/ if ($Altos_Widgets->is_authenticated ()) { 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; } } ?>