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

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

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

	function delfile($_request, $_response)
	{
		//echo("<PRE>");
		//print_r($_request);

		$sqlq = "DELETE FROM ".$this->db_table['filedirdb'].
			" WHERE id=".$_request['fileid'];
		//echo($sqlq);
		if (!$this->db->sql_query($sqlq, BEGIN_TRANSACTION))
		{
			$this->db->sql_query("", ROLLBACK);
			return false;
		}
		$sqlq = "DELETE FROM ".$this->db_table['fileattr'].
			" WHERE id=".$_request['filedirdb']->getlinkid();
		//echo($sqlq);
		if (!$this->db->sql_query($sqlq))
		{
			$this->db->sql_query("", ROLLBACK);
			return false;
		}
		$sqlq = "DELETE FROM ".$this->db_table['dirindex'].
			" WHERE fileid=".$_request['fileid'];
		if (!$this->db->sql_query($sqlq, END_TRANSACTION))
		{
			$this->db->sql_query("", ROLLBACK);
			return false;
		}
		return true;
	}

}

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