query('SELECT i.item_code, i.call_number, loc.location_name, stat.*, i.site FROM item AS i LEFT JOIN mst_item_status AS stat ON i.item_status_id=stat.item_status_id LEFT JOIN mst_location AS loc ON i.location_id=loc.location_id WHERE i.biblio_id='.$id); if ($copy_q->num_rows < 1) { echo ''.__('There is no item/copy for this title yet').''; } else { echo ''; while ($copy_d = $copy_q->fetch_assoc()) { // check if this collection is on loan $loan_stat_q = $dbs->query('SELECT due_date FROM loan AS l LEFT JOIN item AS i ON l.item_code=i.item_code WHERE l.item_code=\''.$copy_d['item_code'].'\' AND is_lent=1 AND is_return=0'); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } echo '
'.$copy_d['item_code'].''.$copy_d['call_number'].''.$copy_d['location_name']; if (trim($copy_d['site']) != "") { echo ' ('.$copy_d['site'].')'; } echo ''; /* DEPRECATED $_rules = @unserialize($copy_d['rules']); */ if ($loan_stat_q->num_rows > 0) { $loan_stat_d = $loan_stat_q->fetch_row(); echo ''.__('Currently On Loan (Due on').date($sysconf['date_format'], strtotime($loan_stat_d[0])).')'; //mfc } else if ($copy_d['no_loan']) { echo ''.__('Available but not for loan').' - '.$copy_d['item_status_name'].''; } else { echo ''.__('Available').(trim($copy_d['item_status_name'])?' - '.$copy_d['item_status_name']:'').''; } $loan_stat_q->free_result(); echo '
'; } } }