<?php

class stat {
	private $stat_id;
	private $stat_name;
	private $stat_order;
	private $stat_deleted;


	public function set_stat_id($_item) {
		$this->stat_id = $_item;
	}

	public function set_stat_name($_item) {
		$this->stat_name = $_item;
	}

	public function set_stat_order($_item) {
		$this->stat_order = $_item;
	}

	public function set_stat_deleted($_item) {
		$this->stat_deleted = $_item;
	}

	public function get_stat_id() {
		return $this->stat_id;
	}

	public function get_stat_name() {
		return $this->stat_name;
	}

	public function get_stat_order() {
		return $this->stat_order;
	}

	public function get_stat_deleted() {
		return $this->stat_deleted;
	}

	public function set_stat_data_by_id($_stat_id) {
		global $sql;
		$stat_data_assoc_array = $sql->assoc_array("select * from statistics where stat_id = " . $_stat_id);
		$stat_data_array = $stat_data_assoc_array[0];
		foreach ($stat_data_array as $field => $value) {
			$function_name = "set_" . $field;
			$this->$function_name($value);
			
		}
	}

}



?>