57 Commits
v1.0 ... main

Author SHA1 Message Date
c04fa96ab2 Update templates/index.html 2026-01-20 15:17:20 +01:00
cdcfdba82e Update cemento.py 2026-01-20 15:16:50 +01:00
6433e722e2 Update templates/index.html 2026-01-20 15:12:06 +01:00
c9f359b30d Update cemento.py 2026-01-20 15:11:40 +01:00
5599c9fd14 Update templates/index.html 2026-01-20 15:02:05 +01:00
34dec1e646 Update cemento.py 2026-01-20 15:01:37 +01:00
6a9c4233e2 Update templates/index.html 2026-01-20 14:53:25 +01:00
88a2ceda45 Update templates/index.html 2026-01-20 14:51:41 +01:00
0981083067 Update cemento.py 2026-01-20 14:51:07 +01:00
b75189fdbf Update cemento.py 2026-01-20 14:48:46 +01:00
94cee29e10 Update templates/index.html 2026-01-20 14:47:29 +01:00
d62e3edac6 Update cemento.py 2026-01-20 14:46:59 +01:00
cb9cfa9e8b Update templates/index.html 2026-01-20 14:43:50 +01:00
3865ddf8f3 Update cemento.py 2026-01-20 14:43:12 +01:00
6eb0c4411f Update templates/index.html 2026-01-20 14:38:24 +01:00
af7c622e2f Update cemento.py 2026-01-20 14:37:48 +01:00
c91289ef9f Update templates/index.html 2026-01-20 13:15:23 +01:00
7ba555890a Update cemento.py 2026-01-20 13:14:51 +01:00
a3d8d9bd0d Update templates/index.html 2026-01-20 13:13:02 +01:00
19ec78289b Update cemento.py 2026-01-20 13:12:36 +01:00
16170317d1 Update templates/index.html 2026-01-20 13:07:56 +01:00
4e3ea7fad8 Update cemento.py 2026-01-20 13:07:19 +01:00
6979a66912 Update templates/index.html 2026-01-20 12:42:30 +01:00
c30d198c3e Update cemento.py 2026-01-20 12:40:43 +01:00
1db2b46044 Update cemento.py 2026-01-20 11:59:23 +01:00
6f18621983 Update cemento.py 2026-01-20 11:57:32 +01:00
d80d816e1c Update cemento.py 2026-01-20 11:55:56 +01:00
fc9267c79c Update cemento.py 2026-01-20 11:04:33 +01:00
f7e7097612 Update cemento.py 2026-01-20 10:44:06 +01:00
5b72a63b8a Update cemento.py 2026-01-20 10:40:22 +01:00
673e88d6d3 Update templates/index.html 2026-01-20 09:40:45 +01:00
416c8feff1 Update cemento.py 2026-01-20 09:40:16 +01:00
c5f9763aeb Update templates/index.html 2026-01-20 09:37:43 +01:00
8bb39a4396 Update cemento.py 2026-01-20 09:37:12 +01:00
636863e207 Update templates/index.html 2026-01-20 09:34:02 +01:00
2093fe9fde Update cemento.py 2026-01-20 09:33:34 +01:00
3b2fbba025 Update templates/index.html 2026-01-20 09:30:42 +01:00
ae0294f774 Update cemento.py 2026-01-20 09:29:34 +01:00
0547260228 Update templates/index.html
Implementata stampa tramite CUPS
2026-01-20 09:22:21 +01:00
11d9df9606 Update cemento.py
Implementata Stamapa tramite CUPS
2026-01-20 09:21:19 +01:00
2749446249 Update cemento.py 2026-01-16 16:11:59 +01:00
71ce30307b Update cemento.py 2026-01-16 16:02:16 +01:00
242412dc19 Update cemento.py 2026-01-16 15:58:26 +01:00
c8c4496d4a Release v1.1 2026-01-16 11:47:41 +01:00
8a92767293 Versione 1.0 2026-01-15 17:54:24 +01:00
27aded61fd Update cemento.py 2026-01-15 16:30:54 +01:00
3e11847964 Release v1.0 2026-01-15 16:30:10 +01:00
d4596b2eeb Aggiornato codice 2026-01-15 16:26:25 +01:00
9eae600e81 Release v1.0 2026-01-15 16:20:48 +01:00
10c13225cc Release v1.0 2026-01-15 16:14:49 +01:00
adae2623e6 Release v1.0 2026-01-15 16:09:12 +01:00
df94568376 Release v1.0 2026-01-15 15:59:14 +01:00
1be5e787a3 Commit delle modifiche 2026-01-15 15:54:06 +01:00
14902379d8 Update templates/index.html 2026-01-15 15:48:28 +01:00
1ac313efa7 Update templates/index.html 2026-01-15 15:44:57 +01:00
002da8f77f Release v1.0 2026-01-15 15:34:34 +01:00
bd7b1d2533 Release v1.0 2026-01-15 15:32:14 +01:00
2 changed files with 129 additions and 134 deletions

