2021-04-19 15:07:51 +02:00
< ? php
/*
* OpenSTAManager : il software gestionale open source per l ' assistenza tecnica e la fatturazione
* Copyright ( C ) DevCode s . r . l .
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < https :// www . gnu . org / licenses />.
*/
use Modules\Interventi\Intervento ;
include_once __DIR__ . '/../../core.php' ;
/*
Dati Anagrafici
*/
echo '
< table class = " table table-bordered " >
< tr >
< th colspan = " 4 " style = " font-size:13pt; " class = " text-center " > '.tr(' Dettaglio anagrafica ', [], [' upper ' => true]).' </ th >
</ tr >
< tr >
< td colspan = " 4 " class = " text-left " > '.tr(' Denominazione ').' : < b > '.$anagrafica[' ragione_sociale '].' </ b ></ td >
</ tr >
< tr >
< td colspan = " 4 " class = " text-left " > '.tr(' Indirizzo ').' : < b > '.$anagrafica[' indirizzo '].' </ b ></ td >
</ tr >
< tr >
< td class = " text-left " colspan = " 2 " > '.tr(' Città ').' : < b > '.$anagrafica[' citta '].' </ b ></ td >
< td class = " text-left " > '.tr(' Provincia ').' : < b > '.$anagrafica[' provincia '].' </ b ></ td >
< td class = " text-left " > '.tr(' Cap ').' : < b > '.$anagrafica[' cap '].' </ b ></ td >
</ tr >
< tr >
< td class = " text-left " colspan = " 2 " > '.tr(' Partita IVA ').' : < b > '.$anagrafica[' piva '].' </ b ></ td >
< td class = " text-left " colspan = " 2 " > '.tr(' Codice fiscale ').' : < b > '.$anagrafica[' codice_fiscale '].' </ b ></ td >
</ tr >
< tr >
< td class = " text-left " colspan = " 2 " > '.tr(' Pec ').' : < b > '.$anagrafica[' pec '].' </ b ></ td >
< td class = " text-left " colspan = " 2 " > '.tr(' Email ').' : < b > '.$anagrafica[' email '].' </ b ></ td >
</ tr >
< tr >
< td class = " text-left " colspan = " 2 " > '.tr(' Telefono ').' : < b > '.$anagrafica[' telefono '].' </ b ></ td >
< td class = " text-left " > '.tr(' cellulare ').' : < b > '.$anagrafica[' cellulare '].' </ b ></ td >
< td class = " text-left " > '.tr(' fax ').' : < b > '.$anagrafica[' fax '].' </ b ></ td >
</ tr >
< tr >
< td colspan = " 4 " class = " text-left " > '.tr(' Agente ').' : < b > '.$agente[' ragione_sociale '].' </ b ></ td >
</ tr >
</ table > ' ;
/*
Sedi
*/
2021-04-26 09:16:16 +02:00
$sedi = $dbo -> fetchArray ( 'SELECT * FROM an_sedi WHERE idanagrafica=' . prepare ( $anagrafica -> idanagrafica ));
if ( ! empty ( $sedi )) {
2021-04-19 15:07:51 +02:00
echo '
< table class = " table table-bordered " >
< tr >
< th colspan = " 4 " style = " font-size:13pt; " class = " text-center " > '.tr(' Sedi ', [], [' upper ' => true]).' </ th >
</ tr > ' ;
2021-04-26 09:16:16 +02:00
for ( $i = 0 ; count ( $sedi ) > $i ; ++ $i ) {
echo '
2021-04-19 15:07:51 +02:00
< tr >
< td colspan = " 4 " class = " text-left " > '.tr(' Nome sede ').' : < b > '.$sedi[$i][' nomesede '].' </ b ></ td >
</ tr >
< tr >
< td colspan = " 4 " class = " text-left " > '.tr(' Indirizzo ').' : < b > '.$sedi[$i][' indirizzo '].' </ b ></ td >
</ tr >
< tr >
< td class = " text-left " colspan = " 2 " > '.tr(' Città ').' : < b > '.$sedi[$i][' citta '].' </ b ></ td >
< td class = " text-left " > '.tr(' Provincia ').' : < b > '.$sedi[$i][' prov '].' </ b ></ td >
< td class = " text-left " > '.tr(' Cap ').' : < b > '.$sedi[$i][' cap '].' </ b ></ td >
</ tr >
< tr >
< td class = " text-left " colspan = " 2 " > '.tr(' telefono ').' : < b > '.$sedi[$i][' telefono '].' </ b ></ td >
< td class = " text-left " colspan = " 2 " > '.tr(' cellulare ').' : < b > '.$sedi[$i][' cellulare '].' </ b ></ td >
</ tr > ' ;
2021-04-26 09:16:16 +02:00
if ( ! empty ( $sedi [ $i + 1 ])) {
echo '
2021-04-19 15:07:51 +02:00
< tr >< td colspan = " 4 " ></ td ></ tr > ' ;
}
2021-04-26 09:16:16 +02:00
}
2021-04-19 15:07:51 +02:00
echo '
</ table > ' ;
}
/*
Impianti
*/
2021-04-26 09:16:16 +02:00
$impianti = $dbo -> fetchArray ( 'SELECT * FROM my_impianti WHERE idanagrafica=' . prepare ( $anagrafica -> idanagrafica ));
2021-04-19 15:07:51 +02:00
2021-04-26 09:16:16 +02:00
if ( ! empty ( $impianti )) {
2021-04-19 15:07:51 +02:00
echo '
< table class = " table table-bordered " >
< tr >
< th colspan = " 4 " style = " font-size:13pt; " class = " text-center " > '.tr(' Impianti ', [], [' upper ' => true]).' </ th >
</ tr > ' ;
2021-04-26 09:16:16 +02:00
for ( $i = 0 ; count ( $impianti ) > $i ; ++ $i ) {
echo '
2021-04-19 15:07:51 +02:00
< tr >
< td colspan = " 2 " class = " text-left " > '.tr(' Matricola ').' : < b > '.$impianti[$i][' matricola '].' </ b ></ td >
2021-10-25 14:49:37 +02:00
< td colspan = " 2 " class = " text-left " > '.tr(' Data ').' : < b > '.Translator::dateToLocale($impianti[$i][' data ']).' </ b ></ td >
2021-04-19 15:07:51 +02:00
</ tr >
< tr >
< td colspan = " 4 " class = " text-left " > '.tr(' Nome ').' : < b > '.$impianti[$i][' nome '].' </ b ></ td >
</ tr >
< tr >
< td colspan = " 4 " class = " text-left " > '.tr(' descrizione ').' : < b > '.$impianti[$i][' descrizione '].' </ b ></ td >
</ tr > ' ;
2021-04-26 09:16:16 +02:00
if ( ! empty ( $impianti [ $i + 1 ])) {
echo '
2021-04-19 15:07:51 +02:00
< tr >< td colspan = " 4 " ></ td ></ tr > ' ;
}
2021-04-26 09:16:16 +02:00
}
2021-04-19 15:07:51 +02:00
echo '
</ table > ' ;
}
/*
Attività
*/
2021-04-26 09:16:16 +02:00
$interventi = $dbo -> fetchArray ( 'SELECT id, sessione.inizio FROM in_interventi LEFT JOIN (SELECT MIN(orario_inizio) AS inizio, in_interventi_tecnici.idintervento FROM in_interventi_tecnici GROUP BY in_interventi_tecnici.idintervento) AS sessione ON sessione.idintervento=in_interventi.id WHERE idanagrafica=' . prepare ( $anagrafica -> idanagrafica ));
2021-04-19 15:07:51 +02:00
2021-04-26 09:16:16 +02:00
if ( ! empty ( $interventi )) {
2021-04-19 15:07:51 +02:00
echo '
< table class = " table table-bordered " >
< tr >
< th colspan = " 4 " style = " font-size:13pt; " class = " text-center " > '.tr(' Attività ', [], [' upper ' => true]).' </ th >
</ tr > ' ;
2021-04-26 09:16:16 +02:00
for ( $i = 0 ; count ( $interventi ) > $i ; ++ $i ) {
$intervento = Intervento :: find ( $interventi [ $i ][ 'id' ]);
echo '
2021-04-19 15:07:51 +02:00
< tr >
< td class = " text-left " > '.tr(' Data richiesta ').' : < b > '.Translator::dateToLocale($intervento->data_richiesta).' </ b ></ td >
< td class = " text-left " colspan = " 2 " > '.tr(' Data scadenza ').' : < b > '.Translator::dateToLocale($intervento->data_scadenza).' </ b ></ td >
< td class = " text-left " > '.tr(' Data inizio ').' : < b > '.Translator::dateToLocale($interventi[$i][' inizio ']).' </ b ></ td >
</ tr >
< tr >
2024-03-20 11:13:28 +01:00
< td colspan = " 2 " class = " text-left " > '.tr(' Tipo ').' : < b > '.$intervento->tipo->getTranslation(' name ').' </ b ></ td >
< td colspan = " 2 " class = " text-left " > '.tr(' stato ').' : < b > '.$intervento->stato->getTranslation(' name ').' </ b ></ td >
2021-04-19 15:07:51 +02:00
</ tr >
< tr >
< td colspan = " 4 " class = " text-left " > '.tr(' richiesta ').' : < b > '.$intervento->richiesta.' </ b ></ td >
</ tr > ' ;
2021-04-26 09:16:16 +02:00
if ( ! empty ( $interventi [ $i + 1 ])) {
echo '
2021-04-19 15:07:51 +02:00
< tr >< td colspan = " 4 " ></ td ></ tr > ' ;
}
2021-04-26 09:16:16 +02:00
}
2021-04-19 15:07:51 +02:00
echo '
</ table > ' ;
2021-04-26 09:16:16 +02:00
}