diff --git a/materiels.tar.gz b/materiels.tar.gz index fd267dd..73fa49a 100644 Binary files a/materiels.tar.gz and b/materiels.tar.gz differ diff --git a/src/lib/Location.php b/src/lib/Location.php new file mode 100644 index 0000000..0d3b7a9 --- /dev/null +++ b/src/lib/Location.php @@ -0,0 +1,43 @@ + 'int', + 'name' => 'string', + ]; + + public function add($data = []) + { + DB::getInstance()->insert('plugin_materiels_location', $data); + } + + public function edit($id, $data = []) + { + $db = DB::getInstance(); + $db->update('plugin_materiels_location', $data, $db->where('id', $id)); + } + + + public function delete($id) + { + DB::getInstance()->delete('plugin_materiels_location', 'id = ' . $id); + } + + public function get($id) + { + return DB::getInstance()->first('SELECT * FROM plugin_materiels_location WHERE id = ?;', $id); + } + + public function listAll() + { + return DB::getInstance()->get('SELECT * FROM plugin_materiels_location ORDER BY name;'); + } +} diff --git a/src/templates/_nav.tpl b/src/templates/_nav.tpl index 323a59a..151fd2f 100644 --- a/src/templates/_nav.tpl +++ b/src/templates/_nav.tpl @@ -2,6 +2,7 @@