Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
etudiants:2014:jeremy.habit:docuwiki [2014/12/29 15:28] – [Code] jeremy.habit | etudiants:2014:jeremy.habit:docuwiki [2019/08/31 14:21] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 214: | Ligne 214: | ||
</ | </ | ||
- | == Exemple DQL (doctrine) == | + | == Fonction loadViewExecSearch() == |
- | < | + | < |
- | <?php | + | public function loadViewExecSearch($type, |
- | //Création de la requête d'update | + | $tableName=""; |
- | $query = $this->doctrine->em->createQuery("UPDATE utilisateur u SET u.nom ='%$nom%' | + | switch ($type){ |
- | //Exécution de la requête. | + | case " |
- | $search | + | $tableName=" |
+ | break; | ||
+ | case " | ||
+ | $tableName=" | ||
+ | break; | ||
+ | case " | ||
+ | $tableName=" | ||
+ | break; | ||
+ | case " | ||
+ | $tableName=" | ||
+ | break; | ||
+ | case " | ||
+ | break; | ||
+ | case " | ||
+ | $tableName=" | ||
+ | break; | ||
+ | } | ||
+ | |||
+ | $eltInfo=DAO\getAll($type," | ||
+ | |||
+ | if ($type==" | ||
+ | $lstSubElt=DAO\getAll($tableName," | ||
+ | $this->jsutils->getAndBindTo(" | ||
+ | $this-> | ||
+ | $this-> | ||
+ | $this-> | ||
+ | $this-> | ||
+ | $this-> | ||
+ | }else{ | ||
+ | if ($type==" | ||
+ | $lstPartie=DAO\getAll($tableName," | ||
+ | $this->load-> | ||
+ | } | ||
+ | else{ | ||
+ | $this-> | ||
+ | } | ||
+ | } | ||
+ | } | ||
</ | </ | ||
+ | == Vue vRecherche == | ||
- | ===== Design ===== | + | <sxh php; |
+ | <?php echo $script_foot;?> | ||
+ | <div id=" | ||
+ | RECHERCHE | ||
+ | </ | ||
- | ^ Avant^ Aprés^ | + | <br> |
- | |{{: | + | <form name=" |
+ | <div class=" | ||
+ | |||
+ | <img title=" | ||
+ | <input title=" | ||
+ | |||
+ | <div id=" | ||
+ | < | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | < | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | < | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | < | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | < | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | < | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | < | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | <div id=" | ||
+ | |||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | == Vue vResultatRecherche== | ||
+ | |||
+ | <sxh php; | ||
+ | <?php echo $script_foot; | ||
+ | if (empty($tablesNeeded)){ | ||
+ | ?> | ||
+ | <div class=" | ||
+ | <img src="<? | ||
+ | <h1 class=" | ||
+ | </ | ||
+ | <?php | ||
+ | } | ||
+ | else{ | ||
+ | ?> | ||
+ | <h1 class=" | ||
+ | <div class=" | ||
+ | <?php | ||
+ | if (in_array(" | ||
+ | ?> | ||
+ | <div class=" | ||
+ | <h1 class=" | ||
+ | < | ||
+ | </ | ||
+ | <div class=" | ||
+ | <? | ||
+ | foreach ($documents as $doc){ | ||
+ | echo "< | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | <? | ||
+ | } | ||
+ | if (in_array(" | ||
+ | ?> | ||
+ | <div class=" | ||
+ | <h1 class=" | ||
+ | < | ||
+ | </ | ||
+ | <div class=" | ||
+ | <? | ||
+ | foreach ($groupes as $grp){ | ||
+ | echo "< | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | <? | ||
+ | } | ||
+ | if (in_array(" | ||
+ | ?> | ||
+ | <div class=" | ||
+ | <h1 class=" | ||
+ | < | ||
+ | </ | ||
+ | <div class=" | ||
+ | <? | ||
+ | foreach ($domaines as $dom){ | ||
+ | echo "< | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | <? | ||
+ | } | ||
+ | if (in_array(" | ||
+ | ?> | ||
+ | <div class=" | ||
+ | <h1 class=" | ||
+ | < | ||
+ | <? | ||
+ | </ | ||
+ | </ | ||
+ | <div class=" | ||
+ | <? | ||
+ | foreach ($utilisateurs as $user){ | ||
+ | echo "< | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | <? | ||
+ | } | ||
+ | if (in_array(" | ||
+ | ?> | ||
+ | <div class=" | ||
+ | <h1 class=" | ||
+ | < | ||
+ | </ | ||
+ | <div class=" | ||
+ | <? | ||
+ | foreach ($themes as $thm){ | ||
+ | echo "< | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | <? | ||
+ | } | ||
+ | if (in_array(" | ||
+ | ?> | ||
+ | <div class=" | ||
+ | <h1 class=" | ||
+ | < | ||
+ | </ | ||
+ | <div class=" | ||
+ | <? | ||
+ | foreach ($mondes as $world){ | ||
+ | echo "< | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | <? | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | <?php | ||
+ | } | ||
+ | ?> | ||
+ | |||
+ | < | ||
+ | $(function() { | ||
+ | $( " | ||
+ | collapsible: | ||
+ | animate: 500, | ||
+ | heightStyle: | ||
+ | active: null | ||
+ | }); | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | == Vue vExecSearch== | ||
+ | |||
+ | <sxh php; | ||
+ | <?php echo @$script_foot; | ||
+ | switch ($type){ | ||
+ | case " | ||
+ | <h1 class=" | ||
+ | <?php if (empty($lstSubElt)){ | ||
+ | ?> | ||
+ | <div class=" | ||
+ | < | ||
+ | <h1 class=" | ||
+ | </ | ||
+ | <? | ||
+ | }else{ | ||
+ | ?> | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <h1 class=" | ||
+ | < | ||
+ | </ | ||
+ | <div class=" | ||
+ | <? | ||
+ | foreach($lstSubElt as $user){ | ||
+ | echo "< | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | </ | ||
+ | <? | ||
+ | } | ||
+ | break; | ||
+ | case " | ||
+ | <h1 class=" | ||
+ | <?php if(empty($lstPartie)){?> | ||
+ | <div class=" | ||
+ | <img src="<? | ||
+ | <h1 class=" | ||
+ | </ | ||
+ | <? | ||
+ | }else{ | ||
+ | ?> | ||
+ | < | ||
+ | <? | ||
+ | foreach($lstPartie as $partie){ | ||
+ | ?> | ||
+ | < | ||
+ | < | ||
+ | <? | ||
+ | </ | ||
+ | <? | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | <?php | ||
+ | } | ||
+ | break; | ||
+ | case " | ||
+ | <h1 class=" | ||
+ | <?php if (empty($lstSubElt)){ | ||
+ | ?> | ||
+ | <div class=" | ||
+ | < | ||
+ | <h1 class=" | ||
+ | </ | ||
+ | <? | ||
+ | }else{ | ||
+ | ?> | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <h1 class=" | ||
+ | < | ||
+ | </ | ||
+ | <div class=" | ||
+ | <? | ||
+ | foreach($lstSubElt as $thm){ | ||
+ | echo "< | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | </ | ||
+ | <? | ||
+ | } | ||
+ | break; | ||
+ | case " | ||
+ | <h1 class=" | ||
+ | < | ||
+ | </ | ||
+ | <? | ||
+ | break; | ||
+ | case " | ||
+ | <h1 class=" | ||
+ | <?php if (empty($lstSubElt)){ | ||
+ | ?> | ||
+ | <div class=" | ||
+ | < | ||
+ | <h1 class=" | ||
+ | </ | ||
+ | <? | ||
+ | }else{ | ||
+ | ?> | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <h1 class=" | ||
+ | < | ||
+ | </ | ||
+ | <div class=" | ||
+ | <? | ||
+ | foreach($lstSubElt as $doc){ | ||
+ | echo "< | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | </ | ||
+ | <? | ||
+ | } | ||
+ | break; | ||
+ | case " | ||
+ | <h1 class=" | ||
+ | <?php if (empty($lstSubElt)){ | ||
+ | ?> | ||
+ | <div class=" | ||
+ | < | ||
+ | <h1 class=" | ||
+ | </ | ||
+ | <? | ||
+ | }else{ | ||
+ | ?> | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <h1 class=" | ||
+ | < | ||
+ | </ | ||
+ | <div class=" | ||
+ | <? | ||
+ | foreach($lstSubElt as $dom){ | ||
+ | echo "< | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | </ | ||
+ | <? | ||
+ | } | ||
+ | break; | ||
+ | } | ||
+ | ?> | ||
+ | |||
+ | < | ||
+ | $(function() { | ||
+ | $( " | ||
+ | collapsible: | ||
+ | animate: 500, | ||
+ | heightStyle: | ||
+ | active: null | ||
+ | }); | ||
+ | }); | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | == Jquery | ||
+ | |||
+ | <sxh php; | ||
+ | function uncheckTout() | ||
+ | { | ||
+ | idTheme=document.getElementById(' | ||
+ | idGroupe=document.getElementById(' | ||
+ | idDocument=document.getElementById(' | ||
+ | idUtilisateur=document.getElementById(' | ||
+ | idDomaine=document.getElementById(' | ||
+ | idTout=document.getElementById(' | ||
+ | idMonde=document.getElementById(' | ||
+ | |||
+ | // si tous les boxes sont cochées, alors on les décoches et on coche " | ||
+ | if(idMonde.checked==true && idTheme.checked==true && idUtilisateur.checked==true && idDocument.checked==true && idGroupe.checked==true && idDomaine.checked==true){ | ||
+ | idTout.checked=true; | ||
+ | idMonde.checked=false; | ||
+ | idTheme.checked=false; | ||
+ | idGroupe.checked=false; | ||
+ | idDocument.checked=false; | ||
+ | idUtilisateur.checked=false; | ||
+ | idDomaine.checked=false; | ||
+ | }else{ // sinon on décoche " | ||
+ | document.getElementById(' | ||
+ | } | ||
+ | |||
+ | if (idMonde.checked==false && idTheme.checked==false && idUtilisateur.checked==false && idDocument.checked==false && idGroupe.checked==false && idDomaine.checked==false && idTout.checked==false){ | ||
+ | idTout.checked=true; | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | function checkToutOnly() | ||
+ | { | ||
+ | idTheme=document.getElementById(' | ||
+ | idGroupe=document.getElementById(' | ||
+ | idDocument=document.getElementById(' | ||
+ | idUtilisateur=document.getElementById(' | ||
+ | idDomaine=document.getElementById(' | ||
+ | idTout=document.getElementById(' | ||
+ | idMonde=document.getElementById(' | ||
+ | |||
+ | idGroupe.checked=false; | ||
+ | idDocument.checked=false; | ||
+ | idUtilisateur.checked=false; | ||
+ | idDomaine.checked=false; | ||
+ | idTheme.checked=false; | ||
+ | idMonde.checked=false; | ||
+ | |||
+ | if (idMonde.checked==false && idTheme.checked==false && idUtilisateur.checked==false && idDocument.checked==false && idGroupe.checked==false && idDomaine.checked==false && idTout.checked==false){ | ||
+ | idTout.checked=true; | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | // permet la simulation du click sur le bouton recherche via la touche Entrée | ||
+ | document.onkeypress = function (e) { | ||
+ | var enterpressed = e? e.which == 13: window.event.keyCode == 13; | ||
+ | if (enterpressed ){ | ||
+ | document.getElementById(' | ||
+ | return false; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | ===== Design/ Aperçu ===== | ||
+ | |||
+ | Ci-dessous, on peut voir les différents résultats suite à la recherche " | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Et là, ci-dessous, on peut voir les différents résultats suite à la recherche " | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Maintenant voici ce qui se passe au click d'un monde : on a cliqué sur le monde Informatique, | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Et à partir d'ici, si on click sur le domaine Analyse, voici ce qui se passe : on affiche les thèmes présents dans ce domaine soit seulement Analyse fonctionnelle (et ainsi de suite) | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Exemple pour un document : on clique sur le document Document trivia, on affiche alors les parties des documents dans l' | ||
+ | |||
+ | {{: |