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

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

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

	function renamefile($_fileid, $_rename, $indexid)
	{
		$sqlq = "UPDATE ".$this->db_table['fileattr'].
			" SET filename='".$_rename."' WHERE id=".
			$_fileid;
		if ($this->db->sql_query($sqlq, BEGIN_TRANSACTION))
		{
			$sqlq = "UPDATE ".$this->db_table['dirindex'].
				" SET dirname='".$_rename."' WHERE ".
				"id=".$indexid;
			if ($this->db->sql_query($sqlq, END_TRANSACTION))
			{
				return true;
			}
			else
			{
				$this->db->sql_query("", ROLLBACK);
				return false;
			}
		}
		
	}
}

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