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:27] – [Code] jeremy.habit | etudiants:2014:jeremy.habit:docuwiki [2019/08/31 14:21] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 114: | Ligne 114: | ||
| </ | </ | ||
| - | == Utilisation de DAO == | + | == Fonction resultatSearch() |
| - | < | + | < |
| - | /** | + | public function resultatSearch($searched){ |
| - | * @brief Modification du mot de passe | + | $caseChecked=$this-> |
| - | * @details saisi de l'ancien mot de passe + nouveau mot de passe | + | $searched=urldecode($searched); |
| - | * @details Vérifie si l'un des champs n'est pas vide | + | if ($searched=='undefined' |
| - | */ | + | { |
| - | public function _modifierMDP(){ | + | $src=ressource_url('sad.png'); |
| - | $Passe1 | + | echo "< |
| - | $passe2 | + | < |
| - | $newPasse | + | <h1 class=' |
| - | $user = $this-> | + | </ |
| - | if($Passe1 != null || $passe2 != null || $newPasse | + | }else{ |
| - | if($this-> | + | $documents=array(); |
| - | $user-> | + | $groupes=array(); |
| - | DAO\update($user); | + | $domaines=array(); |
| - | echo | + | $utilisateurs=array(); |
| + | $themes=array(); | ||
| + | $mondes=array(); | ||
| + | $tablesNeeded=array(); | ||
| + | |||
| + | foreach($caseChecked as $valeur) | ||
| + | { | ||
| + | if ($valeur==" | ||
| + | $documents=DAO\getAll(" | ||
| + | $groupes=DAO\getAll(" | ||
| + | $domaines=DAO\getAll(" | ||
| + | $utilisateurs=DAO\getAll(" | ||
| + | $themes=DAO\getAll(" | ||
| + | $mondes=DAO\getAll(" | ||
| + | $allResult=array($documents, | ||
| + | $i=0; | ||
| + | foreach($allResult as $typeRes) | ||
| + | { $strTablesName=""; | ||
| + | $i++; | ||
| + | if (!empty($typeRes)){ | ||
| + | switch ($i){ | ||
| + | case 1: | ||
| + | $strTablesName=" | ||
| + | break; | ||
| + | case 2: | ||
| + | $strTablesName=" | ||
| + | break; | ||
| + | case 3: | ||
| + | $strTablesName=" | ||
| + | break; | ||
| + | case 4: | ||
| + | $strTablesName=" | ||
| + | break; | ||
| + | case 5: | ||
| + | $strTablesName=" | ||
| + | break; | ||
| + | case 6: | ||
| + | $strTablesName=" | ||
| + | break; | ||
| + | } | ||
| + | array_push($tablesNeeded, | ||
| + | } | ||
| + | } | ||
| + | }else{ | ||
| + | if ($valeur==" | ||
| + | ${$valeur." | ||
| + | }else{ | ||
| + | if ($valeur==" | ||
| + | ${$valeur." | ||
| + | }else{ | ||
| + | ${$valeur." | ||
| + | } | ||
| + | } | ||
| + | $allResult=array(); | ||
| + | $allResultName=array(); | ||
| + | array_push($allResult, | ||
| + | array_push($allResultName, | ||
| + | $i=0; | ||
| + | foreach ($allResult as $typeRes){ | ||
| + | $strTablesName=""; | ||
| + | if (!empty($typeRes)){ | ||
| + | $strTablesName=$allResultName[$i]; | ||
| + | array_push($tablesNeeded, | ||
| + | } | ||
| + | $i++; | ||
| + | } | ||
| + | } | ||
| + | |||
| } | } | ||
| + | |||
| + | $this-> | ||
| + | $this-> | ||
| + | $this-> | ||
| + | $this-> | ||
| + | $this-> | ||
| + | $this-> | ||
| + | $this-> | ||
| + | $this-> | ||
| } | } | ||
| - | else{ | + | } |
| - | echo "veuillez saisir les champs mots de passe"; | + | |
| + | </ | ||
| + | |||
| + | == Fonction loadViewExecSearch() == | ||
| + | |||
| + | < | ||
| + | public function loadViewExecSearch($type, | ||
| + | $tableName=""; | ||
| + | switch ($type){ | ||
| + | case " | ||
| + | $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-> | ||
| + | $this-> | ||
| + | $this-> | ||
| + | $this-> | ||
| + | $this-> | ||
| + | $this-> | ||
| + | }else{ | ||
| + | if ($type=="document"){ | ||
| + | $lstPartie=DAO\getAll($tableName," | ||
| + | $this-> | ||
| + | } | ||
| + | else{ | ||
| + | $this-> | ||
| + | } | ||
| } | } | ||
| } | } | ||
| </ | </ | ||
| - | == Exemple DQL (doctrine) == | + | == Vue vRecherche == |
| + | |||
| + | <sxh php; | ||
| + | <?php echo $script_foot;?> | ||
| + | <div id=" | ||
| + | RECHERCHE | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | <form name=" | ||
| + | <div class=" | ||
| + | |||
| + | <img title=" | ||
| + | <input title=" | ||
| + | |||
| + | <div id=" | ||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | < | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | |||
| + | <div id=" | ||
| + | |||
| + | </ | ||
| - | < | ||
| - | <?php | ||
| - | //Création de la requête d' | ||
| - | $query = $this-> | ||
| - | // | ||
| - | $search = $contenu-> | ||
| </ | </ | ||
| + | == 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 "< | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | <?php | ||
| + | } | ||
| + | if (in_array(" | ||
| + | ?> | ||
| + | <div class=" | ||
| + | <h1 class=" | ||
| + | < | ||
| + | </ | ||
| + | <div class=" | ||
| + | <? | ||
| + | foreach ($groupes as $grp){ | ||
| + | echo "< | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | <?php | ||
| + | } | ||
| + | if (in_array(" | ||
| + | ?> | ||
| + | <div class=" | ||
| + | <h1 class=" | ||
| + | < | ||
| + | </ | ||
| + | <div class=" | ||
| + | <? | ||
| + | foreach ($domaines as $dom){ | ||
| + | echo "< | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | <?php | ||
| + | } | ||
| + | if (in_array(" | ||
| + | ?> | ||
| + | <div class=" | ||
| + | <h1 class=" | ||
| + | < | ||
| + | <? | ||
| + | </ | ||
| + | </ | ||
| + | <div class=" | ||
| + | <? | ||
| + | foreach ($utilisateurs as $user){ | ||
| + | echo "< | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | <?php | ||
| + | } | ||
| + | if (in_array(" | ||
| + | ?> | ||
| + | <div class=" | ||
| + | <h1 class=" | ||
| + | < | ||
| + | </ | ||
| + | <div class=" | ||
| + | <? | ||
| + | foreach ($themes as $thm){ | ||
| + | echo "< | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | <?php | ||
| + | } | ||
| + | if (in_array(" | ||
| + | ?> | ||
| + | <div class=" | ||
| + | <h1 class=" | ||
| + | < | ||
| + | </ | ||
| + | <div class=" | ||
| + | <? | ||
| + | foreach ($mondes as $world){ | ||
| + | echo "< | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | <?php | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | <?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=" | ||
| + | <?php | ||
| + | foreach($lstSubElt as $user){ | ||
| + | echo "< | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | </ | ||
| + | <?php | ||
| + | } | ||
| + | break; | ||
| + | case " | ||
| + | <h1 class=" | ||
| + | <?php if(empty($lstPartie)){?> | ||
| + | <div class=" | ||
| + | <img src="<? | ||
| + | <h1 class=" | ||
| + | </ | ||
| + | <?php | ||
| + | }else{ | ||
| + | ?> | ||
| + | < | ||
| + | <?php | ||
| + | foreach($lstPartie as $partie){ | ||
| + | ?> | ||
| + | < | ||
| + | < | ||
| + | <? | ||
| + | </ | ||
| + | <? | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | <? | ||
| + | } | ||
| + | break; | ||
| + | case " | ||
| + | <h1 class=" | ||
| + | <?php if (empty($lstSubElt)){ | ||
| + | ?> | ||
| + | <div class=" | ||
| + | < | ||
| + | <h1 class=" | ||
| + | </ | ||
| + | <? | ||
| + | }else{ | ||
| + | ?> | ||
| + | <div class=" | ||
| + | <div class=" | ||
| + | <h1 class=" | ||
| + | < | ||
| + | </ | ||
| + | <div class=" | ||
| + | <?php | ||
| + | foreach($lstSubElt as $thm){ | ||
| + | echo "< | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | </ | ||
| + | <?php | ||
| + | } | ||
| + | break; | ||
| + | case " | ||
| + | <h1 class=" | ||
| + | < | ||
| + | </ | ||
| + | <?php | ||
| + | break; | ||
| + | case " | ||
| + | <h1 class=" | ||
| + | <?php if (empty($lstSubElt)){ | ||
| + | ?> | ||
| + | <div class=" | ||
| + | < | ||
| + | <h1 class=" | ||
| + | </ | ||
| + | <? | ||
| + | }else{ | ||
| + | ?> | ||
| + | <div class=" | ||
| + | <div class=" | ||
| + | <h1 class=" | ||
| + | < | ||
| + | </ | ||
| + | <div class=" | ||
| + | <?php | ||
| + | foreach($lstSubElt as $doc){ | ||
| + | echo "< | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | </ | ||
| + | <?php | ||
| + | } | ||
| + | break; | ||
| + | case " | ||
| + | <h1 class=" | ||
| + | <?php if (empty($lstSubElt)){ | ||
| + | ?> | ||
| + | <div class=" | ||
| + | < | ||
| + | <h1 class=" | ||
| + | </ | ||
| + | <? | ||
| + | }else{ | ||
| + | ?> | ||
| + | <div class=" | ||
| + | <div class=" | ||
| + | <h1 class=" | ||
| + | < | ||
| + | </ | ||
| + | <div class=" | ||
| + | <?php | ||
| + | foreach($lstSubElt as $dom){ | ||
| + | echo "< | ||
| + | } | ||
| + | ?> | ||
| + | </ | ||
| + | </ | ||
| + | <?php | ||
| + | } | ||
| + | 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) | ||
| + | |||
| + | {{: | ||
| - | ===== Design ===== | + | Exemple pour un document : on clique sur le document Document trivia, on affiche alors les parties des documents dans l' |
| - | ^ Avant^ Aprés^ | + | {{: |
| - | |{{: | + | |