} } 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) : '') . '>'; }
unset($_REQUEST['modfunc']); } } } if ($_REQUEST['modfunc'] != 'remove') { $sql = 'SELECT ID,TITLE,SHORT_NAME,SORT_ORDER,NEXT_GRADE_ID FROM school_gradelevels WHERE SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY SORT_ORDER'; $QI = DBQuery($sql); $LO = DBGet(DBQuery($sql)); $grade_id_arr = array(); foreach ($LO as $ti => $td) { array_push($grade_id_arr, $td[ID]); } $grade_id = implode(',', $grade_id_arr); $grades_RET = DBGet($QI, array('TITLE' => 'makeTextInput', 'SHORT_NAME' => 'makeTextInput', 'SORT_ORDER' => 'makeTextInput', 'NEXT_GRADE_ID' => 'makeGradeInput')); $columns = array('TITLE' => 'Title', 'SHORT_NAME' => 'Short Name', 'SORT_ORDER' => 'Sort Order', 'NEXT_GRADE_ID' => 'Next Grade'); $link['add']['html'] = array('TITLE' => makeTextInput('', 'TITLE'), 'SHORT_NAME' => makeTextInput('', 'SHORT_NAME'), 'SORT_ORDER' => makeTextInputMod2('', 'SORT_ORDER'), 'NEXT_GRADE_ID' => makeGradeInput('', 'NEXT_GRADE_ID')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove"; $link['remove']['variables'] = array('id' => 'ID'); if ($err_msg) { echo "<b style='color:red'>" . $err_msg . "</b>"; unset($err_msg); } echo "<FORM name=F1 id=F1 action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&modfunc=update method=POST>"; echo '<input type="hidden" name="h1" id="h1" value="' . $grade_id . '">'; ListOutput($grades_RET, $columns, 'Grade Level', 'Grade Levels', $link, true, array('search' => false)); if (AllowEdit()) { echo '<br><CENTER><INPUT class="btn_medium" type=submit value=Save onclick="formcheck_school_setup_grade_levels();"></CENTER>'; } echo '</FORM>'; } function makeTextInput($value, $name)