View File

@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from flask import Flask, render_template, request, Response
import math
import subprocess
app = Flask(__name__)
@@ -10,7 +11,10 @@ def calcola(d):
val = float(v.replace(',', '.')) if v else 0
return val / 1000 if u == "mm" else val / 100 if u == "cm" else val
vol = to_m(d.get('a','0'), d.get('ua','m')) * to_m(d.get('l','0'), d.get('ul','m')) * to_m(d.get('p','0'), d.get('up','m'))
# Salvo le dimensioni originali per il report
dim_orig = {"a": d.get('a','0'), "ua": d.get('ua','m'), "l": d.get('l','0'), "ul": d.get('ul','m'), "p": d.get('p','0'), "up": d.get('up','m')}
vol = to_m(dim_orig['a'], dim_orig['ua']) * to_m(dim_orig['l'], dim_orig['ul']) * to_m(dim_orig['p'], dim_orig['up'])
peso_tot = vol * 2400
mats = ['cem', 'sab', 'ghi']
@@ -19,14 +23,15 @@ def calcola(d):
c = {m: float(d.get(f'c_{m}', '0').replace(',','.')) for m in mats}
somma_p = sum(p.values())
res = {"vol": f"{vol:.3f}", "peso": f"{peso_tot:.0f}"}
perc = {m: (p[m]/somma_p)*100 if somma_p > 0 else 0 for m in mats}
res = {"vol": f"{vol:.3f}", "peso": f"{peso_tot:.0f}", "perc": perc, "dim": dim_orig, "parti": p}
tot_s, costo_t = 0, 0
for m in mats:
kg = (p[m]/somma_p)*peso_tot if somma_p > 0 else 0
s_esatti = kg/w[m] if w[m] > 0 else 0
res[f's_{m}'] = math.ceil(s_esatti)
res[f'cost_{m}'] = f"{math.ceil(s_esatti)*c[m]:.2f}"
tot_s += math.ceil(s_esatti)
costo_t += math.ceil(s_esatti)*c[m]
@@ -45,46 +50,66 @@ def calcola(d):
@app.route('/', methods=['GET', 'POST'])
def index():
res = None
if request.method == 'POST': res = calcola(request.form)
return render_template('index.html', res=res, form=request.form)
msg_stampa = None
if request.method == 'POST':
res = calcola(request.form)
if 'btn_stampa_cups' in request.form:
msg_stampa = esegui_stampa_cups(request.form)
return render_template('index.html', res=res, form=request.form, msg_stampa=msg_stampa)
def esegui_stampa_cups(f):
try:
ps_content = f"""%!PS
/Helvetica-Bold findfont 11 scalefont setfont
70 760 moveto (DIMENSIONI GETTO) show
/Helvetica findfont 10 scalefont setfont
70 745 moveto (Altezza: {f.get('d_a')} {f.get('d_ua')} | Larghezza: {f.get('d_l')} {f.get('d_ul')} | Profondita: {f.get('d_p')} {f.get('d_up')}) show
/Helvetica-Bold findfont 11 scalefont setfont
70 720 moveto (VOLUME: {f.get('res_vol')} m3 | Peso: {f.get('res_peso')} Kg) show
70 700 moveto (ACQUISTI) show
/Helvetica findfont 10 scalefont setfont
70 685 moveto (o Cemento: {f.get('res_s_cem')} sacchetti) show
70 670 moveto (o Sabbia: {f.get('res_s_sab')} sacchetti) show
70 655 moveto (o Ghiaia: {f.get('res_s_ghi')} sacchetti) show
70 640 moveto (o Acqua: {f.get('res_aq')} L | Totale: {f.get('res_tot_s')} sacch.) show
/Helvetica-Bold findfont 11 scalefont setfont
70 620 moveto (COSTO TOTALE: {f.get('res_costo_t')} Euro) show
70 600 moveto (PROPORZIONI) show
/Helvetica findfont 10 scalefont setfont
70 585 moveto (Cem: {f.get('p_cem')} ({f.get('pc_cem')}%) | Sab: {f.get('p_sab')} ({f.get('pc_sab')}%) | Ghi: {f.get('p_ghi')} ({f.get('pc_ghi')}%)) show
70 560 moveto (PER OGNI CARICO ({f.get('res_nc')} CARICHI):) show
70 545 moveto (o Cemento: {f.get('res_bc_cem')} sacchetti) show
70 530 moveto (o Sabbia: {f.get('res_bc_sab')} sacchetti) show
70 515 moveto (o Ghiaia: {f.get('res_bc_ghi')} sacchetti) show
70 500 moveto (o Acqua: {f.get('res_bc_aq')} L) show
showpage"""
subprocess.run(["docker", "exec", "-i", "cups-pdf-server", "lp", "-d", "Virtual_PDF"], input=ps_content.encode('utf-8'))
return "OK - PDF generato in /output!"
except: return "Errore di stampa"
@app.route('/download', methods=['POST'])
def download():
# Costruzione del file TXT con tutti i parametri e i risultati
f = request.form
report = f"""-------------------------------------------
REPORT TECNICO CALCOLO CEMENTO
-------------------------------------------
PARAMETRI DI INPUT:
- Dimensioni: {f.get('a')} {f.get('ua')} (Alt) x {f.get('l')} {f.get('ul')} (Lar) x {f.get('p')} {f.get('up')} (Pro)
- Miscela (Parti): Cem {f.get('p_cem')} | Sab {f.get('p_sab')} | Ghi {f.get('p_ghi')}
- Peso Sacchi: Cem {f.get('w_cem')}kg | Sab {f.get('w_sab')}kg | Ghi {f.get('w_ghi')}kg
- Costo Sacchi: Cem {f.get('c_cem')} | Sab {f.get('c_sab')}€ | Ghi {f.get('c_ghi')}
- Attrezzatura: Betoniera da {f.get('v_bet')} L
RISULTATI GENERALI:
- Volume Totale: {f.get('res_vol')} m3
- Peso Totale: {f.get('res_peso')} Kg
- Acqua Totale: {f.get('res_aq')} L
- Totale Sacchetti da acquistare: {f.get('res_tot_s')}
- COSTO COMPLESSIVO: {f.get('res_costo_t')}
DETTAGLIO ACQUISTI:
- Cemento: {f.get('res_s_cem')} sacchetti (€ {f.get('res_c_cem')})
- Sabbia: {f.get('res_s_sab')} sacchetti (€ {f.get('res_c_sab')})
- Ghiaia: {f.get('res_s_ghi')} sacchetti (€ {f.get('res_c_ghi')})
DOSAGGIO PER SINGOLO CARICO ({f.get('res_nc')} carichi):
- Cemento: {f.get('res_bc_cem')} sacchetti
- Sabbia: {f.get('res_bc_sab')} sacchetti
- Ghiaia: {f.get('res_bc_ghi')} sacchetti
- Acqua: {f.get('res_bc_aq')} L
-------------------------------------------
Generato da Software Cemento Rev.0
-------------------------------------------"""
return Response(report, mimetype="text/plain", headers={"Content-disposition":"attachment;filename=Report_Dettagliato.txt"})
report = (
f"DIMENSIONI GETTO\n"
f"Altezza: {f.get('d_a')} {f.get('d_ua')} Larghezza: {f.get('d_l')} {f.get('d_ul')} Profondità: {f.get('d_p')} {f.get('d_up')}\n\n"
f"VOLUME: {f.get('res_vol')} m3 | Peso: {f.get('res_peso')} Kg\n\n"
f"ACQUISTI\n"
f"• Cemento: \t{f.get('res_s_cem')} sacchetti\n"
f"• Sabbia: \t{f.get('res_s_sab')} sacchetti\n"
f"• Ghiaia: \t{f.get('res_s_ghi')} sacchetti\n"
f"• Acqua: \t{f.get('res_aq')} L | Totale: {f.get('res_tot_s')} sacch.\n\n"
f"COSTO TOTALE: \t{f.get('res_costo_t')} \n\n"
f"PROPORZIONI\n"
f"Cemento: {f.get('p_cem')} \tSabbia: {f.get('p_sab')} \tGhiaia: {f.get('p_ghi')}\n"
f"Cemento: {f.get('pc_cem')}% \tSabbia: {f.get('pc_sab')}% \tGhiaia: {f.get('pc_ghi')}%\n\n"
f"PER OGNI CARICO ({f.get('res_nc')} CARICHI):\n\n"
f"• Cemento: \t{f.get('res_bc_cem')} sacchetti\n"
f"• Sabbia: \t{f.get('res_bc_sab')} sacchetti\n"
f"• Ghiaia: \t{f.get('res_bc_ghi')} sacchetti\n"
f"• Acqua: \t{f.get('res_bc_aq')} L"
)
return Response(report, mimetype="text/plain", headers={"Content-disposition":"attachment;filename=Report_V1_2.txt"})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)

