Skip to content

Commit

Permalink
Correction barre de recherche - again
Browse files Browse the repository at this point in the history
  • Loading branch information
NailaMelhem committed May 6, 2015
1 parent 28fa223 commit d265df9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Application/Controllers/Recherche.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public function getAutoCompletion($params) {
$mot=$params['recherche'];
$ou = 'titre'; // $params['ou'];

if(!$this->verifierChaine($chaine) ){
/*if(!$this->verifierChaine($chaine) ){
//caracteres non permis
return $this->setApiResult( [] );
}
$ou=$this->echapper($ou);
$ou=$this->echapper($ou);*/

$modelRecette = new \Application\Models\Recette();
$res=$modelRecette->fetchAllLike($mot, $ou, " ORDER BY $ou LIMIT 0,10 ");
Expand All @@ -54,23 +54,23 @@ public function getAutoCompletion($params) {

public function getRecherche($params) {
unset($params['method']);
var_dump("params recu",$params);
//var_dump("params recu",$params);
$mot = $params['recherche'];
$ou = $params['ou'];

var_dump($mot, $ou);
//var_dump($mot, $ou);

if(!$this->verifierChaine($mot) ){
/*if(!$this->verifierChaine($mot) ){
//caracteres non permis
return $this->setApiResult( false, true, 'Vous ne pouvez pas faire cette recherche' );
}
$ou=$this->echapper($ou);
$ou=$this->echapper($ou);*/
//echo "<br> ou apres echappe=".$ou."<br>";
$modelViewRecette = new \Application\Models\ViewRecette();
$res=$modelViewRecette->fetchAllLike($mot, $ou, " ORDER BY $ou ");

var_dump("viewrecettes",$res);
//var_dump("viewrecettes",$res);

if( !empty( $res ) ) {
return $this->setApiResult( $res);
Expand Down

0 comments on commit d265df9

Please sign in to comment.