// create table new_table(get_default_table('Tabella1', array(7, 19, 3.7))); add_table_header('Tabella1', array('Codice', 'Oggetto', 'Date'), make_bold($oo_ar10c)); $where = implode(' AND ', $wh); $q = mysql_query(" SELECT P.*,C.codice,C.nome \n FROM pratiche P\n\t\t\t\t\t\t\tLEFT JOIN contact C ON pr_ref_idcliente = C.id\n WHERE {$where}\n ORDER BY pr_codice ASC"); while ($l = mysql_fetch_assoc($q)) { $op = $l[pr_operatore]; $oper = is_array($OPER[$op]) ? $OPER[$op][0] . " (" . $OPER[$op][1] . ")" : ''; $valore = 'Indeterminato'; if ($l[pr_valore] == -2) { $valore = 'Indet/Extra'; } if ($l[pr_valore] > 0) { $valore = nform($l[pr_valore]); } add_table_row('Tabella1', array($l[pr_codice] . "\n\nN. " . (int) $l[pr_numero], "Repertorio n. " . $l[pr_repertorio] . "\t\t" . "Cliente: " . $l[codice] . " (" . $l[nome] . ")\n" . $l[pr_oggetto] . "\n" . "Tipo: " . $l[pr_tipo] . " (" . $PRTIPO[$l[pr_tipo]] . ")\t\t" . "Operatore: " . $oper . "\n" . "Valore: {$valore}\t\tCrit.: " . $l[pr_criterio] . "\t\tFido:" . nform($l[pr_fido]) . "\n" . "Aut. C.: " . $l[pr_comp_cod] . " . " . $l[pr_comp_desc] . "\tN.Prov: " . $l[pr_nprovv] . "\n" . "Giud: " . $l[pr_giudice] . "\t\tN.Ruol: " . $l[pr_nruolo], "Ape: " . mysql_to_date($l[pr_data_inizio]) . "\n" . "Ins: " . mysql_to_date($l[pr_data_ins]) . "\n" . "Agg: " . mysql_to_date($l[pr_data_mod])), array($oo_ar10, $oo_ar10, $oo_ar10e)); // note if ($l[note] && in_array(1, $P[print_note]) && !$rapida) { add_table_row('Tabella1', array("NOTE: " . $l[note]), $oo_ar10); } } // create content $OO_PAGE_STYLE = set_page_style($PAGE_STYLE); $OO_PAGE_HEADER = set_page_header("#DATA#\t\t\t\tELENCO PRATICHE\t\tPag.: #PAGINA#"); $OO_PAGE_FOOTER = ''; // set_page_footer('#DATA# #ORA#'); $header_style = array(color => '#000000', size => '12pt', align => 'start', face => 'Verdana'); //$footer_style = array(color => '#ffff00', size => '12pt', align => 'end', face => 'Verdana'); $OO_HEADER_STYLE = set_header_style($header_style); $OO_FOOTER_STYLE = ''; // set_footer_style($footer_style);
$p_tot_ant = nform($tot_ant * $n_val, 0, $n_dec, $n_tho); add_table_row('Tabella2', array(EXPORT_SXW_F_TOTANT, $p_tot_ant), array($oo_def, $oo_def_e)); add_table_row('Tabella2', array('', '----------------------'), array($oo_def, $oo_def_e)); $tot1 -= sprintf('%.2f', $tot_ant); } // LORDO $p_totale_lordo = nform($tot1 * $n_val, 0, $n_dec, $n_tho); add_table_row('Tabella2', array(EXPORT_SXW_F_TOTLOR, $p_totale_lordo), array($oo_def, $oo_def_e)); // RITENUTA $p_imp_irpef = nform($imp_irpef * $n_val, 0, $n_dec, $n_tho); $p_ritenuta_acconto = nform($imp_irpef * ($rit_acc / 100) * $n_val, 0, $n_dec, $n_tho); add_table_row('Tabella2', array(sprintf(EXPORT_SXW_F_RITACC, $rit_acc, $n_cod, $p_imp_irpef), $p_ritenuta_acconto), array($oo_def, $oo_def_e)); $tot1 -= $imp_irpef * ($rit_acc / 100); // TOTALE DOVUTO add_table_row('Tabella2', array('', '----------------------'), array($oo_def, $oo_def_e)); $p_totale_dovuto = nform($tot1 * $n_val, 0, $n_dec, $n_tho); add_table_row('Tabella2', array(EXPORT_SXW_F_TOTDOV, $p_totale_dovuto), array($oo_def, $oo_def_e)); // create content $OO_PAGE_STYLE = set_page_style($PAGE_STYLE); $OO_PAGE_HEADER = ''; $OO_PAGE_FOOTER = ''; $OO_HEADER_STYLE = ''; $OO_FOOTER_STYLE = ''; $OO_TABLE_STYLES = gen_table_style(); $OO_TEXT .= render_table('Tabella1'); $OO_TEXT .= print_text("\n", $oo_def); $OO_TEXT .= render_table('Tabella2'); $OO_FONT_STYLES = gen_font_style(); $url = make_sxw($filename); //print "$save_doc-".$P['dest_prat'][realval][0]."-".$P['ref_id'][realval][0]."-".$_SESSION[user][ref_prat]."<br>"; // salvataggio come documento
$PAGE_STYLE[height] = 29.7; //intestazione: info cliente // create table new_table(get_default_table('Tabella1', array(1.6, 5.7, 1.5, 1.5, 1.5, 1.7, 1.5, 1.5, 1.7, 1.4, 1.4))); add_table_header('Tabella1', array(EXPORT_SXW_TAR_COD, EXPORT_SXW_TAR_DESCIMP, EXPORT_SXW_TAR_DIR, EXPORT_SXW_TAR_STRA, EXPORT_SXW_TAR_PENA, EXPORT_SXW_TAR_CONC, EXPORT_SXW_TAR_PRET, EXPORT_SXW_TAR_TRIB, EXPORT_SXW_TAR_AMMN, EXPORT_SXW_TAR_CA, EXPORT_SXW_TAR_CC), make_bold($oo_def_c)); $where = implode(' AND ', $wh); $q = $DB->Execute(" SELECT * \r\n FROM INT_tariffe \r\n WHERE {$where}\r\n ORDER BY tatid ASC"); while ($l = $q->FetchRow()) { utf8_encode_array($l); if ($l[tat_imp_molt] == '') { $l[tat_imp_molt] = ' '; } if ($l[tat_nonimp_molt] == '') { $l[tat_nonimp_molt] = ' '; } add_table_row('Tabella1', array($l[tatid], $rapida ? $l[tat_desc] : "{$l['tat_desc']}\n" . EXPORT_SXW_SPE . ":\t" . nform($l[tat_imp]) . " ({$l['tat_imp_molt']})" . " " . nform($l[tat_nonimp]) . " ({$l['tat_nonimp_molt']})", $rapida ? '' : $l[tat_diritti], $rapida ? '' : $l[tat_stragiudiziali], $rapida ? '' : $l[tat_ccostituzionale], $rapida ? '' : $l[tat_conciliazione], $rapida ? '' : $l[tat_pretura], $rapida ? '' : $l[tat_tribunale], $rapida ? '' : $l[tat_amministrative], $rapida ? '' : $l[tat_cappello], $rapida ? '' : $l[tat_ccassazione]), array($oo_def_c, $oo_def, $oo_def_c, $oo_def_c, $oo_def_c, $oo_def_c, $oo_def_c, $oo_def_c, $oo_def_c, $oo_def_c, $oo_def_c)); } // create content $OO_PAGE_STYLE = set_page_style($PAGE_STYLE); $OO_PAGE_HEADER = set_page_header("#DATA#\t\t\t\t" . EXPORT_SXW_TIT_TAR . "\t\t\t" . EXPORT_SXW_TIT_PG . ": #PAGINA#"); $OO_PAGE_FOOTER = ''; // set_page_footer('#DATA# #ORA#'); $header_style = array(color => '#000000', size => '12pt', align => 'start', face => 'Verdana'); //$footer_style = array(color => '#ffff00', size => '12pt', align => 'end', face => 'Verdana'); $OO_HEADER_STYLE = set_header_style($header_style); $OO_FOOTER_STYLE = ''; // set_footer_style($footer_style); $OO_TABLE_STYLES = gen_table_style(); $OO_TEXT .= render_table('Tabella1'); $OO_FONT_STYLES = gen_font_style(); $url = make_sxw($filename);
// gruppi $q = $DB->Execute("\tSELECT gruppi.id,users.nome FROM gruppi,group_user,users \r\n\t\t\t\t\t\t\tWHERE groupid=gruppi.id AND userid = users.id"); while ($l = $q->FetchRow()) { $GRP[$l[id]][] = $l[nome]; } utf8_encode_array($GRP); //intestazione: info cliente // create table new_table(get_default_table('Tabella1', array(5, 8, 4, 4))); add_table_header('Tabella1', array(EXPORT_SXW_NAME, EXPORT_SXW_DESCR, EXPORT_SXW_TYPE, EXPORT_SXW_TAR), make_bold($oo_def_c)); $where = implode(' AND ', $wh); $q = $DB->Execute(" SELECT * \r\n FROM gruppi \r\n WHERE {$where}\r\n ORDER BY name ASC"); $TIPI = array(EXPORT_SXW_T_GRP, EXPORT_SXW_T_DEP, EXPORT_SXW_T_OFF); while ($l = $q->FetchRow()) { utf8_encode_array($l); add_table_row('Tabella1', array($l[name], $l[descr], $TIPI[$l[tipo]], nform($l[on_orar])), array($oo_def_c, $oo_def, $oo_def_c, $oo_def_c)); // note if (is_array($GRP[$l[id]]) && $P[print_note] == 1) { add_table_row('Tabella1', array(EXPORT_SXW_USERS . ": " . implode(", ", $GRP[$l[id]])), $oo_def); } } // create content $OO_PAGE_STYLE = set_page_style($PAGE_STYLE); $OO_PAGE_HEADER = set_page_header("#DATA#\t\t\t\t" . EXPORT_SXW_TIT_GRP . "\t\t\t" . EXPORT_SXW_TIT_PG . ": #PAGINA#"); $OO_PAGE_FOOTER = ''; // set_page_footer('#DATA# #ORA#'); $header_style = array(color => '#000000', size => '12pt', align => 'start', face => 'Verdana'); //$footer_style = array(color => '#ffff00', size => '12pt', align => 'end', face => 'Verdana'); $OO_HEADER_STYLE = set_header_style($header_style); $OO_FOOTER_STYLE = ''; // set_footer_style($footer_style);
if ($l[tat_imp_molt] == '') { $l[tat_imp_molt] = ' '; } if ($l[tat_nonimp_molt] == '') { $l[tat_nonimp_molt] = ' '; } // gruppi $gpr = ''; if (is_array($GRP[$l[id]])) { $gpr = "\n" . EXPORT_SXW_GROUPS . ": "; foreach ($GRP[$l[id]] as $g) { $gpr .= "{$g}, "; } $gpr = substr($gpr, 0, strlen($gpr) - 2); } add_table_row('Tabella1', array($l[codice], $l[nome] . $gpr, nform($l[onorario])), array($oo_def_c, $oo_def, $oo_def_c)); } // create content $OO_PAGE_STYLE = set_page_style($PAGE_STYLE); $OO_PAGE_HEADER = set_page_header("#DATA#\t\t\t\t" . EXPORT_SXW_TIT_OPER . "\t\t" . EXPORT_SXW_TIT_PG . ": #PAGINA#"); $OO_PAGE_FOOTER = ''; // set_page_footer('#DATA# #ORA#'); $header_style = array(color => '#000000', size => '12pt', align => 'start', face => 'Verdana'); //$footer_style = array(color => '#ffff00', size => '12pt', align => 'end', face => 'Verdana'); $OO_HEADER_STYLE = set_header_style($header_style); $OO_FOOTER_STYLE = ''; // set_footer_style($footer_style); $OO_TABLE_STYLES = gen_table_style(); $OO_TEXT .= render_table('Tabella1'); $OO_FONT_STYLES = gen_font_style(); $url = make_sxw($filename);