Aggiunto costo intervento su plugin "Interventi svolti" di MyImpianti

This commit is contained in:
Bacca97 2018-03-23 11:35:17 +01:00
parent cfc6ed976a
commit 4e25b26524
1 changed files with 17 additions and 1 deletions

View File

@ -1,6 +1,7 @@
<?php
include_once __DIR__.'/../../../core.php';
include_once $docroot.'/modules/interventi/modutil.php';
// INTERVENTI ESEGUITI SU QUESTO IMPIANTO
echo '
@ -11,16 +12,20 @@ echo '
<div class="box-body">';
$results = $dbo->fetchArray('SELECT in_interventi.id, in_interventi.codice, descrizione, (SELECT MIN(orario_inizio) FROM in_interventi_tecnici WHERE idintervento=my_impianti_interventi.idintervento) AS data FROM my_impianti_interventi INNER JOIN in_interventi ON my_impianti_interventi.idintervento=in_interventi.id WHERE idimpianto='.prepare($id_record).' ORDER BY data DESC');
$totale_interventi = 0;
if (!empty($results)) {
echo '
<table class="table table-striped table-hover">
<tr>
<th width="25%">'.tr('Intervento').'</th>
<th width="350">'.tr('Intervento').'</th>
<th>'.tr('Descrizione').'</th>
<th width="150" class="text-right">'.tr('Costo totale').'</th>
</tr>';
foreach ($results as $result) {
$costi_intervento = get_costi_intervento($result['id']);
$totale_interventi += $costi_intervento['totale'];
echo '
<tr>
<td>
@ -30,8 +35,19 @@ if (!empty($results)) {
])).'
</td>
<td>'.nl2br($result['descrizione']).'</td>
<td class="text-right">'.Translator::numberToLocale($costi_intervento['totale']).' &euro;</td>
</tr>';
}
echo ' <tr>';
echo ' <td colspan="2" class="text-right">';
echo ' <b>Totale:</b>';
echo ' </td>';
echo ' <td class="text-right">';
echo '<b>'.Translator::numberToLocale($totale_interventi).' &euro;</b>';
echo ' </td>';
echo ' </tr>';
echo '
</table>';