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

class DAOFindPath
{
	var $db;
	var $db_table;
	var $db_field;

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

	function findPath($_patharray)
	{
		$sqlq=new SQLSelect();
		$sqlq->setSelect($this->db_field['filedirdb'],
			$this->db_table['filedirdb']);
		$sqlq->setSelect($this->db_field['dirattr'],
			$this->db_table['dirattr']);
		$sqlq->setSelect($this->db_field['dirindex'],
			$this->db_table['dirindex']);
		// Get the dir index to id
		$tsql = $this->db_table['dirindex'].".dirname IN (";
		for ($i=0; $i<count($_patharray); $i++)
		{
			$tsql.= $_patharray[$i];
			if ((count($_patharray)-1)>$i)
			{
				$tsql.=","
			}
		}
		$tsql.=")";
		$sqlq->setWhere($tsql);
		unset($tsql);
		$sqlq->setWhere($this->db_table['filedirdb'].".linkid=".
			$this->table['dirattr'].".id");
		$sqlq->setWhere($this->db_table['dirindex'].".fileid=".$this->db_table['filedirdb'].".id");
		$sqlq->setGroup($this->db_table['filedirdb'].".id"):
	}
}

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