verifica
This commit is contained in:
parent
2c82d90dd4
commit
5f80048cec
20 changed files with 999 additions and 1 deletions
|
@ -0,0 +1,39 @@
|
|||
<?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>
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
require_once('../../includes/functions.php');
|
||||
checkSession();
|
||||
|
||||
try {
|
||||
$connection = getDbConnection();
|
||||
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$prepare = $connection->prepare("DELETE FROM modello WHERE codice = ?;");
|
||||
$prepare->bindParam(1, $_POST['codice']);
|
||||
|
||||
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>
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
require_once('../../includes/functions.php');
|
||||
checkSession();
|
||||
|
||||
try {
|
||||
$connection = getDbConnection();
|
||||
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$tipologia = $_GET["tipologia"];
|
||||
$prepare = $connection->prepare("SELECT t.nome
|
||||
FROM modello AS m
|
||||
INNER JOIN biciclette.tipologia t on m.tipologia = t.codice
|
||||
WHERE m.tipologia = ?
|
||||
ORDER BY t.codice");
|
||||
|
||||
$prepare->bindParam(1, $tipologia);
|
||||
$prepare->execute();
|
||||
|
||||
if ($prepare->rowCount() >= 1) {
|
||||
$bici = $prepare->fetchAll();
|
||||
$quantita = $prepare->rowCount();
|
||||
$tipologia = $bici[0]['nome'];
|
||||
} else {
|
||||
echo "nessuna quantita";
|
||||
}
|
||||
|
||||
} 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>
|
||||
|
||||
<h1>Quantita per tipologia: <?php echo $tipologia ?></h1>
|
||||
<h1><?= $quantita ?></h1>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue