delete.php

-efface des fichiers dans la base et les fichiers sur le serveur.
This commit is contained in:
2024-12-11 18:03:53 +01:00
parent d8f28b47b8
commit 4c22f27eb6
12 changed files with 384 additions and 104 deletions

View File

@@ -0,0 +1 @@
.

Binary file not shown.

View File

@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sur-le-sentier.fr\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-10 10:29+0100\n"
"PO-Revision-Date: 2024-12-10 10:29+0100\n"
"POT-Creation-Date: 2024-12-11 17:32+0100\n"
"PO-Revision-Date: 2024-12-11 17:32+0100\n"
"Last-Translator: Bruno <bruno@clicclac.info>\n"
"Language-Team: French <bruno@clicclac.info>\n"
"Language: fr\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.5\n"
"X-Poedit-KeywordsList: gettext;_\n"
"X-Poedit-KeywordsList: gettext;_;__\n"
"X-Poedit-Basepath: ../../..\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-SearchPath-0: .\n"
@@ -47,29 +47,29 @@ msgid "Sign In"
msgstr "Se connecter"
#: 1-login.php:33 admin.php:69 avif/avif.php:167 clean_bdd.php:721
#: edit_bdd.php:141 insert_bdd.php:527 insert_bdd.php:710 maps.php:186
#: modify_bdd.php:240 photo-du-mois.php:321 requests.php:230 view_bdd.php:231
#: view_bdd2.php:429
#: delete_bdd.php:215 edit_bdd.php:135 insert_bdd.php:527 insert_bdd.php:710
#: maps.php:186 modify_bdd.php:240 photo-du-mois.php:321 requests.php:230
#: view_bdd.php:231 view_bdd2.php:430
msgid "Home"
msgstr "Accueil"
#: 1-login.php:33 admin.php:69 avif/avif.php:14 avif/avif.php:27
#: clean_bdd.php:721 edit_bdd.php:141 insert_bdd.php:527 insert_bdd.php:710
#: maps.php:186 modify_bdd.php:240 photo-du-mois.php:29 requests.php:230
#: view_bdd.php:231 view_bdd2.php:429
#: clean_bdd.php:721 delete_bdd.php:215 edit_bdd.php:135 insert_bdd.php:527
#: insert_bdd.php:710 maps.php:186 modify_bdd.php:240 photo-du-mois.php:29
#: requests.php:230 view_bdd.php:231 view_bdd2.php:430
msgid "Picture of the month"
msgstr "Photo du mois"
#: 1-login.php:33 admin.php:69 avif/avif.php:167 clean_bdd.php:721
#: edit_bdd.php:141 insert_bdd.php:527 insert_bdd.php:710 maps.php:14
#: maps.php:39 modify_bdd.php:240 photo-du-mois.php:321 requests.php:230
#: view_bdd.php:231 view_bdd2.php:429
#: delete_bdd.php:215 edit_bdd.php:135 insert_bdd.php:527 insert_bdd.php:710
#: maps.php:14 maps.php:39 modify_bdd.php:240 photo-du-mois.php:321
#: requests.php:230 view_bdd.php:231 view_bdd2.php:430
msgid "Maps"
msgstr "Carte"
#: 1-login.php:33 admin.php:69 clean_bdd.php:721 edit_bdd.php:141
#: insert_bdd.php:710 modify_bdd.php:240 requests.php:230 view_bdd.php:231
#: view_bdd2.php:429
#: 1-login.php:33 admin.php:69 clean_bdd.php:721 delete_bdd.php:215
#: edit_bdd.php:135 insert_bdd.php:710 modify_bdd.php:240 requests.php:230
#: view_bdd.php:231 view_bdd2.php:430
msgid "Admin page"
msgstr "Page administrateur"
@@ -89,32 +89,32 @@ msgstr "Page: "
#: _test/photo-du-mois _2.php:328 _test/photo-du-mois-lc-lite.php:253
#: _test/photo-du-mois-ng.php:196 _test/photo-du-mois-ps.php:241
#: ovh/ce-mois.php:665 photo-du-mois.php:308 view_bdd2.php:413
#: ovh/ce-mois.php:665 photo-du-mois.php:308 view_bdd2.php:414
msgid "Previous Page"
msgstr "Page précédente"
#: _test/photo-du-mois _2.php:328 _test/photo-du-mois-lc-lite.php:253
#: _test/photo-du-mois-ng.php:196 _test/photo-du-mois-ps.php:241
#: ovh/ce-mois.php:665 photo-du-mois.php:308 view_bdd2.php:413
#: ovh/ce-mois.php:665 photo-du-mois.php:308 view_bdd2.php:414
msgid "prev"
msgstr "prec"
#: _test/photo-du-mois _2.php:331 _test/photo-du-mois-lc-lite.php:256
#: _test/photo-du-mois-ng.php:199 _test/photo-du-mois-ps.php:244
#: ovh/ce-mois.php:668 photo-du-mois.php:307 photo-du-mois.php:311
#: view_bdd2.php:412 view_bdd2.php:416
#: view_bdd2.php:413 view_bdd2.php:417
msgid "Page"
msgstr "Page"
#: _test/photo-du-mois _2.php:337 _test/photo-du-mois-lc-lite.php:262
#: _test/photo-du-mois-ng.php:205 _test/photo-du-mois-ps.php:250
#: ovh/ce-mois.php:674 photo-du-mois.php:317 view_bdd2.php:422
#: ovh/ce-mois.php:674 photo-du-mois.php:317 view_bdd2.php:423
msgid "Next Page"
msgstr "Page suivante"
#: _test/photo-du-mois _2.php:337 _test/photo-du-mois-lc-lite.php:262
#: _test/photo-du-mois-ng.php:205 _test/photo-du-mois-ps.php:250
#: ovh/ce-mois.php:674 photo-du-mois.php:317 view_bdd2.php:422
#: ovh/ce-mois.php:674 photo-du-mois.php:317 view_bdd2.php:423
msgid "next"
msgstr "suiv"
@@ -130,8 +130,8 @@ msgstr "Etat: "
msgid " logged in"
msgstr " connecté"
#: avif/picture.php:18 edit_bdd.php:55 modify_bdd.php:157 requests.php:14
#: view_bdd.php:52 view_bdd2.php:98
#: avif/picture.php:18 delete_bdd.php:118 edit_bdd.php:49 modify_bdd.php:157
#: requests.php:14 view_bdd.php:52 view_bdd2.php:98
msgid "View photos in Sqlite base"
msgstr "Voir les photos dans la base Sqlite"
@@ -277,8 +277,8 @@ msgstr "Lumière tungstène"
msgid "Fluorescent"
msgstr "Lumière fluo blanche"
#: clean_bdd.php:399 clean_bdd.php:692 edit_bdd.php:94 functions.php:459
#: insert_bdd.php:322 modify_bdd.php:196 view_bdd2.php:302
#: clean_bdd.php:399 clean_bdd.php:692 delete_bdd.php:155 edit_bdd.php:88
#: functions.php:459 insert_bdd.php:322 modify_bdd.php:196 view_bdd2.php:303
msgid "Flash"
msgstr "Utilisation du flash"
@@ -302,8 +302,8 @@ msgstr "Température de couleur (Kelvin)"
msgid "Manual"
msgstr "Exposition manuelle"
#: clean_bdd.php:423 clean_bdd.php:693 edit_bdd.php:92 functions.php:455
#: insert_bdd.php:285 modify_bdd.php:194 view_bdd2.php:302
#: clean_bdd.php:423 clean_bdd.php:693 delete_bdd.php:153 edit_bdd.php:86
#: functions.php:455 insert_bdd.php:285 modify_bdd.php:194 view_bdd2.php:303
msgid "Program"
msgstr "Programme"
@@ -335,13 +335,13 @@ msgstr "Paysage"
msgid "Reading added photos"
msgstr "Lecture des photos ajoutées"
#: clean_bdd.php:692 edit_bdd.php:91 modify_bdd.php:193 view_bdd.php:148
#: view_bdd2.php:300
#: clean_bdd.php:692 delete_bdd.php:152 edit_bdd.php:85 modify_bdd.php:193
#: view_bdd.php:148 view_bdd2.php:301
msgid "Thumb"
msgstr "Vignette"
#: clean_bdd.php:692 edit_bdd.php:91 modify_bdd.php:193 view_bdd.php:149
#: view_bdd2.php:300
#: clean_bdd.php:692 delete_bdd.php:152 edit_bdd.php:85 modify_bdd.php:193
#: view_bdd.php:149 view_bdd2.php:301
msgid "Filename"
msgstr "Fichier"
@@ -349,23 +349,23 @@ msgstr "Fichier"
msgid "File size"
msgstr "Taille fichier"
#: clean_bdd.php:692 edit_bdd.php:91 functions.php:446 modify_bdd.php:193
#: view_bdd2.php:300
#: clean_bdd.php:692 delete_bdd.php:152 edit_bdd.php:85 functions.php:446
#: modify_bdd.php:193 view_bdd2.php:301
msgid "Date"
msgstr "Date"
#: clean_bdd.php:692 edit_bdd.php:92 functions.php:451 modify_bdd.php:194
#: view_bdd.php:156 view_bdd2.php:300
#: clean_bdd.php:692 delete_bdd.php:153 edit_bdd.php:86 functions.php:451
#: modify_bdd.php:194 view_bdd.php:156 view_bdd2.php:301
msgid "Lens"
msgstr "Objectif"
#: clean_bdd.php:692 edit_bdd.php:91 functions.php:447 modify_bdd.php:193
#: view_bdd.php:151 view_bdd2.php:300
#: clean_bdd.php:692 delete_bdd.php:152 edit_bdd.php:85 functions.php:447
#: modify_bdd.php:193 view_bdd.php:151 view_bdd2.php:301
msgid "Speed"
msgstr "Vitesse"
#: clean_bdd.php:692 edit_bdd.php:91 functions.php:448 modify_bdd.php:193
#: view_bdd.php:153 view_bdd2.php:300
#: clean_bdd.php:692 delete_bdd.php:152 edit_bdd.php:85 functions.php:448
#: modify_bdd.php:193 view_bdd.php:153 view_bdd2.php:301
msgid "Aperture"
msgstr "Ouverture"
@@ -373,23 +373,23 @@ msgstr "Ouverture"
msgid "Exposure Corr."
msgstr "Correction dexpo."
#: clean_bdd.php:692 edit_bdd.php:91 functions.php:449 modify_bdd.php:193
#: view_bdd2.php:300
#: clean_bdd.php:692 delete_bdd.php:152 edit_bdd.php:85 functions.php:449
#: modify_bdd.php:193 view_bdd2.php:301
msgid "Iso"
msgstr "ISO"
#: clean_bdd.php:692 edit_bdd.php:92 functions.php:450 modify_bdd.php:194
#: view_bdd.php:155 view_bdd2.php:301
#: clean_bdd.php:692 delete_bdd.php:153 edit_bdd.php:86 functions.php:450
#: modify_bdd.php:194 view_bdd.php:155 view_bdd2.php:302
msgid "Model"
msgstr "APN"
#: clean_bdd.php:692 edit_bdd.php:92 functions.php:454 modify_bdd.php:194
#: view_bdd.php:158 view_bdd2.php:302
#: clean_bdd.php:692 delete_bdd.php:153 edit_bdd.php:86 functions.php:454
#: modify_bdd.php:194 view_bdd.php:158 view_bdd2.php:303
msgid "Metering"
msgstr "Mesure"
#: clean_bdd.php:693 edit_bdd.php:92 functions.php:452 modify_bdd.php:194
#: view_bdd.php:157 view_bdd2.php:302
#: clean_bdd.php:693 delete_bdd.php:153 edit_bdd.php:86 functions.php:452
#: modify_bdd.php:194 view_bdd.php:157 view_bdd2.php:303
msgid "Focal"
msgstr "Focale"
@@ -401,41 +401,45 @@ msgstr "Balance des blancs"
msgid "Mode"
msgstr "Mode"
#: clean_bdd.php:693 edit_bdd.php:94 functions.php:461 modify_bdd.php:196
#: view_bdd.php:161
#: clean_bdd.php:693 delete_bdd.php:155 edit_bdd.php:88 functions.php:461
#: modify_bdd.php:196 view_bdd.php:161
msgid "Software"
msgstr "Logiciel"
#: clean_bdd.php:693 view_bdd2.php:301
#: clean_bdd.php:693 view_bdd2.php:302
msgid "Latitude"
msgstr "Latitude"
#: clean_bdd.php:693 view_bdd2.php:301
#: clean_bdd.php:693 view_bdd2.php:302
msgid "Longitude"
msgstr "Longitude"
#: clean_bdd.php:693 view_bdd2.php:301
#: clean_bdd.php:693 view_bdd2.php:302
msgid "Alttitude"
msgstr "Alttitude"
#: clean_bdd.php:693 edit_bdd.php:94 functions.php:462 modify_bdd.php:196
#: view_bdd2.php:302
#: clean_bdd.php:693 delete_bdd.php:155 edit_bdd.php:88 functions.php:462
#: modify_bdd.php:196 view_bdd2.php:303
msgid "Keywords"
msgstr "Mots-clés"
#: clean_bdd.php:693 edit_bdd.php:94 modify_bdd.php:196 view_bdd2.php:301
#: clean_bdd.php:693 delete_bdd.php:155 edit_bdd.php:88 modify_bdd.php:196
#: view_bdd2.php:302
msgid "Title"
msgstr "Titre"
#: clean_bdd.php:693 edit_bdd.php:94 modify_bdd.php:196 view_bdd2.php:302
#: clean_bdd.php:693 delete_bdd.php:155 edit_bdd.php:88 modify_bdd.php:196
#: view_bdd2.php:303
msgid "Creator"
msgstr "Créateur"
#: clean_bdd.php:694 edit_bdd.php:94 functions.php:465 modify_bdd.php:196
#: clean_bdd.php:694 delete_bdd.php:155 edit_bdd.php:88 functions.php:465
#: modify_bdd.php:196
msgid "City"
msgstr "Ville"
#: clean_bdd.php:694 edit_bdd.php:94 functions.php:466 modify_bdd.php:196
#: clean_bdd.php:694 delete_bdd.php:155 edit_bdd.php:88 functions.php:466
#: modify_bdd.php:196
msgid "Department"
msgstr "Departement"
@@ -443,48 +447,82 @@ msgstr "Departement"
msgid "CP"
msgstr "CP"
#: clean_bdd.php:694 edit_bdd.php:94 functions.php:468 modify_bdd.php:196
#: clean_bdd.php:694 delete_bdd.php:155 edit_bdd.php:88 functions.php:468
#: modify_bdd.php:196
msgid "Country"
msgstr "Etat"
#: clean_bdd.php:694 edit_bdd.php:94 functions.php:463 modify_bdd.php:196
#: view_bdd2.php:301
#: clean_bdd.php:694 delete_bdd.php:155 edit_bdd.php:88 functions.php:463
#: modify_bdd.php:196 view_bdd2.php:302
msgid "Copyright"
msgstr "Copyright"
#: clean_bdd.php:694 edit_bdd.php:94 modify_bdd.php:196 view_bdd2.php:301
#: clean_bdd.php:694 delete_bdd.php:155 edit_bdd.php:88 modify_bdd.php:196
#: view_bdd2.php:302
msgid "Legende"
msgstr "Légende"
#: edit_bdd.php:27 edit_bdd.php:32
#: delete_bdd.php:40 delete_bdd.php:94 delete_bdd.php:101 edit_bdd.php:27
#: edit_bdd.php:32
msgid "No images select !"
msgstr "Aucune image sélectionnée !"
#: edit_bdd.php:37
#: delete_bdd.php:69
#, php-format
msgid "File %s doesn't exist !"
msgstr "Fichier: %s supprimé !"
#: delete_bdd.php:86
#, php-format
msgid "File: %s deleted!"
msgstr "Fichier: %s supprimé!"
#: delete_bdd.php:106 edit_bdd.php:37
msgid "Please log in !"
msgstr "Veuillez-vous connecter !"
#: edit_bdd.php:76
msgid "Edit database"
msgstr "Editer la base"
#: delete_bdd.php:137
msgid "Suppress images "
msgstr "Supprimer images "
#: edit_bdd.php:91 modify_bdd.php:193 view_bdd2.php:300
#: delete_bdd.php:152 edit_bdd.php:85 modify_bdd.php:193 view_bdd2.php:301
msgid "Id"
msgstr "Id"
#: edit_bdd.php:91 modify_bdd.php:193
#: delete_bdd.php:152 edit_bdd.php:85 modify_bdd.php:193
msgid "Expo. correct"
msgstr "Correction dexpo."
#: edit_bdd.php:92 modify_bdd.php:194 view_bdd2.php:302
#: delete_bdd.php:153 edit_bdd.php:86 modify_bdd.php:194 view_bdd2.php:303
msgid "Wb"
msgstr "BdB"
#: edit_bdd.php:94 modify_bdd.php:196
#: delete_bdd.php:155 edit_bdd.php:88 modify_bdd.php:196
msgid "Code"
msgstr "Code"
#: edit_bdd.php:130
#: delete_bdd.php:188
msgid ""
"Clic on <b>Delete</b> button will delete the images in the database and the "
"files on the server."
msgstr ""
"Cliquer sur le bouton <b>Effacer</b> effacera les images dans la base et les "
"fichiers sur le serveur."
#: delete_bdd.php:189
msgid "Delete"
msgstr "Supprimer"
#: delete_bdd.php:204
#, php-format
msgid "%d rows deleted and the following files:"
msgstr "%d lignes supprimées avec la requête suivante:"
#: edit_bdd.php:70
msgid "Edit database"
msgstr "Editer la base"
#: edit_bdd.php:124
msgid "Update"
msgstr "Mise-à-jour"
@@ -504,39 +542,39 @@ msgstr "Commentaire"
msgid "User comment"
msgstr "Commentaire utilis."
#: index.php:125 ovh/ce-mois.php:348 vegas/index.php:102
#: index.php:126 ovh/ce-mois.php:348 vegas/index.php:102
msgid "Blog"
msgstr "Blog"
#: index.php:125 vegas/index.php:102
#: index.php:126 vegas/index.php:102
msgid "Go to the <span class=\"green\">blog...</span>"
msgstr "Aller sur le <span class=\"green\">blog...</span>"
#: index.php:127 ovh/ce-mois.php:349 vegas/index.php:104
#: index.php:128 ovh/ce-mois.php:349 vegas/index.php:104
msgid "Gallery"
msgstr "Portfolio"
#: index.php:127 vegas/index.php:104
#: index.php:128 vegas/index.php:104
msgid "Visit the <span class=\"green\">gallery...</span>"
msgstr "Visiter la <span class=\"green\">galerie...</span>"
#: index.php:129
#: index.php:130
msgid "Piwigo"
msgstr "Piwigo"
#: index.php:129
#: index.php:130
msgid "Visit the <span class=\"green\">Piwigo gallery...</span>"
msgstr "Visiter la <span class=\"green\">galerie Piwigo…</span>"
#: index.php:131 vegas/index.php:106
#: index.php:132 vegas/index.php:106
msgid "This month"
msgstr "Ce mois-çi"
#: index.php:131
#: index.php:132
msgid "Picture of the <span class=\"green\">month</span> ..."
msgstr "Photo du <span class=\"green\">mois</span> …"
#: index.php:153 vegas/index.php:113
#: index.php:154 vegas/index.php:113
msgid "Powered by"
msgstr "Propulsé par"
@@ -620,19 +658,19 @@ msgstr "Insertion de "
msgid " in database"
msgstr " dans la base"
#: localize.php:230 vegas/index.php:34
#: localize.php:231 vegas/index.php:34
msgid "French"
msgstr "Français"
#: localize.php:230 vegas/index.php:34
#: localize.php:231 vegas/index.php:34
msgid "English"
msgstr "Anglais"
#: localize.php:230 vegas/index.php:34
#: localize.php:231 vegas/index.php:34
msgid "German"
msgstr "Allemand"
#: localize.php:230 vegas/index.php:34
#: localize.php:231 vegas/index.php:34
msgid "Spanish"
msgstr "Espagnol"
@@ -744,7 +782,7 @@ msgstr "Choix du language"
msgid "Photo's licence"
msgstr "License des photos"
#: photo-du-mois.php:202 view_bdd.php:182 view_bdd2.php:339
#: photo-du-mois.php:202 view_bdd.php:182 view_bdd2.php:340
msgid "by"
msgstr "par"
@@ -776,19 +814,19 @@ msgstr "vitesse"
msgid "<span class=\"green\">Latest</span> images..."
msgstr "<span class=\"green\">Dernières</span> images..."
#: view_bdd.php:36 view_bdd2.php:41
#: view_bdd.php:36
msgid " photos successfully deleted !"
msgstr " photos effacées !"
#: view_bdd.php:40 view_bdd2.php:45
#: view_bdd.php:40
msgid "Empty request !"
msgstr "Requête nulle !"
#: view_bdd.php:116 view_bdd.php:169 view_bdd2.php:295 view_bdd2.php:320
#: view_bdd.php:116 view_bdd.php:169 view_bdd2.php:295 view_bdd2.php:321
msgid "Edit"
msgstr "Editer"
#: view_bdd.php:117 view_bdd.php:170 view_bdd2.php:296 view_bdd2.php:321
#: view_bdd.php:117 view_bdd.php:170 view_bdd2.php:297 view_bdd2.php:322
msgid "Suppress"
msgstr "Supprimer"
@@ -807,7 +845,7 @@ msgstr "Date prise de vue"
msgid "ISO"
msgstr "ISO"
#: view_bdd.php:154 view_bdd2.php:300
#: view_bdd.php:154 view_bdd2.php:301
msgid "Exposure corr."
msgstr "Correction dexpo."
@@ -819,7 +857,7 @@ msgstr "Programme"
msgid "WB"
msgstr "Balance des blancs"
#: view_bdd.php:229 view_bdd2.php:427
#: view_bdd.php:229 view_bdd2.php:428
msgid "Log out"
msgstr "Déconnexion"
@@ -851,26 +889,33 @@ msgstr "an"
msgid "OK"
msgstr "Ok"
#: view_bdd2.php:300
#: view_bdd2.php:301
msgid "Select"
msgstr "Sélectionner"
#: view_bdd2.php:300
#: view_bdd2.php:301
msgid "Size"
msgstr "Taille"
#: view_bdd2.php:300
#: view_bdd2.php:301
msgid "Width"
msgstr "Largeur"
#: view_bdd2.php:300
#: view_bdd2.php:301
msgid "Height"
msgstr "Hauteur"
#: view_bdd2.php:316
#: view_bdd2.php:317
msgid "No image found !"
msgstr "Aucune image trouvée !"
#~ msgid " rows deleted with following request:"
#~ msgstr " lignes supprimées avec la requête suivante:"
#, php-format
#~ msgid "Rates %s in &euro;/ week:"
#~ msgstr "Taux %s en &euro;/semaine:"
#~ msgid "Request null"
#~ msgstr "Requête nulle"

