summaryrefslogtreecommitdiff
path: root/public/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'public/app/models')
-rw-r--r--public/app/models/admin/Privilege_model.php42
-rw-r--r--public/app/models/cms/Course_model.php3
2 files changed, 44 insertions, 1 deletions
diff --git a/public/app/models/admin/Privilege_model.php b/public/app/models/admin/Privilege_model.php
new file mode 100644
index 0000000..c385484
--- /dev/null
+++ b/public/app/models/admin/Privilege_model.php
@@ -0,0 +1,42 @@
+<?php
+
+namespace app\models\admin;
+
+use Registry;
+use Render;
+
+
+class Privilege_model {
+
+ /** privileges
+ * ---
+ * get all privileges
+ *
+ * @param void
+ * @return privileges (array)
+ */
+ public static function privileges()
+ {
+ return Registry::use('database')->runQuery(
+ "SELECT * FROM privilege",[]
+ );
+ }
+
+ /** edit privileges
+ * ---
+ */
+ public static function edit_privileges()
+ {
+ // TODO: ...
+ }
+
+
+ /** update course
+ * ---
+ */
+ public static function update_course()
+ {
+ // TODO: ...
+ }
+
+} \ No newline at end of file
diff --git a/public/app/models/cms/Course_model.php b/public/app/models/cms/Course_model.php
index 4fb49c0..4740a4f 100644
--- a/public/app/models/cms/Course_model.php
+++ b/public/app/models/cms/Course_model.php
@@ -14,7 +14,7 @@ class Course_model {
public static function get_categories()
{
return Registry::use('database')->runQuery(
- "SELECT * FROM course",
+ "SELECT * FROM course ORDER BY `order`",
[]
);
}
@@ -74,6 +74,7 @@ class Course_model {
'rec' => [
'id' => $rec['id'],
'label' => $rec['label'],
+ 'order' => $rec['order'],
'parent' => $rec['parent_id']
],
'childs' => self::to_tree($dataset, $child) // recursively