first commit

This commit is contained in:
Bildcraft1 2024-10-31 10:47:12 +01:00
commit d975e212f9
35 changed files with 813 additions and 0 deletions

26
prestito/conferma.php Normal file
View file

@ -0,0 +1,26 @@
<?php
session_start();
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Conferma</title>
<?php require "includes/head.php" ?>
</head>
<body>
<div class="container">
<h1>Riepilogo del Prestito</h1>
<p>Nome: <?= $_SESSION["nome"] ?></p>
<p>Cognome: <?= $_SESSION["cognome"] ?></p>
<p>Prestito: <?= $_SESSION["cifra"] ?>&euro;</p>
<p>Durata: <?php if($_SESSION["prestito"] == 1) echo "Prestito Mensile"; else echo "Prestito Annuale"?></p>
</div>
<?php require "includes/footer.php" ?>
</body>
</html>

13
prestito/errore.php Normal file
View file

@ -0,0 +1,13 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Prestito</title>
<?php require "includes/head.php" ?>
</head>
<body class="bg-danger">
<h2> Errore dati insufficienti </h2>
<?php require "includes/footer.php" ?>
</body>
</html>

View file

@ -0,0 +1,3 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>

View file

@ -0,0 +1,2 @@
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">

27
prestito/index.php Normal file
View file

@ -0,0 +1,27 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Prestito</title>
<?php require "includes/head.php" ?>
</head>
<body>
<div class="container">
<h1>Banca Bruschetta</h1>
<h2>Form Prestito</h2>
<form action="prestito.php" method="post">
Name: <input type="text" name="nome"><br>
Cognome: <input type="text" name="cogn"><br><br>
Prestito Annuale <input type="radio" name="prestito" value="12"> (365gg) 4%<br>
Prestito Mensile <input type="radio" name="prestito" value="1"> 830gg) 5%<br><br>
Cifra: <input type="text" name="cifra"><br><br>
<input type="submit">
</form>
</div>
<?php require "includes/footer.php" ?>
</body>
</html>

39
prestito/prestito.php Normal file
View file

@ -0,0 +1,39 @@
<?php
session_start();
if (!isset($_POST["prestito"]) or ($_POST["cifra"] == "")) {
header("Location: errore.php");
exit();
}
$_SESSION["nome"] = $_POST["nome"];
$_SESSION["cognome"] = $_POST["cogn"];
$_SESSION["prestito"] = $_POST["prestito"];
$_SESSION["cifra"] = $_POST["cifra"];
if ($_POST["prestito"] == 12) {
$temp = $_POST["cifra"] * 1.04;
} else {
$temp = $_POST["cifra"] * 1.004167;
}
$_SESSION["cifraCalcolata"] = $temp;
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Prestito</title>
<?php require "includes/head.php" ?>
</head>
<body>
<h1>Calcolo saldo del prestito richiesto</h1>
<p>Benvenuto <?php echo $_POST["nome"] . " " . $_POST["cogn"]; ?><br>
il saldo del tuo prestito di <?php echo $_POST["cifra"] ?> tra xx giorni sarà di:
<?= $_SESSION["cifraCalcolata"] ?> &euro;
</p>
<a class="btn btn-primary" href="conferma.php" role="button">Conferma Prestito</a>
<?php require "includes/footer.php" ?>
</body>
</html>