I have a block of code I want to store in a variable so I could make it into a PDF using dompdf
$html = '<div class="receiptContainer">
<center>
<img src="Images/logo.png" width="175px">
<h4>GOKUJOU JAPANESE RESTAURANT</h4>
<p>Total Gas Station, Hibbard Ave., Looc,<br>Dumaguete City, 6200 Negros Oriental, Philippines <br>
09985555175 | 422-1435 <br>
<?php echo date("Y-m-d h:i:sA"); ?>
</p>
<table width="90%" style="text-align: center;">
<tr>
<th>DESCRIPTION</th>
<th>QTY</th>
<th>PRICE</th>
<th>TOTAL</th>
</tr>
<tr>
<td></td>
</tr>
<?php
$query = mysqli_query($con, "SELECT * FROM orders WHERE customerID = '".$_SESSION['customer']."' AND status = '"Checked Out"'");
while($row = mysqli_fetch_row($query)){
?>
<tr>
<td><?php echo $row[3]; ?></td>
<td><?php echo $row[5]; ?></td>
<td><?php echo $row[4]; ?></td>
<td><?php echo $row[6]; ?></td>
</tr>
<?php
}
$total = mysqli_query($con, "SELECT SUM(total) AS grandTotal FROM orders WHERE customerID = '".$_SESSION['customer']."' AND status = '"Checked Out"' GROUP BY customerID");
$row = mysqli_fetch_row($total);
$sum = $row[0];
?>
<tr>
<!-- break space -->
<tr></tr><tr></tr><tr></tr><tr></tr>
<tr></tr><tr></tr><tr></tr><tr></tr>
<tr></tr><tr></tr><tr></tr><tr></tr>
<td colspan="1" style="text-align: left">GRAND TOTAL: <?php echo $sum; ?></td>
<td colspan="3"></td>
</tr>
<tr style="text-align: left">
<td colspan="1">CASH: <?php echo $_SESSION['"cash"']; ?></td>
<td colspan="3"></td>
</tr>
<tr style="text-align: left">
<td colspan="1">CHANGE: <?php echo $_SESSION['"cash"'] - $sum; ?></td>
<td colspan="3"></td>
</tr>
</table>
</center>
</div>';
//start PDF generation
$dompdf = new Dompdf();
$dompdf->loadHTML($html);
$dompdf->setPaper(array(0, 0, 1080, 500), 'landscape');
$dompdf->render();
$dompdf->stream("samplepdf");
?>
This how I structured my code, and it returns me an error:
Parse error: syntax error, unexpected '"' in C:\xampp\htdocs\Gokujou\checkout.php on line 107
and this is line 107:
$query = mysqli_query($con, "SELECT * FROM orders WHERE customerID = '".$_SESSION['customer']."' AND status = '"Checked Out"'");
How do I concatenate this MySQL statement properly?