$value) { if (!empty($value) && starts_with($field, 'search_')) { $field_name = str_replace('search_', '', $field); $field_name = str_replace('__', ' ', $field_name); $field_name = str_replace('-', ' ', $field_name); array_push($search_filters, '`'.$field_name.'` LIKE "%'.$value.'%"'); } } } if (!empty($search_filters)) { $module_query = str_replace('2=2', '2=2 AND ('.implode(' AND ', $search_filters).') ', $module_query); } // Filtri derivanti dai permessi (eventuali) $module_query = Modules::replaceAdditionals($id_module, $module_query); $scadenze = $dbo->fetchArray($module_query); // carica report html $report = file_get_contents($docroot.'/templates/scadenzario/scadenzario.html'); $body = file_get_contents($docroot.'/templates/scadenzario/scadenzario_body.html'); include_once $docroot.'/templates/pdfgen_variables.php'; //Filtro in base al segmento $id_segment = $_SESSION['module_'.$id_module]['id_segment']; $rs_segment = $dbo->fetchArray('SELECT * FROM zz_segments WHERE id='.prepare($id_segment)); $add_where = 'AND '.$rs_segment[0]['clause']; $body .= '
Documento | \n"; $body .= "Anagrafica | \n"; $body .= "Tipo di pagamento | \n"; $body .= "Data scadenza | \n"; $body .= "Importo | \n"; $body .= "GiĆ pagato | \n"; $body .= "
---|---|---|---|---|---|
'.$scadenze[$i]['Rif. Fattura'].' '.Translator::dateToLocale($scadenze[$i]['Data emissione'])." | \n";
$body .= ' '.$scadenze[$i]['Anagrafica']." | \n"; $body .= ''.$scadenze[$i]['Tipo di pagamento']." | \n"; $body .= "".Translator::dateToLocale($scadenze[$i]['Data scadenza'])." | \n"; $body .= "".moneyFormat($scadenze[$i]['Importo'], 2)." | \n"; $body .= "".moneyFormat($scadenze[$i]['Pagato'], 2)." | \n"; $body .= "
TOTALE: | ".moneyFormat($totale_da_pagare, 2)." | ".moneyFormat($totale_pagato, 2)." | \n"; $body .= "