<?php

//ISKOLA-VÁROS OSZTÁLY


class school_city {
	private $scc_id;
	private $scc_city;
	private $scc_order;
	private $scc_deleted;

	public function set_scc_id($_id) {
		$this->scc_id = $_id;
	}

	public function set_scc_city($_city) {
		$this->scc_city = $_city;
	}

	public function set_scc_order($_order) {
		$this->scc_order = $_order;
	}

	public function set_scc_deleted($_deleted) {
		$this->scc_deleted = $_deleted;
	}

	public function get_scc_id() {
		return $this->scc_id;
	}

	public function get_scc_city() {
		return $this->scc_city;
	}

	public function get_scc_order() {
		return $this->scc_order;
	}

	public function get_scc_deleted() {
		return $this->scc_deleted;
	}

	public static function create_school_city($_scc_city) {
		global $sql;
		return $sql->insert_into('school_city', array('scc_city' => $_scc_city));
	}

	public static function update_school_city($_scc_id, $_scc_city, $_scc_order) {
		global $sql;
		$sql->update_table('school_city', array('scc_city' => $_scc_city, 'scc_order' => $_scc_order), array('scc_id' => $_scc_id));
	}


	public function set_school_city_data_by_id($_scc_id) {
		global $sql, $school_city;
		$school_city_data_assoc_array = $sql->assoc_array("select * from school_city where scc_id = " . $_scc_id);
		$school_city_data_array = $school_city_data_assoc_array[0];
		foreach ($school_city_data_array as $field => $value) {
			$function_city = "set_" . $field;
			$this->$function_city($value); //alapadatok beállítása
		}
	}


}


?>