You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WHERE `mg_movimenti`.`idutente` = '.prepare($id_utente).'
65
+
AND `mg_movimenti`.`data` BETWEEN '.prepare($inizio_giorno).' AND '.prepare($fine_giorno);
66
+
67
+
$records = database()->fetchArray($query);
68
+
69
+
return$this->mapModifiedRecords($records);
37
70
}
38
71
39
72
publicfunctionretrieveRecord($id)
40
73
{
41
-
return [];
74
+
// Recupera l'ID utente loggato per sicurezza
75
+
$user = auth_osm()->getUser();
76
+
$id_utente = $user->id;
77
+
78
+
// Query per recuperare il dettaglio del movimento
79
+
$query = 'SELECT
80
+
`mg_movimenti`.`id`,
81
+
`mg_movimenti`.`idarticolo` AS id_articolo,
82
+
`mg_movimenti`.`qta`,
83
+
`mg_movimenti`.`movimento` AS descrizione,
84
+
`mg_movimenti`.`data`,
85
+
`mg_movimenti`.`idsede` AS id_sede_azienda,
86
+
`mg_movimenti`.`idutente` AS id_utente,
87
+
`mg_movimenti`.`manuale`
88
+
FROM
89
+
`mg_movimenti`
90
+
LEFT JOIN `mg_articoli` ON `mg_movimenti`.`idarticolo` = `mg_articoli`.`id`
91
+
LEFT JOIN `mg_articoli_lang` ON (`mg_articoli`.`id` = `mg_articoli_lang`.`id_record` AND `mg_articoli_lang`.`id_lang` = '.prepare(\Models\Locale::getDefault()->id).')
92
+
WHERE
93
+
`mg_movimenti`.`id` = '.prepare($id).'
94
+
AND `mg_movimenti`.`idutente` = '.prepare($id_utente);
0 commit comments