|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione |
| 5 | + * Copyright (C) DevCode s.r.l. |
| 6 | + * |
| 7 | + * This program is free software: you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU General Public License as published by |
| 9 | + * the Free Software Foundation, either version 3 of the License, or |
| 10 | + * (at your option) any later version. |
| 11 | + * |
| 12 | + * This program is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU General Public License |
| 18 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 19 | + */ |
| 20 | + |
| 21 | +include_once __DIR__.'/../../core.php'; |
| 22 | +use Models\Module; |
| 23 | + |
| 24 | +echo ' |
| 25 | +<hr> |
| 26 | +<div class="card card-warning"> |
| 27 | + <div class="card-header"> |
| 28 | + <h4 class="card-title"> |
| 29 | + '.tr('Periodi temporali').' |
| 30 | + </h4> |
| 31 | + <div class="card-tools pull-right"> |
| 32 | + <button class="btn btn-warning btn-xs" onclick="add_calendar()"> |
| 33 | + <i class="fa fa-plus"></i> '.tr('Aggiungi periodo').' |
| 34 | + </button> |
| 35 | + <button type="button" class="btn btn-tool" data-card-widget="collapse"> |
| 36 | + <i class="fa fa-plus"></i> |
| 37 | + </button> |
| 38 | + </div> |
| 39 | + </div> |
| 40 | +
|
| 41 | + <div class="card-body collapse in" id="calendars"> |
| 42 | +
|
| 43 | + </div> |
| 44 | +</div> |
| 45 | +
|
| 46 | +<div class="card card-primary"> |
| 47 | + <div class="card-header"> |
| 48 | + <h3 class="card-title"> |
| 49 | + <span class="tip" title="'.tr('La statistica considera le fatture di acquisto nel periodo temporale definito').'"><i class="fa fa-question-circle"></i></span> |
| 50 | + '.tr('Prezzo medio acquisto').' |
| 51 | + </h3> |
| 52 | + </div> |
| 53 | +
|
| 54 | + <div class="card-body"> |
| 55 | + <table class="table table-striped table-sm table-bordered"> |
| 56 | + <thead> |
| 57 | + <tr> |
| 58 | + <th class="text-center">#</th> |
| 59 | + <th>'.tr('Periodo').'</th> |
| 60 | + <th>'.tr('Prezzo minimo').'</th> |
| 61 | + <th>'.tr('Prezzo medio').'</th> |
| 62 | + <th>'.tr('Prezzo massimo').'</th> |
| 63 | + <th>'.tr('Oscillazione').'</th> |
| 64 | + <th>'.tr('Oscillazione in %').'</th> |
| 65 | + <th>'.tr('Andamento prezzo').'</th> |
| 66 | + </tr> |
| 67 | + </thead> |
| 68 | + <tbody id="prezzi_acquisto"> |
| 69 | +
|
| 70 | + </tbody> |
| 71 | + </table> |
| 72 | + </div> |
| 73 | +</div> |
| 74 | +
|
| 75 | +<div class="card card-primary"> |
| 76 | + <div class="card-header"> |
| 77 | + <h3 class="card-title"> |
| 78 | + <span class="tip" title="'.tr('La statistica considera le fatture di vendita nel periodo temporale definito').'"><i class="fa fa-question-circle"></i></span> |
| 79 | + '.tr('Prezzo medio vendita').' |
| 80 | + </h3> |
| 81 | + </div> |
| 82 | +
|
| 83 | + <div class="card-body"> |
| 84 | + <table class="table table-striped table-sm table-bordered"> |
| 85 | + <thead> |
| 86 | + <tr> |
| 87 | + <th>#</th> |
| 88 | + <th>'.tr('Periodo').'</th> |
| 89 | + <th>'.tr('Prezzo minimo').'</th> |
| 90 | + <th>'.tr('Prezzo medio').'</th> |
| 91 | + <th>'.tr('Prezzo massimo').'</th> |
| 92 | + <th>'.tr('Oscillazione').'</th> |
| 93 | + <th>'.tr('Oscillazione in %').'</th> |
| 94 | + <th>'.tr('Andamento prezzo').'</th> |
| 95 | + </tr> |
| 96 | + </thead> |
| 97 | + <tbody id="prezzi_vendita"> |
| 98 | +
|
| 99 | + </tbody> |
| 100 | + </table> |
| 101 | + </div> |
| 102 | +</div>'; |
| 103 | + |
| 104 | +$statistiche = Module::where('name', 'Statistiche')->first(); |
| 105 | + |
| 106 | +if ($statistiche != null) { |
| 107 | + echo ' |
| 108 | + <script src="'.$statistiche->fileurl('js/functions.js').'"></script> |
| 109 | + <script src="'.$statistiche->fileurl('js/manager.js').'"></script> |
| 110 | + <script src="'.$statistiche->fileurl('js/calendar.js').'"></script> |
| 111 | + <script src="'.$statistiche->fileurl('js/stat.js').'"></script> |
| 112 | + <script src="'.$statistiche->fileurl('js/stats/table.js').'"></script>'; |
| 113 | +} |
| 114 | + |
| 115 | +echo ' |
| 116 | +
|
| 117 | +<script src="'.$structure->fileurl('js/prezzo.js').'"></script> |
| 118 | +
|
| 119 | +<script> |
| 120 | +var local_url = "'.str_replace('edit.php', '', $structure->fileurl('edit.php')).'"; |
| 121 | +
|
| 122 | +function init_calendar(calendar) { |
| 123 | + var prezzo_acquisto = new Prezzo(calendar, "#prezzi_acquisto", "uscita"); |
| 124 | + var prezzo_vendita = new Prezzo(calendar, "#prezzi_vendita", "entrata"); |
| 125 | +
|
| 126 | + calendar.addElement(prezzo_acquisto); |
| 127 | + calendar.addElement(prezzo_vendita); |
| 128 | +} |
| 129 | +</script>'; |
| 130 | + |
| 131 | +if ($statistiche != null) { |
| 132 | + echo ' |
| 133 | + <script src="'.$statistiche->fileurl('js/init.js').'"></script>'; |
| 134 | +} |
0 commit comments