Version 1.0
-déplacement des fichiers d’admin dans un dossier admin -corrections dans la fonction data_for_lightbox($data). Celle-ci est maintenant toujours utilisé pour l’affichage des vignettes et des images dans la lightbox -les chemins sont nettoyés avec 2 variables: $chemin pour les images, $base pour la base Sqlite -corrections diverses
This commit is contained in:
226
admin/view_bdd.php
Normal file
226
admin/view_bdd.php
Normal file
@@ -0,0 +1,226 @@
|
||||
<?php
|
||||
require ("3-protect.php");
|
||||
//session_start();
|
||||
include '../i18n_setup.php';
|
||||
/*include 'localize.php';
|
||||
$domain = 'sentier';
|
||||
localize($domain);
|
||||
*/
|
||||
include '../functions.php';
|
||||
|
||||
$chemin = '../photos/img/';
|
||||
|
||||
$base = '../db_photo.sqlite3';
|
||||
$conn = new PDO("sqlite:$base");
|
||||
$msg = "";
|
||||
|
||||
if(!empty($_GET['message'])) {
|
||||
$msg = "<h3 class='redstyle'>" . $_GET['message'] . "</h3>";
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta name="description" content="Sur le sentier: admin">
|
||||
<title><?php echo gettext('View photos in Sqlite base'); ?></title>
|
||||
<meta name="msapplication-TileColor" content="#2b5797">
|
||||
<meta name="msapplication-config" content="/icons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
|
||||
<link rel="manifest" href="/icons/site.webmanifest">
|
||||
<link rel="shortcut icon" href="/icons/favicon.ico">
|
||||
|
||||
<link rel="stylesheet" href="../css/sls.css">
|
||||
|
||||
<link rel='stylesheet' href='../lc-lightbox/css/lc_lightbox.min.css'>
|
||||
<link rel='stylesheet' href='../lc-lightbox/css/open_close_fx.css'>
|
||||
<link rel='stylesheet' href='../lc-lightbox/skins/minimal.css'>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer">
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
|
||||
<style>
|
||||
input {width: 100%; padding: 5px 5px; margin: 8px 0; display: inline-block; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box;}
|
||||
/* #Headings th:hover {background: rgb(255, 255, 255); color: black;}
|
||||
#Headings th:hover {background-color: rgb(0, 152, 121); color: white;}*/
|
||||
#details {font-family: Arial, Helvetica, sans-serif; font-size: 12px; border-collapse: collapse; width: 100%; background-color: #fff;}
|
||||
#details td, th {border: 1px solid #fff; padding: 8px;}
|
||||
#details tr:nth-child(even){background-color: #f2f2f2;}
|
||||
#Table tr:hover {background-color: rgb(221, 221, 221); font-weight: bold;}
|
||||
#Headings th {padding-top: 12px; padding-bottom: 12px; background-color: rgb(0, 152, 121); color: white; cursor: pointer;}
|
||||
</style>
|
||||
<script>
|
||||
function showUser(column) {
|
||||
//if (column == "") {column = "ID"}
|
||||
if (column == "") {column = "DateOriginal"} // tri par défaut
|
||||
order = document.getElementById(column).getAttribute("class");
|
||||
id = document.getElementById("filter_id").value;
|
||||
filename = document.getElementById("filter_filename").value;
|
||||
dateoriginal = document.getElementById("filter_dateoriginal").value;
|
||||
speed = document.getElementById("filter_speed").value;
|
||||
iso = document.getElementById("filter_iso").value;
|
||||
aperture = document.getElementById("filter_aperture").value;
|
||||
correctexpo = document.getElementById("filter_correctexpo").value;
|
||||
model = document.getElementById("filter_model").value;
|
||||
lens = document.getElementById("filter_lens").value;
|
||||
focal = document.getElementById("filter_focal").value;
|
||||
metering = document.getElementById("filter_metering").value;
|
||||
program = document.getElementById("filter_program").value;
|
||||
wb = document.getElementById("filter_wb").value;
|
||||
software = document.getElementById("filter_software").value;
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
document.getElementById("Table").innerHTML = this.responseText;
|
||||
}
|
||||
};
|
||||
|
||||
xmlhttp.open("GET","query_bdd.php?id=" + id + "&filename=" + filename + "&dateoriginal=" + dateoriginal + "&speed=" + speed + "&iso=" + iso + "&aperture=" + aperture + "&correctexpo=" + correctexpo + "&model=" + model + "&lens=" + lens + "&focal=" + focal + "&metering=" + metering + "&program=" + program + "&wb=" + wb + "&software=" + software + "&column=" + column + "&order=" + order, true);
|
||||
xmlhttp.send();
|
||||
if (order == "ASC") {document.getElementById(column).setAttribute("class", "DESC");} else {document.getElementById(column).setAttribute("class", "ASC");}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="showUser('')">
|
||||
|
||||
<?php
|
||||
echo '<h1>' . gettext('View database') . ': ' . $base . '</h1><br>';
|
||||
|
||||
echo $msg;
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($_SESSION["user"])) {
|
||||
echo '<form id="viewSelect" name="viewSelect" action="view_bdd.php" method="post" class="myForm" >';
|
||||
echo '<button type="submit" formaction="edit_bdd.php" name="edit" value="edit" class="myButton all">' . gettext('Edit') . '</button>';
|
||||
//echo '<button type="submit" name="suppress" value="suppress" class="myButton all">' . gettext('Suppress') . '</button>';
|
||||
echo '<button type="submit" formaction="delete_bdd.php" name="suppress" value="suppress" class="myButton all">' . gettext('Suppress') . '</button>';
|
||||
}
|
||||
?>
|
||||
|
||||
<table id="details" class="styled-table">
|
||||
<thead>
|
||||
<tr id="filters">
|
||||
<?php echo (isset($_SESSION["user"])) ? '<th> </th>' : ''; ?>
|
||||
<th><input type="text" id="filter_id" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('ID')"></th>
|
||||
<!--th><input type="text" id="filter_thumb" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('Thumb')"></th-->
|
||||
<th> </th>
|
||||
<th><input type="text" id="filter_filename" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('FileName')"></th>
|
||||
<th><input type="text" id="filter_dateoriginal" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('DateOriginal')"></th>
|
||||
<th><input type="text" id="filter_speed" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('Speed')"></th>
|
||||
<th><input type="text" id="filter_iso" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('ISO')"></th>
|
||||
<th><input type="text" id="filter_aperture" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('Aperture')"></th>
|
||||
<th><input type="text" id="filter_correctexpo" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('CorrectExpo')"></th>
|
||||
<th><input type="text" id="filter_model" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('Model')"></th>
|
||||
<th><input type="text" id="filter_lens" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('Lens')"></th>
|
||||
<th><input type="text" id="filter_focal" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('Focal')"></th>
|
||||
<th><input type="text" id="filter_metering" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('Metering')"></th>
|
||||
<th><input type="text" id="filter_program" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('Program')"></th>
|
||||
<th><input type="text" id="filter_wb" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('WB')"></th>
|
||||
<th><input type="text" id="filter_software" placeholder="<?php echo gettext('Filter'); ?>" oninput="showUser('Software')"></th>
|
||||
</tr>
|
||||
|
||||
<tr id = "Headings">
|
||||
<?php if (isset($_SESSION["user"])) { ?>
|
||||
<th id = "Coche" class="ASC" onclick="showUser('Coche')">X</th>
|
||||
<?php } ?>
|
||||
<th id = "ID" class="ASC" onclick="showUser('ID')">ID</th>
|
||||
<th id = "Thumb" class="ASC" onclick="showUser('Thumb')"><?php echo gettext('Thumb'); ?></th>
|
||||
<th id = "FileName" class="ASC" onclick="showUser('FileName')"><?php echo gettext('Filename'); ?></th>
|
||||
<th id = "DateOriginal" class="DESC" onclick="showUser('DateOriginal')"><?php echo gettext('Date Original'); ?></th> <!-- ordre par défaut -->
|
||||
<th id = "Speed" class="ASC" onclick="showUser('Speed')"><?php echo gettext('Speed'); ?></th>
|
||||
<th id = "ISO" class="ASC" onclick="showUser('ISO')"><?php echo gettext('ISO'); ?></th>
|
||||
<th id = "Aperture" class="ASC" onclick="showUser('Aperture')"><?php echo gettext('Aperture'); ?></th>
|
||||
<th id = "CorrectExpo" class="ASC" onclick="showUser('CorrectExpo')"><?php echo gettext('Exposure corr.'); ?></th>
|
||||
<th id = "Model" class="ASC" onclick="showUser('Model')"><?php echo gettext('Model'); ?></th>
|
||||
<th id = "Lens" class="ASC" onclick="showUser('Lens')"><?php echo gettext('Lens'); ?></th>
|
||||
<th id = "Focal" class="ASC" onclick="showUser('Focal')"><?php echo gettext('Focal'); ?></th>
|
||||
<th id = "Metering" class="ASC" onclick="showUser('Metering')"><?php echo gettext('Metering'); ?></th>
|
||||
<th id = "Program" class="ASC" onclick="showUser('Program')"><?php echo gettext('Programm'); ?></th>
|
||||
<th id = "WB" class="ASC" onclick="showUser('WB')"><?php echo gettext('WB'); ?></th>
|
||||
<th id = "Software" class="ASC" onclick="showUser('Software')"><?php echo gettext('Software'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="Table"></tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if (isset($_SESSION["user"])) {
|
||||
echo '<button type="submit" formaction="edit_bdd.php" name="edit" value="edit" class="myButton all">' . gettext('Edit') . '</button>';
|
||||
//echo '<button type="submit" name="suppress" value="suppress" class="myButton all">' . gettext('Suppress') . '</button>';
|
||||
echo '<button type="submit" formaction="delete_bdd.php" name="suppress" value="suppress" class="myButton all">' . gettext('Suppress') . '</button>';
|
||||
echo '</form>';
|
||||
}
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
var $obj = lc_lightbox('td a', {
|
||||
img_zoom : true, // whether to enable zooming system
|
||||
|
||||
author_by_txt : '<?php echo gettext("by"); ?>', // which text is used before the author name, by default is "by"
|
||||
|
||||
slideshow : true, // whether to enable slideshow
|
||||
open_close_time : 200, // durée de l'animation pour l'ouverture et la fermeture de la lightbox
|
||||
ol_time_diff : 100, // animation de superposition avance (à l'ouverture) et retard (à la fermeture) à la fenêtre
|
||||
fading_time : 50, // durée de l'animation de fondu des éléments
|
||||
animation_time : 100,
|
||||
slideshow_time : 4000, // durée de l'intervalle du diaporama
|
||||
autoplay : false, // autoplay slideshow - bool
|
||||
counter : false, // s'il faut afficher le compteur d'éléments
|
||||
progressbar : false, // s'il faut afficher une barre de progression lors de l'exécution du diaporama
|
||||
|
||||
max_width : '95%', // largeur maximale de la lightbox
|
||||
max_height : '95%', // hauteur maximale de la lightbox
|
||||
ol_opacity : 0.7, // overlay opacity / value between 0 and 1
|
||||
ol_color : '#111', // background color of the overlay
|
||||
ol_pattern : false, // overlay patterns - insert the pattern name or false
|
||||
|
||||
wrap_class : 'lcl_fade_oc', // Classes personnalisées ajoutées au wrapper: effet à l'ouverture de la lb (lcl_fade_oc | lcl_zoomin_oc | lcl_rtl_oc)
|
||||
skin : 'minimal', // minimal | light | dark
|
||||
data_position : 'over', // Spécifie où les données des éléments seront affichées. Les modes disponibles sont :over, under|rside|lside
|
||||
cmd_position : 'inner', // Déclare où les commandes doivent être affichées : inner|outer
|
||||
ins_close_pos : 'normal', // set closing button position for inner commands - normal/corner
|
||||
nav_btn_pos : 'normal', // Régle les flèches et la position de lecture/pause. Options disponibles: normal|middle
|
||||
|
||||
txt_hidden : true, // whether to hide texts on lightbox opening - bool or int (related to browser's smaller side)
|
||||
shox_title : true, // s'il faut afficher les titres
|
||||
show_descr : true, // s'il faut afficher les descriptions
|
||||
show_author : true, // s'il faut afficher les auteurs
|
||||
|
||||
thumbs_nav : false, // permet la navigation par vignettes (nécessite des éléments affiche ou images)
|
||||
|
||||
fullscreen : true, // Autoriser ou non le mode plein écran
|
||||
fs_img_behavior : 'smart', //Comportement de l'image en plein écran : fit|fill|smart
|
||||
fs_only : 500, // s'il faut utiliser uniquement l'ouverture de la lightbox en mode plein écran (utile pour les appareils mobiles) : false | (integer)
|
||||
browser_fs_mode : true, // utiliser ou non le mode plein écran du navigateur
|
||||
|
||||
txt_toggle_cmd : true, // s'il faut afficher le bouton de basculement du texte de l'élément
|
||||
download : true, // whether to show element's file download button
|
||||
autoplay_videos : false, // bool / whether to autoplay videos (NB: modern browsers ignore this for deeplinked elements. Not applied if video has poster)
|
||||
touchswipe : true, // permet les interactions tactiles (nécessite AlloyFinger)
|
||||
rclick_prevent : true, // s'il faut éviter le clic droit sur les éléments de la lightbox
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<?php $logout = (isset($_SESSION["user"])) ? '<a class="" href="4-logout.php" role="button">' . gettext("Log out") . '</a>' : ''; ?>
|
||||
|
||||
<p class="navPage"><a href="../index.php" title="<?php echo gettext("Home"); ?>"><?php echo gettext("Home"); ?></a> | <a href="../photo-du-mois.php" title="<?php echo gettext("Picture of the month"); ?>"><?php echo gettext("Picture of the month"); ?></a> | <a href="../maps.php" title="<?php echo gettext("Maps"); ?>"><?php echo gettext("Maps"); ?></a> | <a href="admin.php" title="<?php echo gettext("Admin page"); ?>"><?php echo gettext("Admin page"); ?></a> | <?php echo $logout; ?></p>
|
||||
|
||||
<p><em><small>© 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
|
||||
|
||||
<script src='../lc-lightbox/js/lc_lightbox.min.js'></script>
|
||||
<script src='../lc-lightbox/lib/AlloyFinger/alloy_finger.min.js'></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user