@@ -274,10 +274,7 @@ public function retrieveRecord($id)
274274 idstatointervento AS id_stato_intervento,
275275 idpagamento AS id_pagamento,
276276 informazioniaggiuntive AS informazioni_aggiuntive,
277- IF(idsede_destinazione = 0, NULL, idsede_destinazione) AS id_sede,
278- firma_file,
279- IF(firma_data = '0000-00-00 00:00:00', '', firma_data) AS firma_data,
280- firma_nome
277+ IF(idsede_destinazione = 0, NULL, idsede_destinazione) AS id_sede
281278 FROM in_interventi
282279 WHERE in_interventi.id = " .prepare ($ id );
283280
@@ -336,15 +333,6 @@ protected function aggiornaRecord($record, $data)
336333 $ record ->idsede_destinazione = $ data ['id_sede ' ] ?: 0 ;
337334 $ record ->idpagamento = $ data ['id_pagamento ' ] ?: 0 ;
338335
339- // Salvataggio firma eventuale
340- if (empty ($ record ->firma_nome ) && !empty ($ data ['firma_nome ' ])) {
341- $ record ->firma_nome = $ data ['firma_nome ' ];
342- $ record ->firma_data = $ data ['firma_data ' ];
343-
344- // Salvataggio fisico
345- $ firma_file = $ this ->salvaFirma ($ data ['firma_contenuto ' ]);
346- $ record ->firma_file = $ firma_file ;
347- }
348336
349337 // Aggiornamento degli impianti collegati
350338 $ database ->query ('DELETE FROM my_impianti_interventi WHERE idintervento = ' .prepare ($ record ->id ));
@@ -371,19 +359,4 @@ protected function aggiornaRecord($record, $data)
371359 }
372360 }
373361
374- protected function salvaFirma ($ firma_base64 )
375- {
376- // Salvataggio firma
377- $ firma_file = 'firma_ ' .time ().'.png ' ;
378-
379- $ data = explode (', ' , (string ) $ firma_base64 );
380-
381- $ manager = ImageManager::gd ();
382- $ img = $ manager ->read (base64_decode ($ data [1 ]));
383- $ img ->scale (680 , 202 );
384-
385- $ img ->save (base_dir ().'/files/interventi/ ' .$ firma_file );
386-
387- return $ firma_file ;
388- }
389362}
0 commit comments