fixed photo quotations
This commit is contained in:
@@ -8,8 +8,8 @@ $file = $_FILES['file'] ?? null;
|
|||||||
$filename = $_POST['filename'] ?? null;
|
$filename = $_POST['filename'] ?? null;
|
||||||
$idquotations = $_POST['idquotations'] ?? null;
|
$idquotations = $_POST['idquotations'] ?? null;
|
||||||
|
|
||||||
if (!$file || !$filename || !$idquotations) {
|
if (!$file || !$filename || !$idquotations || !isset($iduserlogin)) {
|
||||||
echo json_encode(['success' => false, 'message' => 'Dati mancanti']);
|
echo json_encode(['success' => false, 'message' => 'Dati mancanti o utente non autenticato']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ if (!in_array($file['type'], $allowedTypes)) {
|
|||||||
try {
|
try {
|
||||||
$dbHandler = DBHandlerSelect::getInstance();
|
$dbHandler = DBHandlerSelect::getInstance();
|
||||||
$pdo = $dbHandler->getConnection();
|
$pdo = $dbHandler->getConnection();
|
||||||
$stmt = $pdo->prepare("SELECT idquotations FROM quotations WHERE idquotations = :idquotations");
|
$stmt = $pdo->prepare("SELECT id FROM quotations WHERE id = :idquotations");
|
||||||
$stmt->execute([':idquotations' => $idquotations]);
|
$stmt->execute([':idquotations' => $idquotations]);
|
||||||
if (!$stmt->fetch()) {
|
if (!$stmt->fetch()) {
|
||||||
echo json_encode(['success' => false, 'message' => 'idquotations non valido']);
|
echo json_encode(['success' => false, 'message' => 'idquotations non valido']);
|
||||||
|
|||||||
Reference in New Issue
Block a user