$categories_RET = DBGet(DBQuery("SELECT ID,TITLE FROM STUDENT_FIELD_CATEGORIES")); echo '<CENTER><TABLE bgcolor=#FFFFCC><TR><TD>'; echo '<CENTER><SELECT name=category_id onchange="document.location.href=\'' . PreparePHP_SELF($_REQUEST, array('category_id')) . '&category_id=\'+this.form.category_id.value;"><OPTION value="">' . _('All Categories') . '</OPTION>'; foreach ($categories_RET as $category) { echo '<OPTION value=' . $category['ID'] . ($_REQUEST['category_id'] == $category['ID'] ? ' SELECTED' : '') . '>' . ParseMLField($category['TITLE']) . '</OPTION>'; } echo '</SELECT>'; echo '<TABLE></CENTER><HR>'; if (count($fields_RET['text'])) { foreach ($fields_RET['text'] as $field) { echo '<TR><TD align=right><small><b>' . ParseMLField($field['TITLE']) . '</b></small></TD><TD>' . _makeTextInput('CUSTOM_' . $field['ID']) . '</TD></TR>'; } } if (count($fields_RET['numeric'])) { foreach ($fields_RET['numeric'] as $field) { echo '<TR><TD align=right><small><b>' . ParseMLField($field['TITLE']) . '</b></small></TD><TD>' . _makeTextInput('CUSTOM_' . $field['ID'], true) . '</TD></TR>'; } } if (count($fields_RET['date'])) { foreach ($fields_RET['date'] as $field) { echo '<TR><TD align=right><small><b>' . ParseMLField($field['TITLE']) . '</b></small></TD><TD>' . _makeDateInput('CUSTOM_' . $field['ID']) . '</TD></TR>'; } } if (count($fields_RET['select'])) { foreach ($fields_RET['select'] as $field) { $select_options = array(); $field['SELECT_OPTIONS'] = str_replace("\n", "\r", str_replace("\r\n", "\r", $field['SELECT_OPTIONS'])); $options = explode("\r", $field['SELECT_OPTIONS']); if (count($options)) { foreach ($options as $option) { if ($option != '') {
$query = mysql_query('SELECT * FROM students'); $f = 0; while ($colnames = mysql_fetch_field($query)) { if ($colnames->name == $title) { $f = 1; } } if ($f == 0) { $title = 'CUSTOM_' . trim($field['ID']); } echo '<TR><TD class=lable>' . $field['TITLE'] . '</TD><TD>' . _makeTextInput($title) . '</TD></TR>'; } } if (count($fields_RET['numeric'])) { foreach ($fields_RET['numeric'] as $field) { echo '<TR><TD class=lable>' . $field['TITLE'] . '</TD><TD>' . _makeTextInput('CUSTOM_' . $field['ID'], true) . '</TD></TR>'; } } if (count($fields_RET['date'])) { foreach ($fields_RET['date'] as $field) { echo '<TR><TD class=lable>' . $field['TITLE'] . '</TD><TD>' . _makeDateInput('CUSTOM_' . $field['ID']) . '</TD></TR>'; } } if (count($fields_RET['select'])) { foreach ($fields_RET['select'] as $field) { if ($field[TITLE] == 'Ethnicity' || $field[TITLE] == 'Gender' || $field[TITLE] == 'Language') { $select_options = array(); $field['SELECT_OPTIONS'] = str_replace("\n", "\r", str_replace("\r\n", "\r", $field['SELECT_OPTIONS'])); $options = explode("\r", $field['SELECT_OPTIONS']); if (count($options)) { foreach ($options as $option) {
echo '<TD>'; echo _makeAutoSelectInput('CUSTOM_' . $field['ID'], $field['TITLE'], 'staff'); echo '</TD>'; if ($i % $per_row == 0) { echo '</TR>'; } else { echo '<TD style="width:50px;"></TD>'; } $i++; break; case 'numeric': if (($i - 1) % $per_row == 0) { echo '<TR>'; } echo '<TD>'; echo _makeTextInput('CUSTOM_' . $field['ID'], $field['TITLE'], 'size=5 maxlength=10', 'staff'); echo '</TD>'; if ($i % $per_row == 0) { echo '</TR>'; } else { echo '<TD style="width:50px;"></TD>'; } $i++; break; case 'date': if (($i - 1) % $per_row == 0) { echo '<TR>'; } echo '<TD>'; echo _makeDateInput('CUSTOM_' . $field['ID'], $field['TITLE'], 'staff'); echo '</TD>';
if ($_REQUEST['table'] == '0') { $functions['STATE_CODE'] = '_makeSelectInput'; $LO_columns['STATE_CODE'] = _('State Code'); } $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'SHORT_NAME' => _makeTextInput('', 'SHORT_NAME'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER'), 'TYPE' => _makeSelectInput('', 'TYPE'), 'DEFAULT_CODE' => _makeCheckBoxInput('', 'DEFAULT_CODE')); if ($_REQUEST['table'] == '0') { $link['add']['html']['STATE_CODE'] = _makeSelectInput('', 'STATE_CODE'); } $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove&table={$_REQUEST['table']}"; $link['remove']['variables'] = array('id' => 'ID'); $tabs[] = array('title' => button('add'), 'link' => "Modules.php?modname={$_REQUEST['modname']}&table=new"); } else { $sql = "SELECT ID,TITLE,SORT_ORDER FROM ATTENDANCE_CODE_CATEGORIES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' ORDER BY SORT_ORDER,TITLE"; $functions = array('TITLE' => '_makeTextInput', 'SORT_ORDER' => '_makeTextInput'); $LO_columns = array('TITLE' => 'Title', 'SORT_ORDER' => 'Sort Order'); $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove&table=new"; $link['remove']['variables'] = array('id' => 'ID'); $tabs[] = array('title' => button('white_add'), 'link' => "Modules.php?modname={$_REQUEST['modname']}&table=new"); } $LO_ret = DBGet(DBQuery($sql), $functions); echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update&table={$_REQUEST['table']} method=POST>"; DrawHeader('', SubmitButton(_('Save'))); echo '<BR>'; echo '<CENTER>' . WrapTabs($tabs, "Modules.php?modname={$_REQUEST['modname']}&table={$_REQUEST['table']}") . '</CENTER>'; ListOutput($LO_ret, $LO_columns, '.', '.', $link, array(), array('count' => false, 'download' => false, 'search' => false)); echo '<CENTER>' . SubmitButton(_('Save')) . '</CENTER>'; echo '</FORM>'; } function _makeTextInput($value, $name) {
echo '<TD>'; echo _makeAutoSelectInput('CUSTOM_' . $field['ID'], $field['TITLE']); echo '</TD>'; if ($i % 3 == 0) { echo '</TR>'; } else { echo '<TD width=50></TD>'; } $i++; break; case 'numeric': if (($i - 1) % 3 == 0) { echo '<TR>'; } echo '<TD>'; echo _makeTextInput('CUSTOM_' . $field['ID'], $field['TITLE'], 'size=5 maxlength=10 class=cell_floating'); echo '</TD>'; if ($i % 3 == 0) { echo '</TR>'; } else { echo '<TD width=50></TD>'; } $i++; break; case 'date': if (($i - 1) % 3 == 0) { echo '<TR>'; } echo '<TD>'; echo _makeDateInput('CUSTOM_' . $field['ID'], $field['TITLE']); echo '</TD>';
} } if ($_REQUEST['modfunc'] != 'remove') { $sql = "SELECT ROOM_ID,TITLE,TITLE as NAME,CAPACITY,DESCRIPTION,SORT_ORDER FROM rooms WHERE school_id='" . UserSchool() . "' ORDER BY sort_order"; $QI = DBQuery($sql); $LO = DBGet(DBQuery($sql)); $room_id_arr = array(); foreach ($LO as $ti => $td) { array_push($room_id_arr, $td[ROOM_ID]); } $room_id = implode(',', $room_id_arr); $room_ids = ''; $room_iv = ''; $rooms_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'CAPACITY' => '_makeIntInput', 'DESCRIPTION' => '_makeTextInput', 'SORT_ORDER' => '_makeIntInput')); $columns = array('TITLE' => 'Title', 'CAPACITY' => 'Capacity', 'DESCRIPTION' => 'Description', 'SORT_ORDER' => 'Sort Order'); $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'CAPACITY' => _makeTextInput('', 'CAPACITY'), 'DESCRIPTION' => _makeTextInput('', 'DESCRIPTION'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove"; $link['remove']['variables'] = array('id' => 'ROOM_ID'); 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="' . $room_id . '">'; $count_room = count($rooms_RET); if ($count_room > 0) { $count_room = DBGet(DBQuery("Select max(ROOM_ID) as maxid FROM rooms")); $count_room = $count_room[1]['MAXID']; } echo "<input type=hidden id=count_room value={$count_room} />"; ListOutput($rooms_RET, $columns, 'Room', 'Rooms', $link); echo '<br><CENTER>' . SubmitButton('Save', '', 'class=btn_medium onclick="return formcheck_rooms();"') . '</CENTER>'; echo '</FORM>'; } function _makeTextInput($value, $name)
echo '<td width="121px">' . $req . $field['TITLE'] . '</td><td>:</td><td>'; echo _makeAutoSelectInput('CUSTOM_' . $field['ID'], ''); echo '</TD>'; echo '</TR>'; break; case 'edits': echo '<TR>'; echo '<td width="121px">' . $req . $field['TITLE'] . '</td><td>:</td><td>'; echo _makeAutoSelectInput('CUSTOM_' . $field['ID'], ''); echo '</TD>'; echo '</TR>'; break; case 'numeric': echo '<TR>'; echo '<td width="121px">' . $req . $field['TITLE'] . '</td><td>:</td><td>'; echo _makeTextInput('CUSTOM_' . $field['ID'], '', 'size=5 maxlength=10 class=cell_medium'); echo '</TD>'; echo '</TR>'; break; case 'date': echo '<TR>'; echo '<td width="121px">' . $req . $field['TITLE'] . '</td><td>:</td><td>'; echo _makeDateInput_mod('CUSTOM_' . $field['ID'], ''); echo '</TD>'; echo '</TR>'; break; case 'codeds': case 'select': echo '<TR>'; echo '<td width="121px">' . $req . $field['TITLE'] . '</td><td>:</td><td>'; echo _makeSelectInput('CUSTOM_' . $field['ID'], '');
//modif Francois: css WPadmin echo '<TABLE style="margin:0 auto;"><TR><TD>'; echo '<span class="center"><SELECT name=category_id onchange="document.location.href=\'' . PreparePHP_SELF($_REQUEST, array('category_id')) . '&category_id=\'+this.form.category_id.value;"><OPTION value="">' . _('All Categories') . '</OPTION>'; foreach ($categories_RET as $category) { echo '<OPTION value="' . $category['ID'] . '"' . ($_REQUEST['category_id'] == $category['ID'] ? ' SELECTED="SELECTED"' : '') . '>' . ParseMLField($category['TITLE']) . '</OPTION>'; } echo '</SELECT>'; echo '</span><TABLE class="widefat cellspacing-0">'; if (count($fields_RET['text'])) { foreach ($fields_RET['text'] as $field) { echo '<TR><TD style="text-align:right"><b>' . ParseMLField($field['TITLE']) . '</b></TD><TD>' . _makeTextInput('CUSTOM_' . $field['ID']) . '</TD></TR>'; } } if (count($fields_RET['numeric'])) { foreach ($fields_RET['numeric'] as $field) { echo '<TR><TD style="text-align:right"><b>' . ParseMLField($field['TITLE']) . '</b></TD><TD>' . _makeTextInput('CUSTOM_' . $field['ID'], true) . '</TD></TR>'; } } if (count($fields_RET['date'])) { foreach ($fields_RET['date'] as $field) { echo '<TR><TD style="text-align:right"><b>' . ParseMLField($field['TITLE']) . '</b></TD><TD>' . _makeDateInput('CUSTOM_' . $field['ID']) . '</TD></TR>'; } } if (count($fields_RET['select'])) { foreach ($fields_RET['select'] as $field) { $select_options = array(); $field['SELECT_OPTIONS'] = str_replace("\n", "\r", str_replace("\r\n", "\r", $field['SELECT_OPTIONS'])); $options = explode("\r", $field['SELECT_OPTIONS']); if (count($options)) { foreach ($options as $option) { if ($option != '') {
$a = DeletePromptStaffCert('Certificate'); } if ($_REQUEST['delete_ok'] == '1') { DBQuery("DELETE FROM staff_certification WHERE STAFF_CERTIFICATION_ID=" . $_REQUEST['certification_id']); unset($_REQUEST['modfunc']); } if (!$_REQUEST['modfunc']) { if ($_REQUEST['certification_id'] != '' && $_REQUEST['certification_id'] != 'new') { $this_certification_RET = DBGet(DBQuery("SELECT * FROM staff_certification\r\n WHERE STAFF_ID=" . UserStaffID())); $this_certification = $this_certification_RET[1]; } $sql = "SELECT STAFF_CERTIFICATION_ID AS ID,STAFF_ID,STAFF_CERTIFICATION_DATE,STAFF_CERTIFICATION_EXPIRY_DATE,\r\n STAFF_CERTIFICATION_CODE,STAFF_CERTIFICATION_SHORT_NAME,STAFF_CERTIFICATION_NAME,\r\n STAFF_PRIMARY_CERTIFICATION_INDICATOR,STAFF_CERTIFICATION_DESCRIPTION FROM staff_certification\r\n WHERE STAFF_ID=" . UserStaffID(); $QI = DBQuery($sql); $cert_RET = DBGet($QI, array('STAFF_CERTIFICATION_NAME' => '_makeTextInput', 'STAFF_CERTIFICATION_CODE' => '_makeTextInput', 'STAFF_CERTIFICATION_DATE' => '_makeDateInput', 'STAFF_CERTIFICATION_SHORT_NAME' => '_makeTextInput', 'STAFF_PRIMARY_CERTIFICATION_INDICATOR' => '_makeSelectInput', 'STAFF_CERTIFICATION_EXPIRY_DATE' => '_makeDateInput', 'STAFF_CERTIFICATION_DESCRIPTION' => '_makeContentInput')); $columns = array('STAFF_CERTIFICATION_NAME' => 'Certification Name', 'STAFF_CERTIFICATION_CODE' => 'Certification Code', 'STAFF_CERTIFICATION_DATE' => 'Certification Date', 'STAFF_CERTIFICATION_SHORT_NAME' => 'Certification Short Name', 'STAFF_PRIMARY_CERTIFICATION_INDICATOR' => 'Primary Certification Indicator', 'STAFF_CERTIFICATION_EXPIRY_DATE' => 'Certification Expiry Date', 'STAFF_CERTIFICATION_DESCRIPTION' => 'Certification Description'); $link['add']['html'] = array('STAFF_CERTIFICATION_NAME' => _makeTextInput('', 'STAFF_CERTIFICATION_NAME'), 'STAFF_CERTIFICATION_CODE' => _makeTextInput('', 'STAFF_CERTIFICATION_CODE'), 'STAFF_CERTIFICATION_DATE' => _makeDateInput('', 'STAFF_CERTIFICATION_DATE'), 'STAFF_CERTIFICATION_SHORT_NAME' => _makeTextInput('', 'STAFF_CERTIFICATION_SHORT_NAME'), 'STAFF_PRIMARY_CERTIFICATION_INDICATOR' => _makeSelectInput('', 'STAFF_PRIMARY_CERTIFICATION_INDICATOR'), 'STAFF_CERTIFICATION_EXPIRY_DATE' => _makeDateInput('', 'STAFF_CERTIFICATION_EXPIRY_DATE'), 'STAFF_CERTIFICATION_DESCRIPTION' => _makeContentInput('', 'STAFF_CERTIFICATION_DESCRIPTION')); // $link['remove']['link'] = "Modules.php?modname=$_REQUEST[modname]&include=$_REQUEST[include]&category_id=$_REQUEST[category_id]&staff_id=".UserStaffID()."&modfunc=remove"; $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&include={$_REQUEST['include']}&category_id={$_REQUEST['category_id']}&modfunc=remove"; $link['remove']['variables'] = array('id' => 'ID'); ListOutputStaffCert($cert_RET, $columns, 'Certificate', 'Certificates', $link); //echo '<pre>';print_r($_REQUEST);echo '</pre>'; } function _makeTextInput($value, $name) { global $THIS_RET; if ($THIS_RET['ID']) { $id = $THIS_RET['ID']; } else { $id = 'new'; } if ($name != 'TITLE') {
} } if ($_REQUEST['modfunc'] != 'remove') { if ($_REQUEST['table'] !== 'new') { $sql = 'SELECT ID,TITLE,SHORT_NAME,TYPE,DEFAULT_CODE,STATE_CODE,SORT_ORDER,TABLE_NAME FROM attendance_codes WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND TABLE_NAME=\'' . $_REQUEST['table'] . '\' ORDER BY SORT_ORDER,TITLE'; $QI = DBQuery($sql); $LO = DBGet(DBQuery($sql)); $attandance_id_arr = array(); foreach ($LO as $ti => $td) { array_push($attandance_id_arr, $td[ID]); } $attandance_id = implode(',', $attandance_id_arr); $attendance_codes_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'SHORT_NAME' => '_makeTextInput', 'SORT_ORDER' => '_makeTextInput', 'TYPE' => '_makeSelectInput', 'STATE_CODE' => '_makeSelectInput', 'DEFAULT_CODE' => '_makeCheckBoxInput')); } $columns = array('TITLE' => 'Title', 'SHORT_NAME' => 'Short Name', 'SORT_ORDER' => 'Sort Order', 'TYPE' => 'Type', 'DEFAULT_CODE' => 'Default for Teacher', 'STATE_CODE' => 'State Code'); $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'SHORT_NAME' => _makeTextInput('', 'SHORT_NAME'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER', 'onkeydown=return numberOnlyMod(event,this);'), 'TYPE' => _makeSelectInput('', 'TYPE'), 'DEFAULT_CODE' => _makeCheckBoxInput('', 'DEFAULT_CODE'), 'STATE_CODE' => _makeSelectInput('', 'STATE_CODE')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove"; $link['remove']['variables'] = array('id' => 'ID', 'table' => 'TABLE_NAME'); echo "<FORM name=F1 id=F1 action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&modfunc=update&table=" . strip_tags(trim($_REQUEST[table])) . " method=POST>"; echo '<input type="hidden" name="h1" id="h1" value="' . $attandance_id . '">'; $tabs = array(array('title' => 'Attendance', 'link' => "Modules.php?modname={$_REQUEST['modname']}&table=0")); $categories_RET = DBGet(DBQuery('SELECT ID,TITLE FROM attendance_code_categories WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY TITLE')); foreach ($categories_RET as $category) { $tabs[] = array('title' => $category['TITLE'], 'link' => "Modules.php?modname={$_REQUEST['modname']}&table=" . $category['ID']); } if ($_REQUEST['table'] === 'new') { $tabs[] = array('title' => button('white_add'), 'link' => "Modules.php?modname={$_REQUEST['modname']}&table=new"); } else { $tabs[] = array('title' => button('add'), 'link' => "Modules.php?modname={$_REQUEST['modname']}&table=new"); } $max_id = DBGet(DBQuery("select max(ID) maxid from attendance_codes"));
$has_assigned_RET = DBGet(DBQuery("SELECT COUNT(*) AS TOTAL_ASSIGNED FROM student_standards WHERE grade_id={$_REQUEST['id']}")); $has_assigned = $has_assigned_RET[1]['TOTAL_ASSIGNED']; if ($has_assigned > 0) { UnableDeletePromptX('Cannot delete because standard grade is associated.'); } else { if (DeletePromptX('Standard Grade')) { DBQuery("DELETE FROM standard_grades WHERE ID='{$_REQUEST['id']}'"); unset($_SESSION['GR_scale_id']); } } } if (!$_REQUEST['modfunc']) { $sql = "SELECT ID,GRADE,DESCRIPTION,SORT_ORDER FROM standard_grades WHERE school_id='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY sort_order,grade"; $functions = array('GRADE' => '_makeTextInput', 'DESCRIPTION' => '_makeTextInput', 'SORT_ORDER' => '_makeIntInput'); $LO_columns = array('GRADE' => 'Grade', 'DESCRIPTION' => 'Description', 'SORT_ORDER' => 'Order'); $link['add']['html'] = array('GRADE' => _makeTextInput('', 'GRADE'), 'DESCRIPTION' => _makeTextInput('', 'DESCRIPTION'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove"; $link['remove']['variables'] = array('id' => 'ID'); $link['add']['html']['remove'] = button('add'); $LO_ret = DBGet(DBQuery($sql), $functions); echo "<FORM name=F1 id=F1 action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update method=POST>"; ListOutput($LO_ret, $LO_columns, 'Standard Grade', 'Standard Grades', $link, array(), array('search' => false)); echo '<BR>'; echo '<CENTER>' . SubmitButton('Save', '', 'class=btn_medium onclick="formcheck_grade_grade();"') . '</CENTER>'; echo '</FORM>'; } function _makeTextInput($value, $name) { global $THIS_RET; if ($THIS_RET['ID']) { $id = $THIS_RET['ID'];
echo '<TD style="width:100px">'; echo ($field['REQUIRED'] == 'Y' ? '<span class=red>*</span>' : '') . $field['TITLE'] . '</TD><TD>:</TD><TD>' . _makeAutoSelectInput('CUSTOM_' . $field['ID']); echo '</TD>'; echo '</TR>'; break; case 'edits': echo '<TR>'; echo '<TD style="width:100px">'; echo ($field['REQUIRED'] == 'Y' ? '<span class=red>*</span>' : '') . $field['TITLE'] . '</TD><TD>:</TD><TD>' . _makeAutoSelectInput('CUSTOM_' . $field['ID']); echo '</TD>'; echo '</TR>'; break; case 'numeric': echo '<TR>'; echo '<TD style="width:100px">'; echo ($field['REQUIRED'] == 'Y' ? '<span class=red>*</span>' : '') . $field['TITLE'] . '</TD><TD>:</TD><TD>' . _makeTextInput('CUSTOM_' . $field['ID'], '', 'size=5 maxlength=10 class=cell_floating'); echo '</TD>'; echo '</TR>'; break; case 'date': echo '<TR>'; echo '<TD style="width:100px">'; echo ($field['REQUIRED'] == 'Y' ? '<span class=red>*</span>' : '') . $field['TITLE'] . '</TD><TD>:</TD><TD>' . _makeDateInput('CUSTOM_' . $field['ID'], ''); echo '</TD>'; echo '</TR>'; break; case 'codeds': case 'select': echo '<TR>'; echo '<TD style="width:100px">'; echo ($field['REQUIRED'] == 'Y' ? '<span class=red>*</span>' : '') . $field['TITLE'] . '</TD><TD>:</TD><TD>' . _makeSelectInput('CUSTOM_' . $field['ID'], '');
} } } DrawHeader(ProgramTitle()); if ($_REQUEST['modfunc'] == 'remove' && AllowEdit()) { if (DeletePrompt('period')) { DBQuery("DELETE FROM SCHOOL_PERIODS WHERE PERIOD_ID='{$_REQUEST['id']}'"); unset($_REQUEST['modfunc']); } } if ($_REQUEST['modfunc'] != 'remove') { $sql = "SELECT PERIOD_ID,TITLE,SHORT_NAME,SORT_ORDER,LENGTH,START_TIME,END_TIME,BLOCK,ATTENDANCE FROM SCHOOL_PERIODS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' ORDER BY SORT_ORDER"; $QI = DBQuery($sql); $periods_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'SHORT_NAME' => '_makeTextInput', 'SORT_ORDER' => '_makeTextInput', 'BLOCK' => '_makeTextInput', 'LENGTH' => '_makeTextInput', 'START_TIME' => '_makeTimeInput', 'END_TIME' => '_makeTimeInput', 'ATTENDANCE' => '_makeCheckboxInput')); $columns = array('TITLE' => _('Title'), 'SHORT_NAME' => _('Short Name'), 'SORT_ORDER' => _('Sort Order'), 'LENGTH' => _('Length (minutes)'), 'BLOCK' => _('Block'), 'ATTENDANCE' => _('Used for Attendance'), 'START_TIME' => _('Start Time'), 'END_TIME' => _('End Time')); $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'SHORT_NAME' => _makeTextInput('', 'SHORT_NAME'), 'LENGTH' => _makeTextInput('', 'LENGTH'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER'), 'BLOCK' => _makeTextInput('', 'BLOCK'), 'START_TIME' => _makeTimeInput('', 'START_TIME'), 'END_TIME' => _makeTimeInput('', 'END_TIME'), 'ATTENDANCE' => _makeCheckboxInput('', 'ATTENDANCE')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove"; $link['remove']['variables'] = array('id' => 'PERIOD_ID'); echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update method=POST>"; DrawHeader('', SubmitButton(_('Save'))); ListOutput($periods_RET, $columns, _('Period'), _('Periods'), $link); echo '<CENTER>' . SubmitButton(_('Save')) . '</CENTER>'; echo '</FORM>'; } function _makeTextInput($value, $name) { global $THIS_RET; if ($THIS_RET['PERIOD_ID']) { $id = $THIS_RET['PERIOD_ID']; } else { $id = 'new';
DBQuery("DELETE FROM PORTAL_NOTES WHERE ID='{$_REQUEST['id']}'"); //modif Francois: Moodle integrator if (MOODLE_INTEGRATOR) { $moodleError = Moodle($_REQUEST['modname'], 'core_notes_delete_notes'); } unset($_REQUEST['modfunc']); } } if ($_REQUEST['modfunc'] != 'remove') { //modif Francois: file attached to portal notes $sql = "SELECT ID,SORT_ORDER,TITLE,CONTENT,START_DATE,END_DATE,PUBLISHED_PROFILES,FILE_ATTACHED,CASE WHEN END_DATE IS NOT NULL AND END_DATE<CURRENT_DATE THEN 'Y' ELSE NULL END AS EXPIRED FROM PORTAL_NOTES WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY EXPIRED DESC,SORT_ORDER,PUBLISHED_DATE DESC"; $QI = DBQuery($sql); $notes_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'CONTENT' => '_makeContentInput', 'SORT_ORDER' => '_makeTextInput', 'FILE_ATTACHED' => '_makeFileAttached', 'START_DATE' => '_makePublishing')); $columns = array('TITLE' => _('Title'), 'CONTENT' => _('Note'), 'SORT_ORDER' => _('Sort Order'), 'FILE_ATTACHED' => _('File Attached'), 'START_DATE' => _('Publishing Options')); //,'START_TIME'=>'Start Time','END_TIME'=>'End Time' $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'CONTENT' => _makeContentInput('', 'CONTENT'), 'SHORT_NAME' => _makeTextInput('', 'SHORT_NAME'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER'), 'FILE_ATTACHED' => _makeFileAttached('', 'FILE_ATTACHED'), 'START_DATE' => _makePublishing('', 'START_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" enctype="multipart/form-data">'; DrawHeader('', SubmitButton(_('Save'))); //modif Francois: fix SQL bug invalid sort order if (isset($error)) { echo $error; } //modif Francois: Moodle integrator echo $moodleError; if (!empty($PortalNotesFilesError)) { echo ErrorMessage(array($PortalNotesFilesError)); } ListOutput($notes_RET, $columns, 'Note', 'Notes', $link); echo '<BR /><span class="center">' . SubmitButton(_('Save')) . '</span>';
} } } if ($_REQUEST['modfunc'] != 'remove') { #$sql = "SELECT PERIOD_ID,TITLE,SHORT_NAME,SORT_ORDER,LENGTH,START_TIME,END_TIME,BLOCK,ATTENDANCE FROM school_periods WHERE SYEAR='".UserSyear()."' AND SCHOOL_ID='".UserSchool()."' ORDER BY SORT_ORDER"; $sql = 'SELECT PERIOD_ID,TITLE,SHORT_NAME,SORT_ORDER,LENGTH,START_TIME,END_TIME,ATTENDANCE,IGNORE_SCHEDULING FROM school_periods WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY SORT_ORDER'; $QI = DBQuery($sql); #$periods_RET = DBGet($QI,array('TITLE'=>'_makeTextInput','SHORT_NAME'=>'_makeTextInput','SORT_ORDER'=>'_makeTextInputMod','BLOCK'=>'_makeTextInput','LENGTH'=>'_makeTextInputMod','START_TIME'=>'_makeTimeInput','END_TIME'=>'_makeTimeInputEnd','ATTENDANCE'=>'_makeCheckboxInput')); #$periods_RET = DBGet($QI,array('TITLE'=>'_makeTextInput','SHORT_NAME'=>'_makeTextInput','SORT_ORDER'=>'_makeTextInputMod','BLOCK'=>'_makeTextInput','LENGTH'=>'LENGTH','START_TIME'=>'_makeTimeInput','END_TIME'=>'_makeTimeInputEnd','ATTENDANCE'=>'_makeCheckboxInput')); $periods_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'SHORT_NAME' => '_makeTextInput', 'SORT_ORDER' => '_makeTextInputMod', 'LENGTH' => 'LENGTH', 'START_TIME' => '_makeTimeInput', 'END_TIME' => '_makeTimeInputEnd', 'ATTENDANCE' => '_makeCheckboxInput', 'IGNORE_SCHEDULING' => '_makeCheckboxInput')); #$columns = array('TITLE'=>'Title','SHORT_NAME'=>'Short Name','SORT_ORDER'=>'Sort Order','START_TIME'=>'Start Time','END_TIME'=>'End Time','LENGTH'=>'Length (minutes)','IGNORE_SCHEDULING'=>'Block','ATTENDANCE'=>'Used for Attendance'); $columns = array('TITLE' => '' . _('Title') . '', 'SHORT_NAME' => '' . _('Short Name') . '', 'SORT_ORDER' => '' . _('Sort Order') . '', 'START_TIME' => '' . _('Start Time') . '', 'END_TIME' => '' . _('End Time') . '', 'LENGTH' => '' . _('Length') . ' <div></div>(' . _('minutes') . ')', 'ATTENDANCE' => '' . _('Used for') . ' <div></div>' . _('Attendance') . '', 'IGNORE_SCHEDULING' => '' . _('Ignore for') . '<div></div>' . _('Scheduling') . ''); //,'START_TIME'=>'Start Time','END_TIME'=>'End Time' #$link['add']['html'] = array('TITLE'=>_makeTextInput('','TITLE'),'SHORT_NAME'=>_makeTextInput('','SHORT_NAME'),'LENGTH'=>_makeTextInputMod2('','LENGTH'),'SORT_ORDER'=>_makeTextInputMod2('','SORT_ORDER'),'BLOCK'=>_makeTextInput('','BLOCK'),'START_TIME'=>_makeTimeInput('','START_TIME'),'END_TIME'=>_makeTimeInputEnd('','END_TIME'),'ATTENDANCE'=>_makeCheckboxInput('','ATTENDANCE')); #$link['add']['html'] = array('TITLE'=>_makeTextInput('','TITLE'),'SHORT_NAME'=>_makeTextInput('','SHORT_NAME'),'SORT_ORDER'=>_makeTextInputMod2('','SORT_ORDER'),'BLOCK'=>_makeTextInput('','BLOCK'),'START_TIME'=>_makeTimeInput('','START_TIME'),'END_TIME'=>_makeTimeInputEnd('','END_TIME'),'ATTENDANCE'=>_makeCheckboxInput('','ATTENDANCE')); $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'SHORT_NAME' => _makeTextInput('', 'SHORT_NAME'), 'SORT_ORDER' => _makeTextInputMod2('', 'SORT_ORDER'), 'START_TIME' => _makeTimeInput('', 'START_TIME'), 'END_TIME' => _makeTimeInputEnd('', 'END_TIME'), 'ATTENDANCE' => _makeCheckboxInput('', 'ATTENDANCE'), 'IGNORE_SCHEDULING' => _makeCheckboxInput('', 'IGNORE_SCHEDULING')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove"; $link['remove']['variables'] = array('id' => 'PERIOD_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={$_REQUEST['modname']}&modfunc=update method=POST>"; #DrawHeader('',SubmitButton('Save')); ListOutput($periods_RET, $columns, _('Period'), _('Periods'), $link); echo '<br><CENTER>' . SubmitButton(_('Save'), '', 'class=btn_medium onclick="formcheck_school_setup_periods();"') . '</CENTER>'; echo '</FORM>'; } function _makeTextInput($value, $name) { global $THIS_RET;
if (DeletePrompt(_('Poll'))) { DBQuery("DELETE FROM PORTAL_POLLS WHERE ID='{$_REQUEST['id']}'"); DBQuery("DELETE FROM PORTAL_POLL_QUESTIONS WHERE PORTAL_POLL_ID='{$_REQUEST['id']}'"); unset($_REQUEST['modfunc']); } } if ($_REQUEST['modfunc'] != 'remove') { $sql_questions = "SELECT ppq.ID,ppq.PORTAL_POLL_ID,ppq.OPTIONS,ppq.VOTES,ppq.QUESTION,ppq.TYPE FROM PORTAL_POLL_QUESTIONS ppq, PORTAL_POLLS pp WHERE pp.SCHOOL_ID='" . UserSchool() . "' AND pp.SYEAR='" . UserSyear() . "' AND pp.ID=ppq.PORTAL_POLL_ID ORDER BY ppq.ID"; $QI_questions = DBQuery($sql_questions); $questions_RET = DBGet($QI_questions, array('OPTIONS' => '_makeOptionsInput')); $sql = "SELECT pp.ID,pp.SORT_ORDER,pp.TITLE,'See_PORTAL_POLL_QUESTIONS' AS OPTIONS, pp.VOTES_NUMBER,pp.START_DATE,pp.END_DATE,pp.PUBLISHED_PROFILES,pp.STUDENTS_TEACHER_ID,CASE WHEN pp.END_DATE IS NOT NULL AND pp.END_DATE<CURRENT_DATE THEN 'Y' ELSE NULL END AS EXPIRED FROM PORTAL_POLLS pp WHERE pp.SCHOOL_ID='" . UserSchool() . "' AND pp.SYEAR='" . UserSyear() . "' ORDER BY EXPIRED DESC,pp.SORT_ORDER,pp.PUBLISHED_DATE DESC"; $QI = DBQuery($sql); $polls_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'OPTIONS' => '_makeOptionsInputs', 'VOTES_NUMBER' => '_makePollVotes', 'SORT_ORDER' => '_makeTextInput', 'START_DATE' => '_makePublishing')); $columns = array('TITLE' => _('Title'), 'OPTIONS' => _('Poll'), 'VOTES_NUMBER' => _('Results'), 'SORT_ORDER' => _('Sort Order'), 'START_DATE' => _('Publishing Options')); //,'START_TIME'=>'Start Time','END_TIME'=>'End Time' $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'OPTIONS' => _makeOptionsInputs('', 'OPTIONS'), 'VOTES_NUMBER' => _makePollVotes('', 'VOTES_NUMBER'), 'SHORT_NAME' => _makeTextInput('', 'SHORT_NAME'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER'), 'START_DATE' => _makePublishing('', 'START_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'))); //modif Francois: fix SQL bug invalid sort order if (isset($error)) { echo $error; } ListOutput($polls_RET, $columns, 'Poll', 'Polls', $link); echo '<span class="center">' . SubmitButton(_('Save')) . '</span>'; echo '</FORM>'; } function _makeTextInput($value, $name) { global $THIS_RET;
} DrawBC("School Setup > " . ProgramTitle()); if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'remove' && AllowEdit()) { if (DeletePrompt_Portal('message')) { // echo paramlib_validation($column=SORT_ORDER,$_REQUEST[id]); exit; DBQuery('DELETE FROM portal_notes WHERE ID=\'' . paramlib_validation($column = SORT_ORDER, $_REQUEST[id]) . '\''); unset($_REQUEST['modfunc']); } } if ($_REQUEST['modfunc'] != 'remove') { $sql = 'SELECT ID,SORT_ORDER,TITLE,CONTENT,START_DATE,END_DATE,PUBLISHED_PROFILES,CASE WHEN END_DATE IS NOT NULL AND END_DATE<CURRENT_DATE THEN \'Y\' ELSE NULL END AS EXPIRED FROM portal_notes WHERE (SCHOOL_ID=\'' . UserSchool() . '\' OR SCHOOL_ID IS NULL) AND SYEAR=\'' . UserSyear() . '\' ORDER BY EXPIRED DESC,SORT_ORDER,PUBLISHED_DATE DESC'; $QI = DBQuery($sql); $notes_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'CONTENT' => '_makeContentInput', 'SORT_ORDER' => '_makeTextInput', 'START_DATE' => '_makePublishing')); $columns = array('TITLE' => 'Title', 'CONTENT' => 'Note', 'SORT_ORDER' => 'Sort Order', 'START_DATE' => 'Publishing Options'); //,'START_TIME'=>'Start Time','END_TIME'=>'End Time' $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'CONTENT' => _makeContentInput('', 'CONTENT'), 'SHORT_NAME' => _makeTextInput('', 'SHORT_NAME'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER'), 'START_DATE' => _makePublishing('', 'START_DATE')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove"; $link['remove']['variables'] = array('id' => 'ID'); echo "<FORM name=F2 id=F2 action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update method=POST>"; #DrawHeader('',SubmitButton('Save')); ListOutput($notes_RET, $columns, 'Note', 'Notes', $link); echo '<br><CENTER>' . SubmitButton('Save', '', 'class=btn_medium onclick="formcheck_school_setup_portalnotes();"') . '</CENTER>'; echo '</FORM>'; } function _makeTextInput($value, $name) { global $THIS_RET; if ($THIS_RET['ID']) { $id = $THIS_RET['ID']; } else { $id = 'new';
} } } } unset($_REQUEST['modfunc']); } if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'remove') { if (DeletePromptX('Honor Roll')) { DBQuery("DELETE FROM honor_roll WHERE id='{$_REQUEST['id']}'"); } } if (!$_REQUEST['modfunc']) { $sql = 'SELECT TITLE,VALUE, id as ID FROM honor_roll WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\' ORDER BY VALUE'; $functions = array('TITLE' => '_makeTextInput', 'VALUE' => 'makeTextInputt'); $LO_columns = array('TITLE' => 'Honor Roll', 'VALUE' => 'Breakoff'); $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'VALUE' => makeTextInputt('', 'VALUE')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove"; $link['remove']['variables'] = array('id' => 'ID'); $link['add']['html']['remove'] = button('add'); $LO_ret = DBGet(DBQuery($sql), $functions); $tabs = array(); $tabs[] = array('title' => 'Honor Roll Setup'); echo "<FORM name=F1 id=F1 action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update method=POST>"; echo '<BR>'; echo '<style type="text/css">#div_margin { margin-top:-20px; _margin-top:-1px; }</style>'; echo WrapTabs($tabs, ""); echo '<div id="div_margin">'; PopTable_wo_header('header'); ListOutputMod($LO_ret, $LO_columns, '', '', $link, array(), array('count' => false, 'download' => false, 'search' => false)); echo '<BR>'; echo '<CENTER>' . SubmitButton('Save', '', 'class=btn_medium onclick="formcheck_honor_roll();"') . '</CENTER>';
echo '<TD style="width:120px">'; echo $field['TITLE'] . '</TD><TD>:</TD><TD>' . _makeAutoSelectInput('CUSTOM_' . $field['ID']); echo '</TD>'; echo '</TR>'; break; case 'edits': echo '<TR>'; echo '<TD style="width:120px">'; echo $field['TITLE'] . '</TD><TD>:</TD><TD>' . _makeAutoSelectInput('CUSTOM_' . $field['ID']); echo '</TD>'; echo '</TR>'; break; case 'numeric': echo '<TR>'; echo '<TD style="width:120px">'; echo $field['TITLE'] . '</TD><TD>:</TD><TD>' . _makeTextInput('CUSTOM_' . $field['ID'], '', 'size=5 maxlength=10 class=cell_floating'); echo '</TD>'; echo '</TR>'; break; case 'date': echo '<TR>'; echo '<TD style="width:120px">'; echo $field['TITLE'] . '</TD><TD>:</TD><TD>' . DateInputAY($value['CUSTOM_' . $field['ID']], 'CUSTOM_' . $field['ID'], $field['ID']); echo '<input type=hidden name=custom_date_id[] value="' . $field['ID'] . '" />'; echo '</TD>'; echo '</TR>'; break; case 'codeds': case 'select': echo '<TR>'; echo '<TD style="width:120px">';
} } if ($_REQUEST['modfunc'] != 'remove') { if ($_REQUEST['table'] !== 'new') { // $sql = "SELECT ID,TITLE,SHORT_NAME,TYPE,DEFAULT_CODE,STATE_CODE,SORT_ORDER FROM attendance_codes WHERE SYEAR='".UserSyear()."' AND SCHOOL_ID='".UserSchool()."' AND TABLE_NAME='".$_REQUEST['table']."' ORDER BY SORT_ORDER,TITLE"; //$tabl=optional_param('table','',PARAM_ALPHANUM); $sql = 'SELECT ID,TITLE,SHORT_NAME,TYPE,DEFAULT_CODE,STATE_CODE,SORT_ORDER,TABLE_NAME FROM attendance_codes WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND TABLE_NAME=\'' . $_REQUEST['table'] . '\' ORDER BY SORT_ORDER,TITLE'; $QI = DBQuery($sql); $attendance_codes_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'SHORT_NAME' => '_makeTextInput', 'SORT_ORDER' => '_makeTextInput', 'TYPE' => '_makeSelectInput', 'STATE_CODE' => '_makeSelectInput', 'DEFAULT_CODE' => '_makeCheckBoxInput')); } $columns = array('TITLE' => '' . _('Title') . '', 'SHORT_NAME' => '' . _('Short Name') . '', 'SORT_ORDER' => '' . _('Sort Order') . '', 'TYPE' => '' . _('Type') . '', 'DEFAULT_CODE' => '' . _('Default for Teacher') . '', 'STATE_CODE' => '' . _('State Code') . ''); /* if($_REQUEST['table']!='0') unset($columns['STATE_CODE']); */ $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'SHORT_NAME' => _makeTextInput('', 'SHORT_NAME'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER'), 'TYPE' => _makeSelectInput('', 'TYPE'), 'DEFAULT_CODE' => _makeCheckBoxInput('', 'DEFAULT_CODE'), 'STATE_CODE' => _makeSelectInput('', 'STATE_CODE')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove"; $link['remove']['variables'] = array('id' => 'ID', 'table' => 'TABLE_NAME'); echo "<FORM name=F1 id=F1 action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update&table={$_REQUEST['table']} method=POST>"; #DrawHeader('',SubmitButton('Save')); $tabs = array(array('title' => '' . _('Attendance') . '', 'link' => "Modules.php?modname={$_REQUEST['modname']}&table=0")); $categories_RET = DBGet(DBQuery('SELECT ID,TITLE FROM attendance_code_categories WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\'')); foreach ($categories_RET as $category) { $tabs[] = array('title' => $category['TITLE'], 'link' => "Modules.php?modname={$_REQUEST['modname']}&table=" . $category['ID']); } if ($_REQUEST['table'] === 'new') { $tabs[] = array('title' => button('white_add'), 'link' => "Modules.php?modname={$_REQUEST['modname']}&table=new"); } else { $tabs[] = array('title' => button('add'), 'link' => "Modules.php?modname={$_REQUEST['modname']}&table=new"); } if ($_REQUEST['table'] !== 'new') {
$date = DBGet(DBQuery("SELECT type,id FROM CUSTOM_FIELDS WHERE ID='" . $field['ID'] . "'")); foreach ($date as $da) { if ($da['TYPE'] == 'date') { $sql = DBGet(DBQuery("SELECT DATE_FORMAT(CUSTOM_" . $da['ID'] . ",'%b-%d-%Y') as DATE FROM STUDENTS WHERE STUDENT_ID='" . UserStudentID() . "'")); foreach ($sql as $sq) { // echo $sq['DATE']; echo '<TR>'; echo '<td width=125px style="font-weight:bold">' . $field['TITLE'] . ':</td>'; echo '<td class=cell_medium>' . $sq['DATE'] . ''; echo '</TD>'; echo '</TR>'; } } else { echo '<TR>'; echo '<td width=125px style="font-weight:bold">' . $field['TITLE'] . ':</td><td>'; echo _makeTextInput('CUSTOM_' . $field['ID'], '', 'class=cell_medium'); echo '</TD>'; echo '</TR>'; } } } } } echo "</TABLE>"; } } //===NEWLY ADDED==================================================================================== echo "</td><tr>"; echo "</table>"; echo '<div style="page-break-before: always;"> </div>'; foreach ($categories_RET as $id => $category) {
if (empty($_REQUEST['modfunc'])) { $sql = "SELECT NULL AS REMOVE,du.ID AS USAGE_ID,df.ID,COALESCE(du.TITLE,df.TITLE) AS TITLE,du.SORT_ORDER,df.DATA_TYPE,du.SELECT_OPTIONS FROM DISCIPLINE_FIELDS df LEFT OUTER JOIN DISCIPLINE_FIELD_USAGE du ON (du.DISCIPLINE_FIELD_ID=df.ID AND du.SYEAR='" . UserSyear() . "' AND du.SCHOOL_ID='" . UserSchool() . "') ORDER BY du.ID,du.SORT_ORDER"; $QI = DBQuery($sql); $referrals_RET = DBGet($QI, array('REMOVE' => '_makeRemove', 'TITLE' => '_makeTextInput', 'SORT_ORDER' => '_makeTextInput', 'DATA_TYPE' => '_makeType', 'SELECT_OPTIONS' => '_makeTextAreaInput')); foreach ($referrals_RET as $key => $item) { if (!$item['USAGE_ID']) { $referrals_RET[$key]['row_color'] = 'CCCCCC'; } } if (count($referrals_RET)) { $columns = array('REMOVE' => ''); } else { $columns = array(); } $columns += array('TITLE' => _('Title'), 'SORT_ORDER' => _('Sort Order'), 'DATA_TYPE' => _('Data Type'), 'SELECT_OPTIONS' => _('Pull-Down') . '/' . _('Select Multiple from Options') . '/' . _('Select One from Options')); $link['add']['html'] = array('REMOVE' => button('add'), 'TITLE' => _makeTextInput('', 'TITLE'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER'), 'SELECT_OPTIONS' => _makeTextAreaInput('', 'SELECT_OPTIONS'), 'DATA_TYPE' => _makeType('', 'DATA_TYPE')); echo '<FORM action="Modules.php?modname=' . $_REQUEST['modname'] . '" method="POST">'; DrawHeader('', SubmitButton(_('Save'))); //modif Francois: fix SQL bug invalid sort order if (isset($error)) { echo $error; } ListOutput($referrals_RET, $columns, 'Referral Form Category', 'Referral Form Categories', $link); echo '<span class="center">' . SubmitButton(_('Save')) . '</span>'; echo '</FORM>'; } function _makeType($value, $name) { global $THIS_RET; if ($THIS_RET['USAGE_ID']) { $id = $THIS_RET['USAGE_ID'];
echo _makeTextInput('CUSTOM_' . $field['ID'], $field['TITLE'], '', $request); echo '</TD></TR>'; break; case 'autos': echo '<TR><TD>'; echo _makeAutoSelectInput('CUSTOM_' . $field['ID'], $field['TITLE'], $request); echo '</TD></TR>'; break; case 'edits': echo '<TR><TD>'; echo _makeAutoSelectInput('CUSTOM_' . $field['ID'], $field['TITLE'], $request); echo '</TD></TR>'; break; case 'numeric': echo '<TR><TD>'; echo _makeTextInput('CUSTOM_' . $field['ID'], $field['TITLE'], 'size=5 maxlength=10', $request); echo '</TD></TR>'; break; case 'date': echo '<TR><TD>'; echo _makeDateInput('CUSTOM_' . $field['ID'], $field['TITLE'], $request); echo '</TD></TR>'; break; case 'codeds': case 'select': echo '<TR><TD>'; echo _makeSelectInput('CUSTOM_' . $field['ID'], $field['TITLE'], $request); echo '</TD></TR>'; break; case 'multiple': echo '<TR><TD>';
} if ($_REQUEST['modfunc'] == 'delete' && AllowEdit()) { if (DeletePrompt(_('Category'))) { $id = $_REQUEST['id']; DBQuery("DELETE FROM DISCIPLINE_CATEGORIES WHERE ID='{$id}'"); DBQuery("ALTER TABLE DISCIPLINE_REFERRALS DROP COLUMN CATEGORY_{$id}"); unset($_REQUEST['modfunc']); unset($_REQUEST['id']); } } if (empty($_REQUEST['modfunc'])) { $sql = "SELECT ID,TITLE,SORT_ORDER,TYPE,OPTIONS FROM DISCIPLINE_CATEGORIES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' ORDER BY SORT_ORDER"; $QI = DBQuery($sql); $referrals_RET = DBGet($QI, array('TITLE' => '_makeTextInput', 'SORT_ORDER' => '_makeTextInput', 'TYPE' => '_makeType', 'OPTIONS' => '_makeTextAreaInput')); $columns = array('TITLE' => _('Title'), 'SORT_ORDER' => _('Sort Order'), 'TYPE' => _('Data Type'), 'OPTIONS' => _('Options')); $link['add']['html'] = array('TITLE' => _makeTextInput('', 'TITLE'), 'SORT_ORDER' => _makeTextInput('', 'SORT_ORDER'), 'OPTIONS' => _makeTextAreaInput('', 'OPTIONS'), 'TYPE' => _makeType('', 'TYPE')); if (AllowEdit()) { $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=delete"; $link['remove']['variables'] = array('id' => 'ID'); } echo '<FORM action="Modules.php?modname=' . $_REQUEST['modname'] . '" method="POST">'; DrawHeader('', SubmitButton(_('Save'))); ListOutput($referrals_RET, $columns, 'Referral Form Category', 'Referral Form Categories', $link); echo '<span class="center">' . SubmitButton(_('Save')) . '</span>'; echo '</FORM>'; } function _makeType($value, $name) { global $THIS_RET; if ($THIS_RET['ID']) { $id = $THIS_RET['ID'];