File manager - Edit - /home/filmpbuk/public_html/index3.php.333
Back
<!DOCTYPE html> <?php /* FILMOTECH Website INDEX page (c) 2013-2018 by Pascal PLUCHON http://www.filmotech.fr */ // Site parameters require_once("include/params.inc.php"); require_once("include/config.inc.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_field = "TitreVF"; $search_label = "Titre"; $search_query = ""; // 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(); $page = 1; $offset = 0; $pagination = $paginate; 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, TitreVO, %s , FilmVu, PretEnCours, Support, Annee, Edition, EntreeType, Duree, Realisateurs, Acteurs, EntreeSource, Synopsis FROM %s WHERE %s LIKE '%s' ORDER BY TitreVF", $second_column, $cfg->DB_TABLE , $_GET['search_field'] , '%' . addslashes($search_query) . '%' ); $select_count = sprintf( "SELECT COUNT(*) FROM %s WHERE %s LIKE '%s' ORDER BY TitreVF", $cfg->DB_TABLE , $_POST['search_field'] , '%' . 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, TitreVO, " . $second_column . ",Annee, Support, FilmVu, PretEnCours, Edition, Pays, EntreeType, Duree, Realisateurs, Acteurs, 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, PretEnCours FROM " . $cfg->DB_TABLE . " ORDER BY TitreVF"; $count = $total_record; // $select_count = "SELECT COUNT(*) FROM " . $cfg->DB_TABLE; } } $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"> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> </head> <body> <?php include('header.php'); ?> <!-- Center block --> <div class="row"> <!-- Movie list --> <!--div class="col-8"--> <div class="col-md-12 col-sm-12"> <?php if ($search_query!='') { if ($count!=0) { echo('<div class="alert alert-success alert-block">'); echo($result_for_search .' <strong>' . $search_label . '</strong> '.$contains.' <strong>' . $search_query . '</strong>' ); echo('</div>'); } else { echo('<div class="alert alert-danger alert-block">'); echo($no_result .' <strong>' . $search_label . '</strong> '.$contains.' <strong>' . $search_query . '</strong>' ); echo('</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 } ?> <table class="table table-hover table-striped table-condensed"> <thead> <th width="15"></th> <th width="130"></th> <th width="400"></th> <th>col4</th></thead> <?php } ?> <!--tr onmouseover="this.style.cursor='pointer';"><td>Puces</td><td>Titre</td><td>Genre</td></tr--> <?php while ($data = $response->fetch()) { ?> <tr> <td> <?php 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.'" />' ); } ?> </td> <!-- Affiche --> <td> <div class="divfilmindex" onclick="window.location.href='filmotech_detail.php?id=<?php echo $data['ID']; ?>'" style="width:115px; height:153px;"> <?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="100" height="133" src="' . $filename . '"></div>';//movie_cover } else { echo '<div class=""></div>';//movie_cover } ?> </td> <!-- titre et info date,tps --> <td><?php echo "<div class='infos_title_search'>"; echo $data['TitreVF'].'<br>'.'</div>'; echo "<p>"."<span class='titrefilmvo-search'>".'('. $data['TitreVO'] . ')'. '<br />'.'</span>'."</p>"; echo ( "<div class='release_date_search'>".$data['Annee'].' '.gmstrftime( "%Hh%Mmn", $data['Duree'] * 60 )."</div>" ); echo($field_labels['Realisateurs']).' :'."<span class='muted'>". $data['Realisateurs']; echo "<p>".$field_labels['Acteurs'].':'."<span class='muted'>". $data['Acteurs']."</p>"; ?> </td> <td> <?php echo ( "<div class='infos_editionsupport_search'>".$data['Support'].' '.'/'.' '.$data['Edition'].' '.'/'.' '.$data['EntreeSource']."</div>" ); echo ( "<div class='infos_genre_search'>".$data['Genre']."</div>" ); ?> </td> </tr> <?php } $response->closeCursor(); ?> <?php if ($count!=0) { ?> </table> <?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 echo( '<p class="text-center"><small>' . $label_movie_count . '</small></p>' ); ?> <?php } ?> <?php if ($show_update_date && $count!=0) echo( '<p class="text-center"><small>' . $last_update_label . '</small></p>' ); ?> <!-- End of movie list --> </div> <!-- Side bar --> <!--div class="col-4"--> <div class="col-12 col-lg-4"> <!-- Last added movies <?php if ($show_latest) { echo( '<div class="alert alert-warning alert-block">'); echo( '<h4>' . $latest_label . '</h4><br />' ); echo( '<ul>' ); $response = $db->query('SELECT * FROM '. $cfg->DB_TABLE .' ORDER BY EntreeDate DESC LIMIT ' . $max_latest ); while ($data = $response->fetch()) { echo( '<li><a href="filmotech_detail.php?id=' . $data['ID'] . '">' . $data['TitreVF'] . '</a></li>' ); } $response->closeCursor(); echo( '</ul>' ); echo( '</div>' ); } ?>--> <!-- Favorites <?php if ($show_favorites_index) { echo( '<div class="alert alert-success alert-block">' ); echo( '<h4>' . $favorites_label . '</h4><br />' ); echo( '<ul>' ); foreach ($favorites as $key => $value) { echo( '<li><a href="'.$value.'">'.$key.'</a></li>'); } echo( '</ul>' ); echo( '</div>' ); } ?>--> <!-- Personal code #1 <?php if ($show_custom_1_index) { echo( '<div class="alert alert-info alert-block">' ); echo( '<h4>' . $custom_label_1 . '</h4><br />' ); echo( '<div>' . $custom_code_1 . '</div>' ); echo( '</div>' ); } ?>--> <!-- Personal code #2 <?php if ($show_custom_2_index) { echo( '<div class="alert alert-info alert-block">' ); echo( '<h4>' . $custom_label_2 . '</h4><br />' ); echo( '<div>' . $custom_code_2 . '</div>' ); echo( '</div>' ); } ?>--> <!-- End of side bar --> </div> <!-- End of main block --> </div> <!-- Footer --> <div class="well well-small"> <table width="100%"> <tr> <td width="33%"><div class="muted"><?php echo($copyright); ?></div></td> <td width="33%"><div class="text-center muted"><a href="mailto:<?php echo($mail_address); ?>"> <?php echo($mail_label); ?></a></div></td> <td width="33%"><div class="text-right muted"><?php echo($powered_by); ?> <a href="http://www.filmotech.fr">Filmotech</a></div></td> </tr> </table> </div> <!-- End of page --> <!-- JavaScript plugins (requires jQuery) --> <script src="https://code.jquery.com/jquery.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 (https://github.com/scottjehl/Respond) --> <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> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.3.33 | Generation time: 0.4 |
proxy
|
phpinfo
|
Settings