File manager - Edit - /home/filmpbuk/public_html/index.php.hs
Back
<!DOCTYPE html> <?php /* 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"); // 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) . '%' ,'TitreVO', '%' . addslashes($search_query) . '%'); //,'Acteurs', '%' . addslashes($search_query) . '%' OR %s LIKE '%s' $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; } } $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"> <!-- Navigation bar --> <nav class="navbar navbar-default" role="navigation"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav"> <li class=""><a href="index.php"><i class="fas fa-home fa-2x"></i> <?php echo( $navbar_active_title ); ?></a></li> <!--<li class=""><a href="nonvu.php"><i class="fa fa-eye fa-2x"></i> <?php echo($navbar_active_nonvu ); ?></a></li> <li class=""><a href="lasttitle.php"><i class="fa fa-file-text-o fa-2x"></i> <?php echo( $navbar_active_last ); ?></a></li>--> </ul> <button type="button" class="btn navbar-right " onclick="toggle_div(this,'searchplus');" >Recherche Avancé <i class="fab fa-searchengin fa-2x" title="recherche avancé"></i></button> <div id="searchplus" class="searchplus" style="display:none"> <!-- --> <form class="navbar-form navbar-right" role="search" method="post"> <div class="form-group"> <input class="champ_recherche" type="hidden" name="search_field" value="<?php echo($search_field); ?>"> <input type="text" class="form-control" placeholder="<?php echo($navbar_search) ?>" name="search_query"> </div> <button type="submit" class="btn" style="right: 45px;position: relative;"><i class="fa fa-search fa-2x"></i></button><!--<?php echo($navbar_go) ?>--> </form> <ul class="nav navbar-nav navbar-right"> <li class=""> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo($navbar_search_by . ' ' . $search_label); ?> <b class="caret"></b></a> <ul class="dropdown-menu"> <?php foreach ($search_fields as $value) { echo( '<li><a tabindex="0" href="#" name="'.$value.'">'.$field_labels[$value].'</a></li>'); } ?> </ul> </li> </ul> </div> </div> <!-- /.navbar-collapse --> </nav> <!-- Center block --> <div class="row page-inner"> <!-- Movie list --> <div class="col-md-12 col-sm-12"> <!-- ----------------resultats de recherche --------------> <?php if ($search_query!='') { if ($count!=0) { echo('<div class="alert alert-success 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>' . $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">'); 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 pagination QUE si pas de recherche --> <?php if ($search_query =='' && $search_query2 =='') { include('affichepagi.php'); } ?> <!-- Pagination Perso Simple <?php $nombreDePages = ceil($total_record/$nb_record_per_page); if ($page==1) echo('<li class="previous disabled"><a href="#">'.$previous_page.'</a></li>'); else echo('<li class="previous"><a href="?Page='.($page-1).'">'.$previous_page.'</a></li>'); ?> <?php for ($i = 1; $i <= $nombreDePages; $i++): if ($page==$i) echo('<span class="pagination2"><a href="?Page='.$i.'">'.$i.'</a></span>'); else echo('<span class="pagination"><a href="?Page='.$i.'">'.$i.'</a></span>');?> <?php endfor; // <li class="next disabled"></li><li class="next"></li> //echo'<span class="pagination-info">'.("Page" . " " .$page . " " . "sur" . " " . ceil($total_record/$nb_record_per_page).'</span>'); if ($page>=ceil($total_record/$nb_record_per_page)) echo('<li class="next disabled"><a href="#">'.$next_page.' </a></li>'); else echo('<li class="next"><a href="?Page='.($page+1).'">'.$next_page.'</a></li>'); ?> --> <!-- Fin Pagination Perso Simple --> </ul> <!-- <?php echo'<span class="pagination-info">'.("Page" . " " .$page . " " . "sur" . " " . ceil($total_record/$nb_record_per_page).'</span>'); ?>--> </div> <!-- <?php if ($count!=0) { ?> <?php if ($pagination) { ?> <ul class="pager"> <?php if ($page==1) echo('<li class="previous disabled"><a href="#">← '.$previous_page.'</a></li>'); else echo('<li class="previous"><a href="?Page='.($page-1).'">← '.$previous_page.'</a></li>'); ?> <span class="text-info"><?php echo($page . "/" . ceil($total_record/$nb_record_per_page)); ?></span> <?php if ($page>=ceil($total_record/$nb_record_per_page)) echo('<li class="next disabled"><a href="#">'.$next_page.' → </a></li>'); else echo('<li class="next"><a href="?Page='.($page+1).'">'.$next_page.' → </a></li>'); ?> </ul> <?php } ?> --> <?php } ?> <!------------------------Fin de Pagination -----------------> <!--------------------------Affichage de la liste des films sous forme de galerie---------float: left;--------------> <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']."</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 if ($search_query =='' && $search_query2 =='') { include('affichepagi.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('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>
| ver. 1.4 |
Github
|
.
| PHP 7.3.33 | Generation time: 0.4 |
proxy
|
phpinfo
|
Settings