Email faktura linjer i php
Hej, Først og fremmest så undskyld for kodningen, jeg er stadig ny :Djeg har et lille system som gerne skulle sende en faktura afsted i en email.
Den sender mail osv, men hvis kunden har bestilt mere end 1 vare, kommer der kun den første ordre linje frem på mailen.
Anyone?
Hvis det (som det helt sikekrt kan) kan gøres mere smart, så gerne hjælp mig her :D
$invoice_info = $mysqli->query("SELECT * FROM retail_order WHERE order_id = '".$_POST[order_uni]."' Group by order_id");
while($invoice = $invoice_info->fetch_object())
{
$message5 = '
<table width="930" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr>
<td align="center"><table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" height="35"><b>Product:</b></td>
<td align="left"><b>';
$invoice_prod_name = $mysqli->query("SELECT * FROM chili_products WHERE id = '".$invoice->prod_id."'");
while($invoice_prods_name = $invoice_prod_name->fetch_object())
{
$message6 = $invoice_prods_name->product_name;
}
$message7 =
'</b></td>
</tr>
<tr>
<td colspan="2" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="17%" style="border-bottom:solid black 1px;"><b>Color</b></td>
<td width="17%" style="border-bottom:solid black 1px;"><b>Size</b></td>
<td width="17%" style="border-bottom:solid black 1px;"><b>Model</b></td>
<td width="17%" style="border-bottom:solid black 1px;"><b>Qty</b></td>
</tr>';
//HER STARTER FAKTURA LINJERNE
$query = "SELECT * FROM retail_order WHERE order_id = '".$_POST[order_uni]."'";
$result = mysql_query($query)
or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$message8 = " <tr>";
$message9 = " <td>".$row[color]."</td>";
$message10 = " <td>".$row[size]."</td>";
$message11 = " <td>".$row[model]."</td>";
$message12 = " <td>".$row[amount]."</td>";
$message13 = " </tr>";
}
// HER SLUTTER FAKTURA LINJERNE
$message14 = "
</table></td>
</tr>
</table></td>
</tr>
</table>
";
}
$mail->Body= $message5.$message6.$message7.$message8.$message9.$message10.
$message11.$message12.$message13.$message14.$message15;