Update select.php

This commit is contained in:
Luca 2019-06-25 17:29:20 +02:00
parent c17794ae7b
commit 0902672c5b
1 changed files with 2 additions and 2 deletions

View File

@ -200,7 +200,7 @@ switch ($resource) {
case 'sedi':
if (isset($superselect['idanagrafica'])) {
$query = "SELECT * FROM (SELECT '0' AS id, CONCAT('Sede legale', ' (' , (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica = ".$superselect['idanagrafica']." ), ')') AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione";
$query = "SELECT * FROM (SELECT '0' AS id, CONCAT_WS(' - ', 'Sede legale' , (SELECT CONCAT (citta, ' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione";
foreach ($elements as $element) {
$filter[] = 'id='.prepare($element);
@ -219,7 +219,7 @@ switch ($resource) {
if (isset($superselect['idanagrafica'])) {
$user = Auth::user();
$query = "SELECT * FROM (SELECT '0' AS id, CONCAT('Sede legale', ' (' , (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica = ".$user->idanagrafica." ), ')') AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione";
$query = "SELECT * FROM (SELECT '0' AS id, CONCAT_WS(' - ', 'Sede legale' , (SELECT CONCAT (citta, ' (', ragione_sociale,')') FROM an_anagrafiche |where|)) AS descrizione UNION SELECT id, CONCAT_WS(' - ', nomesede, citta) FROM an_sedi |where|) AS tab |filter| ORDER BY descrizione";
foreach ($elements as $element) {
$filter[] = 'id='.prepare($element);