Mise-à-jour sur-le-sentier.fr
version 2
This commit is contained in:
67
query_bdd.php
Normal file
67
query_bdd.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
require ("3-protect.php");
|
||||
include 'localize.php';
|
||||
$domain = 'sentier';
|
||||
localize($domain);
|
||||
include 'functions.php';
|
||||
|
||||
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'];
|
||||
class MyDB extends SQLite3 {
|
||||
function __construct() {
|
||||
$this->open('db_photo.sqlite3');
|
||||
}
|
||||
}
|
||||
$db = new MyDB();
|
||||
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("photos/img", "photos/thumb", $row['filename']);
|
||||
$full = host() . $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-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');
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user