-
Notifications
You must be signed in to change notification settings - Fork 0
/
foam.php
34 lines (28 loc) · 968 Bytes
/
foam.php
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
<?php require "constantes.php"; ?>
<p>
Tamaño máximo de una plancha: 305cm x 156cm
<form action="#foam" method="post">
Ancho: <input type="number" name="ancho" /> cms. <br />
Alto: <input type="number" name="alto" /> cms. <br /><br />
<input type="checkbox" name="mostcoste" value="mostrar" />Coste <br /><br />
<input type="submit" name="calcfoam" value="Calcular" />
</form>
<?php
if($_POST['calcfoam'] && isset($_COOKIE["usuario"])){
$ancho = $_POST['ancho'];
$alto = $_POST['alto'];
$mostcoste = $_POST['mostcoste'];
$metros = ($ancho * $alto)/10000;
//Calculo del precio
$precio = $metros * 85; //Provisional Precio del metro cuadrado de foam
if($precio<8)
$precio=8;
$coste = $metros * COSTM2FOAM;
echo "<br />Metros cuadrados de impresión: "; echo $metros; echo " m<sup>2</sup>. <br />";
if($mostcoste == "mostrar"){
echo "<br />Coste: "; echo round($coste, 2); echo "€. <br />";
}
echo "<br />PVP: "; echo round($precio, 2); echo "€.";
}
?>
</p>