View File

@@ -2,134 +2,104 @@
<html lang="it">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Software Cemento Rev.0</title>
<title>Software Cemento V 1.2</title>
<style>
:root { --mac-bg: #f2f2f7; --mac-blue: #007aff; --mac-red: #ff3b30; --mac-green: #34c759; }
body { font-family: -apple-system, system-ui, sans-serif; background: var(--mac-bg); padding: 20px; font-size: 14px; color: #1c1c1e; }
:root { --mac-bg: #f2f2f7; --mac-blue: #007aff; --mac-red: #ff3b30; --mac-green: #34c759; --mac-gray: #8e8e93; }
body { font-family: -apple-system, sans-serif; background: var(--mac-bg); padding: 20px; font-size: 14px; }
.container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; max-width: 1200px; margin: auto; }
.panel { background: rgba(255,255,255,0.8); backdrop-filter: blur(10px); border-radius: 12px; padding: 20px; flex: 1; min-width: 320px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
table { width: 100%; border-collapse: collapse; margin-bottom: 15px; background: white; border-radius: 8px; overflow: hidden; }
th { padding: 10px; font-size: 14px; color: white; text-transform: uppercase; }
td { padding: 8px; text-align: center; border: 1px solid #e5e5ea; font-size: 14px; }
.panel { background: rgba(255,255,255,0.9); border-radius: 12px; padding: 20px; flex: 1; min-width: 320px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
table { width: 100%; border-collapse: collapse; margin-bottom: 15px; border-radius: 8px; overflow: hidden; background: white; }
th { padding: 10px; font-size: 13px; color: white; text-transform: uppercase; }
td { padding: 8px; border: 1px solid #e5e5ea; text-align: center; }
.h-blue { background: var(--mac-blue); }
.h-red { background: var(--mac-red); }
.input-group { position: relative; display: inline-block; width: 90%; }
input { width: 100%; border: 1px solid #d1d1d6; border-radius: 5px; padding: 6px 5px; text-align: center; font-size: 14px; box-sizing: border-box; }
.unit-label { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: #8e8e93; pointer-events: none; }
select { border: 1px solid #d1d1d6; border-radius: 5px; padding: 5px; font-size: 14px; }
.btn { width: 100%; padding: 12px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; margin-top: 10px; font-size: 15px; color: white; text-transform: uppercase; }
input { width: 85%; border: 1px solid #d1d1d6; border-radius: 5px; padding: 4px; text-align: center; }
.btn { width: 100%; padding: 12px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; margin-top: 10px; color: white; text-transform: uppercase; }
.btn-calc { background: var(--mac-green); }
.btn-exp { background: #5856d6; margin-top: 20px; }
.res-section { margin-bottom: 15px; }
.res-section h4 { margin: 0 0 5px 0; text-transform: uppercase; font-size: 12px; color: #8e8e93; }
.res-box { background: white; padding: 15px; border-radius: 10px; border: 1px solid #d1d1d6; line-height: 1.6; }
.btn-cups { background: var(--mac-blue); }
.btn-exp { background: #5856d6; }
.btn-device { background: #c7c7cc; color: #1c1c1e; }
.res-box { border: 1px solid #d1d1d6; border-radius: 10px; padding: 15px; background: #fff; line-height: 1.6; }
ul { list-style: none; padding: 0; margin: 0; }
li { padding-left: 15px; position: relative; }
li::before { content: "•"; position: absolute; left: 0; }
hr { border: 0; border-top: 1px solid #d1d1d6; margin: 15px 0; }
@media print { .no-print { display: none !important; } .res-box { border: none; } }
.footer { text-align: center; font-size: 10px; color: var(--mac-gray); margin-top: 15px; }
@media print { .no-print { display: none !important; } }
</style>
</head>
<body>
<div class="container">
<div class="panel no-print">
<form method="POST">
<table>
<tr class="h-blue"><th colspan="3">Dimensioni</th></tr>
<table><tr class="h-blue"><th colspan="3">Dimensioni</th></tr>
<tr><td>Altezza</td><td><input type="text" name="a" value="{{form.get('a','0')}}"></td><td><select name="ua">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('ua','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
<tr><td>Larghezza</td><td><input type="text" name="l" value="{{form.get('l','0')}}"></td><td><select name="ul">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('ul','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
<tr><td>Profondità</td><td><input type="text" name="p" value="{{form.get('p','0')}}"></td><td><select name="up">{% for u in ['m','cm','mm'] %}<option value="{{u}}" {% if form.get('up','m')==u %}selected{% endif %}>{{u}}</option>{% endfor %}</select></td></tr>
</table>
<table>
<tr class="h-red"><th colspan="3">Miscela (Parti)</th></tr>
<tr>
<td>Cemento:<br><input type="text" name="p_cem" value="{{form.get('p_cem','1')}}"></td>
<td>Sabbia:<br><input type="text" name="p_sab" value="{{form.get('p_sab','3')}}"></td>
<td>Ghiaia:<br><input type="text" name="p_ghi" value="{{form.get('p_ghi','5')}}"></td>
</tr>
<table><tr class="h-red"><th colspan="3">Miscela (Parti)</th></tr>
<tr><td>Cem:<br><input type="text" name="p_cem" value="{{form.get('p_cem','1')}}"></td><td>Sab:<br><input type="text" name="p_sab" value="{{form.get('p_sab','3')}}"></td><td>Ghi:<br><input type="text" name="p_ghi" value="{{form.get('p_ghi','5')}}"></td></tr>
</table>
<table>
<tr class="h-red"><th colspan="3">Peso sacchette (Kg)</th></tr>
<tr>
<td>Cemento:<br><div class="input-group"><input type="text" name="w_cem" value="{{form.get('w_cem','25')}}"><span class="unit-label">Kg</span></div></td>
<td>Sabbia:<br><div class="input-group"><input type="text" name="w_sab" value="{{form.get('w_sab','25')}}"><span class="unit-label">Kg</span></div></td>
<td>Ghiaia:<br><div class="input-group"><input type="text" name="w_ghi" value="{{form.get('w_ghi','25')}}"><span class="unit-label">Kg</span></div></td>
</tr>
<table><tr class="h-red"><th colspan="3">Peso sacchette (Kg)</th></tr>
<tr><td>Cem:<input type="text" name="w_cem" value="{{form.get('w_cem','25')}}"></td><td>Sab:<input type="text" name="w_sab" value="{{form.get('w_sab','25')}}"></td><td>Ghi:<input type="text" name="w_ghi" value="{{form.get('w_ghi','25')}}"></td></tr>
</table>
<table>
<tr class="h-red"><th colspan="3">Costo sacchette (€)</th></tr>
<tr>
<td>Cemento:<br><div class="input-group"><input type="text" name="c_cem" value="{{form.get('c_cem','1')}}"><span class="unit-label"></span></div></td>
<td>Sabbia:<br><div class="input-group"><input type="text" name="c_sab" value="{{form.get('c_sab','1')}}"><span class="unit-label"></span></div></td>
<td>Ghiaia:<br><div class="input-group"><input type="text" name="c_ghi" value="{{form.get('c_ghi','1')}}"><span class="unit-label"></span></div></td>
</tr>
<table><tr class="h-red"><th colspan="3">Costo sacchette (€)</th></tr>
<tr><td>Cem:<input type="text" name="c_cem" value="{{form.get('c_cem','1')}}"></td><td>Sab:<input type="text" name="c_sab" value="{{form.get('c_sab','1')}}"></td><td>Ghi:<input type="text" name="c_ghi" value="{{form.get('c_ghi','1')}}"></td></tr>
</table>
<table>
<tr class="h-red"><th>Attrezzatura</th></tr>
<tr><td>Volume Betoniera: <div class="input-group" style="width:80px;"><input type="text" name="v_bet" value="{{form.get('v_bet','160')}}"><span class="unit-label">L</span></div></td></tr>
</table>
<table><tr class="h-red"><th>Attrezzatura</th></tr><tr><td>Volume Betoniera: <input type="text" name="v_bet" value="{{form.get('v_bet','160')}}" style="width:60px;"> L</td></tr></table>
<button type="submit" class="btn btn-calc">Esegui Calcolo</button>
</form>
<div class="footer">VERSIONE SOFTWARE: V 1.2 | DATA: 20/01/2026</div>
</div>
<div class="panel">
<h3>Risultati</h3>
{% if res %}
<div class="res-box">
<div class="res-section">
<b>Volume:</b> {{ res.vol }} m³ | <b>Peso:</b> {{ res.peso }} Kg
</div>
<b>DIMENSIONI GETTO</b><br>
Altezza: {{res.dim.a}} {{res.dim.ua}} &nbsp; Larghezza: {{res.dim.l}} {{res.dim.ul}} &nbsp; Profondità: {{res.dim.p}} {{res.dim.up}}<br><br>
<b>VOLUME:</b> {{ res.vol }} m³ | <b>Peso:</b> {{ res.peso }} Kg
<hr>
<div class="res-section">
<h4>Acquisti</h4>
Cemento: {{ res.s_cem }} sacchetti<br>
Sabbia: {{ res.s_sab }} sacchetti<br>
Ghiaia: {{ res.s_ghi }} sacchetti<br>
Acqua: {{ res.acqua }} L<br>
<b>Totale materiale:</b> {{ res.tot_sacc }} sacchetti
</div>
<div class="res-section">
<h4>Costo stimato</h4>
<b>Costo totale: {{ res.costo_tot }} €</b>
</div>
<b>ACQUISTI</b>
<ul>
<li>Cemento: {{ res.s_cem }} sacchetti</li>
<li>Sabbia: {{ res.s_sab }} sacchetti</li>
<li>Ghiaia: {{ res.s_ghi }} sacchetti</li>
<li>Acqua: {{ res.acqua }} L | <b>Totale: {{ res.tot_sacc }} sacch.</b></li>
</ul>
<br>
<b>COSTO TOTALE: {{ res.costo_tot }} €</b>
<hr>
<div class="res-section">
<h4>Per ogni carico ({{ res.n_c }} carichi):</h4>
Cemento: {{ res.bc_cem }} sacchetti<br>
• Sabbia: {{ res.bc_sab }} sacchetti<br>
• Ghiaia: {{ res.bc_ghi }} sacchetti<br>
• Acqua: {{ res.bc_aq }} L
<b>PROPORZIONI</b><br>
Cemento: {{res.parti.cem}} &nbsp; Sabbia: {{res.parti.sab}} &nbsp; Ghiaia: {{res.parti.ghi}}<br>
Cemento: {{ "%.1f"|format(res.perc.cem) }}% &nbsp; Sabbia: {{ "%.1f"|format(res.perc.sab) }}% &nbsp; Ghiaia: {{ "%.1f"|format(res.perc.ghi) }}%
<hr>
<b>PER OGNI CARICO ({{ res.n_c }} CARICHI):</b>
<ul>
<li>• Cemento: {{ res.bc_cem }} sacchetti</li>
<li>• Sabbia: {{ res.bc_sab }} sacchetti</li>
<li>• Ghiaia: {{ res.bc_ghi }} sacchetti</li>
<li>• Acqua: {{ res.bc_aq }} L</li>
</ul>
</div>
</div>
<form action="/download" method="POST" class="no-print">
<form method="POST" class="no-print">
{% for k,v in form.items() %}<input type="hidden" name="{{k}}" value="{{v}}">{% endfor %}
<input type="hidden" name="d_a" value="{{res.dim.a}}"><input type="hidden" name="d_ua" value="{{res.dim.ua}}">
<input type="hidden" name="d_l" value="{{res.dim.l}}"><input type="hidden" name="d_ul" value="{{res.dim.ul}}">
<input type="hidden" name="d_p" value="{{res.dim.p}}"><input type="hidden" name="d_up" value="{{res.dim.up}}">
<input type="hidden" name="p_cem" value="{{res.parti.cem}}"><input type="hidden" name="p_sab" value="{{res.parti.sab}}"><input type="hidden" name="p_ghi" value="{{res.parti.ghi}}">
<input type="hidden" name="pc_cem" value="{{'%.1f'|format(res.perc.cem)}}"><input type="hidden" name="pc_sab" value="{{'%.1f'|format(res.perc.sab)}}"><input type="hidden" name="pc_ghi" value="{{'%.1f'|format(res.perc.ghi)}}">
<input type="hidden" name="res_vol" value="{{res.vol}}"><input type="hidden" name="res_peso" value="{{res.peso}}">
<input type="hidden" name="res_aq" value="{{res.acqua}}"><input type="hidden" name="res_tot_s" value="{{res.tot_sacc}}">
<input type="hidden" name="res_costo_t" value="{{res.costo_tot}}"><input type="hidden" name="res_s_cem" value="{{res.s_cem}}">
<input type="hidden" name="res_c_cem" value="{{res.cost_cem}}"><input type="hidden" name="res_s_sab" value="{{res.s_sab}}">
<input type="hidden" name="res_c_sab" value="{{res.cost_sab}}"><input type="hidden" name="res_s_ghi" value="{{res.s_ghi}}">
<input type="hidden" name="res_c_ghi" value="{{res.cost_ghi}}"><input type="hidden" name="res_nc" value="{{res.n_c}}">
<input type="hidden" name="res_bc_cem" value="{{res.bc_cem}}"><input type="hidden" name="res_bc_sab" value="{{res.bc_sab}}">
<input type="hidden" name="res_bc_ghi" value="{{res.bc_ghi}}"><input type="hidden" name="res_bc_aq" value="{{res.bc_aq}}">
<input type="hidden" name="a" value="{{form.get('a')}}"><input type="hidden" name="ua" value="{{form.get('ua')}}">
<input type="hidden" name="l" value="{{form.get('l')}}"><input type="hidden" name="ul" value="{{form.get('ul')}}">
<input type="hidden" name="p" value="{{form.get('p')}}"><input type="hidden" name="up" value="{{form.get('up')}}">
<input type="hidden" name="p_cem" value="{{form.get('p_cem')}}"><input type="hidden" name="p_sab" value="{{form.get('p_sab')}}"><input type="hidden" name="p_ghi" value="{{form.get('p_ghi')}}">
<input type="hidden" name="w_cem" value="{{form.get('w_cem')}}"><input type="hidden" name="w_sab" value="{{form.get('w_sab')}}"><input type="hidden" name="w_ghi" value="{{form.get('w_ghi')}}">
<input type="hidden" name="c_cem" value="{{form.get('c_cem')}}"><input type="hidden" name="c_sab" value="{{form.get('c_sab')}}"><input type="hidden" name="c_ghi" value="{{form.get('c_ghi')}}">
<input type="hidden" name="v_bet" value="{{form.get('v_bet')}}">
<button type="submit" class="btn btn-exp">Esporta TXT Completo</button>
<input type="hidden" name="res_costo_t" value="{{res.costo_tot}}"><input type="hidden" name="res_nc" value="{{res.n_c}}">
<input type="hidden" name="res_s_cem" value="{{res.s_cem}}"><input type="hidden" name="res_s_sab" value="{{res.s_sab}}"><input type="hidden" name="res_s_ghi" value="{{res.s_ghi}}">
<input type="hidden" name="res_bc_cem" value="{{res.bc_cem}}"><input type="hidden" name="res_bc_sab" value="{{res.bc_sab}}"><input type="hidden" name="res_bc_ghi" value="{{res.bc_ghi}}"><input type="hidden" name="res_bc_aq" value="{{res.bc_aq}}">
<button type="submit" name="btn_stampa_cups" class="btn btn-cups">Stampa PDF (CUPS)</button>
<button type="submit" formaction="/download" class="btn btn-exp">Esporta TXT</button>
<button type="button" onclick="window.print()" class="btn btn-device">Stampa Pagina</button>
</form>
<button onclick="window.print()" class="btn no-print" style="background:#d1d1d6; color:#1c1c1e;">Stampa</button>
{% else %}
<p style="color:#8e8e93; text-align:center;">Inserisci i dati e premi "Esegui Calcolo".</p>
{% if msg_stampa %}<p style="color:var(--mac-green); font-weight:bold; text-align:center;">{{ msg_stampa }}</p>{% endif %}
{% endif %}
</div>
</div>