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:
The code is here https://pastebin.com/DQrWjv3K
Thank you now
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.