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

class DAONewDirectory extends DAONewUfd
{
	var $db;
	var $db_table;
	var $db_field;

	function DAONewDirectory()
	{
		global $db, $db_table, $db_field;
		$this->db = $db;
		$this->db_table = $db_table;
		$this->db_field = $db_field;
	}
	
	function newDirectory($_ufdobj)
	{
		$wdirobj = $_ufdobj->getobj();
		$sqlq = "INSERT INTO `".$this->db_table['dirattr']."` (".
			"`dirname`, `fullpath`, `temppass`) VALUES ('".
			$wdirobj->getdirname()."', '".$wdirobj->getfullpath().
			"', '".$wdirobj->gettemppass()."')";

		if ($this->db->sql_query($sqlq, BEGIN_TRANSACTION))
		{
			$NDirid = $this->db->sql_nextid();
			if ($NDirid>0)
			{
				$wdirobj->setid($NDirid);
				$_ufdobj->setobj($wdirobj);
				$_ufdobj->setlinkid($NDirid);
				$NUfdid = $this->newUfd($_ufdobj);
				
				if ($NUfdid>0)
				{
					$_ufdobj->setid($NUfdid);
					return $_ufdobj;
				}
			}
		}
		return null;
	}

	function rollback()
	{
		$this->db->sql_query("", ROLLBACK);
	}
}


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