query("SELECT r.*, b.title FROM reserve AS r LEFT JOIN biblio AS b ON r.biblio_id=b.biblio_id WHERE r.member_id='$memberID'"); // create table object $reserve_list = new simbio_table(); $reserve_list->table_attr = 'align="center" style="width: 100%;" cellpadding="3" cellspacing="0"'; $reserve_list->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"'; $reserve_list->highlight_row = true; // table header $headers = array(__('Remove'), __('Title'), __('Item Code'), __('Reserve Date')); $reserve_list->setHeader($headers); // row number init $row = 1; while ($reserve_list_d = $reserve_list_q->fetch_assoc()) { // alternate the row color $row_class = ($row%2 == 0)?'alterCell':'alterCell2'; // remove reserve link $remove_link = ' '; // check if item/collection is available $avail_q = $dbs->query("SELECT COUNT(loan_id) FROM loan WHERE item_code='".$reserve_list_d['item_code']."' AND is_lent=1 AND is_return=0"); $avail_d = $avail_q->fetch_row(); if ($avail_d[0] < 1) { $reserve_list_d['title'] .= ' - '.strtoupper(__('Available')).''; } // check if reservation are already expired if ( (strtotime(date('Y-m-d'))-strtotime($reserve_list_d['reserve_date']))/(3600*24) > $sysconf['reserve_expire_periode'] ) { $reserve_list_d['title'] .= ' - '.__('ALREADY EXPIRED').''; } // row colums array $fields = array( $remove_link, $reserve_list_d['title'], $reserve_list_d['item_code'], $reserve_list_d['reserve_date'] ); // append data to table row $reserve_list->appendTableRow($fields); // set the HTML attributes $reserve_list->setCellAttr($row, null, "valign='top' class='$row_class'"); $reserve_list->setCellAttr($row, 0, "valign='top' align='center' class='$row_class' style='width: 5%;'"); $reserve_list->setCellAttr($row, 1, "valign='top' class='$row_class' style='width: 70%;'"); $row++; } echo $reserve_list->printTable(); // hidden form for return and extend process echo '
'; } // get the buffered content $content = ob_get_clean(); // include the page template require SB.'/admin/'.$sysconf['admin_template']['dir'].'/notemplate_page_tpl.php';