2017-08-04 16:28:16 +02:00
|
|
|
<?php
|
2020-09-07 15:04:06 +02:00
|
|
|
/*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
include_once __DIR__.'/core.php';
|
|
|
|
|
2018-02-03 16:29:53 +01:00
|
|
|
if (!isset($resource)) {
|
2018-02-03 15:03:48 +01:00
|
|
|
$op = empty($op) ? filter('op') : $op;
|
2019-02-22 10:37:37 +01:00
|
|
|
$search = filter('search');
|
|
|
|
$page = filter('page') ?: 0;
|
|
|
|
$length = filter('length') ?: 100;
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2020-07-31 10:58:59 +02:00
|
|
|
// Opzioni di selezione sugli elementi
|
|
|
|
$options = filter('options') ?: [];
|
|
|
|
$options_compatibility = $_SESSION['superselect'] ?: [];
|
|
|
|
$options = array_merge($options_compatibility, $options);
|
|
|
|
|
|
|
|
// Preselezione su $elements dichiarato da file precedente
|
2018-02-03 15:03:48 +01:00
|
|
|
if (!isset($elements)) {
|
|
|
|
$elements = [];
|
2017-08-04 16:28:16 +02:00
|
|
|
}
|
2018-02-03 15:03:48 +01:00
|
|
|
$elements = (!is_array($elements)) ? explode(',', $elements) : $elements;
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2020-07-31 10:58:59 +02:00
|
|
|
$results = AJAX::select($op, $elements, $search, $page, $length, $options);
|
2019-06-29 11:01:26 +02:00
|
|
|
|
2018-02-03 15:03:48 +01:00
|
|
|
echo json_encode($results);
|
2018-02-03 16:29:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Casi particolari
|
|
|
|
else {
|
2017-08-04 16:28:16 +02:00
|
|
|
}
|