Correzione su utilizzo della sessione PHP

This commit is contained in:
Dasc3er 2021-03-15 10:39:42 +01:00 committed by Thomas Zilio
parent 0ede10ce75
commit d8c63a75e8
38 changed files with 87 additions and 82 deletions

View File

@ -197,7 +197,7 @@ if (!$api_request) {
if (!empty($id_module)) {
// Segmenti
if (!isset($_SESSION['module_'.$id_module]['id_segment'])) {
if (session('module_'.$id_module.'.id_segment') === null) {
$segments = Modules::getSegments($id_module);
session(['module_'.$id_module.'.id_segment' => isset($segments[0]['id']) ? $segments[0]['id'] : null]);
}

View File

@ -85,7 +85,7 @@ if (!empty($options['create_document'])) {
// Opzioni aggiuntive per le Fatture
if (in_array($final_module['name'], ['Fatture di vendita', 'Fatture di acquisto'])) {
$id_segment = $_SESSION['module_'.$final_module['id']]['id_segment'];
$id_segment = session('module_'.$final_module['id'].'.id_segment');
$stato_predefinito = $database->fetchOne("SELECT id FROM co_statidocumento WHERE descrizione = 'Bozza'");

View File

@ -74,7 +74,7 @@ if (!empty($type) && $type != 'menu' && $type != 'custom') {
echo '
<div class="row">
<div class="col-md-4 pull-right">
{[ "type": "select", "name": "id_segment_", "required": 0, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module = '.prepare($id_module).'", "value": "'.$_SESSION['module_'.$id_module]['id_segment'].'" ]}
{[ "type": "select", "name": "id_segment_", "required": 0, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module = '.prepare($id_module).'", "value": "'.session('module_'.$id_module.'.id_segment').'" ]}
</div>
</div>
<br>';

View File

@ -62,7 +62,7 @@ if (auth()->check()) {
<script>
search = []';
$array = $_SESSION['module_'.$id_module];
$array = session('module_'.$id_module);
if (!empty($array)) {
foreach ($array as $field => $value) {
if (!empty($value) && string_starts_with($field, 'search_')) {

View File

@ -38,8 +38,8 @@ class DatiFattureElettroniche extends Controllo
{
$fatture_vendita = Fattura::vendita()
->whereNotIn('codice_stato_fe', ['ERR', 'NS', 'EC02', 'ERVAL'])
->where('data', '>=', $_SESSION['period_start'])
->where('data', '<=', $_SESSION['period_end'])
->where('data', '>=', session('period_start'))
->where('data', '<=', session('period_end'))
->orderBy('data')
->get();

View File

@ -108,7 +108,7 @@ switch (post('op')) {
break;
case 'stampa-etichette':
$_SESSION['superselect']['id_articolo_barcode'] = $id_records;
session('superselect.id_articolo_barcode') = $id_records;
$id_print = Prints::getPrints()['Barcode'];
redirect(base_url().'/pdfgen.php?id_print='.$id_print.'&id_record='.Articolo::where('barcode', '!=', '')->first()->id);

View File

@ -32,11 +32,11 @@ $module_fatture = 'Fatture di vendita';
// Segmenti
$id_fatture = module($module_fatture)['id'];
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
if (!!session('module_'.$id_fatture.'.id_segment') === null)) {
$segments = Modules::getSegments($id_fatture);
session(['module_'.$id_fatture.'.id_segment' => isset($segments[0]['id']) ? $segments[0]['id'] : null]);
}
$id_segment = $_SESSION['module_'.$id_fatture]['id_segment'];
$id_segment = session('module_'.$id_fatture.'.id_segment');
$idconto = setting('Conto predefinito fatture di vendita');
$idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
'predefined' => 1,

View File

@ -41,38 +41,42 @@ ORDER BY ragione_sociale ASC');
$zone = $dbo->fetchArray('(SELECT 0 AS ordine, \'0\' AS id, \'Nessuna zona\' AS descrizione) UNION (SELECT 1 AS ordine, id, descrizione FROM an_zone) ORDER BY ordine, descrizione ASC');
// Prima selezione globale per tutti i filtri
if (!isset($_SESSION['dashboard']['idtecnici'])) {
$_SESSION['dashboard']['idtecnici'] = ["'-1'"];
if (session('dashboard.idtecnici') === null) {
$list = ["'-1'"];
foreach ($tecnici_disponibili as $tecnico) {
if(($user['gruppo']=='Tecnici' && $user['idanagrafica']==$tecnico['id']) || $user['gruppo']!='Tecnici'){
$_SESSION['dashboard']['idtecnici'][] = "'".$tecnico['id']."'";
if(($user['gruppo']=='Tecnici' && $user['idanagrafica']==$tecnico['id']) || $user['gruppo']!='Tecnici') {
$list[] = "'".$tecnico['id']."'";
}
}
session(['dashboard.idtecnici' => $list]);
}
if (!isset($_SESSION['dashboard']['idstatiintervento'])) {
$_SESSION['dashboard']['idstatiintervento'] = ["'-1'"];
if (session('dashboard.idstatiintervento') === null) {
$list = ["'-1'"];
foreach ($stati_intervento as $stato) {
$_SESSION['dashboard']['idstatiintervento'][] = "'".$stato['id']."'";
$list[] = "'".$stato['id']."'";
}
session(['dashboard.idstatiintervento' => $list]);
}
if (!isset($_SESSION['dashboard']['idtipiintervento'])) {
$_SESSION['dashboard']['idtipiintervento'] = ["'-1'"];
if (session('dashboard.idtipiintervento') === null) {
$list = ["'-1'"];
foreach ($tipi_intervento as $tipo) {
$_SESSION['dashboard']['idtipiintervento'][] = "'".$tipo['id']."'";
$list[] = "'".$tipo['id']."'";
}
session(['dashboard.idtipiintervento' => $list]);
}
if (!isset($_SESSION['dashboard']['idzone'])) {
$_SESSION['dashboard']['idzone'] = ["'-1'"];
if (session('dashboard.idzone') === null) {
$list = ["'-1'"];
foreach ($zone as $zona) {
$_SESSION['dashboard']['idzone'][] = "'".$zona['id']."'";
$list[] = "'".$zona['id']."'";
}
session(['dashboard.idzone' => $list]);
}
echo '

View File

@ -23,7 +23,7 @@ use Carbon\Carbon;
// Trovo id_print della stampa
$id_print = Prints::getModulePredefinedPrint('Dashboard')['id'];
$date = new Carbon($_SESSION['dashboard']['date']);
$date = new Carbon(session('dashboard')['date']);
echo '
<form action="" method="post" onsubmit="if($(this).parsley().validate()) { return stampa_calendario(); }" >
@ -34,11 +34,11 @@ echo '
</div>
<div class="col-md-2">
{[ "type": "select", "label": "'.tr('Formato').'", "name": "format", "required": "1", "values": "list=\"A4\": \"'.tr('A4').'\", \"A3\": \"'.tr('A3').'\"", "value": "'.$_SESSION['dashboard']['format'].'" ]}
{[ "type": "select", "label": "'.tr('Formato').'", "name": "format", "required": "1", "values": "list=\"A4\": \"'.tr('A4').'\", \"A3\": \"'.tr('A3').'\"", "value": "'.session('dashboard')['format'].'" ]}
</div>
<div class="col-md-4">
{[ "type": "select", "label": "'.tr('Orientamento').'", "name": "orientation", "required": "1", "values": "list=\"L\": \"'.tr('Orizzontale').'\", \"P\": \"'.tr('Verticale').'\"", "value": "'.$_SESSION['dashboard']['orientation'].'" ]}
{[ "type": "select", "label": "'.tr('Orientamento').'", "name": "orientation", "required": "1", "values": "list=\"L\": \"'.tr('Orizzontale').'\", \"P\": \"'.tr('Verticale').'\"", "value": "'.session('dashboard')['orientation'].'" ]}
</div>

View File

@ -35,11 +35,11 @@ if ($module['name'] == 'Ddt di vendita') {
// Segmenti
$id_fatture = module($module_fatture)['id'];
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
if (!!session('module_'.$id_fatture.'.id_segment') === null)) {
$segments = Modules::getSegments($id_fatture);
session(['module_'.$id_fatture.'.id_segment' => isset($segments[0]['id']) ? $segments[0]['id'] : null]);
}
$id_segment = $_SESSION['module_'.$id_fatture]['id_segment'];
$id_segment = session('module_'.$id_fatture.'.id_segment');
$idconto = setting('Conto predefinito fatture di vendita');
$idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
'predefined' => 1,

View File

@ -71,7 +71,7 @@ $idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
</div>
<div class="col-md-6">
{[ "type": "select", "label": "<?php echo tr('Sezionale'); ?>", "name": "id_segment", "required": 1, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module='<?php echo $id_module; ?>' ORDER BY name", "value": "<?php echo $_SESSION['module_'.$id_module]['id_segment']; ?>" ]}
{[ "type": "select", "label": "<?php echo tr('Sezionale'); ?>", "name": "id_segment", "required": 1, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module='<?php echo $id_module; ?>' ORDER BY name", "value": "<?php echo session('module_'.$id_module.'.id_segment'); ?>" ]}
</div>
</div>

View File

@ -482,7 +482,7 @@ $operations['export-csv'] = [
$operations['copy-bulk'] = [
'text' => '<span><i class="fa fa-copy"></i> '.tr('Duplica selezionati').'</span>',
'data' => [
'msg' => tr('Vuoi davvero duplicare le righe selezionate?').'<br><br>{[ "type": "select", "label": "'.tr('Fattura in avanti di').'", "name": "skip_time", "required": 1, "values": "list=\"Giorno\":\"'.tr('Un giorno').'\", \"Settimana\":\"'.tr('Una settimana').'\", \"Mese\":\"'.tr('Un mese').'\", \"Anno\":\"'.tr('Un anno').'\" ", "value": "Giorno" ]}<br>{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module='.$id_module.' ORDER BY name", "value": "'.$_SESSION['module_'.$id_module]['id_segment'].'" ]}<br>{[ "type": "checkbox", "label": "'.tr('Aggiungere i riferimenti ai documenti esterni?').'", "placeholder": "'.tr('Aggiungere i riferimenti ai documenti esterni?').'", "name": "riferimenti" ]}',
'msg' => tr('Vuoi davvero duplicare le righe selezionate?').'<br><br>{[ "type": "select", "label": "'.tr('Fattura in avanti di').'", "name": "skip_time", "required": 1, "values": "list=\"Giorno\":\"'.tr('Un giorno').'\", \"Settimana\":\"'.tr('Una settimana').'\", \"Mese\":\"'.tr('Un mese').'\", \"Anno\":\"'.tr('Un anno').'\" ", "value": "Giorno" ]}<br>{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module='.$id_module.' ORDER BY name", "value": "'.session('module_'.$id_module.'.id_segment').'" ]}<br>{[ "type": "checkbox", "label": "'.tr('Aggiungere i riferimenti ai documenti esterni?').'", "placeholder": "'.tr('Aggiungere i riferimenti ai documenti esterni?').'", "name": "riferimenti" ]}',
'button' => tr('Procedi'),
'class' => 'btn btn-lg btn-warning',
],

View File

@ -19,10 +19,10 @@
include_once __DIR__.'/../../core.php';
if (empty($_SESSION['giacenze_sedi']['idsede'])) {
session(['giacenze_sedi']['idsede' => 0]);
if (session('giacenze_sedi.idsede') === null) {
session(['giacenze_sedi.idsede' => 0]);
}
$id_sede = $_SESSION['giacenze_sedi']['idsede'];
$id_sede = session('giacenze_sedi.idsede');
echo '
<div class="row">

View File

@ -28,11 +28,12 @@ use Util\Zip;
// Segmenti
$id_fatture = module('Fatture di vendita')['id'];
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
if (!!session('module_'.$id_fatture.'.id_segment') === null)) {
$segments = Modules::getSegments($id_fatture);
session(['module_'.$id_fatture.'.id_segment' => isset($segments[0]['id']) ? $segments[0]['id'] : null]);
}
$id_segment = $_SESSION['module_'.$id_fatture]['id_segment'];
$id_segment = session('module_'.$id_fatture.'.id_segment');
$idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
'predefined' => 1,
'dir' => 'entrata',

View File

@ -91,7 +91,7 @@ switch (post('op')) {
break;
}
$segment = $dbo->selectOne('zz_segments', 'name', ['id' => $_SESSION['module_'.$id_module]['id_segment']])['name'];
$segment = $dbo->selectOne('zz_segments', 'name', ['id' => session('module_'.$id_module)['id_segment']])['name'];
if ($segment!='Tutti') {
$operations['copy_listino'] = [

View File

@ -31,11 +31,11 @@ $module_fatture = 'Fatture di vendita';
// Segmenti
$id_fatture = module($module_fatture)['id'];
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
if (!!session('module_'.$id_fatture.'.id_segment') === null)) {
$segments = Modules::getSegments($id_fatture);
$_SESSION['module_'.$id_fatture]['id_segment'] = isset($segments[0]['id']) ? $segments[0]['id'] : null;
session('module_'.$id_fatture.'.id_segment') = isset($segments[0]['id']) ? $segments[0]['id'] : null;
}
$id_segment = $_SESSION['module_'.$id_fatture]['id_segment'];
$id_segment = session('module_'.$id_fatture.'.id_segment');
$idconto = setting('Conto predefinito fatture di vendita');
$idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
'predefined' => 1,

View File

@ -170,8 +170,8 @@ switch (post('op')) {
$idconto_apertura = setting('Conto per Apertura conti patrimoniali');
$idconto_chiusura = setting('Conto per Chiusura conti patrimoniali');
$data_inizio = $_SESSION['period_start'];
$data_fine = $_SESSION['period_end'];
$data_inizio = session('period_start');
$data_fine = session('period_end');
// Lettura di tutti i conti dello stato patrimoniale con saldo != 0
$conti = $dbo->fetchArray('SELECT co_pianodeiconti3.id, SUM(co_movimenti.totale) AS totale FROM ((co_pianodeiconti3 INNER JOIN co_pianodeiconti2 ON co_pianodeiconti3.idpianodeiconti2=co_pianodeiconti2.id) INNER JOIN co_pianodeiconti1 ON co_pianodeiconti2.idpianodeiconti1=co_pianodeiconti1.id) INNER JOIN co_movimenti ON co_pianodeiconti3.id=co_movimenti.idconto WHERE co_pianodeiconti1.descrizione="Patrimoniale" AND data >= '.prepare($data_inizio).' AND data <= '.prepare($data_fine).' AND co_pianodeiconti3.id!='.prepare($idconto_chiusura).' AND is_chiusura=0 GROUP BY co_pianodeiconti3.id HAVING totale != 0');

View File

@ -124,7 +124,7 @@ foreach ($primo_livello as $conto_primo) {
SUM(totale) AS totale,
SUM(totale_reddito) AS totale_reddito
FROM co_movimenti
WHERE data BETWEEN '.prepare($_SESSION['period_start']).' AND '.prepare($_SESSION['period_end']).' GROUP BY idconto
WHERE data BETWEEN '.prepare(session('period_start')).' AND '.prepare(session('period_end')).' GROUP BY idconto
) movimenti ON co_pianodeiconti3.id=movimenti.idconto
WHERE `idpianodeiconti2` = '.prepare($conto_secondo['id']).' ORDER BY numero ASC';
$terzo_livello = $dbo->fetchArray($query3);

View File

@ -29,11 +29,11 @@ $module_fatture = 'Fatture di vendita';
// Segmenti
$id_fatture = module($module_fatture)['id'];
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
if (!!session('module_'.$id_fatture.'.id_segment') === null)) {
$segments = Modules::getSegments($id_fatture);
session(['module_'.$id_fatture.'.id_segment' => isset($segments[0]['id']) ? $segments[0]['id'] : null]);
}
$id_segment = $_SESSION['module_'.$id_fatture]['id_segment'];
$id_segment = session('module_'.$id_fatture.'.id_segment');
$idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
'predefined' => 1,
'dir' => 'entrata',

View File

@ -60,8 +60,8 @@ include_once __DIR__.'/../../core.php';
</div>
<?php
$previous = $_SESSION['module_'.$record['id_module']]['id_segment'];
$previous_module = $_SESSION['module_'.$record['id_module']]['id_segment'];
$previous = session('module_'.$record['id_module'].'.id_segment');
$previous_module = session('module_'.$record['id_module'].'.id_segment');
session(['module_'.$id_module.'.id_segment' => $id_record]);
session(['module_'.$id_module.'.id_segment' => $id_record]);

View File

@ -62,8 +62,8 @@ echo '
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">'.tr('Dati economici<br> dal _START_ al _END_', [
'_START_' => dateFormat($_SESSION['period_start']),
'_END_' => dateFormat($_SESSION['period_end']),
'_START_' => dateFormat(session('period_start')),
'_END_' => dateFormat(session('period_end')),
]).'</h3>
</div>

View File

@ -51,11 +51,11 @@ echo '
echo '
<div class="row">
<div class="col-md-4">
{[ "type": "select", "label": "'.tr('Formato').'", "name": "format", "required": "1", "values": "list=\"A4\": \"'.tr('A4').'\", \"A3\": \"'.tr('A3').'\"", "value": "'.$_SESSION['stampe_contabili']['format'].'" ]}
{[ "type": "select", "label": "'.tr('Formato').'", "name": "format", "required": "1", "values": "list=\"A4\": \"'.tr('A4').'\", \"A3\": \"'.tr('A3').'\"", "value": "'.session('stampe_contabili')['format'].'" ]}
</div>
<div class="col-md-4">
{[ "type": "select", "label": "'.tr('Orientamento').'", "name": "orientation", "required": "1", "values": "list=\"L\": \"'.tr('Orizzontale').'\", \"P\": \"'.tr('Verticale').'\"", "value": "'.$_SESSION['stampe_contabili']['orientation'].'" ]}
{[ "type": "select", "label": "'.tr('Orientamento').'", "name": "orientation", "required": "1", "values": "list=\"L\": \"'.tr('Orizzontale').'\", \"P\": \"'.tr('Verticale').'\"", "value": "'.session('stampe_contabili')['orientation'].'" ]}
</div>
<div class="col-md-4">

View File

@ -219,7 +219,7 @@ echo '
// Sezionale
echo '
<div class="col-md-3">
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE is_fiscale = 1 AND id_module='.$id_module.' ORDER BY name", "value": "'.$_SESSION['module_'.$id_module]['id_segment'].'" ]}
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE is_fiscale = 1 AND id_module='.$id_module.' ORDER BY name", "value": "'.session('module_'.$id_module.'.id_segment').'" ]}
</div>';
// Data di registrazione

View File

@ -66,7 +66,7 @@ echo '
echo '
<div class="row">
<div class="col-md-6">
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module='.$module_fattura['id'].' ORDER BY name", "value":"'.$_SESSION['module_'.$module_fattura['id']]['id_segment'].'" ]}
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module='.$module_fattura['id'].' ORDER BY name", "value":"'.session('module_'.$module_fattura['id'].'.id_segment').'" ]}
</div>';
// Conto

View File

@ -42,7 +42,7 @@ class MissingReceiptTask extends Manager
$data_limite = (new Carbon())->subDays(7);
$in_attesa = Fattura::vendita()
->where('codice_stato_fe', 'WAIT')
->where('data_stato_fe', '>=', $_SESSION['period_start'])
->where('data_stato_fe', '>=', session('period_start'))
->where('data_stato_fe', '<', $data_limite)
->orderBy('data_stato_fe')
->get();

View File

@ -37,7 +37,7 @@ class NotificheRicevuteHook extends Manager
// Messaggio informativo su fatture con stato di errore
$con_errore = Fattura::vendita()
->whereIn('codice_stato_fe', ['NS', 'ERR', 'EC02'])
->where('data_stato_fe', '>=', $_SESSION['period_start'])
->where('data_stato_fe', '>=', session('period_start'))
->orderBy('data_stato_fe')
->count();
@ -45,7 +45,7 @@ class NotificheRicevuteHook extends Manager
$data_limite = (new Carbon())->subDays(7);
$in_attesa = Fattura::vendita()
->where('codice_stato_fe', 'WAIT')
->where('data_stato_fe', '>=', $_SESSION['period_start'])
->where('data_stato_fe', '>=', session('period_start'))
->where('data_stato_fe', '<', $data_limite)
->orderBy('data_stato_fe')
->count();

View File

@ -150,7 +150,7 @@ class Modules
// Aggiunta dei segmenti
if ($include_segments) {
$segments = self::getSegments($module['id']);
$id_segment = isset($_SESSION['module_'.$module['id']]) ? $_SESSION['module_'.$module['id']]['id_segment'] : null;
$id_segment = session('module_'.$module['id'].'.id_segment');
foreach ($segments as $result) {
if (!empty($result['clause']) && $result['id'] == $id_segment) {
$result['clause'] = Query::replacePlaceholder($result['clause']);

View File

@ -73,7 +73,7 @@ class Query
$id_parent = filter('id_parent');
$id_module = Modules::getCurrent()['id'];
$segment = !empty(self::$segments) ? $_SESSION['module_'.$id_module]['id_segment'] : null;
$segment = !empty(self::$segments) ? session('module_'.$id_module.'.id_segment') : null;
$user = auth()->user();
@ -123,7 +123,7 @@ class Query
'|'.$segment_filter.'|' => !empty($segment) ? ' AND '.$segment_name.' = '.prepare($segment) : '',
// Filtro dinamico per il modulo Giacenze sedi
'|giacenze_sedi_idsede|' => prepare(isset($_SESSION['giacenze_sedi']) ? $_SESSION['giacenze_sedi']['idsede'] : null),
'|giacenze_sedi_idsede|' => session('giacenze_sedi.idsede'),
];
// Sostituzione dei formati

View File

@ -31,9 +31,9 @@ echo '<style>
}
</style>';
if (!empty($_SESSION['superselect']['id_articolo_barcode'])) {
$articoli = Articolo::whereIn('id', $_SESSION['superselect']['id_articolo_barcode'])->get();
unset($_SESSION['superselect']['id_articolo_barcode']);
if (!empty(session('superselect.id_articolo_barcode'))) {
$articoli = Articolo::whereIn('id', session('superselect.id_articolo_barcode'))->get();
session()->forget('superselect.id_articolo_barcode');
} else {
$articoli = Articolo::where('id', '=', $id_record)->get();
}

View File

@ -22,8 +22,8 @@ include_once __DIR__.'/../../core.php';
use Carbon\Carbon;
$azienda = $dbo->fetchOne('SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica='.setting('Azienda predefinita'));
$date_start = $_SESSION['period_start'];
$date_end = $_SESSION['period_end'];
$date_start = session('period_start');
$date_end = session('period_end');
$esercizio = new Carbon($date_start);
$esercizio = $esercizio->format('Y');

View File

@ -21,13 +21,13 @@ include_once __DIR__.'/../../core.php';
use Carbon\Carbon;
$calendar = $_SESSION['dashboard'];
$calendar = session('dashboard');
$date = $calendar['date'];
$date = new Carbon($date);
if ($calendar['format'] == 'week') {
$period = explode(' ', $_SESSION['dashboard']['week']);
$period = explode(' ', session('dashboard')['week']);
$day = $period[0];
@ -51,7 +51,7 @@ if ($calendar['format'] == 'week') {
$month = $months[$month];
$maxmonth = $months[$maxmonth];
$title = $_SESSION['dashboard']['week'];
$title = session('dashboard')['week'];
//numero di giorni nel mese
$maxday = cal_days_in_month(CAL_GREGORIAN, $month, $year) + 1;

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
$format = (isset($_SESSION['dashboard']['format'])) ? $_SESSION['dashboard']['format'] : 'A4';
$orientation = (isset($_SESSION['dashboard']['orientation'])) ? $_SESSION['dashboard']['orientation'] : 'L';
$format = (isset(session('dashboard')['format'])) ? session('dashboard')['format'] : 'A4';
$orientation = (isset(session('dashboard')['orientation'])) ? session('dashboard')['orientation'] : 'L';
return [
'format' => $format,

View File

@ -19,7 +19,7 @@
include_once __DIR__.'/../../core.php';
$azienda = $dbo->fetchOne('SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica='.setting('Azienda predefinita'));
$date_start = $_SESSION['period_start'];
$date_end = $_SESSION['period_end'];
$date_start = session('period_start');
$date_end = session('period_end');
$records = $dbo->fetchArray('SELECT co_movimenti.*, co_pianodeiconti3.descrizione AS conto, co_pianodeiconti2.numero AS numero2, co_pianodeiconti3.numero, SUM(co_movimenti.totale) AS totale FROM co_movimenti INNER JOIN co_pianodeiconti3 ON co_movimenti.idconto=co_pianodeiconti3.id INNER JOIN co_pianodeiconti2 ON co_pianodeiconti3.idpianodeiconti2=co_pianodeiconti2.id WHERE co_movimenti.data>='.prepare($date_start).' AND co_movimenti.data<='.prepare($date_end).' GROUP BY co_movimenti.idmastrino, co_movimenti.idconto ORDER BY co_movimenti.data, co_movimenti.idmastrino');

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
$format = (isset($_SESSION['stampe_contabili']['format'])) ? $_SESSION['stampe_contabili']['format'] : 'A4';
$orientation = (isset($_SESSION['stampe_contabili']['orientation'])) ? $_SESSION['stampe_contabili']['orientation'] : 'L';
$format = (isset(session('stampe_contabili')['format'])) ? session('stampe_contabili')['format'] : 'A4';
$orientation = (isset(session('stampe_contabili')['orientation'])) ? session('stampe_contabili')['orientation'] : 'L';
return [
'format' => $format,

View File

@ -26,7 +26,7 @@ $id_module = module('Articoli')['id'];
// Valori di ricerca
$where['servizio'] = '0';
foreach ($_SESSION['module_'.$id_module] as $name => $value) {
foreach (session('module_'.$id_module) as $name => $value) {
if (preg_match('/^search_(.+?)$/', $name, $m)) {
$where[$m[1]] = $value;
}

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
$format = (isset($_SESSION['stampe_contabili']['format'])) ? $_SESSION['stampe_contabili']['format'] : 'A4';
$orientation = (isset($_SESSION['stampe_contabili']['orientation'])) ? $_SESSION['stampe_contabili']['orientation'] : 'L';
$format = (isset(session('stampe_contabili')['format'])) ? session('stampe_contabili')['format'] : 'A4';
$orientation = (isset(session('stampe_contabili')['orientation'])) ? session('stampe_contabili')['orientation'] : 'L';
return [
'format' => $format,

View File

@ -32,8 +32,8 @@ $module_query = $total['query'];
$search_filters = [];
if (is_array($_SESSION['module_'.$id_module])) {
foreach ($_SESSION['module_'.$id_module] as $field => $value) {
if (is_array(session('module_'.$id_module))) {
foreach (session('module_'.$id_module) as $field => $value) {
if (!empty($value) && string_starts_with($field, 'search_')) {
$field_name = str_replace('search_', '', $field);
$field_name = str_replace('__', ' ', $field_name);

View File

@ -32,8 +32,8 @@ $module_query = $total['query'];
$search_filters = [];
if (is_array($_SESSION['module_'.$id_module])) {
foreach ($_SESSION['module_'.$id_module] as $field => $value) {
if (is_array(session('module_'.$id_module))) {
foreach (session('module_'.$id_module) as $field => $value) {
if (!empty($value) && string_starts_with($field, 'search_')) {
$field_name = str_replace('search_', '', $field);
$field_name = str_replace('__', ' ', $field_name);