1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Tableau d'amortissement</title>
</head>
<body>
<div>
<?php
if(isset($_POST["capital"])&&$_POST["taux"]&&$_POST["duree"])
{
$capital=$_POST["capital"];
$taux=$_POST["taux"]/100/12;
$duree=$_POST["duree"]*12;
$assur=$_POST["assur"]*$capital*0.00035;
$mens=($capital*$taux)/(1-pow((1+$taux),-$duree));
echo "<h3>Pour un pr�t de $capital € � ", $_POST["taux"] ,"%, sur ",$_POST["duree"]," ans la mensualit� est de ",round($mens,2)," € hors assurance</h3>";
echo "<h4>Tableau d'amortissement du pr�t</h4>";
echo "<table border=\"1\"> <tr><th>Mois </th><th>Capital restant</ th><th> Mensualit� Hors Ass.</th><th>Amortissement </ th><th>Int�r�t</th><th> Assurance</th><th>Mensualit� Ass. cis </ th>";
//
for($i=1;$i<=$duree;$i++)
{
$int=$capital*$taux;
$amort=$mens-$int;
echo "<tr>";
echo "<td>$i</td>";
echo "<td>",round($capital,2),"</td>";
echo "<td>",round($mens,2),"</td>";
echo "<td>",round($amort,2),"</td>";
echo "<td>",round($int,2),"</td>";
echo "<td>$assur</td>";
echo "<td>",round($mens+$assur,2),"</td>";
echo "</tr>";
$capital=$capital-$amort;
}
echo "</table>";
}
else
{
header("Location:form4.php");
}
?>
</div>
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml11"
alt="Valid XHTML 1.1" height="31" width="88" /></a>
</p>
</body>
</html> |
Partager