本文整理汇总了PHP中UserStaffID函数的典型用法代码示例。如果您正苦于以下问题:PHP UserStaffID函数的具体用法?PHP UserStaffID怎么用?PHP UserStaffID使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UserStaffID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: str_replace
$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');
}
示例2: DBGet
$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 {
示例3: PortalPollsDisplay
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;
}
示例4: core_role_unassign_roles_object
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);
}
示例5: unset
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'];
示例6: DBGet
#
#***************************************************************************************
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();
示例7: DrawBC
#***************************************************************************************
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 '
示例8: _makeExtra
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';
}
}
}
示例9: coalesce
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;
}
}
示例10: substr
}
$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>';
示例11: fclose
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>';
示例12: DBGet
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']);
}
示例13: Search
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);
}
示例14: foreach
//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.')));
}
}
示例15: UserStudentID
}
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>';