File manager - Edit - /home/filmpbuk/public_html/search.php.999.tar
Back
home/filmpbuk/public_html/search.php.999 0000644 00000041130 15055600113 0014111 0 ustar 00 <!DOCTYPE html> <?php header( 'content-type: text/html; charset=utf-8' ); /* FILMOTECH Website INDEX page (c) 2013-2015 by Pascal PLUCHON http://www.filmotech.fr */ // Site parameters require_once("include/params.inc.php"); require_once("include/config.inc.php"); require_once("include/functions.php"); require_once("include/fpagination.php"); require_once("include/fpagisearch.php"); // Get configuration $cfg = new CONFIG(); // Connection to database try { if ( $cfg->DB_TYPE == 'sqlite' ) { $db = new PDO('sqlite:'.$cfg->DB_NAME.'.sqlite3'); } else { $db = new PDO('mysql:host='.$cfg->DB_SERVER.';dbname='.$cfg->DB_NAME, $cfg->DB_USER, $cfg->DB_PASSWORD); $db->query("SET NAMES UTF8"); } } catch (Exception $e) { die('Erreur : ' . $e->getMessage()); } // Query parameters //$search_fields = array( "TitreVF" , "TitreVO" , "Genre" , "Acteurs" , "Realisateurs" , "Commentaires" , "Bonus" , "Reference" ); $search_fields = array( "TitreVF" , "TitreVO" , "Acteurs" , "Pays" , "Annee" , "Genre" , "Realisateurs" , "Reference" , "Support" , "Edition", "Type" , "Source" ,"Synopsis" ); $search_field = "TitreVF"; $search_field2 = "TitreVF"; $search_label = "Titre"; $search_label2 = "Titre"; $search_query = ""; $search_query2 = ""; // Last update $lastUpdate = '?'; $filename = 'update.txt'; if (file_exists($filename)) { $handle = fopen($filename, "r"); $lastUpdate = fread($handle, filesize($filename)); fclose($handle); } $last_update_label = sprintf($last_update,$lastUpdate); // Preparing database request // Count number of records $query = "SELECT count(*) from " . $cfg->DB_TABLE; $result = $db->query($query); $result_fetch = $result->fetch(); $total_record = $result_fetch[0]; $result->closeCursor(); $TitreVF = 'TitreVF'; $page = 1; $offset = 0; $pagination = $paginate; // Recherche sur les champs titreVO, titreVF if ( (isset($_POST['search_query'])) && ($_POST['search_query']!="") ) { $search_query = stripslashes($_POST['search_query']); $search_field = $_POST['search_field']; $search_label = $field_labels[$search_field]; $select = sprintf( "SELECT ID, TitreVF, %s , Annee, Support, Edition, FilmVu, PretEnCours, EntreeType , EntreeSource, Synopsis FROM %s WHERE %s LIKE '%s' OR %s LIKE '%s' ORDER BY TitreVF", $second_column, $cfg->DB_TABLE , $_POST['search_field'] , '%' . addslashes($search_query) . '%' ,'TitreVO', '%' . addslashes($search_query) . '%'); //,'Acteurs', '%' . addslashes($search_query) . '%' OR %s LIKE '%s' $select_count = sprintf( "SELECT COUNT(*) FROM %s WHERE %s LIKE '%s' OR %s LIKE '%s' ORDER BY TitreVF", $cfg->DB_TABLE , $_POST['search_field'] , '%' . addslashes($search_query) . '%' ,'TitreVF', '%' . addslashes($search_query) . '%'); $pagination = false; // Count number of rows returned $result = $db->query($select_count); $result_fetch = $result->fetch(); $count = $result_fetch[0]; $result->closeCursor(); } else { if (isset($_GET['Page'])) $page = $_GET['Page']; $offset = ($page-1) * $nb_record_per_page; if ($paginate) { $select = "SELECT ID, TitreVF, " . $second_column . ",Annee, Support, FilmVu, PretEnCours, Edition, Pays, EntreeType, EntreeSource, Synopsis FROM " . $cfg->DB_TABLE . " ORDER BY ID desc LIMIT " . $nb_record_per_page . " OFFSET " . $offset; $select_count = "SELECT COUNT(*) FROM " . $cfg->DB_TABLE . " ORDER BY TitreVF LIMIT " . $nb_record_per_page . " OFFSET " . $offset; $count = 1; } else { /*$select = "SELECT ID, TitreVF, " . $second_column . ", FilmVu, Annee, Support, PretEnCours, Edition, Pay, EntreeType, EntreeSource, Synopsis FROM " . $cfg->DB_TABLE . " ORDER BY TitreVF"; $count = $total_record;*/ $select = "SELECT ID, TitreVF, " . $second_column . ", FilmVu, Annee, Support, PretEnCours, Edition, Pay, EntreeType, EntreeSource, Synopsis FROM " . $cfg->DB_TABLE . " ORDER BY TitreVF LIMIT". $nb_record_per_page . " OFFSET " . $offset; $select_count = "SELECT COUNT(*) FROM " . $cfg->DB_TABLE . " ORDER BY TitreVF LIMIT " . $nb_record_per_page . " OFFSET " . $offset; $count = 1; } } $response = $db->query($select); if ($pagination) $label_movie_count = sprintf( $movie_count_paginate , $offset+1 , ($offset+$nb_record_per_page)>$total_record ? $total_record : $offset+$nb_record_per_page , $total_record ); else $label_movie_count = sprintf( $movie_count , $count ); // Recherche sur les champs titreVO, titreVF, acteurs formulaire dans le header if ( (isset($_POST['search_query2'])) && ($_POST['search_query2']!="") ) { $search_query2 = stripslashes($_POST['search_query2']); $search_field2 = $_POST['search_field2']; $search_label2 = $field_labels[$search_field2]; $select = sprintf( "SELECT ID, TitreVF, %s , Annee, Support, Edition, FilmVu, PretEnCours, EntreeType, EntreeSource, Synopsis FROM %s WHERE %s LIKE '%s' OR %s LIKE '%s' OR %s LIKE '%s' ORDER BY TitreVF", $second_column, $cfg->DB_TABLE , $_POST['search_field2'] , '%' . addslashes($search_query2) . '%' ,'TitreVO', '%' . addslashes($search_query2) . '%','Acteurs', '%' . addslashes($search_query2) . '%'); $select_count = sprintf( "SELECT COUNT(*) FROM %s WHERE %s LIKE '%s' OR %s LIKE '%s' OR %s LIKE '%s' ORDER BY TitreVF", $cfg->DB_TABLE , $_POST['search_field2'] , '%' . addslashes($search_query2) . '%' ,'TitreVO', '%' . addslashes($search_query2) . '%','Acteurs', '%' . addslashes($search_query2) . '%'); $pagination = false; // Count number of rows returned $result = $db->query($select_count); $result_fetch = $result->fetch(); $count = $result_fetch[0]; $result->closeCursor(); } $response = $db->query($select); if ($pagination) $label_movie_count = sprintf( $movie_count_paginate , $offset+1 , ($offset+$nb_record_per_page)>$total_record ? $total_record : $offset+$nb_record_per_page , $total_record ); else $label_movie_count = sprintf( $movie_count , $count ); function column_format( $field, $value ) { if (($field=='Acteurs')||($field=='Realisateurs')) return strlen( $value ) <= 80 ? str_replace("\r",", ",$value) : mb_substr(str_replace("\r",", ",$value), 0 , 120 , "UTF-8" ) . '...' ; if ($field=='Duree') return $value . ' mn'; return $value; } ?> <html> <head> <title><?php echo($window_title); ?></title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="fontawesome/css/all.css"> </head> <body> <?php include('header.php'); ?> <!-- Main block --> <div class="container"> <!-- Center block --> <div class="row page-inner"> <!-- Movie list --> <div class="col-md-12 col-sm-12"> <!-- ----------------resultats de recherche --------------> <?php if ($search_query !='' || $search_query2 !='') { echo "affichage de la pagination"; include('affichepagisearch.php'); } ?> <?php if ($search_query!='') { if ($count!=0) { echo('<div class="alert alert-success alert-block">'. '<ul class="nav navbar-nav navbar-nav-detail" style="float:none">'. '<li class=""><a href="javascript:history.back();"><i class="fad fa-arrow-alt-circle-left fa-2x"></i> Page précédente</a></li>' .'</ul>'); echo($result_for_search .' '. '<span style="color:red">'. '<strong>' . $search_query . '</strong>' . '</span>' . ' ' . 'dans' .'<span style="color:red">'.' <strong>' . '"' . 'recherche par'. ' ' .$search_label .'"' . '</strong> ' . '</span>'. $contains .' ' . '<span style="color:red">'. '<strong>' . $label_movie_count . '</strong>' . '</span>' ); echo('</div>'); } else { echo('<div class="alert alert-danger alert-block">'); echo($result_for_search .' '. '<span style="color:red">'. '<strong>' . $search_query . '</strong>' . '</span>' . ' ' . 'dans' .'<span style="color:red">'.' <strong>' . '"' . 'recherche par'. ' ' .$search_label .'"' . '</strong> ' . '</span>'. $contains .' ' . '<span style="color:red">'. '<strong>' .$no_result . '</strong>' . '</span>' ); echo('</div>'); } } ?> <?php if ($search_query2!='') { if ($count!=0) { echo('<div class="alert alert-success alert-block">'. '<ul class="nav navbar-nav navbar-nav-detail" style="float:none">'. '<li class=""><a href="javascript:history.back();"><i class="fad fa-arrow-alt-circle-left fa-2x"></i> Page précédente</a></li>' .'</ul>'); echo($result_for_search .' '. '<span style="color:red">'. '<strong>' . $search_query2 . '</strong>' . '</span>' . ' ' . $contains .' ' . '<span style="color:red">'. '<strong>' . $label_movie_count . '</strong>' . '</span>' ); //echo($result_for_search .' '. '<span style="color:red">'. '<strong>' . $search_query2 . '</strong>' . '</span>' . ' ' . 'dans' .'<span style="color:red">'.' <strong>' . '"' . 'recherche par'. ' ' .$search_label2 .'"' . '</strong> ' . '</span>'. $contains .' ' . '<span style="color:red">'. '<strong>' . $label_movie_count . '</strong>' . '</span>' ); echo('</div>'); } else { echo('<div class="alert alert-danger alert-block">'); echo($result_for_search .' '. '<span style="color:red">'. '<strong>' . $search_query2 . '</strong>' . '</span>' . ' ' . 'dans' .'<span style="color:red">'.' <strong>' . '"' . 'recherche par'. ' ' .$search_label2 .'"' . '</strong> ' . '</span>'. $contains .' ' . '<span style="color:red">'. '<strong>' .$no_result . '</strong>' . '</span>' ); echo('</div>'); } } ?> <!-- ---------------- fin resultats de recherche --------------> <!-- PAGINATION FILMOTECH--> <div class="nextprec"> <ul class="pager"> <!--------------------------Affichage de la liste des films sous forme de galerie-----------------------> <div class="div-center-page-liste" style="position: relative;"> <ul class="int"> <?php while ($data = $response->fetch()) { ?> <li class="lifilmindex"> <div class="divfilmindex" onclick="window.location.href='filmotech_detail.php?id=<?php echo $data['ID']; ?>'" style="width:170px; height:320px;"> <?php $filename = sprintf('%s/Filmotech_%05d.jpg', $cfg->POSTERS_DIRECTORY, $data['ID']); if (file_exists($filename)) { echo '<div class=""><img style="border-radius:5px" width="145" height="193" src="' . $filename . '"></div>';//movie_cover } else { echo '<div class=""></div>';//movie_cover } ?> <?php echo "<div class='infos_title'>"; if ($show_lent || $show_not_seen) { if ( ($show_lent) && ($show_not_seen) ) { if ( ($data['FilmVu'] == 'NON') && ($data['PretEnCours'] == 'OUI') ) echo ( '<img src="img/dot_green_orange.png" alt="'.$movie_not_seen_and_lent.'" />' ); elseif ($data['FilmVu'] == 'NON') echo ( '<img src="img/dot_green.png" alt="'.$movie_not_seen.'" />' ); elseif ($data['PretEnCours'] == 'OUI') echo ( '<img src="img/dot_orange.png" alt="'.$movie_lent.'" />' ); } elseif ( ($show_lent) && ($data['PretEnCours'] == 'OUI') ) echo ( '<img src="img/dot_orange.png" alt="'.$movie_lent.'" />' ); elseif ( ($show_not_seen) && ($data['FilmVu'] == 'NON') ) echo ( '<img src="img/dot_green.png" alt="'.$movie_not_seen.'" />' ); } echo $data['TitreVF'].'</div>'; echo ( "<div class='infos_editionsupport'>".$data['Support'].' '.'/'.' '.$data['Edition'].' '.'/'.' '.$data['EntreeSource']."</div>" ); echo ( "<div class='infos_genre'>".$data['Genre']."</div>" ); echo ( "<div class='release_date'>".$data['Annee']."</div>" ); ?> <!-- ---------------- Synopsis en survol -----------------------> <span class="bulle2"> <a href="#" class="bulle2"><br /><img width="25px" height="25px" src="img/logo-camera90.png"><br /> <span> <table> <tr> <td> </td> <td class="div-survol-liste"> <?php echo $data['Synopsis']; // echo('<br>');echo'<br />'; ?> <!--<a style="color:yellow"> <?php echo('Genre : ');?></a> <?php echo $data['Genre']; echo('<br>');echo'<br />'; ?> <a style="color:yellow"> <?php echo('Support : ');?></a> <?php echo $data['Support']; echo('<br>');echo'<br />'; ?> <a style="color:yellow"> <?php echo('Classement : ');?></a> <?php echo $data['Reference']; echo('<br>');echo'<br />'; ?> <a style="color:yellow"> <?php echo ('Année : '); ?></a> <?php echo $data['Annee']; echo('<br>');echo'<br />'; ?> <a style="color:yellow"> <?php echo('Durée : ');?></a> <?php echo $data['Duree']; ?><a style="color:yellow"> <?php echo('Min.');?></a> <?php echo('<br>'); echo('<br>'); ?> <a style="color:yellow"> <?php echo('Note : ')?></a> <?php ?> <img width=75 src="img/note<?php echo $data['Note']; ?>.png" alt="note"/><br /> --> </td> </tr> </table> </span> </a> <span> <!-- fin Synopsis en survol --> </div></li> <?php } $response->closeCursor(); ?> </div> </li> </ul> <ul class="pager"> </ul> <!-- End of movie list --> </div> <div class="pagination-footer"> <!-- Affichage de la pagination QUE si pas de recherche --> <?php include('affichepagisearch.php'); ?> </div> <!-- End of main block --> </div> <!-- Footer --> <h5> <?php if ($show_update_date && $count!=0) echo( '<span style="color:black"><p class="text-center">' . $last_update_label . '<BR /><b>Nombre de films : '. $total_record .'</b></p></span>' ); ?> </h5> <br /> <center><i style="color:black"><a href="http://www.filmotech.fr/" target="_blank">Propulsé par Filmotech</a></i> <?php echo($copyright); ?></center> <br /> <!-- --> <!-- End of page --> <!-- JavaScript plugins (requires jQuery) <script src="js/jquery/jquery-1.12.4.js"></script>--> <script src="js/jquery/jquery-1.12.4.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="js/bootstrap.min.js"></script> <!-- Enable responsive features in IE8 with Respond.js <script src="js/respond.min.js"></script> --> <script> $(".dropdown-menu li a").click(function(){ var selText = $(this).text(); var selName = $(this).attr("name"); $(this).parents('.navbar').find('.champ_recherche').val(selName); $(this).parents('.navbar').find('.dropdown-toggle').html(' '+selText+' <span class="caret"></span>'); //$(this).parents('.navbar').find('.dropdown-toggle').html('Recherche par '+selText+' <span class="caret"></span>'); }); </script> <script>// Fonction Masquer/Afficher une Div function toggle_div(bouton, id) { // On déclare la fonction toggle_div qui prend en param le bouton et un id var div = document.getElementById(id); // On récupère le div ciblé grâce à l'id if(div.style.display=="none") { // Si le div est masqué... div.style.display = "block"; // ... on l'affiche... bouton.innerHTML = "Réduire <i class='far fa-minus-square fa-2x' title='Réduire'></i>";//"Réduire"; // ... et on change le contenu du bouton. } else { // S'il est visible... div.style.display = "none"; // ... on le masque... bouton.innerHTML = "Recherche Avancé <i class='fab fa-searchengin fa-2x' title='recherche avancé'></i>"; // ... et on change le contenu du bouton. } } </script> </body> </html>