<?php 
class cls_ctl_domain
{
	private $perms;
    function __construct()
    {
		global $obj_db;
		$this->perms=array("temp"=>"","type"=>"","url"=>"","title"=>"","id"=>0,"state"=>0);
		$obj_result=$obj_db->query("select * from ".DB_PRE."sys_domain where domain_url='".WEB_URL."'");
		if($obj_rs=$obj_db->fetch_array($obj_result)){
			$this->perms["type"]=$obj_rs["domain_type"];
			$this->perms["url"]=$obj_rs["domain_url"];
			$this->perms["state"]=$obj_rs["domain_state"];
		}
		switch($this->perms["type"]){
			case "fz":
				$obj_result=$obj_db->query("select * from ".DB_PRE."sys_fz where fz_domain='".$this->perms["url"]."'");
				if($obj_rs=$obj_db->fetch_array($obj_result)){
					$this->perms["temp"]=$obj_rs["fz_temp"];
					$this->perms["title"]=$obj_rs["fz_name"];
					$this->perms["id"]=$obj_rs["fz_id"];
					if($obj_rs["fz_state"]<1){
						go_url(WEB_DOMAIN);
						exit;
					}
				}
			case "company":
				if($this->perms["state"]>0){
					$this->perms["id"]=$obj_rs["domain_source_id"];
				}
				break;
		}
    }
	function __destruct()
	{
	}
	function __get($name){
		if(isset($this->perms["$name"])){
			return $this->perms["$name"];
		}
	}
	function __set($name,$value){
		if($this->perms["$name"]){
			$this->perms["$name"]=$value;
		}else{
		}
	}
}
?>