各位前輩好
我有做個訂單資訊
我目前的code會使總資訊出現在每一筆細項的下方
如果我只想一筆訂單出現一次總資訊
請問我的做法要怎麼改呢?
我目前有想到foreach
可是條件式 as 那邊不知道要怎麼放
圖片是長這樣 應該知道我在說什麼了吧QQ
http://i.imgur.com/agCkAGB.jpg
<?php while ($drow = $drs->fetch_assoc()): ?>
<table class="rwd-table table-bordered table-responsive">
<tr >
<th>訂單編號</th>
<th>商品明細</th>
<th>數量</th>
<th>價格</th>
</tr>
<tr>
<td data-th="訂單編號" class="product-num"><?=
$drow['sid'] ?></td>
<td data-th="商品明細" class="product"><p><?=
$drow['product_name'] ?></p></td>
<td data-th="數量" class="product-howmany"><p><?=
$drow['qty'] ?></p></td>
<td data-th="價格" class="product-price"><p><?=
$drow['price'] ?></p></td>
</tr>
</table>
<div class="total">
<p>共 <?= $drow['totalqty'] ?> 項產品</p><br>
<p>總金額: <?= $drow['total'] ?></p>
<p>配送方式:<?= $drow['delivery'] ?></p>
<p>付款方式:<?= $drow['payment'] ?></p>
<p>寄送地址:<?= $drow['address'] ?></p><br>
</div>
<?php endwhile; ?>