Location: PHPKode > projects > RabbitBB - Online Web Storage Project > mywebdrive/PHP_CON/acctype/DAOAcctype.php
<?PHP

class DAOAccType
{
	var $db;
	var $db_table;
	var $db_field;
	
	function DAOAccType()
	{
		global $db, $db_table, $db_field;
		$this->db = $db;;
		$this->db_table = $db_table;
		$this->db_field = $db_field;
	}

	function getbid($_id)
	{
		$sqlq = new SQLSelect();
		$sqlq->setSelect($this->db_field['acctypedb'],
			$this->db_table['acctypedb']);
		$sqlq->setWhere($this->db_table['acctype'].".id=".$_id);
		return $this->populate($sqlq->getRow($this->db, $sqlq->SQLReturn()));
	}

	function populate($_res)
	{
		$tobj = array();
		if (!isset($_res[$this->db_table['acctypedb']]))
			return $tobj;
		$acctyperes = $_res[$this->db_table['acctypedb']];

		for ($i=0; $i<count($acctyperes); $i++)
		{
			$tobj[] = $this->createAccType($acctyperes[$i]);
		}
		unset($acctyperes);
		return $tobj;
	}

	function createAccType($_row)
	{
		return new Acctype($_row['id'], $_row['acctype'], $_row['totalsize'], $_row['filemaxsize'],
			$_row['charges'], $_row['status']);
	}
}

?>
Return current item: RabbitBB - Online Web Storage Project