本文整理汇总了PHP中UserStudentID函数的典型用法代码示例。如果您正苦于以下问题:PHP UserStudentID函数的具体用法?PHP UserStudentID怎么用?PHP UserStudentID使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UserStudentID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: core_user_update_users_object
function core_user_update_users_object()
{
//first, gather the necessary variables
global $_REQUEST;
//gather the Moodle user ID
if (User('PROFILE') == 'student') {
$rosario_id = UserStudentID();
$moodle_id = DBGet(DBQuery("SELECT moodle_id FROM moodlexrosario WHERE rosario_id='" . $rosario_id . "' AND \"column\"='student_id'"));
} else {
$rosario_id = User('STAFF_ID');
$moodle_id = DBGet(DBQuery("SELECT moodle_id FROM moodlexrosario WHERE rosario_id='" . $rosario_id . "' AND \"column\"='staff_id'"));
}
if (count($moodle_id)) {
$moodle_id = (double) $moodle_id[1]['MOODLE_ID'];
} else {
return '';
}
//then, convert variables for the Moodle object:
/*
list of (
object {
id double //ID of the user
password string Optional //Plain text password consisting of any characters
//note Francois: the password must respect the Moodle policy: 8 chars min., 1 number, 1 min, 1 maj and 1 non-alphanum at least.
}
)
*/
$password = $_REQUEST['values']['new'];
$users = array(array('id' => $moodle_id, 'password' => $password));
return array($users);
}
示例2: 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;
}
示例3: _makePaymentsRemove
function _makePaymentsRemove($value, $column)
{
global $THIS_RET, $refunded_payments_RET;
if (!$refunded_payments_RET) {
$refunded_payments_RET = DBGet(DBQuery("SELECT p.REFUNDED_PAYMENT_ID FROM BILLING_PAYMENTS p WHERE p.STUDENT_ID='" . UserStudentID() . "' AND (p.REFUNDED_PAYMENT_ID IS NOT NULL AND p.REFUNDED_PAYMENT_ID!='') AND p.SYEAR='" . UserSyear() . "' AND p.SCHOOL_ID='" . UserSchool() . "'"), array(), array('REFUNDED_PAYMENT_ID'));
}
if (!$THIS_RET['REFUNDED_PAYMENT_ID'] && !$refunded_payments_RET[$THIS_RET['ID']]) {
$return = button('remove', _('Refund'), '"Modules.php?modname=' . $_REQUEST['modname'] . '&modfunc=refund&id=' . $THIS_RET['ID'] . '"');
} elseif ($refunded_payments_RET[$THIS_RET['ID']]) {
$return = '<span style="color:#00A642; text-align:center">' . _('Refunded') . '</span>';
}
return $return . button('remove', _('Delete'), '"Modules.php?modname=' . $_REQUEST['modname'] . '&modfunc=remove&id=' . $THIS_RET['ID'] . '"');
}
示例4: _makePaymentsRemove
function _makePaymentsRemove($value, $column)
{
global $THIS_RET, $refunded_payments_RET;
if (!$refunded_payments_RET) {
$refunded_payments_RET = DBGet(DBQuery("SELECT p.REFUNDED_PAYMENT_ID FROM BILLING_PAYMENTS p WHERE p.STUDENT_ID='" . UserStudentID() . "' AND (p.REFUNDED_PAYMENT_ID IS NOT NULL AND p.REFUNDED_PAYMENT_ID!='') AND p.SYEAR='" . UserSyear() . "' AND p.SCHOOL_ID='" . UserSchool() . "'"), array(), array('REFUNDED_PAYMENT_ID'));
}
if (!$THIS_RET['REFUNDED_PAYMENT_ID'] && !$refunded_payments_RET[$THIS_RET['ID']]) {
$return = button('remove', _('Refund'), "Modules.php?modname={$_REQUEST['modname']}&modfunc=refund&id={$THIS_RET['ID']}");
} elseif ($refunded_payments_RET[$THIS_RET['ID']]) {
$return = '<center><font color=#00FF66>' . _('Refunded') . '</font></center>';
}
return $return . button('remove', _('Delete'), "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove&id={$THIS_RET['ID']}");
}
示例5: GetUserSchools
function GetUserSchools($staff_id, $str = false)
{
if (User('PROFILE_ID') != 4) {
$str_return = '';
$schools = DBGet(DBQuery('SELECT SCHOOL_ID FROM staff_school_relationship WHERE staff_id=' . $staff_id . ' AND syear=' . UserSyear()));
foreach ($schools as $school) {
$return[] = $school['SCHOOL_ID'];
$str_return .= $school['SCHOOL_ID'] . ',';
}
if ($str == true) {
return substr($str_return, 0, -1);
} else {
return $return;
}
} else {
if (User('PROFILE_ID') == 4) {
$schools = DBGet(DBQuery('SELECT SCHOOL_ID FROM student_enrollment WHERE STUDENT_ID=' . UserStudentID() . ' AND SYEAR=' . UserSyear() . ' ORDER BY ID DESC LIMIT 0,1'));
return $schools[1]['SCHOOL_ID'];
}
}
}
示例6: 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='" . $_REQUEST['staff_id'] . "' 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='" . UserStudentID() . "' 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);
}
示例7: GetStuListAttn
//.........这里部分代码省略.........
$sql .= 'CONCAT(s.LAST_NAME,\', \',coalesce(s.COMMON_NAME,s.FIRST_NAME)) AS FULL_NAME,';
} else {
$sql .= 'CONCAT(s.LAST_NAME,\', \',s.FIRST_NAME,\' \',COALESCE(s.MIDDLE_NAME,\' \')) AS FULL_NAME,';
}
$sql .= 's.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME,s.STUDENT_ID,ssm.SCHOOL_ID AS LIST_SCHOOL_ID,ssm.GRADE_ID ' . $extra['SELECT'];
if ($_REQUEST['include_inactive'] == 'Y') {
$sql .= ',' . db_case(array('(ssm.SYEAR=\'' . UserSyear() . '\' AND (ssm.START_DATE IS NOT NULL AND (\'' . date('Y-m-d', strtotime($extra['DATE'])) . '\'<=ssm.END_DATE OR ssm.END_DATE IS NULL)))', 'true', "'<FONT color=green>Active</FONT>'", "'<FONT color=red>Inactive</FONT>'")) . ' AS ACTIVE ';
}
}
$sql .= ' FROM students s,student_enrollment ssm ' . $extra['FROM'] . ' WHERE ssm.STUDENT_ID=s.STUDENT_ID ';
if ($_REQUEST['include_inactive'] == 'Y') {
$sql .= ' AND ssm.ID=(SELECT ID FROM student_enrollment WHERE STUDENT_ID=ssm.STUDENT_ID AND SYEAR<=\'' . UserSyear() . '\' ORDER BY START_DATE DESC LIMIT 1)';
} else {
$sql .= ' AND ssm.SYEAR=\'' . UserSyear() . '\' AND (ssm.START_DATE IS NOT NULL AND (\'' . date('Y-m-d', strtotime($extra['DATE'])) . '\'<=ssm.END_DATE OR ssm.END_DATE IS NULL)) ';
}
if (UserSchool() && $_REQUEST['_search_all_schools'] != 'Y') {
$sql .= ' AND ssm.SCHOOL_ID=\'' . UserSchool() . '\'';
} else {
//
$sql .= ' AND ssm.SCHOOL_ID IN (' . GetUserSchools(UserID(), true) . ') ';
$extra['columns_after']['LIST_SCHOOL_ID'] = 'School';
$functions['LIST_SCHOOL_ID'] = 'GetSchool';
}
if (!$extra['SELECT_ONLY'] && $_REQUEST['include_inactive'] == 'Y') {
$extra['columns_after']['ACTIVE'] = 'Status';
}
break;
case 'teacher':
$sql = 'SELECT ';
if ($extra['SELECT_ONLY']) {
$sql .= $extra['SELECT_ONLY'];
} else {
if (Preferences('NAME') == 'Common') {
$sql .= 'CONCAT(s.LAST_NAME,\', \',coalesce(s.COMMON_NAME,s.FIRST_NAME)) AS FULL_NAME,';
} else {
$sql .= 'CONCAT(s.LAST_NAME,\', \',s.FIRST_NAME,\' \',COALESCE(s.MIDDLE_NAME,\' \')) AS FULL_NAME,';
}
$sql .= 's.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME,s.STUDENT_ID,ssm.SCHOOL_ID,ssm.GRADE_ID ' . $extra['SELECT'];
if ($_REQUEST['include_inactive'] == 'Y') {
$sql .= ',' . db_case(array('(ssm.START_DATE IS NOT NULL AND (\'' . $extra['DATE'] . '\'<=ssm.END_DATE OR ssm.END_DATE IS NULL))', 'true', "'<FONT color=green>Active</FONT>'", "'<FONT color=red>Inactive</FONT>'")) . ' AS ACTIVE';
$sql .= ',' . db_case(array('(\'' . $extra['DATE'] . '\'>=ss.START_DATE AND (\'' . $extra['DATE'] . '\'<=ss.END_DATE OR ss.END_DATE IS NULL))', 'true', "'<FONT color=green>Active</FONT>'", "'<FONT color=red>Inactive</FONT>'")) . ' AS ACTIVE_SCHEDULE';
}
}
//
$sql .= ' FROM students s,course_periods cp,schedule ss,student_enrollment ssm,course_period_var cpv ' . $extra['FROM'] . ' WHERE ssm.STUDENT_ID=s.STUDENT_ID AND cpv.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND cpv.ID="' . $extra['ID'] . '" AND ssm.STUDENT_ID=ss.STUDENT_ID AND ssm.SCHOOL_ID=\'' . UserSchool() . '\' AND ssm.SYEAR=\'' . UserSyear() . '\' AND ssm.SYEAR=cp.SYEAR AND ssm.SYEAR=ss.SYEAR AND ' . db_case(array(User('STAFF_ID'), 'cp.teacher_id', ' cp.teacher_id=' . User('STAFF_ID'), 'cp.secondary_teacher_id', ' cp.secondary_teacher_id=' . User('STAFF_ID'), 'cp.course_period_id IN(SELECT course_period_id from teacher_reassignment tra WHERE cp.course_period_id=tra.course_period_id AND tra.pre_teacher_id=' . User('STAFF_ID') . ')')) . ' AND cp.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\' AND cp.COURSE_ID=ss.COURSE_ID AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID';
if ($extra['cpvdate'] != '') {
$sql .= $extra['cpvdate'];
}
if ($_REQUEST['include_inactive'] == 'Y') {
$sql .= ' AND ssm.ID=(SELECT ID FROM student_enrollment WHERE STUDENT_ID=ssm.STUDENT_ID AND SYEAR=ssm.SYEAR ORDER BY START_DATE DESC LIMIT 1)';
$sql .= ' AND ss.START_DATE=(SELECT START_DATE FROM schedule WHERE STUDENT_ID=ssm.STUDENT_ID AND SYEAR=ssm.SYEAR AND MARKING_PERIOD_ID IN (' . GetAllMP('', $queryMP) . ') AND COURSE_ID=cp.COURSE_ID AND COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID ORDER BY START_DATE DESC LIMIT 1)';
} else {
$sql .= ' AND (ssm.START_DATE IS NOT NULL AND \'' . $extra['DATE'] . '\'>=ssm.START_DATE AND (\'' . $extra['DATE'] . '\'<=ssm.END_DATE OR ssm.END_DATE IS NULL))';
$sql .= ' AND (\'' . $extra['DATE'] . '\'>=ss.START_DATE AND (\'' . $extra['DATE'] . '\'<=ss.END_DATE OR ss.END_DATE IS NULL))';
}
if (!$extra['SELECT_ONLY'] && $_REQUEST['include_inactive'] == 'Y') {
$extra['columns_after']['ACTIVE'] = 'School Status';
$extra['columns_after']['ACTIVE_SCHEDULE'] = 'Course Status';
}
break;
case 'parent':
case 'student':
$sql = 'SELECT ';
if ($extra['SELECT_ONLY']) {
$sql .= $extra['SELECT_ONLY'];
} else {
if (Preferences('NAME') == 'Common') {
$sql .= 'CONCAT(s.LAST_NAME,\', \',coalesce(s.COMMON_NAME,s.FIRST_NAME)) AS FULL_NAME,';
} else {
$sql .= 'CONCAT(s.LAST_NAME,\', \',s.FIRST_NAME,\' \',COALESCE(s.MIDDLE_NAME,\' \')) AS FULL_NAME,';
}
$sql .= 's.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME,s.STUDENT_ID,ssm.SCHOOL_ID,ssm.GRADE_ID ' . $extra['SELECT'];
}
$sql .= ' FROM students s,student_enrollment ssm ' . $extra['FROM'] . '
WHERE ssm.STUDENT_ID=s.STUDENT_ID AND ssm.SYEAR=\'' . UserSyear() . '\' AND ssm.SCHOOL_ID=\'' . UserSchool() . '\' AND (\'' . DBDate() . '\' BETWEEN ssm.START_DATE AND ssm.END_DATE OR (ssm.END_DATE IS NULL AND \'' . DBDate() . '\'>ssm.START_DATE)) AND ssm.STUDENT_ID' . ($extra['ASSOCIATED'] ? ' IN (SELECT STUDENT_ID FROM students_join_users WHERE STAFF_ID=\'' . $extra['ASSOCIATED'] . '\')' : '=\'' . UserStudentID() . '\'');
break;
default:
exit('Error');
}
$sql = appendSQL($sql, $extra);
$sql .= $extra['WHERE'] . ' ';
$sql .= CustomFields('where');
if ($extra['GROUP']) {
$sql .= ' GROUP BY ' . $extra['GROUP'];
}
if (!$extra['ORDER_BY'] && !$extra['SELECT_ONLY']) {
if (Preferences('SORT') == 'Grade') {
$sql .= ' ORDER BY (SELECT SORT_ORDER FROM school_gradelevels WHERE ID=ssm.GRADE_ID),FULL_NAME';
} else {
$sql .= ' ORDER BY FULL_NAME';
}
$sql .= $extra['ORDER'];
} elseif ($extra['ORDER_BY']) {
$sql .= ' ORDER BY ' . $extra['ORDER_BY'];
}
if ($extra['DEBUG'] === true) {
echo '<!--' . $sql . '-->';
}
return DBGet(DBQuery($sql), $functions, $extra['group']);
}
示例8: _
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 '';
示例9: date
$qr .= ' AND \'' . $st_date . '\' BETWEEN ea.start_date AND ea.end_date';
} else {
$st_date = date('Y-m-d');
$qr .= ' AND \'' . $st_date . '\' BETWEEN ea.start_date AND ea.end_date';
}
$qr .= ' AND em.SYEAR=ea.SYEAR AND em.ACTIVITY_ID=ea.ID ORDER BY ea.START_DATE';
$RET = DBGet(DBQuery($qr), array('START_DATE' => 'ProperDate', 'END_DATE' => 'ProperDate'));
$activities_RET = DBGet(DBQuery('SELECT ID,TITLE FROM eligibility_activities WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''));
if (count($activities_RET)) {
foreach ($activities_RET as $value) {
$activities[$value['ID']] = $value['TITLE'];
}
}
$link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove&start_date={$_REQUEST['start_date']}";
$link['remove']['variables'] = array('activity_id' => 'ACTIVITY_ID');
$link['add']['html']['TITLE'] = '<TABLE border=0 cellpadding=0 cellspacing=0><TR><TD>' . SelectInput('', 'new_activity', '', $activities) . ' </TD><TD> <INPUT type=submit value=Add class=btn_medium onclick=\'formload_ajax("elig_stud");\'></TD></TR></TABLE>';
$link['add']['html']['remove'] = button('add');
echo "<FORM action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&modfunc=add&start_date=" . strip_tags(trim($_REQUEST[start_date])) . " method=POST>";
$columns = array('TITLE' => 'Activity', 'START_DATE' => 'Starts', 'END_DATE' => 'Ends');
ListOutput($RET, $columns, 'Activity', 'Activities', $link);
echo '</FORM>';
echo '</TD><TD width=50% valign=top>';
$RET = DBGet(DBQuery('SELECT e.ELIGIBILITY_CODE,c.TITLE as COURSE_TITLE FROM eligibility e,courses c,course_periods cp WHERE e.STUDENT_ID=\'' . UserStudentID() . '\' AND e.SYEAR=\'' . UserSyear() . '\' AND e.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND cp.COURSE_ID=c.COURSE_ID AND e.SCHOOL_DATE BETWEEN \'' . date('Y-m-d', strtotime($start_date)) . '\' AND \'' . date('Y-m-d', strtotime($end_date)) . '\''), array('ELIGIBILITY_CODE' => '_makeLower'));
$columns = array('COURSE_TITLE' => 'Course', 'ELIGIBILITY_CODE' => 'Grade');
ListOutputNew($RET, $columns, 'Course', 'Courses');
echo '</TD></TR></TABLE>';
}
function _makeLower($word)
{
return ucwords(strtolower($word));
}
示例10: DrawHeader
$extra['functions']['PERIOD_' . $period['PERIOD_ID']] = '_makeCodePulldown';
$extra['columns_after']['PERIOD_' . $period['PERIOD_ID']] = $period['SHORT_NAME'];
}
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']} method=POST>";
DrawHeader(ProgramTitle(), '<INPUT type=submit value=' . _('Update') . '>');
if ($REQ_codes) {
foreach ($REQ_codes as $code) {
$code_pulldowns .= _makeCodeSearch($code);
}
} elseif ($abs) {
$code_pulldowns = _makeCodeSearch('A');
} else {
$code_pulldowns = _makeCodeSearch();
}
if (UserStudentID()) {
$current_student_link = "<A HREF=Modules.php?modname={$_REQUEST['modname']}&modfunc=student&month_date={$_REQUEST['month_date']}&day_date={$_REQUEST['day_date']}&year_date={$_REQUEST['year_date']}&student_id=" . UserStudentID() . ">Current Student</A></TD><TD>";
}
DrawHeader(PrepareDate($date, '_date'), '<TABLE><TR><TD>' . $current_student_link . button('add', '', "# onclick='javascript:addHTML(\"" . str_replace('"', '\\"', _makeCodeSearch()) . "\",\"code_pulldowns\"); return false;'") . '</TD><TD><DIV id=code_pulldowns>' . $code_pulldowns . '</DIV></TD></TR></TABLE>');
$_REQUEST['search_modfunc'] = 'list';
Search('student_id', $extra);
echo "</FORM>";
}
function _makePhone($value, $column)
{
global $THIS_RET, $contacts_RET;
if (count($contacts_RET[$THIS_RET['STUDENT_ID']])) {
foreach ($contacts_RET[$THIS_RET['STUDENT_ID']] as $person) {
if ($person[1]['FIRST_NAME'] || $person[1]['LAST_NAME']) {
$tipmessage .= '<B>' . $person[1]['STUDENT_RELATION'] . ': ' . $person[1]['FIRST_NAME'] . ' ' . $person[1]['LAST_NAME'] . '</B><BR>';
}
$tipmessage .= '<TABLE>';
示例11: GetStuList
//.........这里部分代码省略.........
//$sql = 'SELECT '.$distinct;
if (isset($extra['SELECT_ONLY'])) {
$sql .= $extra['SELECT_ONLY'];
} else {
$sql .= "s.LAST_NAME||', '||s.FIRST_NAME||' '||coalesce(s.MIDDLE_NAME,' ') AS FULL_NAME,";
$sql .= 's.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME,s.STUDENT_ID,ssm.SCHOOL_ID,ssm.SCHOOL_ID AS LIST_SCHOOL_ID,ssm.GRADE_ID ' . $extra['SELECT'];
if (isset($_REQUEST['include_inactive']) && $_REQUEST['include_inactive'] == 'Y') {
$sql .= ',' . db_case(array("(ssm.SYEAR='" . UserSyear() . "' AND ('" . $extra['DATE'] . "'>=ssm.START_DATE AND ('" . $extra['DATE'] . "'<=ssm.END_DATE OR ssm.END_DATE IS NULL)))", 'TRUE', '\'<span style="color:green">' . _('Active') . '</span>\'', '\'<span style="color:red">' . _('Inactive') . '</span>\'')) . ' AS ACTIVE';
}
}
$sql .= " FROM STUDENTS s JOIN STUDENT_ENROLLMENT ssm ON (ssm.STUDENT_ID=s.STUDENT_ID";
if (isset($_REQUEST['include_inactive']) && $_REQUEST['include_inactive'] == 'Y') {
//$sql .= " AND ssm.ID=(SELECT max(ID) FROM STUDENT_ENROLLMENT WHERE STUDENT_ID=ssm.STUDENT_ID AND SYEAR<='".UserSyear()."')";
$sql .= " AND ssm.ID=(SELECT ID FROM STUDENT_ENROLLMENT WHERE STUDENT_ID=ssm.STUDENT_ID AND SYEAR<='" . UserSyear() . "' ORDER BY SYEAR DESC,START_DATE DESC LIMIT 1)";
} else {
$sql .= " AND ssm.SYEAR='" . UserSyear() . "' AND ('" . $extra['DATE'] . "'>=ssm.START_DATE AND (ssm.END_DATE IS NULL OR '" . $extra['DATE'] . "'<=ssm.END_DATE))";
}
if (UserSchool() && $_REQUEST['_search_all_schools'] != 'Y') {
$sql .= " AND ssm.SCHOOL_ID='" . UserSchool() . "'";
} else {
if (User('SCHOOLS')) {
$sql .= " AND ssm.SCHOOL_ID IN (" . mb_substr(str_replace(',', "','", User('SCHOOLS')), 2, -2) . ") ";
}
$extra['columns_after']['LIST_SCHOOL_ID'] = 'School';
$functions['LIST_SCHOOL_ID'] = 'GetSchool';
}
$sql .= ")" . $extra['FROM'] . " WHERE TRUE";
if (empty($extra['SELECT_ONLY']) && isset($_REQUEST['include_inactive']) && $_REQUEST['include_inactive'] == 'Y') {
$extra['columns_after']['ACTIVE'] = _('Status');
}
break;
case 'teacher':
$sql = 'SELECT ';
//$sql = 'SELECT '.$distinct;
if ($extra['SELECT_ONLY']) {
$sql .= $extra['SELECT_ONLY'];
} else {
$sql .= "s.LAST_NAME||', '||s.FIRST_NAME||' '||coalesce(s.MIDDLE_NAME,' ') AS FULL_NAME,";
$sql .= 's.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME,s.STUDENT_ID,ssm.SCHOOL_ID,ssm.GRADE_ID ' . $extra['SELECT'];
if ($_REQUEST['include_inactive'] == 'Y') {
$sql .= ',' . db_case(array("('" . $extra['DATE'] . "'>=ssm.START_DATE AND (ssm.END_DATE IS NULL OR '" . $extra['DATE'] . "'<=ssm.END_DATE))", 'TRUE', '\'<span style="color:green">' . _('Active') . '</span>\'', '\'<span style="color:red">' . _('Inactive') . '</span>\'')) . ' AS ACTIVE';
$sql .= ',' . db_case(array("('" . $extra['DATE'] . "'>=ss.START_DATE AND (ss.END_DATE IS NULL OR '" . $extra['DATE'] . "'<=ss.END_DATE)) AND ss.MARKING_PERIOD_ID IN (" . GetAllMP($extra['MPTable'], $extra['MP']) . ")", 'TRUE', '\'<span style="color:green">' . _('Active') . '</span>\'', '\'<span style="color:red">' . _('Inactive') . '</span>\'')) . ' AS ACTIVE_SCHEDULE';
}
}
$sql .= " FROM STUDENTS s JOIN SCHEDULE ss ON (ss.STUDENT_ID=s.STUDENT_ID AND ss.SYEAR='" . UserSyear() . "'";
if ($_REQUEST['include_inactive'] == 'Y') {
$sql .= " AND ss.START_DATE=(SELECT START_DATE FROM SCHEDULE WHERE STUDENT_ID=s.STUDENT_ID AND SYEAR=ss.SYEAR AND COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID ORDER BY START_DATE DESC LIMIT 1)";
} else {
$sql .= " AND ss.MARKING_PERIOD_ID IN (" . GetAllMP($extra['MPTable'], $extra['MP']) . ") AND ('" . $extra['DATE'] . "'>=ss.START_DATE AND ('" . $extra['DATE'] . "'<=ss.END_DATE OR ss.END_DATE IS NULL))";
}
$sql .= ") JOIN COURSE_PERIODS cp ON (cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND " . ($extra['all_courses'] == 'Y' ? "cp.TEACHER_ID='" . User('STAFF_ID') . "'" : "cp.COURSE_PERIOD_ID='" . UserCoursePeriod() . "'") . ")\n\t\t\t\tJOIN STUDENT_ENROLLMENT ssm ON (ssm.STUDENT_ID=s.STUDENT_ID AND ssm.SYEAR=ss.SYEAR AND ssm.SCHOOL_ID='" . UserSchool() . "'";
if ($_REQUEST['include_inactive'] == 'Y') {
$sql .= " AND ssm.ID=(SELECT ID FROM STUDENT_ENROLLMENT WHERE STUDENT_ID=ssm.STUDENT_ID AND SYEAR=ssm.SYEAR ORDER BY START_DATE DESC LIMIT 1)";
} else {
$sql .= " AND ('" . $extra['DATE'] . "'>=ssm.START_DATE AND (ssm.END_DATE IS NULL OR '" . $extra['DATE'] . "'<=ssm.END_DATE))";
}
$sql .= ")" . $extra['FROM'] . " WHERE TRUE";
if (!$extra['SELECT_ONLY'] && $_REQUEST['include_inactive'] == 'Y') {
$extra['columns_after']['ACTIVE'] = _('School Status');
$extra['columns_after']['ACTIVE_SCHEDULE'] = _('Course Status');
}
break;
case 'parent':
case 'student':
$sql = 'SELECT ';
if ($extra['SELECT_ONLY']) {
$sql .= $extra['SELECT_ONLY'];
} else {
$sql .= "s.LAST_NAME||', '||s.FIRST_NAME||' '||coalesce(s.MIDDLE_NAME,' ') AS FULL_NAME,";
$sql .= 's.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME,s.STUDENT_ID,ssm.SCHOOL_ID,ssm.GRADE_ID ' . $extra['SELECT'];
}
$sql .= " FROM STUDENTS s JOIN STUDENT_ENROLLMENT ssm ON (ssm.STUDENT_ID=s.STUDENT_ID AND ssm.SYEAR='" . UserSyear() . "' AND ssm.SCHOOL_ID='" . UserSchool() . "'\n\t\t\t\t\tAND ('" . $extra['DATE'] . "'>=ssm.START_DATE AND (ssm.END_DATE IS NULL OR '" . $extra['DATE'] . "'<=ssm.END_DATE)) AND s.STUDENT_ID" . ($extra['ASSOCIATED'] ? " IN (SELECT STUDENT_ID FROM STUDENTS_JOIN_USERS WHERE STAFF_ID='" . $extra['ASSOCIATED'] . "')" : "='" . UserStudentID() . "'");
$sql .= ")" . $extra['FROM'] . " WHERE TRUE";
break;
default:
exit(_('Error'));
}
//$sql = appendSQL($sql,array('NoSearchTerms'=>$extra['NoSearchTerms']));
$sql .= ' ' . $extra['WHERE'] . ' ';
if (isset($extra['GROUP'])) {
$sql .= ' GROUP BY ' . $extra['GROUP'];
}
if (!isset($extra['ORDER_BY']) && !isset($extra['SELECT_ONLY'])) {
$sql .= ' ORDER BY ';
if (Preferences('SORT') == 'Grade') {
$sql .= '(SELECT SORT_ORDER FROM SCHOOL_GRADELEVELS WHERE ID=ssm.GRADE_ID),';
}
// it would be easier to sort on full_name but postgres sometimes yields strange results
$sql .= 's.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME';
$sql .= $extra['ORDER'];
} elseif (isset($extra['ORDER_BY'])) {
$sql .= ' ORDER BY ' . $extra['ORDER_BY'];
}
//modif Francois: bugfix if PDF, dont echo SQL
if (!isset($_REQUEST['_ROSARIO_PDF']) && 0) {
//activate only for debug purpose
echo '<!--' . $sql . '-->';
}
return DBGet(DBQuery($sql), $functions, $extra['group']);
}
示例12: DBGet
# 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/students/includes/FunctionsInc.php';
$fields_RET = DBGet(DBQuery('SELECT ID,TITLE,TYPE,SELECT_OPTIONS,DEFAULT_SELECTION,REQUIRED,HIDE FROM custom_fields WHERE SYSTEM_FIELD = \'N\' AND CATEGORY_ID=\'' . $_REQUEST[category_id] . '\' ORDER BY SORT_ORDER,TITLE'));
if (UserStudentID()) {
$custom_RET = DBGet(DBQuery('SELECT * FROM students WHERE STUDENT_ID=\'' . UserStudentID() . '\''));
$value = $custom_RET[1];
}
$num_field_gen = true;
if (count($fields_RET)) {
echo '<TABLE cellpadding=5>';
$i = 1;
foreach ($fields_RET as $field) {
if ($field['HIDE'] == 'Y') {
continue;
}
if ($field['REQUIRED'] == 'Y') {
$req = '<font color=red>*</font> ';
} else {
$req = '';
}
示例13: unset
$error[] = $courses_RET[$course][1]['TITLE'] . ' does not have a weight of ' . $weight;
unset($r_courses[$i]);
continue;
}
$sql = "INSERT INTO SCHEDULE_REQUESTS (REQUEST_ID,SYEAR,SCHOOL_ID,STUDENT_ID,SUBJECT_ID,COURSE_ID,COURSE_WEIGHT,MARKING_PERIOD_ID,WITH_TEACHER_ID,NOT_TEACHER_ID,WITH_PERIOD_ID,NOT_PERIOD_ID)\n\t\t\t\t\t\tvalues(" . db_seq_nextval('SCHEDULE_REQUESTS_SEQ') . ",'" . UserSyear() . "','" . UserSchool() . "','" . UserStudentID() . "','" . $courses_RET[$course][1]['SUBJECT_ID'] . "','" . $course . "','" . $weight . "',NULL,'" . $_REQUEST['with_teacher'][$subject][$i] . "','" . $_REQUEST['without_teacher'][$subject][$i] . "','" . $_REQUEST['with_period'][$subject][$i] . "','" . $_REQUEST['without_period'][$subject][$i] . "')";
DBQuery($sql);
}
}
echo ErrorMessage($error, 'Error');
$_SCHEDULER['student_id'] = UserStudentID();
$_SCHEDULER['dont_run'] = true;
include 'modules/Scheduling/Scheduler.php';
$_REQUEST['modfunc'] = 'choose';
}
if ($_REQUEST['modfunc'] == 'choose') {
$QI = DBQuery("SELECT SUBJECT_ID,COURSE_ID,COURSE_WEIGHT,WITH_PERIOD_ID,NOT_PERIOD_ID,WITH_TEACHER_ID,NOT_TEACHER_ID FROM SCHEDULE_REQUESTS WHERE SYEAR='" . UserSyear() . "' AND STUDENT_ID='" . UserStudentID() . "'");
$requests_RET = DBGet($QI, array(), array('SUBJECT_ID'));
$QI = DBQuery("SELECT SUBJECT_ID,TITLE FROM COURSE_SUBJECTS WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY TITLE");
$subjects_RET = DBGet($QI, array(), array('SUBJECT_ID'));
$QI = DBQuery("SELECT DISTINCT COURSE_ID,TITLE,SUBJECT_ID FROM COURSES WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'");
$courses_RET = DBGet($QI, array(), array('SUBJECT_ID', 'COURSE_ID'));
$QI = DBQuery("SELECT DISTINCT c.SUBJECT_ID,cw.COURSE_WEIGHT FROM COURSE_WEIGHTS cw,COURSES c WHERE c.COURSE_ID=cw.COURSE_ID AND c.SCHOOL_ID='" . UserSchool() . "' AND c.SYEAR='" . UserSyear() . "'");
$weights_RET = DBGet($QI, array(), array('SUBJECT_ID'));
$QI = DBQuery("SELECT COURSE_WEIGHT,COURSE_ID FROM COURSE_WEIGHTS WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'");
$course_weights_RET = DBGet($QI, array(), array('COURSE_ID'));
$QI = DBQuery("SELECT COURSE_WEIGHT,COURSE_ID,TEACHER_ID,PERIOD_ID FROM COURSE_PERIODS WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'");
$periods_RET = DBGet($QI, array(), array('COURSE_ID', 'COURSE_WEIGHT'));
$__DBINC_NO_SQLSHOW = true;
echo "<script language=javascript>\n";
foreach ($subjects_RET as $key => $value) {
$html[$key] = "<TABLE><TR><TD width=10></TD><TD><SELECT name=courses[{$key}][]><OPTION value=''>Not Specified</OPTION>";
示例14: unset
echo "<div class=break></div>";
if (AllowEdit()) {
unset($_REQUEST);
$_REQUEST['modname'] = 'scheduling/Schedule.php';
$_REQUEST['search_modfunc'] = 'list';
$extra['link']['FULL_NAME']['link'] = 'Modules.php?modname=scheduling/Requests.php';
$extra['link']['FULL_NAME']['variables'] = array('subject_id' => 'SUBJECT_ID', 'course_id' => 'COURSE_ID');
include 'modules/scheduling/UnfilledRequests.php';
}
}
if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'choose_course') {
if (!isset($_REQUEST['confirm_cid']) || !$_REQUEST['sel_course_period']) {
include "modules/scheduling/MultiCoursesforWindow.php";
} else {
foreach ($_REQUEST['sel_course_period'] as $ses_cpid => $select_cpid) {
DBQuery("INSERT INTO schedule (SYEAR,SCHOOL_ID,STUDENT_ID,START_DATE,MODIFIED_DATE,MODIFIED_BY,COURSE_ID,COURSE_PERIOD_ID,MP,MARKING_PERIOD_ID) values('" . UserSyear() . "','" . UserSchool() . "','" . UserStudentID() . "','" . $date . "','" . $date . "','" . User('STAFF_ID') . "','" . clean_param($_SESSION['crs_id'][$ses_cpid], PARAM_INT) . "','" . clean_param($select_cpid, PARAM_INT) . "','" . clean_param($_SESSION['mp'][$ses_cpid], PARAM_ALPHA) . "','" . clean_param(GetCpDet($ses_cpid, 'MARKING_PERIOD_ID') != '' ? $_SESSION['marking_period_id'][$ses_cpid] : GetMPId('FY'), PARAM_INT) . "')");
DBQuery('UPDATE course_periods SET FILLED_SEATS=FILLED_SEATS+1 WHERE COURSE_PERIOD_ID=\'' . clean_param($select_cpid, PARAM_INT) . '\'');
}
unset($_SESSION['course_period']);
unset($_SESSION['crs_id']);
unset($_SESSION['marking_period_id']);
unset($_SESSION['mp']);
echo "<script language=javascript>opener.document.location = 'Modules.php?modname=" . clean_param($_REQUEST['modname'], PARAM_NOTAGS) . "&time=" . time() . "';window.close();</script>";
}
}
if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'more_info') {
$sql = 'SELECT
s.COURSE_ID,s.COURSE_PERIOD_ID,
s.MARKING_PERIOD_ID,s.START_DATE,s.END_DATE,s.MODIFIED_DATE,s.MODIFIED_BY,
UNIX_TIMESTAMP(s.START_DATE) AS START_EPOCH,UNIX_TIMESTAMP(s.END_DATE) AS END_EPOCH,sp.PERIOD_ID,
cpv.PERIOD_ID,cp.MARKING_PERIOD_ID as COURSE_MARKING_PERIOD_ID,cp.MP,sp.SORT_ORDER,
示例15: DBGet
$b = $cus['ID'];
if ($_REQUEST['category'][$b]) {
$custom_RET = DBGet(DBQuery("SELECT * FROM students WHERE STUDENT_ID='" . UserStudentID() . "'"));
$value = $custom_RET[1];
echo "<table width=100% >";
if ($value['CUSTOM_' . $cus['ID1']] != '') {
echo "<tr><td colspan=2 style=\"border-bottom:1px solid #333; font-size:14px; font-weight:bold;\">" . $cus['TITLE1'] . "</td></tr>";
}
if (count($fields_RET)) {
$i = 1;
foreach ($fields_RET as $field) {
if ($value['CUSTOM_' . $field['ID']] != '') {
$date = DBGet(DBQuery("SELECT type,id FROM custom_fields WHERE ID='" . $field['ID'] . "'"));
foreach ($date as $da) {
if ($da['TYPE'] == 'date') {
$sql = DBGet(DBQuery("SELECT CUSTOM_" . $da['ID'] . " as DATE FROM students WHERE STUDENT_ID='" . UserStudentID() . "'"), array('DATE' => 'ProperDate'));
foreach ($sql as $sq) {
echo '<TR>';
echo '<td width=125px style="font-weight:bold">' . $field['TITLE'] . ':</td>';
echo '<td class=cell_medium>' . $sq['DATE'] . '';
echo '</TD>';
echo '</TR>';
}
} else {
echo '<TR>';
echo '<td width=125px style="font-weight:bold">' . $field['TITLE'] . ':</td><td>';
echo _makeTextInput('CUSTOM_' . $field['ID'], '', 'class=cell_medium');
echo '</TD>';
echo '</TR>';
}
}