Separate clients in foreach with mpdf

My scenario is as follows, I generate a pdf file using the mpdf library and this pdf file is a query of intervals between client code and event date. Ex.: code: 0001 ate 0004 and 0000-00-00 ate 0000-00-00. It is generating the pdf with the result perfectly, but I need to separate the information from each client, because they are being displayed together, see the image and follow the code where I generate the pdf: insert the description of the image here

The code is here https://pastebin.com/DQrWjv3K

Thank you now

Author: SUR1C4T3, 2018-08-15

2 answers

The report is correct. I think you should just put the product loop foreach($reports as $r) inside the customer loop foreach($clients as $c), and after this product loop perform a spacing or page break with $mpdf->AddPage();, thus separating each customer with its products.

 0
Author: C. Bohok, 2018-08-16 21:40:05

Solved as follows:

Https://pastebin.com/r9MXGxSu

Thank You @C. Bohok

 0
Author: Thiago Moreira, 2018-08-17 14:08:49