echo 'location.href = \'loan.php\';';
    echo '</script>';
    exit;
}
// quick return proccess
if (isset($_POST['quickReturnID']) and $_POST['quickReturnID']) {
    // get loan data
    $loan_info_q = $dbs->query("SELECT l.*,m.member_id,m.member_name,b.title FROM loan AS l\n        LEFT JOIN item AS i ON i.item_code=l.item_code\n        LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id\n        LEFT JOIN member AS m ON l.member_id=m.member_id\n        WHERE l.item_code='" . $dbs->escape_string($_POST['quickReturnID']) . "' AND is_lent=1 AND is_return=0");
    if ($loan_info_q->num_rows < 1) {
        echo '<div class="errorBox">' . __('This is item already returned or not exists in loan database') . '</div>';
    } else {
        $return_date = date('Y-m-d');
        // get data
        $loan_d = $loan_info_q->fetch_assoc();
        // create circulation object
        $circulation = new circulation($dbs, $loan_d['member_id']);
        // check for overdue
        $overdue = $circulation->countOverdueValue($loan_d['loan_id'], $return_date);
        // check overdue
        if ($overdue) {
            $msg = str_replace('{overdueDays}', $overdue['days'], __('OVERDUED for {overdueDays} days(s) with fines value of'));
            //mfc
            $loan_d['title'] .= '<div style="color: red; font-weight: bold;">' . $msg . $overdue['value'] . '</div>';
        }
        // return item
        $return_status = $circulation->returnItem($loan_d['loan_id']);
        if ($return_status === ITEM_RESERVED) {
            // get reservation data
            $reserve_q = $dbs->query('SELECT r.member_id, m.member_name
                FROM reserve AS r
                LEFT JOIN member AS m ON r.member_id=m.member_id
Exemple #2
0
    if (confirmBox) {
        // fill the hidden form value
        document.loanHiddenForm.process.value = strProcess;
        document.loanHiddenForm.loanID.value = intLoanID;
        // submit hidden form
        document.loanHiddenForm.submit();
    }
}
</script>
<!--loan specific javascript functions end-->
<?php 
// check if there is member ID
if (isset($_SESSION['memberID'])) {
    $memberID = trim($_SESSION['memberID']);
    $circulation = new circulation($dbs, $memberID);
    $loan_list_query = $dbs->query(sprintf("SELECT L.loan_id, b.title, ct.coll_type_name,\n        i.item_code, L.loan_date, L.due_date, L.return_date, L.renewed,\n        IF(lr.reborrow_limit IS NULL, IF(L.renewed>=mt.reborrow_limit, 1, 0), IF(L.renewed>=lr.reborrow_limit, 1, 0)) AS extend\n        FROM loan AS L\n        LEFT JOIN item AS i ON L.item_code=i.item_code\n        LEFT JOIN mst_coll_type AS ct ON i.coll_type_id=ct.coll_type_id\n        LEFT JOIN member AS m ON L.member_id=m.member_id\n        LEFT JOIN mst_member_type AS mt ON m.member_type_id=mt.member_type_id\n        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\n        LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id\n        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'];