39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
require_once('../../includes/functions.php');
|
|
checkSession();
|
|
|
|
try {
|
|
$connection = getDbConnection();
|
|
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
$prepare = $connection->prepare("INSERT INTO `modello` (`codice`, `descrizione`, `quantita`, `tipologia`) VALUES (NULL, ?, ?, ?);");
|
|
$prepare->bindParam(1, $_POST['descrizione']);
|
|
$prepare->bindParam(2, $_POST['quantita']);
|
|
$prepare->bindParam(3, $_POST['tipologia']);
|
|
|
|
try {
|
|
$prepare->execute();
|
|
} catch (PDOException $e) {
|
|
echo "Impossibile inserire il modello, controllare i dati";
|
|
die($e->getMessage());
|
|
}
|
|
|
|
} catch (PDOException $e) {
|
|
die("Error: " . $e->getMessage());
|
|
}
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Login</title>
|
|
<link rel="stylesheet" href="../../includes/css/pico.min.css">
|
|
</head>
|
|
<body>
|
|
<main class="container">
|
|
<a href="../dashboard.php" class="button">Torna alla dashboard</a>
|
|
<h2>Operazione eseguita con successo</h2>
|
|
</main>
|
|
</body>
|
|
</html>
|