1
Locale/nocache Symbolic link
View File

@@ -0,0 +1 @@
.

View File

@@ -511,6 +511,10 @@ h3.greenstyle {
.font10 {
font-size: 10px;
}
.alert {
color: red;
text-align: left;
}
input[type="text"], textarea {

221
delete_bdd.php Normal file
View File

@@ -0,0 +1,221 @@
<?php require ("3-protect.php");
include 'localize.php';
$domain = 'sentier';
localize($domain);
include 'functions.php';
$base = 'db_photo.sqlite3';
$conn = new PDO("sqlite:$base");
$conn2 = new PDO("sqlite:$base");
$msg = "";
$req_suppress = "";
$req_delete = "";
$files_deleted = "";
$files = array();
//_pr($_POST);
/*
// view_bdd2.php:
supress ; coche => delete_bdd.php (delete ; coche)
edit; coche => edit_bdd.php => modify_bdd.php (modif sur la bdd)
*/
if (isset($_SESSION["user"])) {
if ((isset($_POST["suppress"])) && ($_POST["suppress"] == "suppress")) {
if (isset($_POST['coche']) && (! empty($_POST['coche']))) {
$rr = "";
foreach($_POST['coche'] as $key => $value) {
$r = "id = '" . $value . "' OR ";
$rr .= $r;
}
$req = substr($rr, 0, -4);
$req_suppress = "SELECT * FROM photos WHERE " . $req . " ORDER BY id";
}
else {
$url = "view_bdd.php?message=" . urlencode(gettext("No images select !"));
header("location: $url");
}
}
elseif ((isset($_POST["delete"])) && ($_POST["delete"] == "delete")) {
if (isset($_POST['id']) && (! empty($_POST['id']))) {
$rr = "";
foreach($_POST['id'] as $key => $value) {
$r = "id = '" . $value . "' OR ";
$rr .= $r;
}
$req = substr($rr, 0, -4);
/**/
$req_suppress = "SELECT id, filename FROM photos WHERE " . $req . " ORDER BY id"; // Pour supprimer les fichiers
$stmt = $conn->prepare($req_suppress);
$stmt->execute();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$ids[] = $row['id'];
if (file_exists($file)) {
$files[] = realpath('.') . "/" . $file;
}
else {
//$msg .= "File $file doesn't exist !";
$msg .= sprintf( gettext("File %s doesn't exist !"), $file);
}
}
//_pr($files);
$req_delete = "DELETE FROM photos WHERE id in (".str_repeat("?,", count($ids) - 1)."?)";
// DELETE FROM photos WHERE id in (?,?)
$stmt = $conn->prepare($req_delete);
$stmt->execute($ids);
$count = $stmt->rowCount();
if ($count = count($files)) {
foreach ($files as $file) {
if (unlink($file)) {
//echo "File: " . $file . " deleted!" . "<br />";
$files_deleted .= sprintf( gettext("File: %s deleted!"), $file ) . "\n";
//echo $a;
}
}
}
}
else {
$url = "view_bdd.php?message=" . urlencode(gettext("No images select !"));
header("location: $url");
}
}
else {
$url = "view_bdd.php?message=" . urlencode(gettext("No images select !"));
header("location: $url");
}
}
else {
$url = "admin.php?message=" . urlencode(gettext("Please log in !"));
header("location: $url");
}
?>
<!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">
<title><?php echo gettext('View photos in Sqlite base'); ?></title>
<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.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
</head>
<body>
<?php
//debug_to_console($_GET);
//debug_to_console($req_edit);
echo '<h1>' . gettext('Suppress images ') . ': ' . $base . '</h1><br />';
if (($req_suppress != "") and ($req_delete == "")) {
echo '<h3>' . $msg . '</h3>';
try {
$conn3 = new PDO('sqlite:db_photo.sqlite3');
$stmt3 = $conn3->prepare($req_suppress);
$stmt3->execute();
echo '<form id="deleteImage" name="deleteImage" action="delete_bdd.php" method="post" class="myForm" >';
echo '<table class="styled-table">';
echo '<thead>';
echo '<th>' . gettext('Id') . '</th><th>' . gettext('Thumb') . '</th><th>' . gettext('Filename') . '</th><th>' . gettext('Date') . ' </th><th>' . gettext('Speed') . '</th><th>' . gettext('Iso') . '</th><th>' . gettext('Aperture') . '</th><th>' . gettext('Expo. correct') . '</th>';
echo '<th>' . gettext('Model') . '</th><th>' . gettext('Lens') . '</th><th>' . gettext('Focal') . '</th><th>' . gettext('Metering') . '</th><th>' . gettext('Program') . '</th><th>' . gettext('Wb') . '</th>';
echo '<th>' . gettext('Flash') . '</th><th>' . gettext('Software') . '</th><th>' . gettext('Keywords') . '</th><th>' . gettext('Title') . '</th><th>' . gettext('Creator') . '</th><th>' . gettext('City') . '</th><th>' . gettext('Department') . '</th><th>' . gettext('Code') . '</th><th>' . gettext('Country') . '</th><th>' . gettext('Copyright') . '</th><th>' . gettext('Legende') . '</th>';
echo '</thead>';
echo '<tbody>';
while ($row = $stmt3->fetch(PDO::FETCH_ASSOC)) {
$thumbnail = host() . str_replace("photos/img", "photos/thumb", $row['filename']);
$full = host() . $row['filename'];
echo '<tr><td>' . $row['id'] . '</td><td>' . '<a href="' . $full . '"><img src="'.$thumbnail.'" /></a>' . '</td>';
echo '<td>' . $row['filename'] . '</td><td>' . $row['dateoriginal'] . '</td>';
echo '<td>' . $row['speed'] . '</td><td>' . $row['iso'] . '</td><td>' . $row['aperture'] . '</td><td>' . $row['correctexpo'] . '</td>';
echo '<td>' . $row['model'] . '</td>';
echo '<td><input type="text" id="lens" name="lens[]" value="' . $row['lens'] . '" size=""></td>';
echo '<td>' . $row['focal'] . '</td><td>' . $row['metering'] . '</td><td>' . $row['program'] . '</td><td>' . $row['wb'] . '</td>';
echo '<td>' . $row['flash'] . '</td><td>' . $row['software'] . '</td>';
//echo '<td><input type="text" id="keywords" name="keywords[]" value="' . $row['keywords'] . '" size=""></td>';
echo "<td><input type='text' id='keywords' name='keywords[]' value='" . $row['keywords'] . "' size=''></td>";
echo '<td><input type="text" id="title" name="title[]" value="' . $row['title'] . '" size=""></td>';
echo '<td><input type="text" id="creator" name="creator[]" value="' . $row['creator'] . '" size=""></td>';
echo '<td><input type="text" id="city" name="city[]" value="' . $row['city'] . '" size=""></td>';
echo '<td><input type="text" id="department" name="department[]" value="' . $row['department'] . '" size=""></td>';
echo '<td><input type="text" id="code" name="code[]" value="' . $row['code'] . '" size=""></td>';
echo '<td><input type="text" id="country" name="country[]" value="' . $row['country'] . '" size=""></td>';
echo '<td><input type="text" id="copyright" name="copyright[]" value="' . $row['copyright'] . '" size=""></td>';
echo '<td><input type="text" id="legende" name="legende[]" value="' . $row['legende'] . '" size=""></td></tr>';
echo '<input type="hidden" id="id" name="id[]" value="' . $row['id'] . '">';
}
echo '</tbody></table>';
echo '<p class="alert">' . gettext('Clic on <b>Delete</b> button will delete the images in the database and the files on the server.') . '</p>';
echo '<button type="submit" name="delete" value="delete" class="myButton all">' . gettext('Delete') . '</button>';
echo '</form>';
//$conn = null;
}
catch(PDOException $e) {
echo $e->getMessage();
}
$req_suppress = "";
}
if ($req_delete != "") {
//$msg = sprintf("Updated %d rows with following request:", $count);
$msg = sprintf(gettext("%d rows deleted and the following files:"), $count);
//$msg = $count . gettext(" rows deleted and the following files:");
echo '<h3 class="greenstyle">' . $msg . '</h3>';
echo '<h3>' . nl2br($files_deleted) . '</h3>';
//echo '<pre><code>' . $req_delete . '</code></pre>';
}
?>
<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></p>
<p><em><small>&copy; 2013-<?php echo date('Y'); ?> sur-le-sentier.fr</small></em></p>
<script src='lc-lightbox/js/lc_lightbox.min.js' type='text/javascript'></script>
<script src='lc-lightbox/lib/AlloyFinger/alloy_finger.min.js' type='text/javascript'></script>
</body>
</html>

View File

@@ -223,6 +223,7 @@ function localize($domain) {
putenv('LC_ALL=' . $langue);
$loc = setlocale(LC_ALL, $langue);
bindtextdomain($domain, $root . '/Locale/nocache'); // by-pass gettext() cache. Now the cache is forced to flush every time.
bindtextdomain($domain, $root . '/Locale/');
bind_textdomain_codeset($domain, 'UTF-8');
textdomain($domain);

BIN
photos/11_2024.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 KiB

BIN
photos/5_2005.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

BIN
photos/6_2005.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

@@ -11,6 +11,9 @@
if(!empty($_GET['message'])) {
$msg = "<h3 class='redstyle'>" . $_GET['message'] . "</h3>";
}
/*
// Suppression d'images
if (isset($_SESSION["user"])) {
if ((isset($_POST["suppress"])) && ($_POST["suppress"] == "suppress")) {
@@ -41,7 +44,7 @@
}
}
}
// }
*/
?>
<!DOCTYPE html>
<html lang="en">
@@ -114,7 +117,8 @@ function showUser(column) {
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" 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>';
}
?>
@@ -167,7 +171,8 @@ function showUser(column) {
<?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="supress" class="myButton all">' . gettext('Suppress') . '</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>';
}
?>

View File

@@ -1,5 +1,5 @@
<?php require ("3-protect.php");
session_start();
//session_start();
include 'localize.php';
$domain = 'sentier';
localize($domain);
@@ -14,7 +14,7 @@ $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
if (!isset($_GET['page'])) $page = 1;
else $page = intval($_GET['page']);
/*
// Suppression d'images
if (isset($_SESSION["user"])) {
@@ -47,7 +47,7 @@ if (isset($_SESSION["user"])) {
}
}
*/
$gps = (isset($_SESSION['query']['gps'])) ? $_SESSION['query']['gps'] : "off";
@@ -293,7 +293,8 @@ try {
echo '<form id="viewSelect" name="viewSelect" action="view_bdd2.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" 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 '<table class="styled-table">';
echo '<thead>';
@@ -318,7 +319,8 @@ try {
echo '</tbody></table>';
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="supress" class="myButton all">' . gettext('Suppress') . '</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>';
echo '</div>';