2019-07-09 18:29:40 +02:00
< ? php
2020-09-07 15:04:06 +02:00
/*
* OpenSTAManager : il software gestionale open source per l ' assistenza tecnica e la fatturazione
2021-01-20 15:08:51 +01:00
* Copyright ( C ) DevCode s . r . l .
2020-09-07 15:04:06 +02:00
*
* 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 />.
*/
2019-07-09 18:29:40 +02:00
include_once __DIR__ . '/../../core.php' ;
2024-03-05 16:01:45 +01:00
use Models\Module ;
2019-07-09 18:29:40 +02:00
echo '
< hr >
2024-05-16 18:02:50 +02:00
< div class = " card card-warning " >
< div class = " card-header " >
< h4 class = " card-title " >
2019-07-09 18:29:40 +02:00
'.tr(' Periodi temporali ').'
</ h4 >
2024-05-16 18:02:50 +02:00
< div class = " card-tools pull-right " >
2019-07-10 16:31:10 +02:00
< button class = " btn btn-warning btn-xs " onclick = " add_calendar() " >
2019-07-09 18:29:40 +02:00
< i class = " fa fa-plus " ></ i > '.tr(' Aggiungi periodo ').'
</ button >
2024-07-17 09:57:30 +02:00
< button type = " button " class = " btn btn-tool " data - card - widget = " collapse " >
< i class = " fa fa-plus " ></ i >
2019-07-09 18:29:40 +02:00
</ button >
</ div >
</ div >
2020-09-07 15:04:06 +02:00
2024-05-16 18:02:50 +02:00
< div class = " card-body collapse in " id = " calendars " >
2020-09-07 15:04:06 +02:00
2019-07-09 18:29:40 +02:00
</ div >
</ div >
2024-05-16 18:02:50 +02:00
< div class = " card card-primary " >
2024-05-17 12:11:00 +02:00
< div class = " card-header " >
2024-05-16 18:02:50 +02:00
< h3 class = " card-title " >
2021-02-23 11:40:27 +01:00
< span class = " tip " title = " '.tr('La statistica considera le fatture di acquisto nel periodo temporale definito').' " >< i class = " fa fa-question-circle " ></ i ></ span >
2021-02-23 11:34:37 +01:00
'.tr(' Prezzo medio acquisto ').'
</ h3 >
2019-07-09 18:29:40 +02:00
</ div >
2020-09-07 15:04:06 +02:00
2024-05-16 18:02:50 +02:00
< div class = " card-body " >
2019-07-09 18:29:40 +02:00
< table class = " table table-striped table-condensed table-bordered " >
< thead >
< tr >
2019-07-10 16:31:10 +02:00
< th class = " text-center " > #</th>
2019-07-11 12:04:22 +02:00
< th > '.tr(' Periodo ').' </ th >
2019-07-09 18:29:40 +02:00
< th > '.tr(' Prezzo minimo ').' </ th >
2019-07-11 12:04:22 +02:00
< th > '.tr(' Prezzo medio ').' </ th >
2019-07-09 18:29:40 +02:00
< th > '.tr(' Prezzo massimo ').' </ th >
< th > '.tr(' Oscillazione ').' </ th >
< th > '.tr(' Oscillazione in % ').' </ th >
< th > '.tr(' Andamento prezzo ').' </ th >
</ tr >
</ thead >
< tbody id = " prezzi_acquisto " >
2020-09-07 15:04:06 +02:00
2019-07-09 18:29:40 +02:00
</ tbody >
</ table >
</ div >
</ div >
2024-05-16 18:02:50 +02:00
< div class = " card card-primary " >
2024-05-17 12:11:00 +02:00
< div class = " card-header " >
2024-05-16 18:02:50 +02:00
< h3 class = " card-title " >
2021-02-23 11:40:27 +01:00
< span class = " tip " title = " '.tr('La statistica considera le fatture di vendita nel periodo temporale definito').' " >< i class = " fa fa-question-circle " ></ i ></ span >
2021-02-23 11:34:37 +01:00
'.tr(' Prezzo medio vendita ').'
</ h3 >
2019-07-10 15:02:09 +02:00
</ div >
2020-09-07 15:04:06 +02:00
2024-05-16 18:02:50 +02:00
< div class = " card-body " >
2019-07-10 15:02:09 +02:00
< table class = " table table-striped table-condensed table-bordered " >
< thead >
< tr >
2019-07-10 16:31:10 +02:00
< th > #</th>
2019-07-11 12:04:22 +02:00
< th > '.tr(' Periodo ').' </ th >
2019-07-10 15:02:09 +02:00
< th > '.tr(' Prezzo minimo ').' </ th >
2019-07-11 12:04:22 +02:00
< th > '.tr(' Prezzo medio ').' </ th >
2019-07-10 15:02:09 +02:00
< th > '.tr(' Prezzo massimo ').' </ th >
< th > '.tr(' Oscillazione ').' </ th >
< th > '.tr(' Oscillazione in % ').' </ th >
< th > '.tr(' Andamento prezzo ').' </ th >
</ tr >
</ thead >
< tbody id = " prezzi_vendita " >
2020-09-07 15:04:06 +02:00
2019-07-10 15:02:09 +02:00
</ tbody >
</ table >
</ div >
2019-07-11 12:04:22 +02:00
</ div > ' ;
2019-07-10 16:31:10 +02:00
2024-06-11 16:58:27 +02:00
$statistiche = Module :: where ( 'name' , 'Statistiche' ) -> first ();
2019-07-09 18:29:40 +02:00
2020-02-14 12:23:50 +01:00
if ( $statistiche != null ) {
2020-02-11 16:58:25 +01:00
echo '
< script src = " '. $statistiche->fileurl ('js/functions.js').' " ></ script >
< script src = " '. $statistiche->fileurl ('js/manager.js').' " ></ script >
< script src = " '. $statistiche->fileurl ('js/calendar.js').' " ></ script >
< script src = " '. $statistiche->fileurl ('js/stat.js').' " ></ script >
2020-02-11 17:07:11 +01:00
< script src = " '. $statistiche->fileurl ('js/stats/table.js').' " ></ script > ' ;
2020-02-11 16:58:25 +01:00
}
2021-02-18 18:48:44 +01:00
echo '
2019-07-09 18:29:40 +02:00
2019-07-11 12:04:22 +02:00
< script src = " '. $structure->fileurl ('js/prezzo.js').' " ></ script >
2019-07-10 17:22:39 +02:00
2019-07-11 12:04:22 +02:00
< script >
var local_url = " '.str_replace('edit.php', '', $structure->fileurl ('edit.php')).' " ;
2019-07-10 16:31:10 +02:00
2019-07-11 12:04:22 +02:00
function init_calendar ( calendar ) {
2019-07-10 16:31:10 +02:00
var prezzo_acquisto = new Prezzo ( calendar , " #prezzi_acquisto " , " uscita " );
var prezzo_vendita = new Prezzo ( calendar , " #prezzi_vendita " , " entrata " );
2020-09-07 15:04:06 +02:00
2019-07-10 16:31:10 +02:00
calendar . addElement ( prezzo_acquisto );
calendar . addElement ( prezzo_vendita );
2019-07-09 18:29:40 +02:00
}
2020-02-11 16:58:25 +01:00
</ script > ' ;
2020-02-11 17:07:11 +01:00
2020-02-14 12:23:50 +01:00
if ( $statistiche != null ) {
2020-02-11 17:07:11 +01:00
echo '
< script src = " '. $statistiche->fileurl ('js/init.js').' " ></ script > ' ;
}