|
|
@@ -15,7 +15,7 @@ function getLabels() {
|
|
|
return $return;
|
|
|
}
|
|
|
|
|
|
-function getLabelFromId($labelId) {
|
|
|
+function getLabelById($labelId) {
|
|
|
global $db;
|
|
|
|
|
|
$return = array();
|
|
|
@@ -28,4 +28,17 @@ function getLabelFromId($labelId) {
|
|
|
return $return;
|
|
|
}
|
|
|
|
|
|
+function getDocumentsByLabelId($labelId) {
|
|
|
+ global $db;
|
|
|
+
|
|
|
+ $return = array();
|
|
|
+ $documents = $db->query("SELECT * FROM `documents` WHERE `label_id` = " . $labelId . ";");
|
|
|
+
|
|
|
+ foreach($documents as $document) {
|
|
|
+ $return[] = new Document($document->id, $document->filename, $document->path, $document->labelId);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $return;
|
|
|
+}
|
|
|
+
|
|
|
?>
|