Files
sls/admin/query_bdd.php
Bruno21 b35196fdb8 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
2025-02-13 10:07:21 +01:00

81 lines
3.4 KiB
PHP

<?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';
if (isset($_SERVER['HTTP_REFERER'])){
$id = $_GET['id'];
$filename = $_GET['filename'];
$dateoriginal = $_GET['dateoriginal'];
$speed = $_GET['speed'];
$iso = $_GET['iso'];
$aperture = $_GET['aperture'];
$correctexpo = $_GET['correctexpo'];
$model = $_GET['model'];
$lens = $_GET['lens'];
$focal = $_GET['focal'];
$metering = $_GET['metering'];
$program = $_GET['program'];
$wb = $_GET['wb'];
$software = $_GET['software'];
$column = $_GET['column'];
$order = $_GET['order'];
echo $filename;
/*
class MyDB extends SQLite3 {
function __construct() {
$this->open('../db_photo.sqlite3');
//$this->open($base);
}
}
$db = new MyDB();
*/
$db = new SQLite3($base);
if(!$db){
echo $db->lastErrorMsg();
} else {
$ret = $db->query("SELECT * FROM photos WHERE id LIKE '$id%' AND filename LIKE '%$filename%' AND dateoriginal LIKE '%$dateoriginal%' AND speed LIKE '$speed%' AND iso LIKE '$iso%' AND aperture LIKE '$aperture%' AND correctexpo LIKE '$correctexpo%' AND model LIKE '%$model%' AND lens LIKE '%$lens%' AND focal LIKE '%$focal%' AND metering LIKE '%$metering%' AND program LIKE '%$program%' AND wb LIKE '%$wb%' AND software LIKE '%$software%' ORDER BY $column $order");
while($row = $ret->fetchArray(SQLITE3_ASSOC) ){
//$thumbnail = host() . str_replace("img", "thumb", $chemin) . $row['filename'];
//$full = host() . $chemin . $row['filename'];
$lb = data_for_lightbox($row);
echo "<tr>";
echo (isset($_SESSION["user"])) ? '<td>' . '<input type="checkbox" id="edit" name="coche[]" value="' . $row['id'] . '" >' . '</td>' : '';
echo "<td class='priority-1 center'>".$row['id']."</td>";
//echo "<td class='priority-1'>" . "<a href='" . $full . "' title='" . htmlspecialchars($lb['title']) . "' data-lcl-txt='" . htmlspecialchars($lb['description']) . "' data-lcl-author='" . htmlspecialchars($lb['creator']) . "' /><img src='" . $thumbnail . "' alt='" . htmlspecialchars($lb['title']) . "'></a></td>";
echo "<td class='priority-1'>" . "<a href='" . $lb['big'] . "' title='" . htmlspecialchars($lb['title']) . "' data-lcl-txt='" . htmlspecialchars($lb['description']) . "' data-lcl-author='" . htmlspecialchars($lb['creator']) . "' /><img src='" . $lb['thumb'] . "' alt='" . htmlspecialchars($lb['title']) . "'></a></td>";
echo "<td class='priority-2'>".$row['filename']."</td>";
echo "<td class='priority-8'>".$row['dateoriginal']."</td>";
echo "<td class='priority-3'>".$row['speed']."</td>";
echo "<td class='priority-4'>".$row['iso']."</td>";
echo "<td class='priority-5'>".$row['aperture']."</td>";
echo "<td class='priority-6'>".$row['correctexpo']."</td>";
echo "<td class='priority-7'>".$row['model']."</td>";
echo "<td class='priority-8'>".$row['lens']."</td>";
echo "<td class='priority-8'>".$row['focal']."</td>";
echo "<td class='priority-12'>".$row['metering']."</td>";
echo "<td class='priority-13'>".$row['program']."</td>";
echo "<td class='priority-14'>".$row['wb']."</td>";
echo "<td class='priority-14'>".$row['software']."</td>";
echo "</tr>";
}
}
$db->close();
}else{
header('Location: view_bdd.php');
}
?>