From de79bfffde4fd2b6d0aed09d3547d9f04afe0d05 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 11 Mar 2018 17:31:46 +0100 Subject: [PATCH] [webpack.ue.view] update [webpack.ue.data] update [scss.container] update [TODO: add volumes in edit/create] [TODO: implement API/repo] --- build/database/repo/professor.php | 14 +- build/database/repo/ue.php | 8 +- public_html/asset/svg/bell.svg | 44 +++ webpack/component/teacher/view.vue | 2 +- webpack/component/ue/view.vue | 105 +++++-- webpack/data/ue.js | 465 ++++++++++++++++++++++++++++- webpack/scss/container.scss | 11 + 7 files changed, 606 insertions(+), 43 deletions(-) create mode 100644 public_html/asset/svg/bell.svg diff --git a/build/database/repo/professor.php b/build/database/repo/professor.php index fa22578..6f3d391 100644 --- a/build/database/repo/professor.php +++ b/build/database/repo/professor.php @@ -214,21 +214,25 @@ class professor extends Repo_i { /* (1) Prepare Statement */ $st = $this->pdo->prepare("SELECT * FROM `Professeur` WHERE `casLogin` = :cas_login"); - /* (2) Bind params and execute statement */ + /* (2) Check if statement error */ + if( is_bool($st) ) + return NULL; + + /* (3) Bind params and execute statement */ $success = $st->execute([ ':cas_login' => $cas_login ]); - /* (3) Manage error */ + /* (4) Manage error */ if( !$success ) return NULL; - /* (4) Get data */ + /* (5) Get data */ $fetched = $st->fetch(); - /* (5) Return NULL on no result */ + /* (6) Return NULL on no result */ if( $fetched === false ) return NULL; - /* (6) Return data */ + /* (7) Return data */ return $fetched; } diff --git a/build/database/repo/ue.php b/build/database/repo/ue.php index 2c0f82c..31037bd 100644 --- a/build/database/repo/ue.php +++ b/build/database/repo/ue.php @@ -163,11 +163,15 @@ class ue extends Repo_i { public function get(?String $code=null) : ?array{ /* (1) Manage if no id given */ - $cond = is_null($code) ? '' : ' WHERE `code` = :code'; + $cond = is_null($code) ? '' : 'AND `code` = :code'; $parm = is_null($code) ? [] : [':code' => $code]; /* (2) Prepare Statement */ - $st = $this->pdo->prepare("SELECT * FROM `UE`$cond GROUP BY `label` ASC"); + $st = $this->pdo->prepare("SELECT ue.code, ue.label, ue.disabled, ue.required, ue.volumeCours, ue.volumeTD, ue.volumeTP, ue.Formation_idFormation idForm, f.labelFormation labelForm + FROM `UE` ue, `Formation` f + WHERE f.idFormation = ue.Formation_idFormation + $cond + ORDER BY `ue`.`label` ASC"); /* (3) Bind params and execute statement */ if( is_bool($st) ) return []; diff --git a/public_html/asset/svg/bell.svg b/public_html/asset/svg/bell.svg new file mode 100644 index 0000000..822f455 --- /dev/null +++ b/public_html/asset/svg/bell.svg @@ -0,0 +1,44 @@ + +image/svg+xml \ No newline at end of file diff --git a/webpack/component/teacher/view.vue b/webpack/component/teacher/view.vue index dae6a93..401e99c 100644 --- a/webpack/component/teacher/view.vue +++ b/webpack/component/teacher/view.vue @@ -59,7 +59,7 @@
-
+
diff --git a/webpack/component/ue/view.vue b/webpack/component/ue/view.vue index c549486..0a69c4a 100644 --- a/webpack/component/ue/view.vue +++ b/webpack/component/ue/view.vue @@ -1,38 +1,87 @@