From 8abf8cca2e4aa3adede60e98a2d2cd9505ecdc07 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 5 Mar 2018 19:33:43 +0100 Subject: [PATCH 1/7] [BIGUPDATE: api.core.Checker] remove flexibility --- build/api/core/Checker.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/api/core/Checker.php b/build/api/core/Checker.php index 108cb3e..47ca7c2 100755 --- a/build/api/core/Checker.php +++ b/build/api/core/Checker.php @@ -124,7 +124,8 @@ // Boolean case 'boolean': - return $checker && ( is_bool($value) || $value === 'false' || $value === 'true' ); + case 'bool': + return $checker && is_bool($value); break; // Objet non vide @@ -138,7 +139,7 @@ break; case 'numeric': - return $checker && (is_numeric($value) || $value == null || $value == 'null'); + return $checker && (is_numeric($value) || $value == null); break; case "float": From 56cc3eec82ef8e5ad6590a84e01ee87d657f64a9 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 5 Mar 2018 19:35:35 +0100 Subject: [PATCH 2/7] [module.root] to test params | [config.mdules] --- .../api/module/professor/filterController.php | 109 ++++++++++++++++++ build/api/module/rootController.php | 2 +- config/modules.json | 16 ++- 3 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 build/api/module/professor/filterController.php diff --git a/build/api/module/professor/filterController.php b/build/api/module/professor/filterController.php new file mode 100644 index 0000000..20c5526 --- /dev/null +++ b/build/api/module/professor/filterController.php @@ -0,0 +1,109 @@ + [OPT] Array of formation IDS + * @ues [OPT] Array of UE codes + * + * @return matches Array of matching professor IDs + * + ---------------------------------------------------------*/ + public static function post($args){ + + $formations = null; + $ues = null; + extract($args); + + /** @var ue $ue_repo */ + $ue_repo = Repo::getRepo('ue'); + + + /* (1) If no filter -> return error + ---------------------------------------------------------*/ + /* (1) Exit if no filter */ + if( is_null($formations) && is_null($ues) ) + return ['error' => new Error(Err::MissingParam, 'You must give at least 1 parameter')]; + + /* (2) Init. result array (only keys used for unicity) */ + $matches_uniq = []; + + + + /* (2) Filter by formation + ---------------------------------------------------------*/ + if( !is_null($formations) ){ + + /** @var formation $form_repo */ + $form_repo = Repo::getRepo('formation'); + + /* (1) For each formation -> get request */ + foreach($formations as $form_id){ + + // 1. Ignore if wrong format + if( !is_numeric($form_id) || intval($form_id) !== $form_id ) + continue; + + // 2. Get from repo + $fetched_ids = $form_repo->getProfessors($form_id); + + // 3. Add in unique set + foreach($fetched_ids as $prof_id) + $matches_uniq[ intval($prof_id) ] = null; + + + } + + } + + + + /* (3) Filter by ue + ---------------------------------------------------------*/ + // if( !is_null($ues) ){ + + // /** @var ue $ue_repo */ + // $ue_repo = Repo::getRepo('ue'); + + // /* (1) For each ue -> get request */ + // foreach($ues as $ue_code){ + + // // 1. Ignore if wrong format + // if( !is_numeric($ue_code) || intval($ue_code) !== $ue_code ) + // continue; + + // // 2. Get from repo + // $fetched_ids = $ue_repo->getProfessors($ue_code); + + // // 3. Add in unique set + // foreach($fetched_ids as $prof_id) + // $matches_uniq[ intval($prof_id) ] = null; + + // } + + // } + + + + return ['matches' => array_keys($matches_uniq)]; + + } + +} \ No newline at end of file diff --git a/build/api/module/rootController.php b/build/api/module/rootController.php index 4195916..b210dfb 100644 --- a/build/api/module/rootController.php +++ b/build/api/module/rootController.php @@ -10,7 +10,7 @@ /* Generates the API documentation * */ - public function get($args){ + public function post($args){ extract($args); return [ 'args' => $args ]; diff --git a/config/modules.json b/config/modules.json index 5b96093..247cd0b 100644 --- a/config/modules.json +++ b/config/modules.json @@ -1,9 +1,21 @@ { - "GET": { + "POST": { "des": "Returns the API documentation", "per": [], "par": { - "URL0": { "des": "Method name", "typ": "varchar(1,30)", "ren": "method_name", "opt": true, "def": null } + "URL0": { "des": "Method name", "typ": "varchar(1,30)", "ren": "method_name", "opt": true, "def": null }, + "mixed": { "des": "mixed type", "typ": "mixed", "opt": true }, + "id": { "des": "id type", "typ": "id", "opt": true }, + "text": { "des": "text type", "typ": "text", "opt": true }, + "mail": { "des": "mail type", "typ": "mail", "opt": true }, + "alphanumeric": { "des": "alphanumeric type", "typ": "alphanumeric", "opt": true }, + "letters": { "des": "letters type", "typ": "letters", "opt": true }, + "array": { "des": "array type", "typ": "array", "opt": true }, + "array_id": { "des": "array type", "typ": "array", "opt": true }, + "boolean": { "des": "boolean type", "typ": "boolean", "opt": true }, + "object": { "des": "object type", "typ": "object", "opt": true }, + "numeric": { "des": "numeric type", "typ": "numeric", "opt": true }, + "float": { "des": "float type", "typ": "float", "opt": true } } }, From e3726632a3246197b988d6b87f06886c20159cc8 Mon Sep 17 00:00:00 2001 From: Guillaume FAUVET Date: Mon, 5 Mar 2018 19:39:02 +0100 Subject: [PATCH 3/7] Ajout de la page Administration --- public_html/page/settings.php | 48 ++++++++++++++++++++++++ webpack.config.js | 58 +++++++++++++++++++++++------ webpack/component/settings/view.vue | 23 ++++++++++++ webpack/data/settings.js | 0 webpack/page/settings.js | 35 +++++++++++++++++ webpack/routes/settings.js | 11 ++++++ 6 files changed, 164 insertions(+), 11 deletions(-) create mode 100644 public_html/page/settings.php create mode 100644 webpack/component/settings/view.vue create mode 100644 webpack/data/settings.js create mode 100644 webpack/page/settings.js create mode 100644 webpack/routes/settings.js diff --git a/public_html/page/settings.php b/public_html/page/settings.php new file mode 100644 index 0000000..dfea50c --- /dev/null +++ b/public_html/page/settings.php @@ -0,0 +1,48 @@ + + + + + + + + + + Gestion des enseignants + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 5029084..2a75ec5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,5 @@ -var path = require('path') -var webpack = require('webpack') +var path = require('path'); +var webpack = require('webpack'); const ExtractTextPlugin = require("extract-text-webpack-plugin"); @@ -50,15 +50,51 @@ module.exports = [ { }, { - name: "teacher", - entry: './webpack/page/teacher.js', - output: { - path: path.resolve(__dirname, './public_html/js/bundle'), - publicPath: '/js/bundle/', - filename: 'teacher@0.js' - }, - module: mod_common, - devtool: (process.env.NODE_ENV==='development') ? '#eval-source-map' : false + name: "teacher", + entry: './webpack/page/teacher.js', + output: { + path: path.resolve(__dirname, './public_html/js/bundle'), + publicPath: '/js/bundle/', + filename: 'teacher@0.js' + }, + module: mod_common, + devtool: (process.env.NODE_ENV==='development') ? '#eval-source-map' : false + +}, { + + name: "ue", + entry: './webpack/page/ue.js', + output: { + path: path.resolve(__dirname, './public_html/js/bundle'), + publicPath: '/js/bundle/', + filename: 'ue@0.js' + }, + module: mod_common, + devtool: (process.env.NODE_ENV==='development') ? '#eval-source-map' : false + +}, { + + name: "fiche", + entry: './webpack/page/fiche.js', + output: { + path: path.resolve(__dirname, './public_html/js/bundle'), + publicPath: '/js/bundle/', + filename: 'fiche@0.js' + }, + module: mod_common, + devtool: (process.env.NODE_ENV==='development') ? '#eval-source-map' : false + +}, { + + name: "settings", + entry: './webpack/page/settings.js', + output: { + path: path.resolve(__dirname, './public_html/js/bundle'), + publicPath: '/js/bundle/', + filename: 'settings@0.js' + }, + module: mod_common, + devtool: (process.env.NODE_ENV==='development') ? '#eval-source-map' : false }, { diff --git a/webpack/component/settings/view.vue b/webpack/component/settings/view.vue new file mode 100644 index 0000000..39c13cc --- /dev/null +++ b/webpack/component/settings/view.vue @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/webpack/data/settings.js b/webpack/data/settings.js new file mode 100644 index 0000000..e69de29 diff --git a/webpack/page/settings.js b/webpack/page/settings.js new file mode 100644 index 0000000..856afe2 --- /dev/null +++ b/webpack/page/settings.js @@ -0,0 +1,35 @@ +/* (1) Imports +---------------------------------------------------------*/ +/* (1) NPM libs */ +import Vue from 'vue' +import VueRouter from 'vue-router' +import routes from '../routes/settings' + +/* (2) Vues */ +import wrapper_vue from '../vue/wrapper.vue' + +/* (3) Data */ +require('../data/common'); +require('../data/settings'); + + + + +/* (2) Initialisation +---------------------------------------------------------*/ +/* (1) Init Router */ +const router = new VueRouter({ + mode: 'history', + routes: routes[0] +}); + +/* (2) Store router in gstore */ +gstore.add('router', router); + +/* (3) Render view */ +Vue.use(VueRouter); +new Vue({ + el: '#main-vue', + router, + render: h => h(wrapper_vue) +}); \ No newline at end of file diff --git a/webpack/routes/settings.js b/webpack/routes/settings.js new file mode 100644 index 0000000..767a198 --- /dev/null +++ b/webpack/routes/settings.js @@ -0,0 +1,11 @@ +export default{ 0: [ + + { + path: '/settings/view/', + component: require('../component/settings/view.vue').default + }, { + path: '*', + redirect: '/settings/view/' + } + +]} \ No newline at end of file From 3578b73417a0cce1e05b340821aa2f79202f1aad Mon Sep 17 00:00:00 2001 From: Guillaume FAUVET Date: Mon, 5 Mar 2018 19:39:39 +0100 Subject: [PATCH 4/7] Ajout de la page Fiches --- public_html/page/fiche.php | 48 ++++++++++++++++++++++++++++++++ webpack/component/fiche/view.vue | 23 +++++++++++++++ webpack/data/fiche.js | 0 webpack/page/fiche.js | 35 +++++++++++++++++++++++ webpack/routes/fiche.js | 11 ++++++++ 5 files changed, 117 insertions(+) create mode 100644 public_html/page/fiche.php create mode 100644 webpack/component/fiche/view.vue create mode 100644 webpack/data/fiche.js create mode 100644 webpack/page/fiche.js create mode 100644 webpack/routes/fiche.js diff --git a/public_html/page/fiche.php b/public_html/page/fiche.php new file mode 100644 index 0000000..13d3b0d --- /dev/null +++ b/public_html/page/fiche.php @@ -0,0 +1,48 @@ + + + + + + + + + + Gestion des enseignants + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/webpack/component/fiche/view.vue b/webpack/component/fiche/view.vue new file mode 100644 index 0000000..966eef4 --- /dev/null +++ b/webpack/component/fiche/view.vue @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/webpack/data/fiche.js b/webpack/data/fiche.js new file mode 100644 index 0000000..e69de29 diff --git a/webpack/page/fiche.js b/webpack/page/fiche.js new file mode 100644 index 0000000..c7035a3 --- /dev/null +++ b/webpack/page/fiche.js @@ -0,0 +1,35 @@ +/* (1) Imports +---------------------------------------------------------*/ +/* (1) NPM libs */ +import Vue from 'vue' +import VueRouter from 'vue-router' +import routes from '../routes/fiche' + +/* (2) Vues */ +import wrapper_vue from '../vue/wrapper.vue' + +/* (3) Data */ +require('../data/common'); +require('../data/fiche'); + + + + +/* (2) Initialisation +---------------------------------------------------------*/ +/* (1) Init Router */ +const router = new VueRouter({ + mode: 'history', + routes: routes[0] +}); + +/* (2) Store router in gstore */ +gstore.add('router', router); + +/* (3) Render view */ +Vue.use(VueRouter); +new Vue({ + el: '#main-vue', + router, + render: h => h(wrapper_vue) +}); \ No newline at end of file diff --git a/webpack/routes/fiche.js b/webpack/routes/fiche.js new file mode 100644 index 0000000..475cac6 --- /dev/null +++ b/webpack/routes/fiche.js @@ -0,0 +1,11 @@ +export default{ 0: [ + + { + path: '/fiche/view/', + component: require('../component/fiche/view.vue').default + }, { + path: '*', + redirect: '/fiche/view/' + } + +]} \ No newline at end of file From 5ad2f24ff9f4564a4bfae7bb2307944815cf9433 Mon Sep 17 00:00:00 2001 From: Guillaume FAUVET Date: Mon, 5 Mar 2018 19:39:56 +0100 Subject: [PATCH 5/7] Ajout de la page Gestion UE --- public_html/page/ue.php | 48 +++++++++++++++++++++++++++++++ webpack/component/ue/view.vue | 53 +++++++++++++++++++++++++++++++++++ webpack/data/ue.js | 16 +++++++++++ webpack/page/ue.js | 35 +++++++++++++++++++++++ webpack/routes/ue.js | 11 ++++++++ 5 files changed, 163 insertions(+) create mode 100644 public_html/page/ue.php create mode 100644 webpack/component/ue/view.vue create mode 100644 webpack/data/ue.js create mode 100644 webpack/page/ue.js create mode 100644 webpack/routes/ue.js diff --git a/public_html/page/ue.php b/public_html/page/ue.php new file mode 100644 index 0000000..9241273 --- /dev/null +++ b/public_html/page/ue.php @@ -0,0 +1,48 @@ + + + + + + + + + + Gestion des enseignants + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/webpack/component/ue/view.vue b/webpack/component/ue/view.vue new file mode 100644 index 0000000..c549486 --- /dev/null +++ b/webpack/component/ue/view.vue @@ -0,0 +1,53 @@ + + + + + +s \ No newline at end of file diff --git a/webpack/data/ue.js b/webpack/data/ue.js new file mode 100644 index 0000000..00d6875 --- /dev/null +++ b/webpack/data/ue.js @@ -0,0 +1,16 @@ +/* (1) Load UEs +---------------------------------------------------------*/ +/* (1) Initialize list */ +gstore.add('ues', []); + +/* (2) Get UEs */ +api.call('GET ue', { vh: true }, function(rs) { + + // {1} If error -> abort // + if(rs.error !== 0) + return console.log('No UE found, error: ' + rs.error); + + // {2} Store UEs // + console.log(rs); + gstore.get.ues = rs.ues; +}); diff --git a/webpack/page/ue.js b/webpack/page/ue.js new file mode 100644 index 0000000..88019ac --- /dev/null +++ b/webpack/page/ue.js @@ -0,0 +1,35 @@ +/* (1) Imports +---------------------------------------------------------*/ +/* (1) NPM libs */ +import Vue from 'vue' +import VueRouter from 'vue-router' +import routes from '../routes/ue' + +/* (2) Vues */ +import wrapper_vue from '../vue/wrapper.vue' + +/* (3) Data */ +require('../data/common'); +require('../data/ue'); + + + + +/* (2) Initialisation +---------------------------------------------------------*/ +/* (1) Init Router */ +const router = new VueRouter({ + mode: 'history', + routes: routes[0] +}); + +/* (2) Store router in gstore */ +gstore.add('router', router); + +/* (3) Render view */ +Vue.use(VueRouter); +new Vue({ + el: '#main-vue', + router, + render: h => h(wrapper_vue) +}); \ No newline at end of file diff --git a/webpack/routes/ue.js b/webpack/routes/ue.js new file mode 100644 index 0000000..613f7d8 --- /dev/null +++ b/webpack/routes/ue.js @@ -0,0 +1,11 @@ +export default{ 0: [ + + { + path: '/ue/view/', + component: require('../component/ue/view.vue').default + }, { + path: '*', + redirect: '/ue/view/' + } + +]} \ No newline at end of file From 15c57b7abbb0aa03f1700492b2656ebf3d2be4b3 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 5 Mar 2018 19:42:37 +0100 Subject: [PATCH 6/7] [module.professor] GET fixed VH formula (renamed 'du' to 'hoursToDo') --- build/api/module/professorController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build/api/module/professorController.php b/build/api/module/professorController.php index b7f0b69..2ad71af 100644 --- a/build/api/module/professorController.php +++ b/build/api/module/professorController.php @@ -20,8 +20,8 @@ class professorController{ private static function proccess_vh(array &$vh_prof){ /* (1) If not in category 1 nor 3 -> equivalentTD = TD + 2/3.TP + 1.5.COURS */ - if( !in_array($vh_prof['idCat'], [1,3]) ) - return $vh_prof['equiTD'] = $vh_prof['VHTd'] + (2/3)*$vh_prof['VHTp'] + 1.5*$vh_prof['VHCours']; + if( !in_array($vh_prof['idCat'], [1, 3]) ) + return ( $vh_prof['equiTD'] = $vh_prof['VHTd'] + (2/3)*$vh_prof['VHTp'] + 1.5*$vh_prof['VHCours'] ); // exited because of 'return' statement @@ -29,17 +29,17 @@ class professorController{ $vh_prof['equiTD'] = $vh_prof['VHTd'] + $vh_prof['VHTp'] + 1.5*$vh_prof['VHCours']; /* (3) If equivalentTD exceeds HeuresDues */ - if($vh_prof['equiTD'] > $vh_prof['du']){ + if($vh_prof['equiTD'] > $vh_prof['hoursToDo']){ /* (3.1) @valTP = HeuresDues.(TP / equivalentTD) */ - $valTP = $vh_prof['du'] * ( $vh_prof['VHTp'] / $vh_prof['equiTD'] ); + $valTP = $vh_prof['hoursToDo'] * ( $vh_prof['VHTp'] / $vh_prof['equiTD'] ); /* (3.2) equivalentTD = 1.5*COURS + TD + @valTP + (TP-@valTP) */ $vh_prof['equiTD'] = round(1.5*$vh_prof['VHCours'] + $vh_prof['VHTd'] + $valTP + ($vh_prof['VHTp'] - $valTP)*(2/3), 2); } /* (4) VH comp */ - $vh_prof['VHComp'] = round($vh_prof['equiTD'] - $vh_prof['du'], 2); + $vh_prof['VHComp'] = round($vh_prof['equiTD'] - $vh_prof['hoursToDo'], 2); $vh_prof['VHComp'] = ( $vh_prof['VHComp'] < 0 ) ? 0 : $vh_prof['VHComp']; } @@ -53,7 +53,7 @@ class professorController{ ---------------------------------------------------------*/ public static function get($args){ $prof_id = null; - $with_vh = ''; + $with_vh = 0; extract($args); /* Get the professor repo */ @@ -63,7 +63,7 @@ class professorController{ /* (1) If with VH data ---------------------------------------------------------*/ - if( is_string($with_vh) && $with_vh == '1' ){ + if( is_int($with_vh) && $with_vh === 1 ){ /* (1) Get All professors or 1 by its id (if set) */ $fetched = $prof_repo->getWithVH($prof_id); From 565f9d8d11225c30c2bd5718d279a7adfaac4e4b Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 5 Mar 2018 19:51:28 +0100 Subject: [PATCH 7/7] [webpack.teacher.view] filters now works --- build/api/core/Checker.php | 2 +- .../api/module/professor/filterController.php | 30 +++++++------- build/database/repo/ue.php | 40 +++++++++++++++++++ webpack/data/teacher.js | 2 +- 4 files changed, 57 insertions(+), 17 deletions(-) diff --git a/build/api/core/Checker.php b/build/api/core/Checker.php index 47ca7c2..1c49345 100755 --- a/build/api/core/Checker.php +++ b/build/api/core/Checker.php @@ -106,7 +106,7 @@ break; case 'alphanumeric': - return $checker && is_string($value) && preg_match('/^[\w\.-]+$/ui', $value); + return $checker && is_string($value) && preg_match('/^[\w\. -]+$/ui', $value); break; case 'letters': diff --git a/build/api/module/professor/filterController.php b/build/api/module/professor/filterController.php index 20c5526..3fa8235 100644 --- a/build/api/module/professor/filterController.php +++ b/build/api/module/professor/filterController.php @@ -77,28 +77,28 @@ class filterController{ /* (3) Filter by ue ---------------------------------------------------------*/ - // if( !is_null($ues) ){ + if( !is_null($ues) ){ - // /** @var ue $ue_repo */ - // $ue_repo = Repo::getRepo('ue'); + /** @var ue $ue_repo */ + $ue_repo = Repo::getRepo('ue'); - // /* (1) For each ue -> get request */ - // foreach($ues as $ue_code){ + /* (1) For each ue -> get request */ + foreach($ues as $ue_code){ - // // 1. Ignore if wrong format - // if( !is_numeric($ue_code) || intval($ue_code) !== $ue_code ) - // continue; + // 1. Ignore if wrong format + if( !is_string($ue_code) || strlen($ue_code) < 1 ) + continue; - // // 2. Get from repo - // $fetched_ids = $ue_repo->getProfessors($ue_code); + // 2. Get from repo + $fetched_ids = $ue_repo->getProfessors($ue_code); - // // 3. Add in unique set - // foreach($fetched_ids as $prof_id) - // $matches_uniq[ intval($prof_id) ] = null; + // 3. Add in unique set + foreach($fetched_ids as $prof_id) + $matches_uniq[ intval($prof_id) ] = null; - // } + } - // } + } diff --git a/build/database/repo/ue.php b/build/database/repo/ue.php index 8e89c6f..2c0f82c 100644 --- a/build/database/repo/ue.php +++ b/build/database/repo/ue.php @@ -188,4 +188,44 @@ class ue extends Repo_i { return $fetched; } + + + /* (7) Gets all professors who teaches a UE by code + * + * @code The UE code + * + * @return professors The professors' UID matching the @code of the UE + * + ---------------------------------------------------------*/ + public function getProfessors(String $code) : array{ + + /* (1) Prepare statement */ + $st = $this->pdo->prepare("SELECT p.idProfesseur + FROM Professeur p, UE u + WHERE ( + p.idProfesseur IN ( SELECT p_cr.idProfesseur FROM Professeur p_cr, Cours c WHERE c.Professeur_idProfesseur = p_cr.idProfesseur AND c.UE_code = u.code ) + OR p.idProfesseur IN ( SELECT p_td.idProfesseur FROM Professeur p_td, TD t WHERE t.Professeur_idProfesseur = p_td.idProfesseur AND t.UE_code = u.code ) + OR p.idProfesseur IN ( SELECT p_tp.idProfesseur FROM Professeur p_tp, TP t WHERE t.Professeur_idProfesseur = p_tp.idProfesseur AND t.UE_code = u.code ) + ) + AND u.code = :ue_code;"); + + /* (2) Bind params and execute statement */ + if( is_bool($st) ) return []; + $success = $st->execute([ ':ue_code' => $code ]); + + /* (3) Manage error */ + if( !$success ) + return []; + + /* (4) Get data */ + $fetched = $st->fetchAll(); + + /* (5) Return [] on no result */ + if( $fetched === false ) + return []; + + /* (6) Return data */ + return $fetched; + + } } \ No newline at end of file diff --git a/webpack/data/teacher.js b/webpack/data/teacher.js index 4ee7bbf..2205720 100644 --- a/webpack/data/teacher.js +++ b/webpack/data/teacher.js @@ -69,7 +69,7 @@ gstore.add('filter_handler', function(){ element.remClass('filter-hidden'); // 3.2. Only hide if does not match filter - if( rs.professors.indexOf(local_ptr[e].idProfesseur) <= -1 ) + if( rs.matches.indexOf(local_ptr[e].idProfesseur) <= -1 ) element.addClass('filter-hidden'); }