I have array Multidimention, that i designed to master to detail information.
This array Looked like this :
Array
(
[BSIU2473289] => Array
(
[0] => Array
(
[ID_BARANG] => 13649
[THICK] => 0.70
[SIZE] => 0.70MM X 151.8MM
[COIL_NO] => 02NKXTL16064945/48
[NET] => 2772
[GROSS] => 2808
[CONTRACT_NO] => N512C56LJ02
[LOCATION] =>
[NO_URUT] => 5785
)
[1] => Array
(
[ID_BARANG] => 13657
[THICK] => 0.70
[SIZE] => 0.70MM X 151.8MM
[COIL_NO] => 02NKXTL16065029/36
[NET] => 3512
[GROSS] => 3552
[CONTRACT_NO] => N512C56LJ02
[LOCATION] =>
[NO_URUT] => 5784
)
)
)
I want to create a report based this array :
REPORT DUMMY
No : BSIU2473289
CONTAINS :
[ID_BARANG] => 13649
[THICK] => 0.70
[SIZE] => 0.70MM X 151.8MM
[COIL_NO] => 02NKXTL16064945/48
[NET] => 2772
[GROSS] => 2808
[CONTRACT_NO] => N512C56LJ02
[LOCATION] =>
[NO_URUT] => 5785
[CONTAINER] => BSIU2473289
So on, so on.
How can I make the looping like this ?
<?php foreach ($result as $row): ?>
<div class="container">
<div class="header" >
<!--<img src="D:\xampp\htdocs\develop_tsurumaru\assets\admin\img\logo_tli_web.png">-->
<!-- <img src="./assets/admin/img/logo_tli_web.jpg"> -->
</div>
<div class="document-title" style='margin-top : 120px;'>
<hr>
<h1>Check List<br>Check Sheet for PT. Hanwa Indonesia </h1>
</div>
<div class="master" style="width: 40%; display: inline-block">
<table class="table" style="border: none;">
<tr style="border:none">
<td style="height:20px; border: none; text-align: left; width: 30%;">Container No</td>
<td style="border: none; width:5%;">: </td>
<td style="border: none; text-align: left; vertical-align: middle;"><?php echo BSIU243289 ?></td>
</tr>
</table>
</div>
<div style="padding-top : -100px" >
<table>
<thead>
<tr>
<th rowspan="2">NO</th>
<th rowspan="2" style="width: 20%">SIZE</th>
<th rowspan="2" style="width: 18%">CODE OF COIL</th>
<th rowspan="2">WGHT (NET)</th>
<th rowspan="2">WGHT (GROSS)</th>
<th rowspan="2"style="width: 8%">CONTRACT NO</th>
<th rowspan="2">LOCATION</th>
<th colspan="3">DENT</th>
<th rowspan="2">WET</th>
<th rowspan="2" style="font-size: smaller">NO<br>DMG</th>
<th rowspan="2">OTH</th>
<th rowspan="2">NO URUT</th>
</tr>
<tr>
<th style="width: 3%">In</th>
<th style="width: 3%">Out</th>
<th style="width: 3%">End</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$total_net = 0;
$total_gross = 0;
?>
<?php foreach ($row as $key => $value) : ?>
<?php
echo "<tr>";
echo "<td>$i</td>";
echo "<td>". $value['SIZE'] . "</td>";
echo "<td>". $value['COIL_NO'] . "</td>";
echo "<td>". $value['NET'] . "</td>";
echo "<td>". $value['GROSS'] . "</td>";
echo "<td>". $value['CONTRACT_NO'] . "</td>";
echo "<td>". $value['LOCATION'] . "</td>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td>". $value['NO_URUT'] . "</td>";
echo "</tr>";
$total_net += $value['NET'];
$total_gross = $value['GROSS'];
$i++;
?>
<?php endforeach; ?>
<tr>
<td colspan="3">Total :</td>
<td><?= $total_net ?></td>
<td><?= $total_gross ?></td>
<td colspan="9"></td>
</tr>
</tbody>
</table>
</div>
</tbody>
</table>
</div>
</body>