summaryrefslogtreecommitdiff
path: root/www/functions/func_content.php
blob: f7c4629192d53e360a21dcd57b173955f9a480f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php

function get_content($db, $file_id, $owner){

	$content_db = $db->query("SELECT * FROM files WHERE parent=" . $file_id . " AND owner=" . $owner . ";");
	
	$count=0;

	while($row = $content_db->fetchArray(SQLITE3_NUM)){
		$content[$count][0] = $row[0];
		$content[$count][1] = $row[1];
		$content[$count][2] = $row[2];
		$content[$count][3] = $row[3];
		$content[$count][4] = $row[4];
		$content[$count][5] = $row[5];
		$content[$count][6] = $row[6];
		$content[$count][7] = $row[7];
		$content[$count][8] = $row[8];
		$count++;
	}

/*
	var_dump($content); exit;
	if($content[0][4] == "FILE"){
		if(!start_file_download($username, $folder_path)){
			echo "False!"; exit;
			return false;
		} else {
			echo "True!"; exit;
			return true;
		}
	}
*/
	if(!empty($content)){
		return $content;	// returns everything listed in the folder which is commited as parameter
	} else {
		return false;		// empty folder
	}
}