modified pdf1 and tabeldescription
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
require_once('../Connections/cmctrfdb.php'); // Database connection
|
||||
|
||||
if (isset($_GET['idtrf']) && is_numeric($_GET['idtrf'])) {
|
||||
$idtrf = intval($_GET['idtrf']);
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
|
||||
if ($conn->connect_error) {
|
||||
die("Connessione al database fallita: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
// Esegui l'aggiornamento per impostare photoone a NULL
|
||||
$query = "UPDATE `trf-details` SET photoone = NULL WHERE idtrfdetails = ?";
|
||||
$stmt = $conn->prepare($query);
|
||||
$stmt->bind_param("i", $idtrf);
|
||||
$stmt->execute();
|
||||
|
||||
if ($stmt->affected_rows > 0) {
|
||||
error_log("Successfully updated photoone to NULL for idtrfdetails = $idtrf");
|
||||
} else {
|
||||
error_log("Failed to update photoone for idtrfdetails = $idtrf");
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
$conn->close();
|
||||
|
||||
// Reindirizza alla pagina principale
|
||||
header("Location: adddocument.php?idtrf=$idtrf&t=" . time());
|
||||
exit;
|
||||
} else {
|
||||
// Se idtrf non è valido, reindirizza
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
Reference in New Issue
Block a user