06-04-2024

This commit is contained in:
2024-04-06 11:55:24 +02:00
parent f7c5cf7d47
commit 3d22f9c5d8
550 changed files with 27249 additions and 2537 deletions

View File

@@ -0,0 +1,53 @@
<?php
#include_once("inc/db_connect.php");
$conn = new PDO('sqlite:../db_photo.sqlite3');
//$stmt = $conn->prepare($query);
//$stmt->execute();
include 'functions.php';
_pr($_POST);
// lens legende copyright title creator keywords
if ($_POST['action'] == 'edit' && $_POST['id']) {
$updateField='';
if(isset($_POST['lens'])) {
$updateField.= "lens='".$_POST['lens']."'";
} else if(isset($_POST['legende'])) {
$updateField.= "legende='".$_POST['legende']."'";
} else if(isset($_POST['copyright'])) {
$updateField.= "copyright='".$_POST['copyright']."'";
} else if(isset($_POST['title'])) {
$updateField.= "title='".$_POST['title']."'";
} else if(isset($_POST['creator'])) {
$updateField.= "creator='".$_POST['creator']."'";
} else if(isset($_POST['keywords'])) {
$updateField.= "keywords='".$_POST['keywords']."'";
}
if($updateField && $_POST['id']) {
$sqlQuery = "UPDATE photos SET $updateField WHERE id='" . $_POST['id'] . "'";
echo $sqlQuery;
/*
mysqli_query($conn, $sqlQuery) or die("database error:". mysqli_error($conn));
$data = array(
"message" => "Record Updated",
"status" => 1
);
echo json_encode($data);
*/
}
}
if ($_POST['action'] == 'delete' && $_POST['id']) {
$sqlQuery = "DELETE FROM photos WHERE id='" . $_POST['id'] . "'";
echo $sqlQuery;
/*
mysqli_query($conn, $sqlQuery) or die("database error:". mysqli_error($conn));
$data = array(
"message" => "Record Deleted",
"status" => 1
);
echo json_encode($data);
*/
}