diff --git a/.gitignore b/.gitignore
index c18e309..6199e3c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,8 @@
config/config.php
scripts/.loc_hash
.idea
-/public/uploads
+public/uploads/*
+!public/uploads/default.png
/tmp
vendor
composer.json
diff --git a/public/models/readRecords.php b/public/models/readRecords.php
index b5a5de5..ebef6c6 100644
--- a/public/models/readRecords.php
+++ b/public/models/readRecords.php
@@ -63,7 +63,12 @@
$vendeur_format = "$vendeur";
$cle_pub_format = " $pubkeyShort... ";
$data .= '
'.$produit.' | ';
- $data .= ' | ';
+ $imagep = '../uploads/products/'.$antenne_slug.'/'.$row['image'].'';
+ if (file_exists($imagep) && $row['image']) {
+ $data .= ' | ';
+ } else {
+ $data .= ' | ';
+ }
$data .= ''.$vendeur_format.' | ';
$data .= ''.$cle_pub_format.' | ';
$data .= ''.$quantite.' | ';
diff --git a/public/models/readRecords2.php b/public/models/readRecords2.php
index f866e88..109ce08 100644
--- a/public/models/readRecords2.php
+++ b/public/models/readRecords2.php
@@ -19,11 +19,11 @@
$params["antenne_slug"] = $antenne_slug;
$requete = "SELECT souhaits.*, users.username, users.pubkey
- FROM souhaits
- LEFT JOIN antennes
- ON antennes.id = souhaits.antenne_id
- LEFT JOIN users
- ON users.id = souhaits.user_id
+ FROM souhaits
+ LEFT JOIN antennes
+ ON antennes.id = souhaits.antenne_id
+ LEFT JOIN users
+ ON users.id = souhaits.user_id
WHERE antennes.slug = :antenne_slug";
$stmt = $bdd->prepare($requete);
$stmt2 = $bdd->prepare($requete);
@@ -55,7 +55,12 @@
$vendeur_format = "$vendeur";
$pubkeyShort = substr($pubkey, 0, 8);
$data .= ''.$produit.' | ';
- $data .= ' | ';
+ $imagep = '../uploads/recherches/'.$antenne_slug.'/'.$row['image'].'';
+ if (file_exists($imagep) && $row['image']) {
+ $data .= ' | ';
+ } else {
+ $data .= ' | ';
+ }
$data .= ''.$vendeur_format.' | ';
$data .= ''.$pubkeyShort.'... | ';
$data .= ''.$row['quantite'].' | ';
diff --git a/public/uploads/default.png b/public/uploads/default.png
new file mode 100644
index 0000000..ee6994b
Binary files /dev/null and b/public/uploads/default.png differ