query('SELECT DISTINCT l.item_code, b.title FROM loan AS l LEFT JOIN item AS i ON l.item_code=i.item_code LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id WHERE i.item_id='.$id.' AND l.is_lent=1 AND l.is_return=0'); $loan_d = $loan_q->fetch_row(); // send an alert if the member cant be deleted if ($loan_q->num_rows > 0) { echo ''; } else { if ($sql_op->delete('item', 'item_id='.$id)) { echo ''; } else { echo ''; } } } // if biblio ID is set if ($biblioID) { $table = new simbio_table(); $table->table_attr = 'align="center" class="detailTable" style="width: 100%;" cellpadding="2" cellspacing="0"'; // database list $item_q = $dbs->query('SELECT i.item_id, i.item_code, b.title, i.site, loc.location_name, ct.coll_type_name, st.item_status_name FROM item AS i LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id LEFT JOIN mst_location AS loc ON i.location_id=loc.location_id LEFT JOIN mst_coll_type AS ct ON i.coll_type_id=ct.coll_type_id LEFT JOIN mst_item_status AS st ON i.item_status_id=st.item_status_id WHERE i.biblio_id='.$biblioID); $row = 1; while ($item_d = $item_q->fetch_assoc()) { // alternate the row color $row_class = ($row%2 == 0)?'alterCell':'alterCell2'; // links $edit_link = 'Edit'; $remove_link = 'Delete'; $title = $item_d['item_code']; $table->appendTableRow(array($edit_link, $remove_link, $title, $item_d['location_name'], $item_d['site'], $item_d['coll_type_name'], $item_d['item_status_name'])); $table->setCellAttr($row, null, 'class="'.$row_class.'" style="font-weight: bold; width: auto;"'); $table->setCellAttr($row, 0, 'class="'.$row_class.'" style="font-weight: bold; width: 5%;"'); $table->setCellAttr($row, 1, 'class="'.$row_class.'" style="font-weight: bold; width: 10%;"'); $table->setCellAttr($row, 2, 'class="'.$row_class.'" style="font-weight: bold; width: 40%;"'); $row++; } echo $table->printTable(); // hidden form echo '
'; } /* main content end */ $content = ob_get_clean(); // include the page template require SB.'/admin/'.$sysconf['admin_template']['dir'].'/notemplate_page_tpl.php';