$orders) { $html .= '' . '' . '' . '' ; foreach($orders as $order) { $html .= '' ; } $html .= '' . '' . ''; foreach($categoriesArray as $category) { if($category) { $html .= '' ; } foreach($productsArray as $product) { if(($category && $product->id_product_category == $category->id) || (!$category && !$product->id_product_category)) { $html .= line_product($product, $orders) ; } } } $html .= '' .'
' .'
'.$order->getStrUser().'
' //.'
'.number_format($order->amount_with_tax, 2) .' €
' .'
'.$category->name.'
' ; $html .= '' ; $html .= '' . '' . '' . '' . '' . '' . '' . '' . ''; foreach($orders as $order) { $html .= '' ; $strUser = $order->getStrUser() ; if($producer->option_order_reference_type == Producer::ORDER_REFERENCE_TYPE_YEARLY && $order->reference && strlen($order->reference) > 0) { $strUser .= '
'.$order->reference ; } $html .= '' ; $contactUser = '' ; if($order->user) { $contactUser .= $order->user->phone.'
'.$order->user->email ; } $html .= '' ; $html .= '' ; $html .= '' ; $html .= '' ; } $html .= '
ClientContactCommentaireMontant
'.$strUser.''.$contactUser.''.nl2br($order->comment).''.number_format($order->amount_with_tax, 2) .' €
' ; $html .= '' ; } echo($html) ; function line_product($product, $orders) { $html = '' ; $html .= '' ; $html .= ''.$product->name.'' ; foreach($orders as $order) { $quantity = '' ; foreach($order->productOrder as $productOrder) { if($product->id == $productOrder->id_product) { $unit = (Product::strUnit($productOrder->unit, 'wording_short', true) == 'p.') ? '' : ' '.Product::strUnit($productOrder->unit, 'wording_short', true) ; $quantity .= $productOrder->quantity .$unit ; if($productOrder->quantity > 1) { $quantity = ''.$quantity.'' ; } } } $html .= ''.$quantity.'' ; } $html .= '' ; return $html ; }