diff --git a/src/WebApp/application/views/accueil.php b/src/WebApp/application/views/accueil.php index 013356b249bc4bc6cf0a73b2570fcd3511020ad0..29d7a4eef3c10ab7f9418b54041569d9d6e61e92 100644 --- a/src/WebApp/application/views/accueil.php +++ b/src/WebApp/application/views/accueil.php @@ -57,7 +57,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $this->load->library('session'); if(isset($_SESSION['username'])){ echo('<li class="nav-item">'); - echo('<a class="nav-link js-scroll-trigger" href="index.php/User/deconnexion">Déconnexion</a>'); + echo('<a class="nav-link js-scroll-trigger" href="index.php/User/deconnexion">Décon<div class="col-xl-4 col-lg-7">…</div>nexion</a>'); echo('</li>'); } else { @@ -139,59 +139,56 @@ defined('BASEPATH') OR exit('No direct script access allowed'); <br> <br> <br> - <br> <!-- Project One Row --> - <div class="row justify-content-center no-gutters mb-5 mb-lg-0"> - <div class="col-lg-6"> - <img class="img-fluid" src="<?php echo base_url(); ?>assets/img/demo-image-01.jpg" alt=""> - </div> - <div class="col-lg-6"> - <div class="bg-black text-center h-100 project"> - <div class="d-flex h-100"> - <div class="project-text w-100 my-auto text-center text-lg-left"> - <h4 class="text-white">Misty</h4> - <p class="mb-0 text-white-50">An example of where you can put an image of a project, or anything else, along with a description.</p> - <hr class="d-none d-lg-block mb-0 ml-0"> - </div> - </div> - </div> - </div> - </div> + <div id="search" class="row align-items-center no-gutters mb-4 mb-lg-5"> + <center> + <h3>Rechercher un film</h3> + <br/><br/> + <div> + <form method="POST" action="." > + <div class="form-group"> + <input type="text" name="research" /> + <br/><br/> + <input class="btn btn-primary text-white" type="submit" name="bouton" value="Rechercher"> + <br/><br/> + </div> + </form> + </div> + </center> + </div> + + <?php + if (isset($_POST["research"])) + { echo "<h3> Resultat de votre recherche </h3>" ; + $array=getResearchMovieArray($_POST["research"])?> + <div id="class"> + <table class="table borderless"> + <tbody> + <tr> + <br/> + <?php + for($k=0; $k<1; $k++) + { + echo('<tr>'); + for ($i = (0+5*$k); $i < min(5+5*$k,count($array)); $i++) { + echo('<td><br/><a href="fiche_film?id='.$array[$i]['id'].'" onclick="$(\'.loading\').fadeIn(1);"><img class="img-fluid img-thumbnail" width="100%" src="https://image.tmdb.org/t/p/w500/'.$array[$i]['poster_path'].'" alt="affiche du film"> <br/><br/><b><center>'.($i+1).'- '.$array[$i]['title'].'</center></b></a> </td>'); + } + echo('</tr>'); + } + ?> + </tr> + </tbody> + </table> + <?php } ?> <!-- Project Two Row --> <div class="row justify-content-center no-gutters"> - <div class="col-lg-6"> - <img class="img-fluid" src="<?php echo base_url(); ?>assets/img/demo-image-02.jpg" alt=""> - </div> - <div class="col-lg-6 order-lg-first"> - <div class="bg-black text-center h-100 project"> - <div class="d-flex h-100"> - <div class="project-text w-100 my-auto text-center text-lg-right"> - <h4 class="text-white">Mountains</h4> - <p class="mb-0 text-white-50">Another example of a project with its respective description. These sections work well responsively as well, try this theme on a small screen!</p> - <hr class="d-none d-lg-block mb-0 mr-0"> - </div> - </div> - </div> - </div> + </div> <!-- Project Three Row --> <div class="row justify-content-center no-gutters mb-5 mb-lg-0"> - <div class="col-lg-6"> - <img class="img-fluid" src="<?php echo base_url(); ?>assets/img/demo-image-01.jpg" alt=""> - </div> - <div class="col-lg-6"> - <div class="bg-black text-center h-100 project"> - <div class="d-flex h-100"> - <div class="project-text w-100 my-auto text-center text-lg-left"> - <h4 class="text-white">Misty</h4> - <p class="mb-0 text-white-50">An example of where you can put an image of a project, or anything else, along with a description.</p> - <hr class="d-none d-lg-block mb-0 ml-0"> - </div> - </div> - </div> - </div> + </div> </div> diff --git a/src/WebApp/application/views/getMovie.php b/src/WebApp/application/views/getMovie.php index 13fa06221076fef1a4d11861b5f266a5285aa7bf..88a83f304877ac8ef9f9fb9e13c818a4517ee8fc 100644 --- a/src/WebApp/application/views/getMovie.php +++ b/src/WebApp/application/views/getMovie.php @@ -47,6 +47,14 @@ function getMovieRecommendationArray($id) return $movie_array; } +function getResearchMovieArray($text) +{ + $tmdb_url='https://api.themoviedb.org/3/search/movie?api_key=7ac6810245f15284418f2a15b9b22225&language=fr-FR&query=' . $text . '&sort_by=vote_count.desc.'; + $movie_json = file_get_contents($tmdb_url); + $movie_array = json_decode($movie_json, true); + + return $movie_array['results']; +} function getBestMovieArray($genre,$min_y,$max_y) {