query(sprintf("SELECT L.loan_id, b.title, ct.coll_type_name, i.item_code, L.loan_date, L.due_date, L.return_date, L.renewed, IF(lr.reborrow_limit IS NULL, IF(L.renewed>=mt.reborrow_limit, 1, 0), IF(L.renewed>=lr.reborrow_limit, 1, 0)) AS extend FROM loan AS L LEFT JOIN item AS i ON L.item_code=i.item_code LEFT JOIN mst_coll_type AS ct ON i.coll_type_id=ct.coll_type_id LEFT JOIN member AS m ON L.member_id=m.member_id LEFT JOIN mst_member_type AS mt ON m.member_type_id=mt.member_type_id LEFT JOIN mst_loan_rules AS lr ON mt.member_type_id=lr.member_type_id AND i.coll_type_id = lr.coll_type_id LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id WHERE L.is_lent=1 AND L.is_return=0 AND L.member_id='%s'", $memberID)); // query modified by Indra Sutriadi // create table object $loan_list = new simbio_table(); $loan_list->table_attr = 'align="center" width="100%" cellpadding="3" cellspacing="0"'; $loan_list->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; $loan_list->highlight_row = true; // table header $headers = array(__('Return'), __('Extend'), __('Item Code'), __('Title'), __('Col. Type'), __('Loan Date'), __('Due Date')); $loan_list->setHeader($headers); // row number init $row = 1; $is_overdue = false; /* modified by Indra Sutriadi */ $circulation->ignore_holidays_fine_calc = $sysconf['ignore_holidays_fine_calc']; $circulation->holiday_dayname = $_SESSION['holiday_dayname']; $circulation->holiday_date = $_SESSION['holiday_date']; /* end of modification */ while ($loan_list_data = $loan_list_query->fetch_assoc()) { // alternate the row color $row_class = ($row%2 == 0)?'alterCell':'alterCell2'; // return link $return_link = ' '; // extend link // check if membership already expired if ($_SESSION['is_expire']) { $extend_link = ' '; } else { // check if this loan just already renewed if ($loan_list_data['return_date'] == date('Y-m-d') || in_array($loan_list_data['loan_id'], $_SESSION['reborrowed']) || $loan_list_data['extend'] == 1) { $extend_link = ' '; } else { $extend_link = ' '; } } // renewed flag if ($loan_list_data['renewed'] > 0) { $loan_list_data['title'] = $loan_list_data['title'].' - '.__('Extended').''; } // check for overdue $curr_date = date('Y-m-d'); $overdue = $circulation->countOverdueValue($loan_list_data['loan_id'], $curr_date); if ($overdue) { $is_overdue = true; $loan_list_data['title'] .= '