exit; } $PSBar->end(); // Query $db = new xdb("sar_grup", "", "lokasi='{$lok}'"); $t = $xtable->use_db($db, $xtable->pageorder_sql('kode', 'nama')); $xtable->btnbar_begin(); $xtable->btnbar_add(); echo '<div class="sfont" style="float:right;margin-top:4px">Total aset: ' . fRp(lokasi_aset($lok)) . '</div>'; $xtable->btnbar_end(); if ($xtable->ndata > 0) { // Table head $xtable->head('@kode', '@nama Grup barang', 'Jumlah unit~C', 'Unit tersedia~C', 'Unit dipinjam~C', 'Total aset~R', 'Keterangan'); $nom = 1; while ($r = mysql_fetch_array($t)) { $xtable->row_begin($r['replid']); $n = mysql_num_rows(mysql_query("SELECT replid FROM sar_barang WHERE grup='" . $r['replid'] . "'")); $xtable->td($r['kode'], 100); $xtable->td($r['nama'], 200); $xtable->td($n, 100, 'c'); $xtable->td(0, 100, 'c'); $xtable->td(0, 100, 'c'); $xtable->td(fRp(grup_aset($r['replid'])), 120, 'r'); $xtable->td(nl2br($r['keterangan'])); $xtable->opt($r['replid'], 'v', 'u', 'd'); $xtable->row_end(); } $xtable->foot(); } else { $xtable->nodata(); }
function lokasi_aset($d) { $n = 0; $t = mysql_query("SELECT replid FROM sar_grup WHERE lokasi='{$d}'"); while ($r = mysql_fetch_array($t)) { $n += grup_aset($r['replid']); } return $n; }
$t = $xtable->use_db($db, $xtable->pageorder_sql('kode', 'nama')); $xtable->btnbar_f(iBtn('Inventory', 'bi_arrow', 'title="Kembali ke inventaris" onclick="katalog_back()"')); hiddenval('opf', 'kat'); ?> <div class="tbltopmbar" style="float:left;margin-top:10px"> <table class="stable" cellspacing="0" cellpadding="0" width="100%"> <tr height="30px"><td colspan="2" align="center" style="font-size:15px">Grup Barang <b><?php echo grup_name($grup); ?> </b></td></tr> <tr height="24px"><td width="100px">Lokasi:</td><td><?php echo lokasi_name($lok); ?> </td></tr> <tr height="24px"><td width="100px">Total aset:</td><td><?php echo fRp(grup_aset($grup)); ?> </td></tr> </table> </div> <?php if ($xtable->ndata > 0) { // Table head $xtable->head('@kode', '@nama barang', 'jenis', 'Jumlah unit~R', 'Aset~R', 'penyusutan<br/>per tahun~R', 'keterangan', '{40px}'); while ($r = mysql_fetch_array($t)) { $xtable->row_begin(); $n = mysql_num_rows(mysql_query("SELECT replid FROM sar_barang WHERE katalog='" . $r['replid'] . "'")); $xtable->td($r['kode'], 80); $xtable->td($r['nama'], 200); $xtable->td(jenis_name($r['jenis']), 200); $xtable->td($n, 80, 'r');