Esempio n. 1
0
<?php

include_once '../models/transaksi.php';
include_once '../inc/functions.php';
$list_data = pemesanan_plant_load_data();
foreach ($list_data['data'] as $key => $data) {
    ?>
<tr class="tr_rows">
    <td align=center><?php 
    echo ++$key;
    ?>
</td>
    <td>&nbsp;<?php 
    echo $data->nama_barang;
    ?>
 <input type=hidden name=id_barang[] value="<?php 
    echo $data->id_barang;
    ?>
" class=id_barang id=id_barang<?php 
    echo $key;
    ?>
 /></td>
    <td align=center><input type=hidden name=harga_jual[] id="harga_jual<?php 
    echo $key;
    ?>
" /> <input type=hidden name=isi_satuan[] id="isi_satuan<?php 
    echo $key;
    ?>
" /> <select name=kemasan[] id="kemasan<?php 
    echo $key;
    ?>
        <th width="5%">Jumlah</th>
        <th width="2%">#</th>
    </tr>
</thead>
<tbody>
    <?php 
$limit = 10;
$page = $_GET['page'];
if ($_GET['page'] === '') {
    $page = 1;
    $offset = 0;
} else {
    $offset = ($page - 1) * $limit;
}
$param = array('id' => $_GET['id_pemesanan_plant'], 'limit' => $limit, 'start' => $offset, 'list' => TRUE, 'search' => $_GET['search']);
$pemesanan_plant = pemesanan_plant_load_data($param);
$list_data = $pemesanan_plant['data'];
$total_data = $pemesanan_plant['total'];
$no = 1;
$sp = "";
foreach ($list_data as $key => $data) {
    $rows = get_distributor_by_barang($data->id_barang);
    ?>
        <tr class="<?php 
    echo $key % 2 == 0 ? 'even' : 'odd';
    ?>
">
            <td align="center"><?php 
    echo $sp !== $data->id ? $no + $offset : NULL;
    ?>
</td>