コード例 #1
0
ファイル: StudentFees.php プロジェクト: SoftScape/opensis
    } else {
        $columns = array();
    }
    $columns += array('TITLE' => _('Fee'), 'AMOUNT' => _('Amount'), 'ASSIGNED_DATE' => _('Assigned'), 'DUE_DATE' => _('Due'), 'COMMENTS' => _('Comment'));
    if (!$_REQUEST['print_statements']) {
        $link['add']['html'] = array('REMOVE' => button('add'), 'TITLE' => _makeFeesTextInput('', 'TITLE'), 'AMOUNT' => _makeFeesTextInput('', 'AMOUNT'), 'ASSIGNED_DATE' => ProperDate(DBDate()), 'DUE_DATE' => _makeFeesDateInput('', 'DUE_DATE'), 'COMMENTS' => _makeFeesTextInput('', 'COMMENTS'));
    }
    if (!$_REQUEST['print_statements']) {
        echo "<FORM action=Modules.php?modname={$_REQUEST['modname']} method=POST>";
        DrawStudentHeader();
        if (AllowEdit()) {
            DrawHeader('', '<INPUT type=submit value=' . _('Save') . '>');
        }
        $options = array();
    } else {
        $options = array('center' => false);
    }
    ListOutput($RET, $columns, _('Fee'), _('Fees'), $link, array(), $options);
    if (!$_REQUEST['print_statements'] && AllowEdit()) {
        echo '<CENTER><INPUT type=submit value=' . _('Save') . '></CENTER>';
    }
    echo '<BR>';
    if (!$_REQUEST['print_statements']) {
        $payments_total = DBGet(DBQuery("SELECT SUM(p.AMOUNT) AS TOTAL FROM BILLING_PAYMENTS p WHERE p.STUDENT_ID='" . UserStudentID() . "' AND p.SYEAR='" . UserSyear() . "'"));
        $table = '<TABLE><TR><TD align=' . ALIGN_RIGHT . '>' . _('Total from Fees:') . ' ' . str_replace(SystemPreferences('CURRENCY'), SystemPreferences('CURRENCY') . '</TD><TD align=' . ALIGN_RIGHT . '>', Currency($fees_total)) . '</TD></TR>';
        $table .= '<TR><TD align=' . ALIGN_RIGHT . '>' . _('Less: Total from Payments:') . ' ' . str_replace(SystemPreferences('CURRENCY'), SystemPreferences('CURRENCY') . '</TD><TD align=' . ALIGN_RIGHT . '>', Currency($payments_total[1]['TOTAL'])) . '</TD></TR>';
        $table .= '<TR><TD align=' . ALIGN_RIGHT . '>' . _('Balance:') . ' <b>' . str_replace(SystemPreferences('CURRENCY'), SystemPreferences('CURRENCY') . '</b></TD><TD align=' . ALIGN_RIGHT . '><b>', Currency($fees_total - $payments_total[1]['TOTAL'], 'CR')) . '</b></TD></TR></TABLE>';
        DrawHeader('', '', $table);
        echo '</FORM>';
    }
}
コード例 #2
0
ファイル: DailyTotals.php プロジェクト: SoftScape/opensis
* @copyright Copyright (C) 2006 Andrew Schmadeke. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* Focus/SIS is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.txt for copyright notices and details.
*/
DrawHeader(ProgramTitle());
if ($_REQUEST['day_start'] && $_REQUEST['month_start'] && $_REQUEST['year_start']) {
    $start_date = $_REQUEST['day_start'] . '-' . $_REQUEST['month_start'] . '-' . $_REQUEST['year_start'];
} else {
    $start_date = '01-' . strtoupper(date('M-y'));
}
if ($_REQUEST['day_end'] && $_REQUEST['month_end'] && $_REQUEST['year_end']) {
    $end_date = $_REQUEST['day_end'] . '-' . $_REQUEST['month_end'] . '-' . $_REQUEST['year_end'];
} else {
    $end_date = DBDate();
}
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']} method=POST>";
DrawHeader(' &nbsp; &nbsp; <B>' . _('Report Timeframe') . ': </B>' . PrepareDate($start_date, '_start') . ' - ' . PrepareDate($end_date, '_end'), '<INPUT type=submit value=' . _('Go') . '>');
echo '</FORM>';
$billing_payments = DBGet(DBQuery("SELECT sum(AMOUNT) AS AMOUNT FROM BILLING_PAYMENTS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND PAYMENT_DATE BETWEEN '{$start_date}' AND '{$end_date}'"));
$billing_fees = DBGet(DBQuery("SELECT sum(f.AMOUNT) AS AMOUNT FROM BILLING_FEES f WHERE AND f.SCHOOL_ID='" . UserSchool() . "' AND f.ASSIGNED_DATE BETWEEN '{$start_date}' AND '{$end_date}'"));
PopTable('header', _('Totals'));
echo '<TABLE border=0 cellpadding=0 cellspacing=0>';
echo '<TR><TD align=' . ALIGN_RIGHT . '>' . _('Payments:') . ' ' . str_replace(SystemPreferences('CURRENCY'), SystemPreferences('CURRENCY') . '</TD><TD align=' . ALIGN_RIGHT . '>', Currency($billing_payments[1]['AMOUNT'])) . '</TD></TR>';
echo '<TR><TD align=' . ALIGN_RIGHT . '>' . _('Less: Fees:') . ' ' . str_replace(SystemPreferences('CURRENCY'), SystemPreferences('CURRENCY') . '</TD><TD align=' . ALIGN_RIGHT . '>', Currency($billing_fees[1]['AMOUNT'])) . '</TD></TR>';
echo '<TR><TD align=' . ALIGN_RIGHT . ' style="border:1;border-style: solid none none none;"><B>' . _('Total:') . ' ' . str_replace(SystemPreferences('CURRENCY'), SystemPreferences('CURRENCY') . '</B></TD><TD align=' . ALIGN_RIGHT . ' style="border:1;border-style: solid none none none"><B>', Currency($billing_payments[1]['AMOUNT'] - $billing_fees[1]['AMOUNT'])) . '</B></TD></TR>';
echo '</TABLE>';
PopTable('footer');