Skip to content
Extraits de code Groupes Projets
Valider ec59da2f rédigé par Quentin PICHOLLET's avatar Quentin PICHOLLET
Parcourir les fichiers

premiere version de la recherche de filù

parent af6889ec
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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 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>
......
......@@ -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)
{
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter