Files
CSiCoDB2/app/Views/pages/reportCommessa.php
T
2026-05-06 11:04:41 +02:00

156 lines
5.0 KiB
PHP

<?= $this->extend('layouts/main') ?>
<?= $this->section('part_body') ?>
<div class="container" role="main" >
<!-- Page Header -->
<br />
<h3><?php echo @$title; ?></h3>
<br />
<div>
<!-- Introduzione tabella: -->
<p>Report complessivo della commessa:</p>
<!-- Tabella: Report commessa -->
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>ID</th>
<th>Nome</th>
<th>Cliente</th>
<th>Descrizione</th>
<th>Stima</th>
<th>Usate</th>
<th>Delta</th>
<th>Stato</th>
<th>Created At</th>
<th>Updated At</th>
<th>Deleted At</th>
</tr>
</thead>
<tbody>
<?php foreach ($datasetCommessa as $item) : ?>
<tr>
<td><?= $item->ID ?></td>
<td><?= $item->Nome ?></td>
<td><?= $item->Cliente ?></td>
<td><?= $item->Descrizione ?></td>
<td><?= $item->Stima ?></td>
<td><?= $item->Usate ?></td>
<td><?= ($item->Stima-$item->Usate) ?></td>
<td><?= $item->Stato ?></td>
<td><?= $item->CreatedAt ?></td>
<td><?= $item->UpdatedAt ?></td>
<td><?= $item->DeletedAt ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<br />
<br />
<div>
<!-- Introduzione tabella: -->
<p>Riepilogo delle stime sulla commessa:</p>
<!-- Tabella: Report Stime -->
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th>IDTipoWork</th>
<th>Descrizione</th>
<th>Stima</th>
<th>TotOre</th>
<th>Delta</th>
<th>Nota</th>
</tr>
</thead>
<tbody>
<?php foreach ($datasetStime as $item) : ?>
<tr>
<td><?= $item->IDTipoWork ?></td>
<td><?= $item->Descrizione ?></td>
<td><?= $item->Stima ?></td>
<td><?= $item->TotOre ?></td>
<td><?= ($item->Stima-$item->TotOre) ?></td>
<td><?= $item->Nota ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<br />
<br />
<div>
<!-- Introduzione tabella: -->
<p>Riepilogo delle ore lavorate sulla commessa, totalizzate per: lavoratore, tipo di orario, tipo di lavoro:</p>
<!-- Tabella: Report Ore -->
<table class="table table-striped">
<thead class="thead-dark">
<tr>
<th> Commessa </th>
<th> IDlavoratore </th>
<th> IDTipoOre </th>
<th> IDTipoWork </th>
<th> TotOre </th>
</tr>
</thead>
<tbody>
<?php foreach ($datasetOre as $item) : ?>
<tr>
<td><?= $item->Commessa ?></td>
<td><?= $item->IDlavoratore ?></td>
<td><?= $item->IDTipoOre ?></td>
<td><?= $item->IDTipoWork ?></td>
<td><?= $item->TotOre ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<br />
<br />
<p>
Per esportare il report in:
<button class="btn btn-success btn-sm" data-toggle="tooltip" title="Esporta i records in CSV" onclick="export_records_csv()">
<svg class="bi bi-cloud-download" width="1em" height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M4.887 5.2l-.964-.165A2.5 2.5 0 1 0 3.5 10H6v1H3.5a3.5 3.5 0 1 1 .59-6.95 5.002 5.002 0 1 1 9.804 1.98A2.501 2.501 0 0 1 13.5 11H10v-1h3.5a1.5 1.5 0 0 0 .237-2.981L12.7 6.854l.216-1.028a4 4 0 1 0-7.843-1.587l-.185.96z"/><path fill-rule="evenodd" d="M5 12.5a.5.5 0 0 1 .707 0L8 14.793l2.293-2.293a.5.5 0 1 1 .707.707l-2.646 2.646a.5.5 0 0 1-.708 0L5 13.207a.5.5 0 0 1 0-.707z"/><path fill-rule="evenodd" d="M8 6a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-1 0v-8A.5.5 0 0 1 8 6z"/></svg>
CSV
</button>
</p>
<br />
<br />
<br />
<br />
</div>
<script type="text/javascript">
function export_records_csv(){
var cnfrm = confirm('Confermi la richiesta di esportare i valori filtrati ?\r\n L\'operazione potrebbe richiedere del tempo.\r\n\r\n FUNZIONE NON COMPLETA, DA TERMINARE');
if (cnfrm) {
window.location = "<?php echo base_url('/Commesse/export_report_csv/' . $id . '/'); ?>";
}
}
</script>
<?= $this->endSection() ?>