1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-27 16:23:19 +01:00
openstamanager/modules/anagrafiche/api/retrieve.php

55 lines
1.5 KiB
PHP
Raw Normal View History

<?php
switch ($resource) {
case 'an_anagrafiche':
$table = 'an_anagrafiche';
if (empty($order)) {
$order[] = 'idanagrafica';
}
2018-02-18 19:53:23 +01:00
if (empty($where['deleted'])) {
2017-09-04 17:18:54 +02:00
$where['deleted'] = 0;
}
break;
2018-06-26 14:30:26 +02:00
case 'clienti':
$q = 'SELECT AN.idanagrafica,
2018-05-18 23:42:20 +02:00
AN.ragione_sociale,
AN.piva,
AN.codice_fiscale,
AN.indirizzo,
AN.indirizzo2,
AN.citta,
AN.cap,
AN.provincia,
AN.km,
IFNULL(AN.lat, 0.00) AS latitudine,
IFNULL(AN.lng, 0.00) AS longitudine,
NAZIONE.nome AS nazione,
AN.telefono,
AN.fax,
AN.cellulare,
AN.email,
AN.sitoweb,
AN.note,
AN.idzona,
AN.deleted
FROM (an_anagrafiche AS AN
LEFT OUTER JOIN an_nazioni NAZIONE ON AN.id_nazione=NAZIONE.id)
HAVING 1=1 AND
AN.deleted=0 AND
AN.idanagrafica IN (SELECT idanagrafica FROM an_tipianagrafiche_anagrafiche WHERE idtipoanagrafica=1)
2018-06-26 14:30:26 +02:00
ORDER BY AN.ragione_sociale';
2018-05-18 23:42:20 +02:00
2018-06-26 14:30:26 +02:00
$results = $dbo->fetchArray($q);
2018-05-18 23:42:20 +02:00
break;
}
return [
2018-06-26 14:30:26 +02:00
'an_anagrafiche',
'clienti',
];