Cara mengeluarkan Jumlah Item berdasarkan Tipe Koleksi

Halo, kali ini saya mau berbagai cara mengeluarkan jumlah item berdasarkan Tipe Koleksi di SLiMS.

Hal ini bertujuan untuk memberikan informasi kepada pemustaka mengenai jumlah koleksi perpustakaan berdasarkan Tipe Koleksi, tentu saja ini di tampilkan pada OPAC.

Berikut Screenshootnya

Screenshot at 2018-04-28 06:42:00

Berikut Script PHPnya

<?php
// query librarian data

$coll_q = $dbs->query(‘
SELECT mc.coll_type_name, COUNT(b.biblio_id) AS hasil FROM mst_coll_type AS mc
LEFT JOIN item AS i ON mc.coll_type_id= i.coll_type_id
LEFT JOIN biblio AS b ON i.biblio_id= b.biblio_id
GROUP BY mc.coll_type_name ASC’);
if ($coll_q->num_rows > 0) {
while ($colltype = $coll_q->fetch_assoc()) {
$aut = $colltype[‘coll_type_name’];
$r_aut = str_replace(‘,’,’ ‘,$aut);

$value = 3;
$last_name = implode(” “, array_slice(explode(” “, $r_aut),0,$value));

echo ‘<p><a href=”index.php?title=&author=&subject=&isbn=&colltype=’.$last_name.’&location=0&gmd=0&searchtype=advance&search=search”> <i class=”ti ti-bookmark”>’.$last_name.’&nbsp&nbsp<span class=”badge”>’.$colltype[‘hasil’].'</span></a></p>’;

}
} else {
echo ‘<p>No Librarian data yet</p>’;
echo ‘</div>’;
}
?>

Happy Coding!

Leave a Reply

Your email address will not be published. Required fields are marked *