if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'remove') { if (DeletePrompt('login message')) { DBQuery("DELETE FROM login_message WHERE ID='{$_REQUEST['id']}'"); unset($_REQUEST['modfunc']); } } if ($_REQUEST['modfunc'] != 'remove') { $maintain_RET = DBGet(DBQuery("SELECT SYSTEM_MAINTENANCE_SWITCH FROM system_preference_misc LIMIT 1")); $maintain = $maintain_RET[1]; echo "<FORM name=maintenance id=maintenance action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update&page_display=MAINTENANCE method=POST>"; echo '<table>'; echo '<tr><td align=left><span style="font-size:12px; font-weight:bold;">' . _('Under Maintenance') . ' :</td><td><span style="font-weight:bold;">' . CheckboxInput($maintain['SYSTEM_MAINTENANCE_SWITCH'], 'maintain[SYSTEM_MAINTENANCE_SWITCH]') . '</span></td></tr>'; $sql = 'SELECT ID,MESSAGE,DISPLAY FROM login_message ORDER BY ID'; $QI = DBQuery($sql); $login_MESSAGE = DBGet($QI, array('MESSAGE' => '_makeContentInput', 'DISPLAY' => '_makeRadio')); $link['add']['html'] = array('MESSAGE' => _makeContentInput('', 'MESSAGE'), 'DISPLAY' => _makeRadio('', 'DISPLAY')); $link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove&page_display=MAINTENANCE"; $link['remove']['variables'] = array('id' => 'ID'); $columns = array('MESSAGE' => '' . _('Login Message') . '', 'DISPLAY' => '' . _('Display') . ''); ListOutput($login_MESSAGE, $columns, _('Message'), _('Messages'), $link, true, array('search' => false)); echo '<tr><td><CENTER>' . SubmitButton(_('Save'), '', 'class=btn_medium') . '</CENTER></td></tr>'; echo '</table>'; echo '</FORM>'; } } else { if (clean_param($_REQUEST['page_display'], PARAM_ALPHAMOD) == 'INACTIVITY') { PopTable('header', _('User Inactivity Days')); include "User_activity_days.php"; PopTable('footer'); } else { if (clean_param($_REQUEST['page_display'], PARAM_ALPHAMOD) == 'FAILURE') {
$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') {
} 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';
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>';