} unset($_REQUEST['modfunc']); } if ($_REQUEST['modfunc'] == 'remove') { if (DeletePromptX('History Marking Period')) { DBQuery('DELETE FROM history_marking_periods WHERE MARKING_PERIOD_ID=\'' . $_REQUEST['id'] . '\''); } } if (!$_REQUEST['modfunc']) { echo "<FORM action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&modfunc=update&tab_id=" . strip_tags(trim($_REQUEST[tab_id])) . "&mp_id={$mp_id} method=POST>"; DrawHeader('', SubmitButton('Save', '', 'class=btn_medium')); echo '<BR>'; $sql = 'SELECT * FROM history_marking_periods WHERE SCHOOL_ID = ' . UserSchool() . ' ORDER BY POST_END_DATE'; $functions = array('MP_TYPE' => 'makeSelectInput', 'NAME' => 'makeTextInput', 'POST_END_DATE' => 'makeDateInput', 'SYEAR' => 'makeSchoolYearSelectInput'); $LO_columns = array('MP_TYPE' => 'Type', 'NAME' => 'Name', 'POST_END_DATE' => 'Grade Post Date', 'SYEAR' => 'School Year'); $link['add']['html'] = array('MP_TYPE' => makeSelectInput('', 'MP_TYPE'), 'NAME' => makeTextInput('', 'NAME'), 'POST_END_DATE' => makeDateInput('', 'POST_END_DATE'), 'SYEAR' => makeSchoolYearSelectInput('', 'SYEAR')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove"; //&mp_id=$mp_id"; $link['remove']['variables'] = array('id' => 'MARKING_PERIOD_ID'); $link['add']['html']['remove'] = button('add'); $LO_ret = DBGet(DBQuery($sql), $functions); ListOutput($LO_ret, $LO_columns, 'History Marking Period', 'History Marking Periods', $link, array(), array('count' => true, 'download' => false, 'search' => false)); echo '<CENTER>'; echo SubmitButton('Save', '', 'class=btn_medium') . '</CENTER>'; echo '</FORM>'; } function makeTextInput($value, $name) { global $THIS_RET; if ($THIS_RET['MARKING_PERIOD_ID']) { $id = $THIS_RET['MARKING_PERIOD_ID'];
} } if (!$_REQUEST[modfunc]) { // LIST if ($note) { echo '<TABLE width=100%><TR><TD bgcolor=#E8E8E9><font size=-1>'; ErrorMessage($note, 'note'); echo '</font></TD></TR></TABLE>'; } echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update METHOD=POST>"; $functions = array('AMOUNT' => 'Currency', 'ACCOUNT_ID' => 'getAccount', 'DUE_DATE' => 'ProperDate', 'SYEAR' => 'DispYear', 'SCHOOL' => 'GetSchool', 'GRADE' => 'GetGrade'); $RET = DBGet(DBQuery('SELECT DISTINCT sb.ID,sb.TITLE,sb.AMOUNT, to_char(sb.DUE_DATE,\'dd-MON-yy\') as DUE_DATE,sb.SYEAR,sb.SCHOOL,sb.GRADE,sb.ACCOUNT_ID FROM STU_BILLING_DEFINED_FEES sb ORDER BY sb.TITLE'), $functions); $columns = array('TITLE' => 'Title', 'AMOUNT' => 'Amount', 'ACCOUNT_ID' => 'Account', 'DUE_DATE' => 'Due Date', 'SYEAR' => 'School Year', 'SCHOOL' => 'School', 'GRADE' => 'Grade'); $link[add][html] = array('TITLE' => makeTitleInput(), 'AMOUNT' => makeAmountInput(), 'ACCOUNT_ID' => makeAccountInput(), 'DUE_DATE' => makeDateInput(), 'SYEAR' => makeSyearInput(), 'SCHOOL' => makeSchoolInput(), 'GRADE' => makeGradeInput(), 'remove' => button('add')); $link[remove] = array('link' => "Modules.php?modname={$_REQUEST['modname']}&modfunc=delete", 'variables' => array('id' => 'ID')); $_REQUEST[modfunc] = 'list'; unset($_REQUEST[modfunc]); ListOutput($RET, $columns, 'Pre-Defined Fee', 'Pre-Defined Fees', $link); echo '<center><input type=submit class=btn_medium value=Save></center>'; } // -- END LIST function makeTitleInput($value = '') { return "<INPUT type=text name=title maxlength=30 size=10 value='{$value}'>"; } function makeAmountInput($value = '') { return "<INPUT type=text name=amount maxlength=10 size=6 " . ($value ? "value=" . Currency($value) : '') . '>'; }
} } } DrawHeader(ProgramTitle()); if ($_REQUEST['modfunc'] == 'remove') { if (DeletePrompt(_('Activity'))) { DBQuery("DELETE FROM ELIGIBILITY_ACTIVITIES WHERE ID='{$_REQUEST['id']}'"); unset($_REQUEST['modfunc']); } } if ($_REQUEST['modfunc'] != 'remove') { $sql = "SELECT ID,TITLE,START_DATE,END_DATE FROM ELIGIBILITY_ACTIVITIES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' ORDER BY TITLE"; $QI = DBQuery($sql); $activities_RET = DBGet($QI, array('TITLE' => 'makeTextInput', 'START_DATE' => 'makeDateInput', 'END_DATE' => 'makeDateInput')); $columns = array('TITLE' => _('Title'), 'START_DATE' => _('Begins'), 'END_DATE' => _('Ends')); $link['add']['html'] = array('TITLE' => makeTextInput('', 'TITLE'), 'START_DATE' => makeDateInput('', 'START_DATE'), 'END_DATE' => makeDateInput('', 'END_DATE')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove"; $link['remove']['variables'] = array('id' => 'ID'); echo '<FORM action="Modules.php?modname=' . $_REQUEST[modname] . '&modfunc=update" method="POST">'; DrawHeader('', SubmitButton(_('Save'))); ListOutput($activities_RET, $columns, 'Activity', 'Activities', $link); echo '<span class="center">' . SubmitButton(_('Save')) . '</span>'; echo '</FORM>'; } function makeTextInput($value, $name) { global $THIS_RET; if ($THIS_RET['ID']) { $id = $THIS_RET['ID']; } else { $id = 'new';