2022-03-07 16:51:54 +01:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
|
|
|
* Copyright (C) DevCode s.n.c.
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2024-03-05 16:01:45 +01:00
|
|
|
use Models\Module;
|
2024-03-22 15:52:24 +01:00
|
|
|
use Util\Query;
|
2022-03-07 16:51:54 +01:00
|
|
|
|
|
|
|
include_once __DIR__.'/../../core.php';
|
|
|
|
|
2024-04-18 17:44:05 +02:00
|
|
|
$structure = Module::find((new Module())->getByField('title', 'Prima nota', Models\Locale::getPredefined()->id));
|
2022-03-07 16:51:54 +01:00
|
|
|
|
2023-08-04 14:54:28 +02:00
|
|
|
if (!empty($_SESSION['superselect']['mastrini'])) {
|
2022-03-07 16:51:54 +01:00
|
|
|
$id_record = $_SESSION['superselect']['mastrini'];
|
2023-08-04 14:54:28 +02:00
|
|
|
$where = 'co_movimenti.idmastrino IN ('.implode(',', $id_record).')';
|
2024-05-23 11:36:25 +02:00
|
|
|
$id_record = json_decode((string) $righe);
|
2022-03-07 16:51:54 +01:00
|
|
|
unset($_SESSION['superselect']['mastrini']);
|
2023-08-04 14:54:28 +02:00
|
|
|
} else {
|
|
|
|
$where = 'co_movimenti.idmastrino='.prepare($id_record);
|
2022-03-07 16:51:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// RISULTATI VISIBILI
|
2024-01-15 15:30:45 +01:00
|
|
|
Query::setSegments(false);
|
2022-03-07 16:51:54 +01:00
|
|
|
$query = Query::getQuery($structure, $where, 0, []);
|
2024-03-05 16:01:45 +01:00
|
|
|
$query = Modules::replaceAdditionals($structure->id, $query);
|
2023-08-04 14:54:28 +02:00
|
|
|
$query = str_replace('1=1', '1=1 AND '.$where, $query);
|
2022-03-07 16:51:54 +01:00
|
|
|
|
|
|
|
$records = Query::executeAndCount($query);
|
|
|
|
|
|
|
|
$campi = [];
|
2023-08-04 14:54:28 +02:00
|
|
|
foreach ($records['results'][0] as $key => $value) {
|
2022-03-07 16:51:54 +01:00
|
|
|
$campi[] = $key;
|
|
|
|
}
|
2023-08-04 14:54:28 +02:00
|
|
|
unset($campi[0]);
|