function SelectedUserProfile($option) { $prof = DBGet(DBQuery('SELECT ' . $option . ' FROM staff WHERE STAFF_ID=' . UserStaffID())); return $prof[1][$option]; }
$title = ' › ' . $category['TITLE']; $can_use = $exceptions_RET[$file][1]['CAN_USE']; $can_edit = $exceptions_RET[$file][1]['CAN_EDIT']; echo "<TR><TD></TD><TD></TD>"; echo "<TD align=center bgcolor=#DDDDDD><INPUT type=checkbox id=can_use[" . str_replace('.', '_', $file) . "] name=can_use[" . str_replace('.', '_', $file) . "] value=true" . ($can_use == 'Y' ? ' CHECKED' : '') . (AllowEdit() ? '' : ' DISABLED') . "></TD>"; echo "<TD align=center bgcolor=#DDDDDD><INPUT type=checkbox id=can_edit[" . str_replace('.', '_', $file) . "] name=can_edit[" . str_replace('.', '_', $file) . "] value=true" . ($can_edit == 'Y' ? ' CHECKED' : '') . (AllowEdit() ? '' : ' DISABLED') . "></TD>"; echo "<TD bgcolor=#DDDDDD> {$title}</TD></TR><TR><TD></TD><TD></TD><TD colspan=3 height=1 bgcolor=#000000></TR>"; } } } else { echo '<TR><TD></TD><TD></TD><TD bgcolor=#FFFFFF colspan=3 align=center><small><b>- ' . $title . ' -</b></small></TD></TR>'; } } } echo '<TR><TD colspan=5 align=center height=20></TD></TR>'; } echo '</TABLE>'; PopTable('footer'); echo '<CENTER>' . SubmitButton(_('Save'), '', 'class=btn_medium') . '</CENTER>'; echo '</DIV>'; echo '</TD></TR></TABLE>'; echo '</FORM>'; echo '<DIV id=new_id_content style="position:absolute;visibility:hidden;">' . _('Title') . ' <INPUT type=text name=new_profile_title><BR>'; echo 'Type <SELECT name=new_profile_type><OPTION value=admin>' . _('Administrator') . '<OPTION value=teacher>Teacher<OPTION value=parent>Parent</SELECT></DIV>'; } elseif (UserStaffID() && $staff_RET[1]['PROFILE_ID']) { $profile_title = DBGet(DBQuery('SELECT TITLE FROM user_profiles WHERE ID=\'' . $staff_RET[1]['PROFILE_ID'] . '\'')); echo '<BR>'; PopTable('header', 'Error', 'width=50%'); echo '<TABLE><TR><TD><IMG SRC=assets/warning_button.gif width=30></TD><TD>' . $staff_RET[1]['FIRST_NAME'] . ' ' . $staff_RET[1]['LAST_NAME'] . '' . _(' is assigned to the profile ') . '' . $profile_title[1]['TITLE'] . '.<BR><BR> ' . _('To assign permissions to this user, either change the permissions for this profile using the') . ' ' . ProgramLink('Users/Profiles.php', '' . _('Profiles') . '') . _(' setup program or change this user to a User with custom permissions using the') . ' ' . ProgramLink('Users/User.php', '' . _('General Info') . '') . _('program') . '</TD></TR></TABLE>'; PopTable('footer'); }
$categories_RET = DBGet(DBQuery('SELECT ID,TITLE,INCLUDE FROM people_field_categories WHERE ' . ($profile ? strtoupper($profile) . '=\'Y\'' : 'ID=\'1\'') . ' ORDER BY SORT_ORDER,TITLE')); foreach ($categories_RET as $category) { if ($can_use_RET['users/User.php&category_id=' . $category['ID']]) { if ($category['ID'] == '1') { $include = 'GeneralInfoInc'; } elseif ($category['ID'] == '2') { $include = 'AddressInfoInc'; } elseif ($category['INCLUDE']) { $include = $category['INCLUDE']; } else { $include = 'OtherInfoUserInc'; } if (User('PROFILE_ID') == 4) { $tabs[] = array('title' => $category['TITLE'], 'link' => "Modules.php?modname={$_REQUEST['modname']}&include={$include}&category_id=" . $category['ID']); } else { $tabs[] = array('title' => $category['TITLE'], 'link' => "Modules.php?modname={$_REQUEST['modname']}&include={$include}&category_id=" . $category['ID'] . "&staff_id=" . UserStaffID()); } } } $_openSIS['selected_tab'] = "Modules.php?modname={$_REQUEST['modname']}&include={$_REQUEST['include']}"; if ($_REQUEST['category_id']) { $_openSIS['selected_tab'] .= '&category_id=' . $_REQUEST['category_id']; } if (User('PROFILE_ID') != 4) { $_openSIS['selected_tab'] .= '&staff_id=' . $_REQUEST['staff_id']; } echo '<BR>'; PopTable('header', $tabs, 'width=96%'); if (!strpos($_REQUEST['include'], '/')) { include 'modules/users/includes/' . $_REQUEST['include'] . '.php'; } else {
function PortalPollsDisplay($value, $name) { global $THIS_RET; static $js_included = false; $poll_id = $THIS_RET['ID']; //get poll: $poll_RET = DBGet(DBQuery("SELECT EXCLUDED_USERS, VOTES_NUMBER, DISPLAY_VOTES FROM PORTAL_POLLS WHERE ID='" . $poll_id . "'")); $poll_questions_RET = DBGet(DBQuery("SELECT ID, QUESTION, OPTIONS, TYPE, VOTES FROM PORTAL_POLL_QUESTIONS WHERE PORTAL_POLL_ID='" . $poll_id . "' ORDER BY ID")); if (!$poll_RET || !$poll_questions_RET) { return ErrorMessage(array('Poll does not exist')); } //should never be displayed, so do not translate //verify if user is in excluded users list (format = '|[profile_id]:[user_id]') $profile_id = User('PROFILE_ID'); if ($profile_id != 0) { //modif Francois: call right Student/Staff ID $user_id = UserStaffID(); } else { $user_id = UserStudentID(); } $excluded_user = '******' . $profile_id . ':' . $user_id; if (mb_strpos($poll_RET[1]['EXCLUDED_USERS'], $excluded_user) !== false) { return PortalPollsVotesDisplay($poll_id, $poll_RET[1]['DISPLAY_VOTES'], $poll_questions_RET, $poll_RET[1]['VOTES_NUMBER']); } //user already voted, display votes $PollForm = ''; if (!$js_included) { $PollForm .= includeOnceJquery(); $PollForm .= '<script type="text/javascript" src="assets/js/jquery.form.js"></script>'; $PollForm .= '<script type="text/javascript"> $(document).ready(function() { $(\'.formPortalPoll\').ajaxForm({ //send the votes in AJAX success: function(data,status,xhr,form) { $(form).parent().html(data); } }); }); </script>'; $js_included = true; } $PollForm .= '<div id="divPortalPoll' . $poll_id . '" style="max-height:350px; overflow-y:auto;"><form method="POST" class="formPortalPoll" action="ProgramFunctions/PortalPolls.fnc.php"><input type="hidden" name="profile_id" value="' . $profile_id . '" /><input type="hidden" name="user_id" value="' . $user_id . '" /><input type="hidden" name="total_votes_string" value="' . _('Total Participants') . '" /><input type="hidden" name="poll_completed_string" value="' . _('Poll completed') . '" /><TABLE class="width-100p cellspacing-0">'; foreach ($poll_questions_RET as $question) { $PollForm .= '<TR><TD><b>' . $question['QUESTION'] . '</b></TD><TD><TABLE class="width-100p cellspacing-0">'; $options_array = explode('<br />', nl2br($question['OPTIONS'])); $checked = true; foreach ($options_array as $option_nb => $option_label) { if ($question['TYPE'] == 'multiple_radio') { $PollForm .= '<TR><TD><label><input type="radio" name="votes[' . $poll_id . '][' . $question['ID'] . ']" value="' . $option_nb . '" ' . ($checked ? 'checked' : '') . ' /> ' . $option_label . '</label></TD></TR>' . "\n"; } else { //multiple $PollForm .= '<TR><TD><label><input type="checkbox" name="votes[' . $poll_id . '][' . $question['ID'] . '][]" value="' . $option_nb . '" /> ' . $option_label . '</label></TD></TR>' . "\n"; } $checked = false; } $PollForm .= '</TABLE></TD></TR>'; } $PollForm .= '</TD></TR></TABLE><P><input type="submit" value="' . _('Submit') . '" /></P></form></div>'; return $PollForm; }
function core_role_unassign_roles_object() { //first, gather the necessary variables global $_REQUEST; //then, convert variables for the Moodle object: /* list of ( object { roleid int //Role to assign to the user userid int //The user that is going to be assigned contextid int //The context to unassign the user role from } )*/ //gather the Moodle user ID $userid = DBGet(DBQuery("SELECT moodle_id FROM moodlexrosario WHERE rosario_id='" . UserStaffID() . "' AND \"column\"='staff_id'")); if (count($userid)) { $userid = (int) $userid[1]['MOODLE_ID']; } else { return null; } //get the contextid global $moodle_contextlevel, $moodle_instance; $moodle_contextlevel = CONTEXT_USER; //gather the Moodle user ID $moodle_instance = DBGet(DBQuery("SELECT moodle_id FROM moodlexrosario WHERE rosario_id='" . $_REQUEST['student_id'] . "' AND \"column\"='student_id'")); if (count($moodle_instance)) { $moodle_instance = (int) $moodle_instance[1]['MOODLE_ID']; } else { return null; } $contexts = Moodle('Global/functions.php', 'local_getcontexts_get_contexts'); $contextid = $contexts[0]['id']; $roleid = MOODLE_PARENT_ROLE_ID; $unassignments = array(array('roleid' => $roleid, 'userid' => $userid, 'contextid' => $contextid)); return array($unassignments); }
function _makeExtra($value, $column) { global $THIS_RET, $student_points, $total_points, $percent_weights; if ($column == 'POINTS') { if ($THIS_RET['TOTAL_POINTS'] != '0') { if ($value != '-1') { if (($THIS_RET['DUE'] || $value != '') && $value != '') { $student_points[$THIS_RET['ASSIGNMENT_TYPE_ID']] += $value; $total_points[$THIS_RET['ASSIGNMENT_TYPE_ID']] += $THIS_RET['TOTAL_POINTS']; $percent_weights[$THIS_RET['ASSIGNMENT_TYPE_ID']] = $THIS_RET['FINAL_GRADE_PERCENT']; } return '<TABLE border=0 cellspacing=0 cellpadding=0 class=LO_field><TR><TD><font size=-1>' . (rtrim(rtrim($value, '0'), '.') + 0) . '</font></TD><TD><font size=-1> / </font></TD><TD><font size=-1>' . $THIS_RET['TOTAL_POINTS'] . '</font></TD></TR></TABLE>'; } else { return '<TABLE border=0 cellspacing=0 cellpadding=0 class=LO_field><TR><TD><font size=-1>Excluded</font></TD><TD></TD><TD></TD></TR></TABLE>'; } } else { $student_points[$THIS_RET['ASSIGNMENT_TYPE_ID']] += $value; return '<TABLE border=0 cellspacing=0 cellpadding=0 class=LO_field><TR><TD><font size=-1>' . (rtrim(rtrim($value, '0'), '.') + 0) . '</font></TD><TD><font size=-1> / </font></TD><TD><font size=-1>' . $THIS_RET['TOTAL_POINTS'] . '</font></TD></TR></TABLE>'; } } elseif ($column == 'LETTER_GRADE') { if ($THIS_RET['TOTAL_POINTS'] != '0') { if ($value != '-1') { if ($THIS_RET['DUE'] && $value == '') { return 'Not Graded'; } else { if ($THIS_RET['DUE'] || $value != '') { return Percent($value / $THIS_RET['TOTAL_POINTS'], 0) . ' ' . _makeLetterGrade($value / $THIS_RET['TOTAL_POINTS'], $THIS_RET['COURSE_PERIOD_ID'], UserStaffID()); } else { return 'not due'; } } } else { return 'n/a n/a'; } } else { return 'e/c'; } } }
} echo '</SELECT>'; } echo '</FORM>'; if (UserStudentID() && (User('PROFILE') == 'admin' || User('PROFILE') == 'teacher')) { $sql = "SELECT FIRST_NAME||' '||coalesce(MIDDLE_NAME,' ')||' '||LAST_NAME||' '||coalesce(NAME_SUFFIX,' ') AS FULL_NAME FROM STUDENTS WHERE STUDENT_ID='" . UserStudentID() . "'"; $RET = DBGet(DBQuery($sql)); echo '<TABLE class="width-100p cellspacing-0 cellpadding-0" style="background-color:#333366;"><TR><TD><A HREF="Side.php?student_id=new&modcat=' . $_REQUEST['modcat'] . '"><IMG SRC="assets/x.png" height="17" style="vertical-align: middle;"></A></TD><TD><B>' . (AllowUse('Students/Student.php') ? '<A HREF="Modules.php?modname=Students/Student.php&student_id=' . UserStudentID() . '" target="body">' : '') . '<span style="color:white" class="size-2">' . $RET[1]['FULL_NAME'] . '</span>' . (AllowUse('Students/Student.php') ? '</A>' : '') . '</B></TD></TR></TABLE>'; } if (UserStaffID() && (User('PROFILE') == 'admin' || User('PROFILE') == 'teacher')) { if (UserStudentID()) { echo '<div style="height:5px;"></div>'; } $sql = "SELECT FIRST_NAME||' '||LAST_NAME AS FULL_NAME FROM STAFF WHERE STAFF_ID='" . UserStaffID() . "'"; $RET = DBGet(DBQuery($sql)); echo '<TABLE class="width-100p cellspacing-0 cellpadding-0" style="background-color:' . (UserStaffID() == User('STAFF_ID') ? '#663333' : '#336633') . ';"><TR><TD><A HREF="Side.php?staff_id=new&modcat=' . $_REQUEST['modcat'] . '"><IMG SRC="assets/x.png" height="17" style="vertical-align: middle;"></A></TD><TD><B>' . (AllowUse('Users/User.php') ? '<A HREF="Modules.php?modname=Users/User.php&staff_id=' . UserStaffID() . '" target="body">' : '') . '<span style="color:white" class="size-2">' . $RET[1]['FULL_NAME'] . '</span>' . (AllowUse('Users/User.php') ? '</A>' : '') . '</B></TD></TR></TABLE>'; } //modif Francois: css WPadmin echo '<BR /><div id="adminmenu">'; // Program Information require 'Menu.php'; foreach ($_ROSARIO['Menu'] as $modcat => $programs) { if (count($_ROSARIO['Menu'][$modcat])) { $keys = array_keys($_ROSARIO['Menu'][$modcat]); echo '<A style="cursor: pointer;" class="menu-top" onclick="openMenu(\'' . $modcat . '\');parent.body.location=\'Modules.php?modname=' . $modcat . '/Search.php\';"><IMG SRC="assets/icons/' . $modcat . '.png" height="32" style="vertical-align:middle;"> ' . _(str_replace('_', ' ', $modcat)) . '</A><DIV id="menu_visible' . $modcat . '" class="wp-submenu" style="display:none;"></DIV>'; echo '<DIV id="menu_hidden' . $modcat . '" style="display:none;"><TABLE class="width-100p cellspacing-0 cellpadding-0">'; //foreach($_ROSARIO['Menu'][$modcat] as $file=>$title) foreach ($keys as $key_index => $file) { $title = $_ROSARIO['Menu'][$modcat][$file]; if (mb_stripos($file, 'http://') !== false) { echo '<TR><TD><A HREF="' . $file . '" target="_blank">' . $title . '</A></TD></TR>';
StaffWidgets('fsa_status'); StaffWidgets('fsa_barcode'); StaffWidgets('fsa_exists_Y'); $extra['SELECT'] .= ',(SELECT BALANCE FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS BALANCE'; $extra['SELECT'] .= ',(SELECT coalesce(STATUS,\'Active\') FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS STATUS'; $extra['functions'] += array('BALANCE' => 'red'); $extra['columns_after'] = array('BALANCE' => 'Balance', 'STATUS' => 'Status'); Search('staff_id', $extra); if (!$_REQUEST['modfunc'] && UserStaffID()) { $staff = DBGet(DBQuery('SELECT s.STAFF_ID,s.FIRST_NAME,s.LAST_NAME,s.MIDDLE_NAME,(SELECT STATUS FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS STATUS,(SELECT BALANCE FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS BALANCE,(SELECT BARCODE FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=s.STAFF_ID) AS BARCODE FROM STAFF s WHERE s.STAFF_ID=' . UserStaffID())); $staff = $staff[1]; if ($staff['BALANCE']) { echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&staff_id=" . UserStaffID() . "&modfunc=update method=POST>"; DrawHeader('', SubmitButton('Save', 'submit[save]') . ($staff['BALANCE'] == 0 ? SubmitButton('Delete Account', 'submit[delete]') : '')); } else { echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&staff_id=" . UserStaffID() . "&modfunc=create method=POST>"; DrawHeader('', SubmitButton('Create Account')); } echo '<BR>'; PopTable('header', 'Account Information', 'width=100%'); echo '<TABLE width=100%>'; echo '<TR>'; echo '<TD valign=top>'; echo '<TABLE width=100%><TR>'; echo '<TD valign=top>'; echo $staff['FIRST_NAME'] . ' ' . $staff['MIDDLE_NAME'] . ' ' . $staff['LAST_NAME'] . '<BR>'; echo '<b><small>' . $staff['STAFF_ID'] . '</small></b>'; if (!$staff['BALANCE']) { $warning = 'This user does not have a Meal Account.'; echo '<BR>' . button('warning', '', '# onMouseOver=\'stm(["Warning","' . $warning . '"],["white","#006699","","","",,"black","#e8e8ff","","","",,,,2,"#006699",2,,,,,"",,,,]);\' onMouseOut=\'htm()\''); }
<?php include_once 'ProgramFunctions/StudentsUsersInfo.fnc.php'; $category_RET = DBGet(DBQuery("SELECT COLUMNS FROM STAFF_FIELD_CATEGORIES WHERE ID='{$_REQUEST['category_id']}'")); $fields_RET = DBGet(DBQuery("SELECT ID,TITLE,TYPE,SELECT_OPTIONS,DEFAULT_SELECTION,REQUIRED FROM STAFF_FIELDS WHERE CATEGORY_ID='{$_REQUEST['category_id']}' ORDER BY SORT_ORDER,TITLE")); if (UserStaffID()) { $custom_RET = DBGet(DBQuery("SELECT * FROM STAFF WHERE STAFF_ID='" . UserStaffID() . "'")); $value = $custom_RET[1]; } //echo '<pre>'; var_dump($fields_RET); echo '</pre>'; if (count($fields_RET)) { echo $separator; } echo '<TABLE class="cellpadding-5">'; $i = 1; $per_row = $category_RET[1]['COLUMNS'] ? $category_RET[1]['COLUMNS'] : '3'; foreach ($fields_RET as $field) { $field['TITLE'] = ParseMLField($field['TITLE']); //echo '<pre>'; var_dump($field); echo '</pre>'; switch ($field['TYPE']) { case 'text': if (($i - 1) % $per_row == 0) { echo '<TR>'; } echo '<TD>'; echo _makeTextInput('CUSTOM_' . $field['ID'], $field['TITLE'], '', 'staff'); echo '</TD>'; if ($i % $per_row == 0) { echo '</TR>'; } else { echo '<TD style="width:50px;"></TD>';
unset($_REQUEST['values']); } if ($_REQUEST['modfunc'] == 'remove' && !$_REQUEST['delete_ok']) { //$a=DeletePromptStaff('Certificate') ; $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'];
echo '<script language=JavaScript>parent.side.location="' . $_SESSION['Side_PHP_SELF'] . '?modcat="+parent.side.document.forms[0].modcat.value;</script>'; Search('staff_id', 'parent'); } } if (UserStaffID()) { if (clean_param($_REQUEST['search_modfunc'], PARAM_ALPHAMOD) == 'list') { echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save method=POST>"; } } if ($note) { DrawHeader('<IMG SRC=assets/check.gif>' . $note); } if (UserStaffID()) { echo '<CENTER><TABLE width="" align="center"><TR><TD valign=top>'; DrawHeader('<div class="big_font">Associated students with ' . $RET[1]['FIRST_NAME'] . ' ' . $RET[1]['LAST_NAME'] . '</div>', $extra['header_right']); $current_RET = DBGet(DBQuery('SELECT u.STUDENT_ID,CONCAT(s.LAST_NAME,\' \',s.FIRST_NAME) AS FULL_NAME FROM students_join_users u,students s WHERE s.STUDENT_ID=u.STUDENT_ID AND u.STAFF_ID=\'' . UserStaffID() . '\'')); $link['remove'] = array('link' => "Modules.php?modname={$_REQUEST['modname']}&modfunc=delete", 'variables' => array('student_id' => 'STUDENT_ID')); ListOutput($current_RET, array('FULL_NAME' => 'Students'), '', '', $link, array(), array('search' => false)); echo '</TD></TR></TABLE><div class="clear"></div><div style="width:830px;">'; if (clean_param($_REQUEST['search_modfunc'], PARAM_ALPHAMOD) == 'list') { echo '<div style="margin-bottom:-28px;">' . DrawHeader('', SubmitButton('Add Selected Students', '', 'class=btn_large')) . '</div>'; } $extra['link'] = array('FULL_NAME' => false); $extra['SELECT'] = ",NULL AS CHECKBOX"; $extra['functions'] = array('CHECKBOX' => '_makeChooseCheckbox'); $extra['columns_before'] = array('CHECKBOX' => '</A><INPUT type=checkbox value=Y name=controller onclick="checkAll(this.form,this.form.controller.checked,\'student\');"><A>'); $extra['new'] = true; $extra['options']['search'] = false; if (AllowEdit()) { Search('student_id', $extra); }
#*************************************************************************************** include '../../RedirectModulesInc.php'; DrawBC("users >> " . ProgramTitle()); PopTable('header', 'Upload Staff\'s Photo'); $UserPicturesPath = 'assets/userphotos/'; if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'edit') { if ($UserPicturesPath && (($file = @fopen($picture_path = $UserPicturesPath . '/' . UserStaffID() . '.JPG', 'r')) || ($file = @fopen($picture_path = $UserPicturesPath . '/' . UserStaffID() . '.JPG', 'r')))) { echo '<div align=center><IMG SRC="' . $picture_path . '?id=' . rand(6, 100000) . '" width=150 class=pic></div><div class=break></div>'; } unset($_REQUEST['modfunc']); } if (UserStaffID()) { $profile = DBGet(DBQuery('SELECT PROFILE FROM staff WHERE STAFF_ID=\'' . UserStaffID() . '\' ')); if ($profile[1]['PROFILE'] != 'parent') { if (clean_param($_REQUEST['action'], PARAM_ALPHAMOD) == 'upload' && $_FILES['file']['name']) { $target_path = $UserPicturesPath . '/' . UserStaffID() . '.JPG'; $destination_path = $UserPicturesPath; $upload = new upload(); $upload->target_path = $target_path; $upload->deleteOldImage(); $upload->destination_path = $destination_path; $upload->name = $_FILES["file"]["name"]; $upload->setFileExtension(); $upload->fileExtension; $upload->validateImage(); if ($upload->wrongFormat == 1) { $_FILES["file"]["error"] = 1; } if ($_FILES["file"]["error"] > 0) { $msg = "<font color=red><b>Cannot upload file. Only jpeg, jpg, png, gif files are allowed.</b></font>"; echo '
# #*************************************************************************************** include '../../../RedirectIncludes.php'; if (GetTeacher(UserStaffID(), '', 'PROFILE', false) == 'teacher') { $mp_select_RET = DBGet(DBQuery('SELECT DISTINCT cp.MARKING_PERIOD_ID, (SELECT TITLE FROM marking_periods WHERE MARKING_PERIOD_ID=cp.MARKING_PERIOD_ID) AS TITLE FROM course_periods cp,courses c, school_periods sp,course_period_var cpv WHERE cp.COURSE_PERIOD_ID=cpv.COURSE_PERIOD_ID AND cp.COURSE_ID=c.COURSE_ID AND (cp.TEACHER_ID=\'' . UserStaffID() . '\' OR cp.SECONDARY_TEACHER_ID=\'' . UserStaffID() . '\') AND cpv.PERIOD_ID=sp.PERIOD_ID AND cp.MARKING_PERIOD_ID IS NOT NULL AND cp.SYEAR=\'' . UserSyear() . '\' AND cp.SCHOOL_ID=\'' . UserSchool() . '\'')); $print_mp = CreateSelect($mp_select_RET, 'marking_period_id', 'Show All', 'Modules.php?modname=' . $_REQUEST['modname'] . '&include=' . $_REQUEST['include'] . '&category_id=' . $_REQUEST['category_id'] . '&marking_period_id='); echo '<div style="padding:10px 0px 0px 25px;"><strong>Marking Periods :</strong> ' . $print_mp . '</div>'; if (!$_REQUEST['marking_period_id']) { $schedule_RET = DBGet(DBQuery('SELECT cp.SCHEDULE_TYPE,cp.course_period_id,\'\' as ROOM,c.TITLE AS COURSE,\'\' as PERIOD,cp.COURSE_WEIGHT,IF(cp.MARKING_PERIOD_ID IS NULL ,\'Custom\',cp.MARKING_PERIOD_ID) AS MARKING_PERIOD_ID, \'\' as DAYS,\'\' AS DURATION from course_periods cp , courses c WHERE cp.course_id=c.COURSE_ID AND (cp.TEACHER_ID=\'' . UserStaffID() . '\' OR cp.SECONDARY_TEACHER_ID=\'' . UserStaffID() . '\') AND cp.SYEAR=\'' . UserSyear() . '\' AND cp.SCHOOL_ID=' . UserSchool()), array('PERIOD_ID' => 'GetPeriod', 'MARKING_PERIOD_ID' => 'GetMP_teacherschedule')); } else { if ($_REQUEST['marking_period_id']) { $sel_mp_info = DBGet(DBQuery('SELECT * FROM marking_periods WHERE MARKING_PERIOD_ID=' . $_REQUEST['marking_period_id'])); $sel_mp_info = $sel_mp_info[1]; $schedule_RET = DBGet(DBQuery('SELECT cp.SCHEDULE_TYPE,cp.course_period_id,\'\' as ROOM,\'\' as PERIOD,c.TITLE AS COURSE,cp.COURSE_WEIGHT,IF(cp.MARKING_PERIOD_ID IS NULL ,\'Custom\',cp.MARKING_PERIOD_ID) AS MARKING_PERIOD_ID, \'\' as DAYS,\'\' AS DURATION from course_periods cp , courses c WHERE cp.course_id=c.COURSE_ID AND (cp.MARKING_PERIOD_ID IN (' . GetAllMP(GetMPTable(GetMP($_REQUEST['marking_period_id'], 'TABLE')), $_REQUEST['marking_period_id']) . ') OR (cp.MARKING_PERIOD_ID IS NULL AND (cp.BEGIN_DATE BETWEEN \'' . $sel_mp_info['START_DATE'] . '\' AND \'' . $sel_mp_info['END_DATE'] . '\'))) AND (cp.TEACHER_ID=\'' . UserStaffID() . '\' OR cp.SECONDARY_TEACHER_ID=\'' . UserStaffID() . '\') AND cp.SCHOOL_ID=\'' . UserSchool() . '\' AND cp.SYEAR=' . UserSyear()), array('PERIOD_ID' => 'GetPeriod', 'MARKING_PERIOD_ID' => 'GetMP_teacherschedule')); } } foreach ($schedule_RET as $rdi => $rdd) { $get_det = DBGet(DBQuery('SELECT cpv.DAYS,cpv.COURSE_PERIOD_DATE,CONCAT(sp.START_TIME,\'' . ' to ' . '\', sp.END_TIME) AS DURATION,r.TITLE as ROOM,sp.TITLE AS PERIOD FROM course_period_var cpv,school_periods sp,rooms r WHERE sp.PERIOD_ID=cpv.PERIOD_ID AND cpv.ROOM_ID=r.ROOM_ID AND cpv.COURSE_PERIOD_ID=' . $rdd['COURSE_PERIOD_ID'])); $cp_info = DBGet(DBQuery('SELECT * FROM course_periods WHERE COURSE_PERIOD_ID=' . $rdd['COURSE_PERIOD_ID'])); if ($rdd['SCHEDULE_TYPE'] == 'FIXED') { $schedule_RET[$rdi]['DAYS'] = _makeDays($get_det[1]['DAYS']); $schedule_RET[$rdi]['DURATION'] = $get_det[1]['DURATION']; $schedule_RET[$rdi]['ROOM'] = $get_det[1]['ROOM']; $schedule_RET[$rdi]['PERIOD'] = $get_det[1]['PERIOD']; if ($schedule_RET[$rdi]['MARKING_PERIOD_ID'] == 'Custom') { $schedule_RET[$rdi]['MARKING_PERIOD_ID'] = date('M/d/Y', strtotime($cp_info[1]['BEGIN_DATE'])) . ' to ' . date('M/d/Y', strtotime($cp_info[1]['END_DATE'])); } } else { $temp_days = array();
# along with this program. If not, see <http://www.gnu.org/licenses/>. #************************************************************************** //error_reporting(1); error_reporting(E_ERROR); $isajax = "ajax"; $start_time = time(); include 'Warehouse.php'; array_rwalk($_REQUEST, 'strip_tags'); if (UserStudentID() && User('PROFILE') != 'parent' && User('PROFILE') != 'student') { $RET = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME,MIDDLE_NAME,NAME_SUFFIX FROM STUDENTS WHERE STUDENT_ID='" . UserStudentID() . "'")); DrawHeaderHome('Selected Student: ' . $RET[1]['FIRST_NAME'] . ' ' . ($RET[1]['MIDDLE_NAME'] ? $RET[1]['MIDDLE_NAME'] . ' ' : '') . $RET[1]['LAST_NAME'] . ' ' . $RET[1]['NAME_SUFFIX'] . ' (<A HREF=Side.php?student_id=new&modcat=' . $_REQUEST['modcat'] . '><font color=red>Remove</font></A>) | <A HREF=' . $_SESSION['List_PHP_SELF'] . '&bottom_back=true target=body>Back to Student List</A>'); } if (UserStaffID() && User('PROFILE') == 'admin') { //if(UserStudentID()) // echo '<IMG SRC=assets/pixel_trans.gif height=2>'; $RET = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME FROM STAFF WHERE STAFF_ID='" . UserStaffID() . "'")); DrawHeaderHome('Selected User: '******'FIRST_NAME'] . ' ' . $RET[1]['LAST_NAME'] . ' (<A HREF=Side.php?staff_id=new&modcat=' . $_REQUEST['modcat'] . '><font color=red>Remove</font></A>)'); } echo "<center><div id='divErr'></div></center>"; if (!isset($_REQUEST['_CENTRE_PDF'])) { Warehouse('header'); //if(strpos($_REQUEST['modname'],'misc/')===false && $_REQUEST['modname']!='Students/Student.php' && $_REQUEST['modname']!='School_Setup/Calendar.php' && $_REQUEST['modname']!='Scheduling/Schedule.php' && $_REQUEST['modname']!='Attendance/Percent.php' && $_REQUEST['modname']!='Attendance/Percent.php?list_by_day=true' && $_REQUEST['modname']!='Scheduling/MassRequests.php' && $_REQUEST['modname']!='Scheduling/MassSchedule.php' && $_REQUEST['modname']!='Student_Billing/Fees.php') if (strpos($_REQUEST['modname'], 'misc/') === false) { echo '<script language="JavaScript">if(window == top && (!window.opener || window.opener.location.href.substring(0,(window.opener.location.href.indexOf("&")!=-1?window.opener.location.href.indexOf("&"):window.opener.location.href.replace("#","").length))!=window.location.href.substring(0,(window.location.href.indexOf("&")!=-1?window.location.href.indexOf("&"):window.location.href.replace("#","").length)))) window.location.href = "index.php";</script>'; } echo "<BODY marginwidth=0 leftmargin=0 border=0 onload='doOnload();' background=assets/bg.gif>"; #echo '<DIV id="Migoicons" style="visibility:hidden;position:absolute;z-index:1000;top:-100"></DIV><SCRIPT language="JavaScript1.2" type="text/javascript">var TipId="Migoicons";var FiltersEnabled = 1;mig_clay();'; echo '<DIV id="Migoicons" style="visibility:hidden;position:absolute;z-index:1000;top:-100"></DIV>'; echo "<TABLE width=100% height=100% border=0 cellpadding=0 align=center><TR><TD valign=top align=center>"; } if ($_REQUEST['modname']) {
//modif Francois: add translation foreach ($RET as $RET_key => $RET_val) { $RET[$RET_key] = array_map('types_locale', $RET_val); } // get details of each transaction foreach ($RET as $key => $value) { $tmpRET = DBGet(DBQuery('SELECT TRANSACTION_ID AS TRANS_ID,* FROM FOOD_SERVICE_STAFF_TRANSACTION_ITEMS WHERE TRANSACTION_ID=\'' . $value['TRANSACTION_ID'] . '\'')); //modif Francois: add translation foreach ($tmpRET as $RET_key => $RET_val) { $tmpRET[$RET_key] = array_map('options_locale', $RET_val); } // merge transaction and detail records $RET[$key] = array($RET[$key]) + $tmpRET; } $columns = array('TRANSACTION_ID' => _('ID'), 'DATE' => _('Date'), 'TIME' => _('Time'), 'BALANCE' => _('Balance'), 'DESCRIPTION' => _('Description'), 'AMOUNT' => _('Amount'), 'SELLER' => _('User')); $group = array(array('TRANSACTION_ID')); $link['remove']['link'] = PreparePHP_SELF($_REQUEST, array(), array('modfunc' => 'delete')); $link['remove']['variables'] = array('transaction_id' => 'TRANS_ID', 'item_id' => 'ITEM_ID'); } else { $RET = DBGet(DBQuery("SELECT fst.TRANSACTION_ID,(SELECT sum(AMOUNT) FROM FOOD_SERVICE_STAFF_TRANSACTION_ITEMS WHERE TRANSACTION_ID=fst.TRANSACTION_ID) AS AMOUNT,fst.BALANCE,to_char(fst.TIMESTAMP,'YYYY-MM-DD') AS DATE,to_char(fst.TIMESTAMP,'HH:MI:SS AM') AS TIME,fst.DESCRIPTION FROM FOOD_SERVICE_STAFF_TRANSACTIONS fst WHERE fst.STAFF_ID='" . UserStaffID() . "' AND SYEAR='" . UserSyear() . "' AND fst.TIMESTAMP BETWEEN '" . $start_date . "' AND date '" . $end_date . "' +1" . $where . " ORDER BY fst.TRANSACTION_ID DESC"), array('DATE' => 'ProperDate', 'BALANCE' => 'red')); $columns = array('TRANSACTION_ID' => _('ID'), 'DATE' => _('Date'), 'TIME' => _('Time'), 'BALANCE' => _('Balance'), 'DESCRIPTION' => _('Description'), 'AMOUNT' => _('Amount')); //modif Francois: add translation foreach ($RET as $RET_key => $RET_val) { $RET[$RET_key] = array_map('types_locale', $RET_val); } } ListOutput($RET, $columns, 'Transaction', 'Transactions', $link, $group); } else { echo ErrorMessage(array(_('This user does not have a Meal Account.'))); } }
$PHP_tmp_SELF = PreparePHP_SELF(); echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=modify METHOD=POST>"; DrawHeader('', SubmitButton('Cancel Sale', 'submit[cancel]') . SubmitButton('Complete Sale', 'submit[complete]')); echo '</FORM>'; echo '<TABLE width=100%><TR>'; echo '<TD valign=top>'; echo $staff['FIRST_NAME'] . ' ' . $staff['MIDDLE_NAME'] . ' ' . $staff['LAST_NAME'] . '<BR>'; echo '<b><small>' . $staff['STAFF_ID'] . '</small></b>'; echo '</TD>'; echo '<TD valign=top>' . red($staff['BALANCE']) . '<BR><small>Balance</small></TD>'; echo '</TR></TABLE>'; echo '<HR>'; if ($staff['BALANCE']) { echo '<TABLE border=0 width=100%>'; echo '<TR><TD width=100% valign=top>'; $RET = DBGet(DBQuery('SELECT fsti.DESCRIPTION,fsti.AMOUNT FROM FOOD_SERVICE_STAFF_TRANSACTIONS fst,FOOD_SERVICE_STAFF_TRANSACTION_ITEMS fsti WHERE fst.STAFF_ID=' . UserStaffID() . ' AND fst.SYEAR=' . UserSyear() . ' AND fst.DESCRIPTION=\'Lunch\' AND fst.TIMESTAMP BETWEEN CURRENT_DATE AND \'tomorrow\' AND fsti.TRANSACTION_ID=fst.TRANSACTION_ID')); $columns = array('DESCRIPTION' => 'Item', 'AMOUNT' => 'Amount'); ListOutput($RET, $columns, 'Earlier Sale', 'Earlier Sales', $link, false, array('save' => false, 'search' => false)); // IMAGE //if ($file = @fopen($StaffPicturesPath.'/'.UserStaffID().'.jpg','r')) { //fclose($file); //echo '<TD rowspan=2 width=150 align=left valign=top><IMG SRC="'.$StaffPicturesPath.'/'.UserStaffID().'.jpg" width=150></TD>'; //} echo '</TD></TR>'; echo '<TR><TD width=100% valign=top>'; $RET = array(array()); foreach ($_SESSION['SALE'] as $key => $value) { $RET[] = array('AMOUNT' => $value['PRICE'], 'DESCRIPTION' => $value['DESCRIPTION'], 'SALE_ID' => $key); } unset($RET[0]); $items_RET = DBGet(DBQuery('SELECT * FROM FOOD_SERVICE_MENU_ITEMS WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND PRICE_STAFF IS NOT NULL ORDER BY SORT_ORDER'));
if (UserStudentID() && (User('PROFILE') == 'admin' || User('PROFILE') == 'teacher')) { if (Preferences('NAME') == 'Common') { $sql = "SELECT coalesce(CUSTOM_200000002,FIRST_NAME)||' '||LAST_NAME AS FULL_NAME FROM STUDENTS WHERE STUDENT_ID='" . UserStudentID() . "'"; } else { $sql = "SELECT FIRST_NAME||' '||coalesce(MIDDLE_NAME,' ')||' '||LAST_NAME||' '||coalesce(NAME_SUFFIX,' ') AS FULL_NAME FROM STUDENTS WHERE STUDENT_ID='" . UserStudentID() . "'"; } $RET = DBGet(DBQuery($sql)); echo '<TABLE border=0 cellpadding=0 cellspacing=0 width=100%><TR><TD bgcolor=#333366 width=19 valign=middle><A HREF=Side.php?student_id=new&modcat=' . $_REQUEST['modcat'] . '><IMG SRC=assets/x.gif height=17 border=0></A></TD><TD bgcolor=#333366><B>' . (AllowUse('Students/Student.php') ? '<A HREF=Modules.php?modname=Students/Student.php&student_id=' . UserStudentID() . ' target=body>' : '') . '<font color=#FFFFFF size=-2>' . $RET[1]['FULL_NAME'] . '</font>' . (AllowUse('Students/Student.php') ? '</A>' : '') . '</B></TD></TR></TABLE>'; } if (UserStaffID() && (User('PROFILE') == 'admin' || User('PROFILE') == 'teacher')) { if (UserStudentID()) { echo '<IMG SRC=assets/pixel_trans.gif height=2>'; } $sql = "SELECT FIRST_NAME||' '||LAST_NAME AS FULL_NAME FROM STAFF WHERE STAFF_ID='" . UserStaffID() . "'"; $RET = DBGet(DBQuery($sql)); echo '<TABLE border=0 cellpadding=0 cellspacing=0 width=100%><TR><TD bgcolor=' . (UserStaffID() == User('STAFF_ID') ? '#663333' : '#336633') . ' width=19 valign=middle><A HREF=Side.php?staff_id=new&modcat=' . $_REQUEST['modcat'] . '><IMG SRC=assets/x.gif height=17 border=0></A></TD><TD bgcolor=' . (UserStaffID() == User('STAFF_ID') ? '#663333' : '#336633') . '><B>' . (AllowUse('Users/User.php') ? '<A HREF=Modules.php?modname=Users/User.php&staff_id=' . UserStaffID() . ' target=body>' : '') . '<font color=#FFFFFF size=-2>' . $RET[1]['FULL_NAME'] . '</font>' . (AllowUse('Users/User.php') ? '</A>' : '') . '</B></TD></TR></TABLE>'; } echo '<BR>'; // echo 'Locale: '.$_SESSION['locale'].'<BR>'; // Program Information require 'Menu.php'; foreach ($_CENTRE['Menu'] as $modcat => $programs) { if (count($_CENTRE['Menu'][$modcat])) { $keys = array_keys($_CENTRE['Menu'][$modcat]); $menu = false; foreach ($keys as $key_index => $file) { if (!is_numeric($file)) { $menu = true; break; } }
} $sql .= '(' . substr($fields, 0, -1) . ') values(' . substr($values, 0, -1) . ')'; DBQuery($sql); } } } unset($_REQUEST['modfunc']); unset($_REQUEST['values']); } if (!$_REQUEST['modfunc']) { if ($_REQUEST['address_id'] != '' && $_REQUEST['address_id'] != 'new') { $this_address_RET = DBGet(DBQuery("SELECT * FROM staff_address\r\n WHERE STAFF_ADDRESS_ID=" . $_REQUEST['address_id'] . " AND STAFF_ID=" . UserStaffID())); $this_address = $this_address_RET[1]; $this_contact_RET = DBGet(DBQuery("SELECT * FROM staff_contact\r\n WHERE STAFF_ID=" . UserStaffID())); $this_contact = $this_contact_RET[1]; $this_emer_contact_RET = DBGet(DBQuery("SELECT * FROM staff_emergency_contact\r\n WHERE STAFF_ID=" . UserStaffID())); $this_emer_contact = $this_emer_contact_RET[1]; } echo '<TABLE border=0><TR><TD valign=top>'; // table 1 echo '<TABLE border=0><TR><TD valign=top>'; // table 2 echo '<TABLE border=0 cellpadding=0 cellspacing=0>'; // table 3 ############################################################################################ $style = ''; ############################################################################################ // New Address echo '</TABLE>'; echo '</TD>'; echo '<TD class=vbreak> </TD><TD valign=top>';
echo '<TABLE width=100% border=0 cellpadding=6>'; echo '<TR>'; $_SESSION['staff_selected'] = $staff['STAFF_ID']; if (clean_param($_REQUEST['staff_id'], PARAM_ALPHANUM) != 'new' && $UserPicturesPath && (($file = @fopen($picture_path = $UserPicturesPath . UserSyear() . '/' . UserStaffID() . '.JPG', 'r')) || $staff['ROLLOVER_ID'] && ($file = @fopen($picture_path = $UserPicturesPath . (UserSyear() - 1) . '/' . $staff['ROLLOVER_ID'] . '.JPG', 'r')))) { fclose($file); echo '<TD width=150><IMG SRC="' . $picture_path . '" width=150></TD><TD valign=top>'; } else { echo '<TD colspan=2>'; } if ($_REQUEST['staff_id'] == 'new') { $id_sent = 0; } else { if ($_REQUEST['staff_id'] != '') { $id_sent = $_REQUEST['staff_id']; } else { $id_sent = UserStaffID(); } } echo '<TABLE width=100% cellpadding=5 >'; echo '<TR><td valign="top">'; echo '<TABLE border=0>'; echo '<tr><td style=width:100px><span class=red>*</span>Name</td><td>:</td><td>'; if (clean_param($_REQUEST['staff_id'], PARAM_ALPHA) == 'new') { echo '<TABLE><TR><TD>' . SelectInput($staff['TITLE'], 'people[TITLE]', 'Title', array('Mr.' => 'Mr.', 'Mrs.' => 'Mrs.', 'Ms.' => 'Ms.', 'Miss' => 'Miss', 'Dr' => 'Dr', 'Rev' => 'Rev'), '') . '</TD><TD>' . TextInput($staff['FIRST_NAME'], 'people[FIRST_NAME]', '<FONT class=red>First</FONT>', 'id=fname size="20" maxlength=50 class=cell_floating') . '</TD><TD>' . TextInput($staff['MIDDLE_NAME'], 'people[MIDDLE_NAME]', 'Middle', 'size="18" maxlength=50 class=cell_floating') . '</TD><TD>' . TextInput($staff['LAST_NAME'], 'people[LAST_NAME]', '<FONT color=red>Last</FONT>', 'id=lname size="20" maxlength=50 class=cell_floating') . '</TD></TR></TABLE>'; } else { echo '<DIV id=user_name><div onclick=\'addHTML("<TABLE><TR><TD>' . str_replace('"', '\\"', SelectInput($staff['TITLE'], 'people[TITLE]', 'Title', array('Mr.' => 'Mr.', 'Mrs.' => 'Mrs.', 'Ms.' => 'Ms.', 'Miss' => 'Miss', 'Dr' => 'Dr', 'Rev' => 'Rev'), '', '', false)) . '</TD><TD>' . str_replace('"', '\\"', TextInput($staff['FIRST_NAME'], 'people[FIRST_NAME]', (!$staff['FIRST_NAME'] ? '<FONT color=red>' : '') . 'First' . (!$staff['FIRST_NAME'] ? '</FONT>' : ''), 'id=fname size=20 maxlength=50', false)) . '</TD><TD>' . str_replace('"', '\\"', TextInput($staff['MIDDLE_NAME'], 'people[MIDDLE_NAME]', 'Middle', 'size=18 maxlength=50', false)) . '</TD><TD>' . str_replace('"', '\\"', TextInput($staff['LAST_NAME'], 'people[LAST_NAME]', (!$staff['LAST_NAME'] ? '<FONT color=red>' : '') . 'Last' . (!$staff['LAST_NAME'] ? '</FONT>' : ''), 'id=lname size=20 maxlength=50', false)) . '</TD></TR></TABLE>","user_name",true);\'>' . (!$staff['TITLE'] && !$staff['FIRST_NAME'] && !$staff['MIDDLE_NAME'] && !$staff['LAST_NAME'] ? '-' : $staff['TITLE'] . ' ' . $staff['FIRST_NAME'] . ' ' . $staff['MIDDLE_NAME'] . ' ' . $staff['LAST_NAME']) . '</div></DIV><small>' . (!$staff['FIRST_NAME'] || !$staff['LAST_NAME'] ? '<FONT color=red>' : '<FONT color=' . Preferences('TITLES') . '>') . '</FONT></small>'; } echo '</td></tr>'; echo '<tr><td><span class=red>*</span>Email Address</td><td>:</td><td>'; echo TextInput($staff['EMAIL'], 'people[EMAIL]', '', 'size=25 maxlength=100 id=email class=cell_floating onkeyup=check_email(this,' . $id_sent . ',4); onblur=check_email(this,' . $id_sent . ',4)') . '<span id="email_error"></span>'; echo '</TD></tr>';
echo "<FORM name=staff id=staff action=Modules.php?modname={$_REQUEST['modname']}&include={$_REQUEST['include']}&category_id={$_REQUEST['category_id']}&modfunc=update method=POST>"; } else { echo "<FORM name=F2 id=F2 action=index.php?modfunc=create_account METHOD=POST>"; } if (basename($_SERVER['PHP_SELF']) != 'index.php') { if (UserStaffID() && UserStaffID() != User('STAFF_ID') && UserStaffID() != $_SESSION['STAFF_ID'] && User('PROFILE') == 'admin') { $delete_button = '<INPUT type=button class=btn_medium value=Delete onclick="window.location=\'Modules.php?modname=' . $_REQUEST['modname'] . '&modfunc=delete\'">'; } } #DrawHeader('',$delete_button.SubmitButton('Save','','class=btn_medium')); if (User('PROFILE_ID')) { $can_use_RET = DBGet(DBQuery("SELECT MODNAME FROM PROFILE_EXCEPTIONS WHERE PROFILE_ID='" . User('PROFILE_ID') . "' AND CAN_USE='Y'"), array(), array('MODNAME')); } else { $can_use_RET = DBGet(DBQuery("SELECT MODNAME FROM STAFF_EXCEPTIONS WHERE USER_ID='" . User('STAFF_ID') . "' AND CAN_USE='Y'"), array(), array('MODNAME')); } $profile = DBGet(DBQuery("SELECT PROFILE FROM STAFF WHERE STAFF_ID='" . UserStaffID() . "'")); $profile = $profile[1]['PROFILE']; $categories_RET = DBGet(DBQuery("SELECT ID,TITLE,INCLUDE FROM STAFF_FIELD_CATEGORIES WHERE " . ($profile ? strtoupper($profile) . '=\'Y\'' : 'ID=\'1\'') . " ORDER BY SORT_ORDER,TITLE")); foreach ($categories_RET as $category) { if ($can_use_RET['Users/User.php&category_id=' . $category['ID']]) { if ($category['ID'] == '1') { $include = 'General_Info'; } elseif ($category['ID'] == '2') { $include = 'Schedule'; } elseif ($category['INCLUDE']) { $include = $category['INCLUDE']; } else { $include = 'Other_Info'; } $tabs[] = array('title' => $category['TITLE'], 'link' => "Modules.php?modname={$_REQUEST['modname']}&include={$include}&category_id=" . $category['ID']); }
echo '</FORM>'; echo '<TABLE width=100%><TR>'; echo '<TD valign=top>' . NoInput($staff['FULL_NAME'], $staff['STAFF_ID']) . '</TD>'; echo '<TD valign=top>' . NoInput(red($staff['BALANCE']), _('Balance')) . '</TD>'; echo '</TR></TABLE>'; echo '<HR>'; if ($staff['ACCOUNT_ID'] && $staff['BALANCE'] != '') { echo '<TABLE border=0 width=100%>'; echo '<TR><TD width=100% valign=top>'; $RET = DBGet(DBQuery("SELECT fsti.DESCRIPTION,fsti.AMOUNT FROM FOOD_SERVICE_STAFF_TRANSACTIONS fst,FOOD_SERVICE_STAFF_TRANSACTION_ITEMS fsti WHERE fst.STAFF_ID='" . UserStaffID() . "' AND fst.SYEAR='" . UserSyear() . "' AND fst.SHORT_NAME='" . $menus_RET[$_REQUEST['menu_id']][1]['TITLE'] . "' AND fst.TIMESTAMP BETWEEN CURRENT_DATE AND CURRENT_DATE+1 AND fsti.TRANSACTION_ID=fst.TRANSACTION_ID")); $columns = array('DESCRIPTION' => _('Item'), 'AMOUNT' => _('Amount')); $singular = sprintf(_('Earlier %s Sale'), $menus_RET[$_REQUEST['menu_id']][1]['TITLE']); $plural = sprintf(_('Earlier %s Sales'), $menus_RET[$_REQUEST['menu_id']][1]['TITLE']); ListOutput($RET, $columns, $singular, $plural, $link, false, array('save' => false, 'search' => false)); // IMAGE if ($file = @fopen($picture = $UserPicturesPath . '/' . UserSyear() . '/' . UserStaffID() . '.JPG', 'r') || ($file = @fopen($picture = $UserPicturesPath . '/' . (UserSyear() - 1) . '/' . UserStaffID() . '.JPG', 'r'))) { fclose($file); echo '<TD rowspan=2 width=150 align=left><IMG SRC="' . $picture . '" width=150></TD>'; } echo '</TD></TR>'; echo '<TR><TD width=100% valign=top>'; $items_RET = DBGet(DBQuery("SELECT fsi.SHORT_NAME,fsi.DESCRIPTION,fsi.PRICE_STAFF,fsi.ICON FROM FOOD_SERVICE_ITEMS fsi,FOOD_SERVICE_MENU_ITEMS fsmi WHERE fsmi.MENU_ID='" . $_REQUEST['menu_id'] . "' AND fsi.ITEM_ID=fsmi.ITEM_ID AND fsmi.CATEGORY_ID IS NOT NULL AND fsi.SCHOOL_ID='" . UserSchool() . "' ORDER BY fsi.SORT_ORDER"), array('ICON' => 'makeIcon'), array('SHORT_NAME')); $items = array(); foreach ($items_RET as $sn => $item) { $items += array($sn => $item[1]['DESCRIPTION']); } $LO_ret = array(array()); foreach ($_SESSION['FSA_sale'] as $id => $item_sn) { $price = $items_RET[$item_sn][1]['PRICE_STAFF']; $LO_ret[] = array('SALE_ID' => $id, 'PRICE' => $price, 'DESCRIPTION' => $items_RET[$item_sn][1]['DESCRIPTION'], 'ICON' => $items_RET[$item_sn][1]['ICON']); }
} } echo "</SELECT>"; echo '</FORM>'; if (UserStudentID() && User('PROFILE') != 'parent' && User('PROFILE') != 'student') { $RET = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME,MIDDLE_NAME,NAME_SUFFIX FROM students WHERE STUDENT_ID='" . UserStudentID() . "'")); //echo '<TABLE border=0 cellpadding=0 cellspacing=0 width=100%><TR><TD width=19 valign=middle><A HREF=Side.php?student_id=new&modcat='.$_REQUEST['modcat'].'><IMG SRC=assets/x.gif height=17 border=0></A></TD><TD ><B><A HREF=Modules.php?modname=Students/Student.php&student_id='.UserStudentID().' target=body><font color=#FFFFFF size=-2>'.$RET[1]['FIRST_NAME'].' '.($RET[1]['MIDDLE_NAME']?$RET[1]['MIDDLE_NAME'].' ':'').$RET[1]['LAST_NAME'].' '.$RET[1]['NAME_SUFFIX'].'</font></A></B></TD></TR></TABLE>'; echo '<TABLE border=0 cellpadding=0 cellspacing=0 width=100%><TR><TD width=19 valign=middle><A HREF=Side.php?student_id=new&modcat=' . optional_param('modcat', '', PARAM_SPCL) . '><IMG SRC=assets/x.gif height=17 border=0></A></TD><TD ><B><A HREF=Modules.php?modname=Students/Student.php&student_id=' . UserStudentID() . ' target=body><font color=#FFFFFF size=-2>' . $RET[1]['FIRST_NAME'] . ' ' . ($RET[1]['MIDDLE_NAME'] ? $RET[1]['MIDDLE_NAME'] . ' ' : '') . $RET[1]['LAST_NAME'] . ' ' . $RET[1]['NAME_SUFFIX'] . '</font></A></B></TD></TR></TABLE>'; } if (UserStaffID() && User('PROFILE') == 'admin') { if (UserStudentID()) { echo '<IMG SRC=assets/pixel_trans.gif height=2>'; } $RET = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME FROM staff WHERE STAFF_ID='" . UserStaffID() . "'")); //echo '<TABLE border=0 cellpadding=0 cellspacing=0 width=100%><TR><TD bgcolor=#336633 width=19 valign=middle><A HREF=Side.php?staff_id=new&modcat='.$_REQUEST['modcat'].'><IMG SRC=assets/x.gif height=17 border=0></A></TD><TD bgcolor=#336633><B><A HREF=Modules.php?modname=Users/User.php&staff_id='.UserStaffID().' target=body><font color=#FFFFFF size=-2>'.$RET[1]['FIRST_NAME'].' '.$RET[1]['LAST_NAME'].'</font></A></B></TD></TR></TABLE>'; echo '<TABLE border=0 cellpadding=0 cellspacing=0 width=100%><TR><TD bgcolor=#336633 width=19 valign=middle><A HREF=Side.php?staff_id=new&modcat=' . optional_param('modcat', '', PARAM_SPCL) . '><IMG SRC=assets/x.gif height=17 border=0></A></TD><TD bgcolor=#336633><B><A HREF=Modules.php?modname=Users/User.php&staff_id=' . UserStaffID() . ' target=body><font color=#FFFFFF size=-2>' . $RET[1]['FIRST_NAME'] . ' ' . $RET[1]['LAST_NAME'] . '</font></A></B></TD></TR></TABLE>'; } echo '<BR>'; // Program Information require 'Menu.php'; foreach ($_openSIS['Menu'] as $modcat => $programs) { if (count($_openSIS['Menu'][$modcat])) { $keys = array_keys($_openSIS['Menu'][$modcat]); $menu = false; foreach ($keys as $key_index => $file) { if (!is_numeric($file)) { $menu = true; } } if (!$menu) { continue;
/* $RET = DBGET(DBQuery("SELECT DISTINCT s.TITLE AS SCHOOL,acc.SCHOOL_DATE,cp.TITLE FROM attendance_calendar acc,course_periods cp,school_periods sp,schools s,staff st,schedule sch WHERE acc.SYEAR='".UserSyear()."' AND (acc.MINUTES IS NOT NULL AND acc.MINUTES>0) AND st.STAFF_ID='".User('STAFF_ID')."' AND (st.SCHOOLS IS NULL OR position(acc.SCHOOL_ID IN st.SCHOOLS)>0) AND cp.SCHOOL_ID=acc.SCHOOL_ID AND cp.SYEAR=acc.SYEAR AND cp.CALENDAR_ID=acc.CALENDAR_ID AND cp.FILLED_SEATS<>0 AND acc.SCHOOL_DATE>=sch.START_DATE AND acc.SCHOOL_DATE<'".DBDate()."' AND cp.MARKING_PERIOD_ID IN (SELECT MARKING_PERIOD_ID FROM school_years WHERE SCHOOL_ID=acc.SCHOOL_ID AND acc.SCHOOL_DATE BETWEEN START_DATE AND END_DATE UNION SELECT MARKING_PERIOD_ID FROM school_semesters WHERE SCHOOL_ID=acc.SCHOOL_ID AND acc.SCHOOL_DATE BETWEEN START_DATE AND END_DATE UNION SELECT MARKING_PERIOD_ID FROM school_quarters WHERE SCHOOL_ID=acc.SCHOOL_ID AND acc.SCHOOL_DATE BETWEEN START_DATE AND END_DATE) AND sp.PERIOD_ID=cp.PERIOD_ID AND (sp.BLOCK IS NULL AND position(substring('UMTWHFS' FROM DAYOFWEEK(acc.SCHOOL_DATE) FOR 1) IN cp.DAYS)>0 OR sp.BLOCK IS NOT NULL AND acc.BLOCK IS NOT NULL AND sp.BLOCK=acc.BLOCK) AND NOT EXISTS(SELECT '' FROM attendance_completed ac WHERE ac.SCHOOL_DATE=acc.SCHOOL_DATE AND ac.STAFF_ID=cp.TEACHER_ID AND ac.PERIOD_ID=cp.PERIOD_ID) AND cp.DOES_ATTENDANCE='Y' AND s.ID=acc.SCHOOL_ID ORDER BY cp.TITLE,acc.SCHOOL_DATE"),array('SCHOOL_DATE'=>'ProperDate')); */ # ------------------------ Old Query It's Also Working End ---------------------------------- # #if($_REQUEST['From'] && $_REQUEST['to']) if ($From && $to) { #$queryMP = UserMP(); #echo GetAllMP('',$queryMP); // $RET = DBGET(DBQuery("SELECT DISTINCT s.TITLE AS SCHOOL,acc.SCHOOL_DATE,cp.TITLE,cp.COURSE_PERIOD_ID FROM attendance_calendar acc,course_periods cp,school_periods sp,schools s,staff st,schedule sch WHERE acc.SYEAR='".UserSyear()."' AND (acc.MINUTES IS NOT NULL AND acc.MINUTES>0) AND st.STAFF_ID='".User('STAFF_ID')."' AND (cp.TEACHER_ID='".User('STAFF_ID')."' OR cp.SECONDARY_TEACHER_ID='".User('STAFF_ID')."') AND (st.SCHOOLS IS NULL OR position(acc.SCHOOL_ID IN st.SCHOOLS)>0) AND cp.SCHOOL_ID=acc.SCHOOL_ID AND cp.SYEAR=acc.SYEAR AND cp.CALENDAR_ID=acc.CALENDAR_ID AND cp.FILLED_SEATS<>0 AND sch.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND acc.SCHOOL_DATE>='".$From."' AND acc.SCHOOL_DATE<='".$to."' AND acc.SCHOOL_DATE>=sch.START_DATE AND cp.MARKING_PERIOD_ID IN (SELECT MARKING_PERIOD_ID FROM school_years WHERE SCHOOL_ID=acc.SCHOOL_ID AND acc.SCHOOL_DATE BETWEEN START_DATE AND END_DATE UNION SELECT MARKING_PERIOD_ID FROM school_semesters WHERE SCHOOL_ID=acc.SCHOOL_ID AND acc.SCHOOL_DATE BETWEEN START_DATE AND END_DATE UNION SELECT MARKING_PERIOD_ID FROM school_quarters WHERE SCHOOL_ID=acc.SCHOOL_ID AND acc.SCHOOL_DATE BETWEEN START_DATE AND END_DATE ) AND sp.PERIOD_ID=cp.PERIOD_ID AND (sp.BLOCK IS NULL AND position(substring('UMTWHFS' FROM DAYOFWEEK(acc.SCHOOL_DATE) FOR 1) IN cp.DAYS)>0 OR sp.BLOCK IS NOT NULL AND acc.BLOCK IS NOT NULL AND sp.BLOCK=acc.BLOCK)AND NOT EXISTS(SELECT '' FROM attendance_completed ac WHERE ac.SCHOOL_DATE=acc.SCHOOL_DATE AND (ac.STAFF_ID=cp.TEACHER_ID OR ac.STAFF_ID=cp.SECONDARY_TEACHER_ID) AND ac.PERIOD_ID=cp.PERIOD_ID) AND cp.DOES_ATTENDANCE='Y' AND s.ID=acc.SCHOOL_ID AND cp.TITLE in(select cp.TITLE FROM schedule s,courses c,course_periods cp,school_periods sp WHERE s.COURSE_ID = c.COURSE_ID AND s.COURSE_ID = cp.COURSE_ID AND s.COURSE_PERIOD_ID = cp.COURSE_PERIOD_ID AND s.SCHOOL_ID = sp.SCHOOL_ID AND s.SCHOOL_ID=".UserSchool()." AND s.SYEAR = c.SYEAR AND sp.PERIOD_ID = cp.PERIOD_ID AND s.SYEAR='".UserSyear()."') ORDER BY cp.TITLE,acc.SCHOOL_DATE"),array('SCHOOL_DATE'=>'ProperDate')); $RET = DBGET(DBQuery('SELECT DISTINCT s.TITLE AS SCHOOL,mi.SCHOOL_DATE,cp.TITLE, mi.COURSE_PERIOD_ID FROM missing_attendance mi,course_periods cp,schools s WHERE mi.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND s.ID=mi.SCHOOL_ID AND mi.SCHOOL_ID=\'' . UserSchool() . '\' AND (mi.TEACHER_ID=\'' . User('STAFF_ID') . '\' OR mi.SECONDARY_TEACHER_ID=\'' . User('STAFF_ID') . '\') AND mi.SCHOOL_DATE>=\'' . $From . '\' AND mi.SCHOOL_DATE<\'' . $to . '\' ORDER BY cp.TITLE,mi.SCHOOL_DATE'), array('SCHOOL_DATE' => 'ProperDate')); } if (!UserStudentID() || substr($_REQUEST['modname'], 0, 5) == 'Users') { $RET_Users = DBGet(DBQuery('SELECT FIRST_NAME,LAST_NAME FROM staff WHERE STAFF_ID=\'' . UserStaffID() . '\'')); DrawHeaderHome('' . _('Selected User') . ': ' . $RET_Users[1]['FIRST_NAME'] . ' ' . $RET_Users[1]['LAST_NAME'] . ' ( <A HREF=Side.php?modname=' . $_REQUEST['modname'] . '&staff_id=new&From=' . $From . '&to=' . $to . ' >' . _('Back to User List') . ' )</A>'); } #echo count($RET); if (count($RET)) { echo '<p><center><font color=#FF0000><b>' . _('Warning') . _('!!') . '</b></font> - ' . _('Teachers have missing attendance data') . ':</center>'; $modname = "Users/TeacherPrograms.php?include=Attendance/TakeAttendance.php&miss_attn=1&From={$From}&to={$to}"; $link['remove']['link'] = "Modules.php?modname={$modname}&modfunc=attn&username=admin"; $link['remove']['variables'] = array('date' => 'SCHOOL_DATE', 'cp_id' => 'COURSE_PERIOD_ID'); $_SESSION['miss_attn'] = 1; ListOutput_missing_attn($RET, array('SCHOOL_DATE' => _('Date'), 'TITLE' => _('Period-Teacher'), 'SCHOOL' => _('School')), _('Period'), _('Periods'), $link, array(), array('save' => false, 'search' => false)); echo '</p>'; } else { echo '<p><center><font color=#FF0000></font>' . _('Attendance completed for this teacher') . ':</center>'; }
echo '<div id=sh_err></div>'; if (!strpos($_REQUEST['include'], '/')) { include 'modules/users/includes/' . $_REQUEST['include'] . '.php'; } else { include 'modules/' . $_REQUEST['include'] . '.php'; $separator = '<HR>'; include 'modules/users/includes/OtherInfoInc.php'; } echo PopTable('footer'); if (User('PROFILE') == 'admin') { if (isset($_SESSION['staff_id'])) { $this_school_RET_mod = DBGet(DBQuery("SELECT s.*,l.* FROM staff s,login_authentication l WHERE l.USER_ID=s.STAFF_ID AND l.PROFILE_ID NOT IN (3,4) AND s.STAFF_ID=" . UserStaffID())); $this_school_mod = $this_school_RET_mod[1]; $username = $this_school_mod['USERNAME']; $password = $this_school_mod['PASSWORD']; $this_school_RET = DBGet(DBQuery("SELECT * FROM staff_school_info WHERE STAFF_ID=" . UserStaffID())); $this_school = $this_school_RET[1]; } else { $username = ''; $password = ''; $this_school['JOINING_DATE'] = ''; } if ($_REQUEST['staff_id'] != 'new') { if ($_REQUEST['category_id'] == 1 && ($username == '' || $password == '' || $this_school['JOINING_DATE'] == '')) { echo '<CENTER>' . SubmitButton('Save & Next', '', 'class=btn_wide onClick="return formcheck_add_staff(0);"') . '</CENTER>'; } if ($_REQUEST['category_id'] == 1 && $username != '' && $password != '' && $this_school['JOINING_DATE'] != '') { echo '<CENTER>' . SubmitButton('Save', '', 'class=btn_medium onClick="return formcheck_add_staff(0);"') . '</CENTER>'; } if ($_REQUEST['category_id'] != 1) { echo '<CENTER>' . SubmitButton('Save', '', 'class=btn_medium onClick="return formcheck_add_staff(0);"') . '</CENTER>';
// $period_select .= "<OPTION value={$period['ID']}" . (CpvId() == $period['ID'] ? ' SELECTED' : '') . ">" . $period['SHORT_NAME'] . ($period['MARKING_PERIOD_ID'] != $fy_id ? ' ' . GetMP($period['MARKING_PERIOD_ID'], 'SHORT_NAME') : '') . (strlen($period['DAYS']) < 5 ? ' ' . $period['DAYS'] : '') . ' - ' . $period['COURSE_TITLE'] . "</OPTION>"; // if (CpvId() == $period['ID']) { $_SESSION['UserPeriod'] = $period['PERIOD_ID']; } } $period_select .= "</SELECT>"; } } } $profile = DBGet(DBQuery('SELECT PROFILE FROM staff WHERE STAFF_ID=' . UserID())); if ($profile[1]['PROFILE'] == "admin") { DrawHeader($period_select); } echo '</FORM><BR>'; unset($_openSIS['DrawHeader']); $_openSIS['allow_edit'] = AllowEdit($_REQUEST['modname']); $_openSIS['User'] = array(1 => array('STAFF_ID' => UserStaffID(), 'NAME' => GetTeacher(UserStaffID()), 'USERNAME' => GetTeacher(UserStaffID(), '', 'USERNAME'), 'PROFILE' => 'teacher', 'SCHOOLS' => ',' . UserSchool() . ',', 'SYEAR' => UserSyear())); echo '<CENTER><TABLE width=100% ><TR><TD>'; include 'modules/' . $_REQUEST['include']; echo '</TD></TR></TABLE></CENTER>'; } } ?> <script type="text/javascript"> function close_window() { window.close(); } </script>
$dis_val = 'N'; } echo CheckboxInput_No($dis_val, 'staff_school[IS_DISABLE]', '', 'CHECKED', $new, '<IMG SRC=assets/check.gif width=15>', '<IMG SRC=assets/x.gif width=15>'); echo '</TD>'; echo '</TR>'; if ($this_school['SCHOOL_ACCESS']) { $pieces = explode(",", $this_school['SCHOOL_ACCESS']); } echo '</TABLE>'; echo '</div>'; echo '</div>'; echo '</TD></TR>'; echo '</TABLE>'; echo '</FIELDSET>'; echo '<br/>'; $profile_return = DBGet(DBQuery("SELECT PROFILE_ID FROM staff WHERE STAFF_ID='" . UserStaffID() . "'")); if ($profile_return[1]['PROFILE_ID'] != '') { echo '<table><tr><td><FIELDSET><LEGEND><FONT color=gray>School Information</FONT></LEGEND>'; $functions = array('START_DATE' => '_makeStartInputDate', 'PROFILE' => '_makeUserProfile', 'END_DATE' => '_makeEndInputDate', 'SCHOOL_ID' => '_makeCheckBoxInput_gen', 'ID' => '_makeStatus'); $sql = 'SELECT s.ID,ssr.SCHOOL_ID,s.TITLE,ssr.START_DATE,ssr.END_DATE,st.PROFILE FROM schools s,staff st INNER JOIN staff_school_relationship ssr USING(staff_id) WHERE s.id=ssr.school_id AND st.staff_id=' . User('STAFF_ID') . ' GROUP BY ssr.SCHOOL_ID'; $school_admin = DBGet(DBQuery($sql), $functions); $columns = array('SCHOOL_ID' => '<a><INPUT type=checkbox value=Y name=controller onclick="checkAll(this.form,this.form.controller.checked,\'values[SCHOOLS]\');" /></a>', 'TITLE' => 'School', 'PROFILE' => 'Profile', 'START_DATE' => 'Start Date', 'END_DATE' => 'Drop Date', 'ID' => 'Status'); ListOutputStaffPrint($school_admin, $columns, 'School Record', 'School Records', array(), array(), array('search' => false)); echo '</FIELDSET>'; echo "</td></tr></table>"; } } } else { echo ''; } $separator = '<HR>';
DBQuery($update); } } } } $exceptions_RET = DBGet(DBQuery("SELECT MODNAME,CAN_USE,CAN_EDIT FROM STAFF_EXCEPTIONS WHERE USER_ID='{$user_id}'"), array(), array('MODNAME')); unset($tmp_menu); unset($_REQUEST['modfunc']); unset($_SESSION['_REQUEST_vars']['modfunc']); unset($_REQUEST['can_edit']); unset($_SESSION['_REQUEST_vars']['can_edit']); unset($_REQUEST['can_use']); unset($_SESSION['_REQUEST_vars']['can_use']); } if (UserStaffID() && !$_REQUEST['modfunc']) { $staff_RET = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME,PROFILE,PROFILE_ID FROM STAFF WHERE STAFF_ID='" . UserStaffID() . "'")); if (!$staff_RET[1]['PROFILE_ID']) { echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=update method=POST>"; DrawHeader(_('Select the programs with which this user can use and save information.'), SubmitButton(_('Save'))); echo '<BR>'; PopTable('header', _('Permissions')); echo '<TABLE border=0 cellspacing=0>'; foreach ($menu as $modcat => $profiles) { $values = $profiles[$staff_RET[1]['PROFILE']]; echo '<TR><TD valign=top align=right>'; echo "<BR><b><font color=gray>" . str_replace('_', ' ', $modcat) . "</font></b></TD><TD width=3> </TD>"; echo "<TH bgcolor=#FFFFFF><small><font color=gray>Can Use" . (AllowEdit() ? "<INPUT type=checkbox name=can_use_{$modcat} onclick='checkAll(this.form,this.form.can_use_{$modcat}.checked,\"can_use[{$modcat}\");'>" : '') . "</font></small></TH><TH bgcolor=#FFFFFF> <small><font color=gray>Can Edit" . (AllowEdit() ? "<INPUT type=checkbox name=can_edit_{$modcat} onclick='checkAll(this.form,this.form.can_edit_{$modcat}.checked,\"can_edit[{$modcat}\");'>" : '') . "</font></small></TH><TH bgcolor=#FFFFFF></TH></TR>"; if (count($values)) { foreach ($values as $file => $title) { if (!is_numeric($file)) { $can_use = $exceptions_RET[$file][1]['CAN_USE'];
# See license.txt. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # #*************************************************************************************** include '../../../RedirectIncludes.php'; include_once 'modules/users/includes/FunctionsInc.php'; $fields_RET = DBGet(DBQuery('SELECT ID,TITLE,TYPE,SELECT_OPTIONS,DEFAULT_SELECTION,REQUIRED FROM staff_fields WHERE CATEGORY_ID=\'' . $_REQUEST[category_id] . '\' ORDER BY SORT_ORDER,TITLE')); if (UserStaffID()) { $custom_RET = DBGet(DBQuery('SELECT * FROM staff WHERE STAFF_ID=\'' . UserStaffID() . '\'')); $value = $custom_RET[1]; } if (count($fields_RET)) { echo '<table>'; echo $separator; } $i = 1; foreach ($fields_RET as $field) { switch ($field['TYPE']) { case 'text': echo '<TR>'; echo '<TD style="width:120px">'; echo $field['TITLE'] . '</TD><TD>:</TD><TD>' . _makeTextInput('CUSTOM_' . $field['ID'], '', 'size=25 class=cell_floating'); echo '</TD>'; echo '</TR>';
echo '' . _('Disable User') . '</TD><TD>:</TD><TD>' . CheckboxInput($staff['IS_DISABLE'], 'staff[IS_DISABLE]', '', 'CHECKED', $new, '<IMG SRC=assets/check.gif width=15>', '<IMG SRC=assets/x.gif width=15>'); echo '</TD></TR>'; echo '<TR><TD>'; echo '' . _('Last Login') . '</TD><TD>:</TD><TD>' . NoInput(ProperDate(substr($staff['LAST_LOGIN'], 0, 10)) . substr($staff['LAST_LOGIN'], 10)); echo '</TD></TR>'; echo '<TR><TD>'; echo '' . _('Staff ID') . '</TD><TD>:</TD><TD>' . NoInput($staff['STAFF_ID']); echo '</TD></TR>'; } echo '</TR>'; echo '</table></td>'; echo '<TD>'; $UserPicturesPath = 'assets/UserPhotos/'; $profile = DBGet(DBQuery('SELECT PROFILE FROM staff WHERE STAFF_ID=\'' . UserStaffID() . '\' ')); if ($profile[1]['PROFILE'] != 'parent') { if ($_REQUEST['staff_id'] != 'new' && $UserPicturesPath && (($file = @fopen($picture_path = $UserPicturesPath . '/' . UserStudentID() . '.JPG', 'r')) || ($file = @fopen($picture_path = $UserPicturesPath . '/' . UserStaffID() . '.JPG', 'r')))) { fclose($file); echo '<div width=150 align="center"><IMG SRC="' . $picture_path . '?id=' . rand(6, 100000) . '" width=150 class=pic>'; if (User('PROFILE') == 'admin' && User('PROFILE') != 'student' && User('PROFILE') != 'parent') { echo '<br><a href=Modules.php?modname=Users/UploadUserPhoto.php?modfunc=edit style="text-decoration:none"><b>' . _("Update Staff's Photo") . '</b></a></div>'; } else { echo ''; } } else { if ($_REQUEST['staff_id'] != 'new') { echo '<div align="center"><IMG SRC="assets/noimage.jpg?id=' . rand(6, 100000) . '" width=144 class=pic>'; if (User('PROFILE') == 'admin' && User('PROFILE') != 'student' && User('PROFILE') != 'parent') { echo '<br><a href=Modules.php?modname=Users/UploadUserPhoto.php style="text-decoration:none"><b>' . _("Upload Staff's Photo") . '</b></a></div>'; } } else { echo '';
# You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # #*************************************************************************************** include '../../../Redirect_includes.php'; if (GetTeacher(UserStaffID(), '', 'PROFILE', false) == 'teacher') { #$schedule_RET = DBGet(DBQuery("SELECT cp.PERIOD_ID,cp.ROOM,c.TITLE,cp.COURSE_WEIGHT,cp.MARKING_PERIOD_ID FROM course_periods cp,courses c WHERE cp.COURSE_ID=c.COURSE_ID AND cp.TEACHER_ID='".UserStaffID()."' AND cp.SYEAR='".UserSyear()."'"),array('PERIOD_ID'=>'GetPeriod','MARKING_PERIOD_ID'=>'GetMP')); //$schedule_RET = DBGet(DBQuery("SELECT cp.PERIOD_ID,cp.ROOM,c.TITLE,cp.COURSE_WEIGHT,cp.MARKING_PERIOD_ID, cp.DAYS, CONCAT(sp.START_TIME, ' to ', sp.END_TIME) AS DURATION FROM course_periods cp,courses c, school_periods sp WHERE cp.COURSE_ID=c.COURSE_ID AND cp.TEACHER_ID='".UserStaffID()."' AND cp.PERIOD_ID=sp.PERIOD_ID AND cp.SYEAR='".UserSyear()."'"),array('PERIOD_ID'=>'GetPeriod','MARKING_PERIOD_ID'=>'GetMP')); $mp_select_RET = DBGet(DBQuery('SELECT DISTINCT cp.MARKING_PERIOD_ID, (SELECT TITLE FROM marking_periods WHERE MARKING_PERIOD_ID=cp.MARKING_PERIOD_ID) AS TITLE FROM course_periods cp,courses c, school_periods sp WHERE cp.COURSE_ID=c.COURSE_ID AND (cp.TEACHER_ID=\'' . UserStaffID() . '\' OR cp.SECONDARY_TEACHER_ID=\'' . UserStaffID() . '\') AND cp.PERIOD_ID=sp.PERIOD_ID AND cp.SYEAR=\'' . UserSyear() . '\' AND cp.SCHOOL_ID=\'' . UserSchool() . '\'')); $print_mp = CreateSelect($mp_select_RET, 'marking_period_id', _('Show All'), 'Modules.php?modname=' . $_REQUEST['modname'] . '&include=' . $_REQUEST['include'] . '&category_id=' . $_REQUEST['category_id'] . '&marking_period_id='); echo '<div style="padding:10px 0px 0px 25px;"><strong>' . _('Marking Periods') . ' :</strong> ' . $print_mp . '</div>'; if (!$_REQUEST['marking_period_id']) { $schedule_RET = DBGet(DBQuery('SELECT cp.PERIOD_ID,cp.ROOM,c.TITLE,cp.COURSE_WEIGHT,cp.MARKING_PERIOD_ID, cp.DAYS, CONCAT(sp.START_TIME, \'' . ' to ' . '\', sp.END_TIME) AS DURATION, sp.TITLE AS P_NAME FROM course_periods cp,courses c, school_periods sp WHERE cp.COURSE_ID=c.COURSE_ID AND (cp.TEACHER_ID=\'' . UserStaffID() . '\' OR cp.SECONDARY_TEACHER_ID=\'' . UserStaffID() . '\') AND cp.PERIOD_ID=sp.PERIOD_ID AND cp.SYEAR=\'' . UserSyear() . '\' AND cp.SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY P_NAME'), array('PERIOD_ID' => 'GetPeriod', 'MARKING_PERIOD_ID' => 'GetMP')); } else { if ($_REQUEST['marking_period_id']) { $schedule_RET = DBGet(DBQuery('SELECT cp.PERIOD_ID,cp.ROOM,c.TITLE,cp.COURSE_WEIGHT,cp.MARKING_PERIOD_ID, cp.DAYS, CONCAT(sp.START_TIME, \'' . ' to ' . '\', sp.END_TIME) AS DURATION, sp.TITLE AS P_NAME FROM course_periods cp,courses c, school_periods sp WHERE cp.COURSE_ID=c.COURSE_ID AND cp.MARKING_PERIOD_ID=\'' . $_REQUEST['marking_period_id'] . '\' AND (cp.TEACHER_ID=\'' . UserStaffID() . '\' OR cp.SECONDARY_TEACHER_ID=\'' . UserStaffID() . '\') AND cp.SCHOOL_ID=\'' . UserSchool() . '\' AND cp.PERIOD_ID=sp.PERIOD_ID AND cp.SYEAR=\'' . UserSyear() . '\' ORDER BY P_NAME'), array('PERIOD_ID' => 'GetPeriod', 'MARKING_PERIOD_ID' => 'GetMP')); } } ListOutput($schedule_RET, array('TITLE' => '' . _('Course') . '', 'PERIOD_ID' => '' . _('Period') . '', 'DAYS' => '' . _('Days') . '', 'DURATION' => '' . _('Time') . '', 'ROOM' => '' . _('Room') . '', 'MARKING_PERIOD_ID' => '' . _('Marking Period') . ''), _('Course'), _('Courses')); #ListOutput($schedule_RET,array('TITLE'=>'Course','PERIOD_ID'=>'Period','ROOM'=>'Room','MARKING_PERIOD_ID'=>'Marking Period'),'Course','Courses'); #echo '<HR>'; } $_REQUEST['category_id'] = 2; include 'modules/Users/includes/Other_Info.inc.php'; function CreateSelect($val, $name, $opt, $link = '') { //$html .= "<table width=600px><tr><td align=right width=45%>"; //$html .= $cap." </td><td width=55%>"; if ($link != '') { $html .= "<select name=" . $name . " id=" . $name . " onChange=\"window.location='" . $link . "' + this.options[this.selectedIndex].value;\">"; } else {