$monthDis = $filterOptions->filterFields['month']->displayVal(); $year = $filterOptions->filterFields['year']->val; $stName = $student->get_a_tag($student->name()); if (!$feeVouchers) { $html->echoError("No vouchers are saved for {$stName} for {$monthDis} {$year}"); } else { // hidden inputs for editable fields: $html->echoHiddenInputs(new Fee_voucher()); $html->echoHiddenInputs(new Fee_voucher_datail()); $html->echoHiddenInputs(new Fine_record()); $html->echoHiddenInputs(new Last_class_arrear()); // find voucher $stId = $student->id->val; $month = $filterOptions->filterFields['month']->val; $cond = "student_id = {$stId} AND month = '{$month}' AND year = {$year}"; if ($voucher = Fee_voucher::findByCondition($cond)) { // there should be only one voucher for one month if (count($voucher) > 1) { $html->echoError("More than one vouchers are saved for {$stName} for {$monthDis} {$year}"); } else { $voucher = array_shift($voucher); $voucher->showMarkup(); } } else { $html->echoError("No vouchers are saved for {$stName} for {$monthDis} {$year}"); } } if ($count % $vOptions->numCopiesPerPage == 0) { $html->pageBreak(); } // two vouchers per page