Visualizzazione checklist impianti in stampa Attività

This commit is contained in:
MatteoPistorello 2024-04-03 17:21:32 +02:00
parent d7822c33bf
commit 9f57920975
1 changed files with 18 additions and 1 deletions

View File

@ -19,6 +19,7 @@
use Carbon\Carbon; use Carbon\Carbon;
use Models\Module; use Models\Module;
use Modules\Checklists\Check;
include_once __DIR__.'/../../core.php'; include_once __DIR__.'/../../core.php';
@ -546,7 +547,23 @@ if ($options['checklist']) {
echo renderChecklistHtml($check); echo renderChecklistHtml($check);
} }
echo ' $impianti_collegati = $dbo->fetchArray('SELECT * FROM my_impianti_interventi INNER JOIN my_impianti ON my_impianti_interventi.idimpianto = my_impianti.id WHERE idintervento = '.prepare($id_record));
foreach ($impianti_collegati as $impianto) {
$checks = Check::where('id_module_from', (new Module())->getByField('name', 'Impianti', Models\Locale::getPredefined()->id))->where('id_record_from', $impianto['id'])->where('id_module', (new Module())->getByField('name', 'Interventi', Models\Locale::getPredefined()->id))->where('id_record', $id_record)->where('id_parent', null)->get();
if (sizeof($checks)) {
echo '
<tr>
<th class="text-center" colspan="2" style="font-size:11pt;">
<b>'.tr('Impianto', [], ['upper' => true]).' '.$impianto['matricola'].' - '.$impianto['nome'].'</b>
</th>
</tr>';
foreach ($checks as $check) {
echo renderChecklistHtml($check);
}
}
}
echo '
</table>'; </table>';
} }
} }