<?php 
class CRoleInfo
{
	var $role_id;
	var $role_grade;
	var $role_name;
	var $role_desc;
};

class CModuleRole extends CModuleBase
{
	function Init()
	{
		$sql = "select * from tb_role order by 1";		
		$this->db->ExeQuerySql($sql);
	
		while($this->db->FetchRow())
		{			
			$mod = new CRoleInfo();
			$mod->role_id = $this->db->Get("role_id");
			$mod->role_grade = $this->db->Get("role_grade");
			$mod->role_name = $this->db->Get("role_name");
			$mod->role_desc = $this->db->Get("role_desc");
			
			$this->modules[$this->GetSize()] = $mod;
		}
		
		$this->db->FreeResult();
	}
	
	function InitModule($module_id)
	{
		$sql = "select * from tb_role where role_id=".$module_id;		
		$this->db->ExeQuerySql($sql);
		while($this->db->FetchRow())
		{			
			$this->module = new CRoleInfo();
			$this->module->role_id = $this->db->Get("role_id");
			$this->module->role_grade = $this->db->Get("role_grade");
			$this->module->role_name = $this->db->Get("role_name");
			$this->module->role_desc = $this->db->Get("role_desc");
		}
		
		$this->db->FreeResult();
	}
};
?>
