Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //funzione che si occupa di prendere $html e spezzarlo in modo da gestire la divisione della fattura
- function BreakTabellaProdotti($html)
- {
- //Stringa che concatena tutta la lista degli oggetti
- $Prodotti;
- //INIZIO HTML
- //$re = "/<ciaobella>(.*)<\\/ciaobella>/sm";
- $re = "/<start>(.*)<\\/start>/sm";
- preg_match($re, $html, $matches);
- $start = $matches[1];
- //HEADER
- $te = "/<header>(.*)<\\/header>/sm";
- preg_match($te, $html, $matchesA);
- $head = $matchesA[1];
- //FOOTER
- $xj = "/<footer>(.*)<\\/footer>/sm";
- preg_match($xj, $html, $matchesC);
- $foot = $matchesC[1];
- //FINE HTML
- $xe = "/<end>(.*)<\\/end>/sm";
- preg_match($xe, $html, $matchesB);
- $end = $matchesB[1];
- //break di pagina
- $break = '<p style="page-break-after: always">CIAO</p>';
- //Inizio Tabella prodotti
- $tabInizio = '<table width = "1445" border="1" rules = "cols" frame ="box" class = "type16">';
- //DESCRIZIONE PRODOTTI
- $ty = "/<descr>(.*)<\\/descr>/sm";
- preg_match($ty, $html, $matchesC);
- $descrz = $matchesC[1];
- //Fine Tabella prodotti
- $tabFine = '</table>';
- //PRODOTTI Trovati
- $pr = "/<riga>(.*)<\\/riga>/sm";
- $v = preg_match($pr, $html, $matchesP);
- //righe vuote per fattura IVA dei prodotti
- $vuotaIVA = '';
- // Inizio creazione prima parte della tabella
- // $superhtml = $start.$head.$tabInizio.$descrz.$tabFine;
- for ($i = 1 ; $i < 10 ; $i++)
- {
- $Prodotti =$Prodotti.$matchesP[$i];
- }
- //numero ci righe vuote da stampare
- // $t=20;
- //$i = 1;
- $pag=1;
- //funzione per la creazione della tabella dei prodotti , max elementi per pagina : 28
- /* do
- {
- $Prodotti =$Prodotti.$matchesP[$i];
- // $t--;
- if( (($pag *20)==$i) )
- {
- $pag++;
- $superhtml = $superhtml.$Prodotti.$tabFine.$foot.$break.$head.$tabInizio.$descrz;
- //$Prodotti ='';
- //$t = 20;
- }
- $i++;
- while($matchesP[$i] != null);*/
- /* if($t >0)
- {
- $superhtml = $superhtml.$Prodotti
- }*/
- // $superhtml = $superhtml.$Prodotti.$tabFine.$foot.$end;
- //prova
- $superhtml = $start.$head.$tabInizio.$descrz.$Prodotti.$tabFine.$v;
- return $superhtml;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement