diff --git a/src/WebApp/application/views/fiche_film.php b/src/WebApp/application/views/fiche_film.php index 38cf887bbbed401d3e3c3b45cc2136cca787fa37..fd7ac53eac0e41710e5159f88bc62cd8cd12d4d1 100644 --- a/src/WebApp/application/views/fiche_film.php +++ b/src/WebApp/application/views/fiche_film.php @@ -106,11 +106,29 @@ include('getMovie.php'); </tr> <tr> <td style="text-align: right;">De :</td> - <td>undefined</td> + <td> + <?php foreach(getMovieCastArray(297762)['crew'] as $tab) + { + if($tab['job']=="Director") + { + echo($tab['name'].' / '); + } + } + ?> + </td> </tr> <tr> <td style="text-align: right;">Ecrit par :</td> - <td>undefined</td> + <td> + <?php foreach(getMovieCastArray(297762)['crew'] as $tab) + { + if($tab['job']=="Story") + { + echo($tab['name'].' / '); + } + } + ?> + </td> </tr> <tr> <td style="text-align: right;">Date de sortie :</td> @@ -151,7 +169,7 @@ include('getMovie.php'); <div class="row align-items-center no-gutters mb-4 mb-lg-5"> <div class="featured-text text-center text-lg-left"> - <h4>Casting</h4> + <h3>Casting</h3> <div> <table class="table borderless"> @@ -162,7 +180,7 @@ include('getMovie.php'); { echo('<tr>'); for ($i = (0+5*$k); $i < (5+5*$k); $i++) { - echo('<td><img class="img-fluid" src="https://image.tmdb.org/t/p/w500/'.getMovieCastArray(297762)['cast'][$i]['profile_path'].'" alt="photo de l\'acteur/actrice"> '.getMovieCastArray(297762)['cast'][$i]['name'].'<br/><p class="text-black-50 mb-0">as '.getMovieCastArray(297762)['cast'][$i]['character'].'</p></td>'); + echo('<td><img class="img-fluid img-thumbnail" width="100%" src="https://image.tmdb.org/t/p/w500/'.getMovieCastArray(297762)['cast'][$i]['profile_path'].'" alt="photo de l\'acteur/actrice"> <br/>'.getMovieCastArray(297762)['cast'][$i]['name'].'<br/><p class="text-black-50 mb-0">'.getMovieCastArray(297762)['cast'][$i]['character'].'</p></td>'); } echo('</tr>'); } @@ -173,8 +191,47 @@ include('getMovie.php'); </div> </div> </div> -</div> + <br/> + <div class="row align-items-center no-gutters mb-4 mb-lg-5"> + <div class="featured-text text-center text-lg-left"> + <h3>Trailer</h3> + </div> + </div> + <div class="row align-items-center no-gutters mb-4 mb-lg-5"> + <div class="col-xl-2 col-lg-2"> + </div> + <div class="col-xl-8 col-lg-8"> + <center><iframe width="100%" height="350" src="https://www.youtube.com/embed/<?php echo(getMovieVideoArray(297762)['results']['0']['key'])?>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></center> + </div> + <div class="col-xl-2 col-lg-2"> + </div> + </div> + + + <div class="row align-items-center no-gutters mb-4 mb-lg-5"> + <div class="featured-text text-center text-lg-left"> + <h3>Si vous aimez ce film vous aimerez aussi :</h3> + <div> + <table class="table borderless"> + <tbody> + <tr> + <?php + { + for ($i = 0; $i < 5; $i++) { + echo('<td><img class="img-fluid img-thumbnail" width="100%" src="https://image.tmdb.org/t/p/w500/'.getMovieRecommendationArray(297762)['results'][$i]['poster_path'].'" alt="photo du film"> <br/><center>'.getMovieRecommendationArray(297762)['results'][$i]['title']).'</center>'; + } + } + ?> + </tr> + </tbody> + </table> + </div> + </div> + </div> + + +</div> </body> </html> diff --git a/src/WebApp/application/views/getMovie.php b/src/WebApp/application/views/getMovie.php index a3d0a2de3505f14fba9688d0ab46642385af078d..fc47223cee4c72da303044fde3ca756847aef675 100644 --- a/src/WebApp/application/views/getMovie.php +++ b/src/WebApp/application/views/getMovie.php @@ -30,6 +30,24 @@ function getMovieCastArray($id) return $movie_array; } +function getMovieVideoArray($id) +{ + $tmdb_url = 'https://api.themoviedb.org/3/movie/' . $id . '/videos?api_key=7ac6810245f15284418f2a15b9b22225&language=fr-FR'; + $movie_json = file_get_contents($tmdb_url); + $movie_array = json_decode($movie_json, true); + + return $movie_array; +} + +function getMovieRecommendationArray($id) +{ + $tmdb_url = 'https://api.themoviedb.org/3/movie/'. $id .'/recommendations?api_key=7ac6810245f15284418f2a15b9b22225&language=fr-FR'; + $movie_json = file_get_contents($tmdb_url); + $movie_array = json_decode($movie_json, true); + + return $movie_array; +} + function getRandomMovie() { $input = array(28,329,299536,157336,578,13183,597,118340,111,68718,1271,16869,348,807,27205,553974,1895,274,497,78,65,238,769,500,3082,37165,200,300,600,100,550,115,155,165,175,180,185,215,235,240,275,280,380,415,435,440,475,565,595,605,620,640,650,680,710,406,313369,11324);