Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $surat=array('kontrak 1','kontrak 2','kontrak 3');
- $detail=array(
- array(
- array('aws','invoice','sp0'),
- array('aws','invoice','sp0'),
- array('aws','invoice','sp0'),
- ),
- 2=> array(
- array('aws','invoice','sp0'),
- ),
- );
- ?><table border=1>
- <thead>
- <tr>
- <th>No</th>
- <th>KONTRAK </th>
- <th>AWS</th>
- <th>Tipe</th>
- <th>SP</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $i = 1;
- //while ($data = mysqli_fetch_array($query)) {
- foreach($surat as $id0=>$name){
- $total=count($detail[$id0]);
- $total2=$total==0?1:$total;
- echo "
- <tr>
- <td rowspan=\"".$total2."\">" . $i . "</td>
- <td rowspan=\"".$total2."\">" . $name."</td>";
- if($total==0){
- echo "<td colspan=3> </td></tr>";
- }
- else{
- $i2=0;
- foreach($detail[$id0] as $id1=>$row1){
- echo "<td>".implode("</td><td>",$row1)."</td></tr>";
- $i2++;
- if($i2<$total) echo "<tr>";
- }
- }
- $i++;
- }
- ?> </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement