<?php error_reporting(0);
//print_mz($col);
?>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
    
    

<table border="1">
    <tr>
        <td>No</td>
        <?php
        //print_mz($col);
        foreach($col as $cols=>$val){?>
        <?php if($val[0]!=='ID'){?>
        <td><?php echo $val[0] ?></td><?php }?>
        <?php } ?>
    </tr>
    <?php
    //error_reporting(E_ALL);
    //print_mz($q);
    //$oi=$q->row_array();
    //print_mz($oi);
    $a=1; foreach($lastq as $rs){
       // print_mz($rs);
        ?>
    <tr>
        
        <td><?php echo $a?></td>
        <?php
        //print_mz($col);
        foreach($col as $cols=>$val) {?>
        <?php if($val[0]!=='ID' && $val[0]!=='Produk'){?>
        <td><?php echo $rs[$cols] ?></td><?php } 
        elseif($val[0]=='Produk'){
            
                                    $pr=GetAll('activity_sales_detail',array('activity'=>'where/'.$rs['id']));
                                    //lastq();
                                    $produkz=array();
                                    foreach($pr->result_array() as $prdk){
                                        $produkz[]=GetValue('title','master_produk',array('id'=>'where/'.$prdk['produk']));
                                    }
                                    $produk=implode(',',$produkz);
            
            ?>
        <td><?php echo $produk?></td><?php }?>
        <?php } ?>
    </tr>
    <?php $a++;}?>
</table>
    
</body>
</html>