utility::writeLogs($dbs, 'member', $_SESSION['memberID'], 'circulation', $_SESSION['realname'] . ' return item ' . $loan_d[0] . ' for member (' . $_SESSION['memberID'] . ')');
     echo '<script type="text/javascript">';
     if ($circulation->loan_have_overdue) {
         echo "\n" . 'alert(\'' . __('Overdue fines inserted to fines database') . '\');' . "\n";
     }
     if ($return_status === ITEM_RESERVED) {
         echo 'location.href = \'loan_list.php?reserveAlert=' . urlencode($loan_d[0]) . '\';';
     } else {
         echo 'location.href = \'loan_list.php\';';
     }
     echo '</script>';
 } else {
     // set holiday settings
     $circulation->holiday_dayname = $_SESSION['holiday_dayname'];
     $circulation->holiday_date = $_SESSION['holiday_date'];
     $extend_status = $circulation->extendItemLoan($loanID);
     if ($extend_status === ITEM_RESERVED) {
         echo '<script type="text/javascript">';
         echo 'alert(\'' . __('Item CANNOT BE Extended! This Item is being reserved by other member') . '\');';
         echo 'location.href = \'loan_list.php\';';
         echo '</script>';
     } else {
         // write log
         utility::writeLogs($dbs, 'member', $_SESSION['memberID'], 'circulation', $_SESSION['realname'] . ' extend loan for item ' . $loan_d[0] . ' for member (' . $_SESSION['memberID'] . ')');
         echo '<script type="text/javascript">';
         echo 'alert(\'' . __('Loan Extended') . '\');';
         if ($circulation->loan_have_overdue) {
             echo "\n" . 'alert(\'' . __('Overdue fines inserted to fines database') . '\');' . "\n";
         }
         echo 'location.href = \'loan_list.php\';';
         echo '</script>';