本文整理汇总了PHP中UserCoursePeriod函数的典型用法代码示例。如果您正苦于以下问题:PHP UserCoursePeriod函数的具体用法?PHP UserCoursePeriod怎么用?PHP UserCoursePeriod使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UserCoursePeriod函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _makeLetterGrade
function _makeLetterGrade($percent, $course_period_id = 0, $staff_id = 0, $ret = 'TITLE')
{
global $programconfig, $_ROSARIO;
if (!$course_period_id) {
$course_period_id = UserCoursePeriod();
}
if (!$staff_id) {
$staff_id = User('STAFF_ID');
}
if (!$programconfig[$staff_id]) {
$config_RET = DBGet(DBQuery("SELECT TITLE,VALUE FROM PROGRAM_USER_CONFIG WHERE USER_ID='" . $staff_id . "' AND PROGRAM='Gradebook'"), array(), array('TITLE'));
if (count($config_RET)) {
foreach ($config_RET as $title => $value) {
$programconfig[$staff_id][$title] = $value[1]['VALUE'];
}
} else {
$programconfig[$staff_id] = true;
}
}
if (!$_ROSARIO['_makeLetterGrade']['courses'][$course_period_id]) {
$_ROSARIO['_makeLetterGrade']['courses'][$course_period_id] = DBGet(DBQuery("SELECT DOES_BREAKOFF,GRADE_SCALE_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $course_period_id . "'"));
}
$does_breakoff = $_ROSARIO['_makeLetterGrade']['courses'][$course_period_id][1]['DOES_BREAKOFF'];
$grade_scale_id = $_ROSARIO['_makeLetterGrade']['courses'][$course_period_id][1]['GRADE_SCALE_ID'];
$percent *= 100;
if ($does_breakoff == 'Y') {
if ($programconfig[$staff_id]['ROUNDING'] == 'UP') {
$percent = ceil($percent);
} elseif ($programconfig[$staff_id]['ROUNDING'] == 'DOWN') {
$percent = floor($percent);
} elseif ($programconfig[$staff_id]['ROUNDING'] == 'NORMAL') {
$percent = round($percent);
}
} else {
$percent = round($percent);
}
// school default
if ($ret == '%') {
return $percent;
}
if (!$_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id]) {
$_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id] = DBGet(DBQuery("SELECT TITLE,ID,BREAK_OFF,COMMENT FROM REPORT_CARD_GRADES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND GRADE_SCALE_ID='{$grade_scale_id}' ORDER BY BREAK_OFF IS NOT NULL DESC,BREAK_OFF DESC,SORT_ORDER"));
}
//$grades = array('A+','A','A-','B+','B','B-','C+','C','C-','D+','D','D-','F');
foreach ($_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id] as $grade) {
if ($does_breakoff == 'Y' ? $percent >= $programconfig[$staff_id][$course_period_id . '-' . $grade['ID']] && is_numeric($programconfig[$staff_id][$course_period_id . '-' . $grade['ID']]) : $percent >= $grade['BREAK_OFF']) {
//modif Francois: use Report Card Grades comments
//return $ret=='ID' ? $grade['ID'] : $grade['TITLE'];
return $grade[$ret];
}
}
}
示例2: _makeLetterGrade
function _makeLetterGrade($percent, $course_period_id = 0, $staff_id = 0, $ret = '')
{
global $programconfig, $_openSIS;
if (!$course_period_id) {
$course_period_id = UserCoursePeriod();
}
if (!$staff_id) {
$staff_id = User('STAFF_ID');
}
if (!$programconfig[$staff_id]) {
$config_RET = DBGet(DBQuery('SELECT TITLE,VALUE FROM program_user_config WHERE USER_ID=\'' . $staff_id . '\' AND PROGRAM=\'Gradebook\''), array(), array('TITLE'));
if (count($config_RET)) {
foreach ($config_RET as $title => $value) {
$programconfig[$staff_id][$title] = $value[1]['VALUE'];
}
} else {
$programconfig[$staff_id] = true;
}
}
if (!$_openSIS['_makeLetterGrade']['courses'][$course_period_id]) {
$_openSIS['_makeLetterGrade']['courses'][$course_period_id] = DBGet(DBQuery('SELECT DOES_BREAKOFF,GRADE_SCALE_ID FROM course_periods WHERE COURSE_PERIOD_ID=\'' . $course_period_id . '\''));
}
$does_breakoff = $_openSIS['_makeLetterGrade']['courses'][$course_period_id][1]['DOES_BREAKOFF'];
$grade_scale_id = $_openSIS['_makeLetterGrade']['courses'][$course_period_id][1]['GRADE_SCALE_ID'];
$percent *= 100;
// if ($does_breakoff=='Y')
// {
if ($programconfig[$staff_id]['ROUNDING'] == 'UP') {
$percent = ceil($percent);
} elseif ($programconfig[$staff_id]['ROUNDING'] == 'DOWN') {
$percent = floor($percent);
} elseif ($programconfig[$staff_id]['ROUNDING'] == 'NORMAL') {
$percent = round($percent, 2);
} else {
$percent = round($percent, 2);
}
// school default
if ($ret == '%') {
return $percent;
}
if (!$_openSIS['_makeLetterGrade']['grades'][$grade_scale_id]) {
$_openSIS['_makeLetterGrade']['grades'][$grade_scale_id] = DBGet(DBQuery('SELECT TITLE,ID,BREAK_OFF FROM report_card_grades WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND GRADE_SCALE_ID=\'' . $grade_scale_id . '\' ORDER BY BREAK_OFF IS NOT NULL DESC,BREAK_OFF DESC,SORT_ORDER'));
}
//$grades = array('A+','A','A-','B+','B','B-','C+','C','C-','D+','D','D-','F');
foreach ($_openSIS['_makeLetterGrade']['grades'][$grade_scale_id] as $grade) {
if ($does_breakoff == 'Y' ? $percent >= $programconfig[$staff_id][$course_period_id . '-' . $grade['ID']] && is_numeric($programconfig[$staff_id][$course_period_id . '-' . $grade['ID']]) : $percent >= $grade['BREAK_OFF']) {
return $ret == 'ID' ? $grade['ID'] : $grade['TITLE'];
}
}
}
示例3: core_calendar_create_calendar_events_object
function core_calendar_create_calendar_events_object()
{
//first, gather the necessary variables
global $columns;
//then, convert variables for the Moodle object:
/*
list of (
//event
object {
name string //event name
description string Default to "null" //Description
format int Default to "1" //description format (1 = HTML, 0 = MOODLE, 2 = PLAIN or 4 = MARKDOWN)
courseid int Default to "0" //course id
groupid int Default to "0" //group id
repeats int Default to "0" //number of repeats
eventtype string Default to "user" //Event type
timestart int Default to "1370827707" //timestart
timeduration int Default to "0" //time duration (in minutes)
visible int Default to "1" //visible
sequence int Default to "1" //sequence
}
)
*/
$name = $columns['TITLE'];
$description = (!empty($columns['ASSIGNED_DATE']) ? _('Assigned Date') . ': ' . ProperDate($columns['ASSIGNED_DATE']) . '<br />' : '') . $columns['DESCRIPTION'];
$format = 1;
//gather the Moodle course ID
$courseid = DBGet(DBQuery("SELECT moodle_id FROM moodlexrosario WHERE rosario_id='" . UserCoursePeriod() . "' AND \"column\"='course_period_id'"));
if (count($courseid)) {
$courseid = (int) $courseid[1]['MOODLE_ID'];
} else {
return null;
}
$eventtype = 'course';
$timestart = strtotime($columns['DUE_DATE']);
$events = array(array('name' => $name, 'description' => $description, 'format' => $format, 'courseid' => $courseid, 'timestart' => $timestart, 'eventtype' => $eventtype));
return array($events);
}
示例4: _makePercentGrade
function _makePercentGrade($grade_id, $course_period_id = 0, $staff_id = 0)
{
global $programconfig, $_openSIS;
if (!$course_period_id) {
$course_period_id = UserCoursePeriod();
}
if (!$staff_id) {
$staff_id = User('STAFF_ID');
}
if (!$programconfig[$staff_id]) {
$config_RET = DBGet(DBQuery('SELECT TITLE,VALUE FROM program_user_config WHERE USER_ID=\'' . $staff_id . '\' AND PROGRAM=\'Gradebook\''), array(), array('TITLE'));
if (count($config_RET)) {
foreach ($config_RET as $title => $value) {
$programconfig[$staff_id][$title] = $value[1]['VALUE'];
}
} else {
$programconfig[$staff_id] = true;
}
}
if (!$_openSIS['_makeLetterGrade']['courses'][$course_period_id]) {
$_openSIS['_makeLetterGrade']['courses'][$course_period_id] = DBGet(DBQuery('SELECT DOES_BREAKOFF,GRADE_SCALE_ID FROM course_periods WHERE COURSE_PERIOD_ID=\'' . $course_period_id . '\''));
}
$does_breakoff = $_openSIS['_makeLetterGrade']['courses'][$course_period_id][1]['DOES_BREAKOFF'];
$grade_scale_id = $_openSIS['_makeLetterGrade']['courses'][$course_period_id][1]['GRADE_SCALE_ID'];
if (!$_openSIS['_makeLetterGrade']['grades'][$grade_scale_id]) {
$_openSIS['_makeLetterGrade']['grades'][$grade_scale_id] = DBGet(DBQuery('SELECT TITLE,ID,BREAK_OFF FROM report_card_grades WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND GRADE_SCALE_ID=\'' . $grade_scale_id . '\' ORDER BY BREAK_OFF IS NOT NULL DESC,BREAK_OFF DESC,SORT_ORDER'));
}
//$grades = array('A+','A','A-','B+','B','B-','C+','C','C-','D+','D','D-','F');
foreach ($_openSIS['_makeLetterGrade']['grades'][$grade_scale_id] as $grade) {
$prev = $crnt;
$crnt = $does_breakoff == 'Y' ? $programconfig[$staff_id][$course_period_id . '-' . $grade['ID']] : $grade['BREAK_OFF'];
if (is_numeric($grade_id) ? $grade_id == $grade['ID'] : strtoupper($grade_id) == strtoupper($grade['TITLE'])) {
return ($crnt + ($crnt > $prev ? 100 : $prev)) / 2;
}
}
return 0;
}
示例5: Widgets
//.........这里部分代码省略.........
}
}
$extra['search'] .= '</TD><TD>' . _('Between') . ' <INPUT type="text" name="class_rank_low" size="3" maxlength="5"> & <INPUT type="text" name="class_rank_high" size="3" maxlength="5"></TD></TR>';
}
break;
case 'letter_grade':
if ($RosarioModules['Grades']) {
if (count($_REQUEST['letter_grade'])) {
if (!$extra['NoSearchTerms']) {
$_ROSARIO['SearchTerms'] .= '<b>' . ($_REQUEST['letter_grade_exclude'] == 'Y' ? _('Without') : _('With')) . ' ' . _('Report Card Grade') . ': </b>';
}
$letter_grades_RET = DBGet(DBQuery("SELECT ID,TITLE FROM REPORT_CARD_GRADES WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'"), array(), array('ID'));
foreach ($_REQUEST['letter_grade'] as $grade => $Y) {
$letter_grades .= ",'{$grade}'";
if (!$extra['NoSearchTerms']) {
$_ROSARIO['SearchTerms'] .= $letter_grades_RET[$grade][1]['TITLE'] . ', ';
}
}
if (!$extra['NoSearchTerms']) {
$_ROSARIO['SearchTerms'] = mb_substr($_ROSARIO['SearchTerms'], 0, -2) . '<BR />';
}
$extra['WHERE'] .= " AND " . ($_REQUEST['letter_grade_exclude'] == 'Y' ? 'NOT ' : '') . "EXISTS (SELECT '' FROM STUDENT_REPORT_CARD_GRADES sg3 WHERE sg3.STUDENT_ID=ssm.STUDENT_ID AND sg3.SYEAR=ssm.SYEAR AND sg3.REPORT_CARD_GRADE_ID IN (" . mb_substr($letter_grades, 1) . ") AND sg3.MARKING_PERIOD_ID='" . $_REQUEST['letter_grade_term'] . "' )";
}
$extra['search'] .= '<TR><TD style="text-align:right; width:120px:">' . _('Grade') . '<BR /><label><INPUT type="checkbox" name="letter_grade_exclude" value="Y"> ' . _('Did not receive') . '</label><BR /><label><INPUT type="radio" name="letter_grade_term" value="' . GetParentMP('SEM', UserMP()) . '"> ' . GetMP(GetParentMP('SEM', UserMP()), 'SHORT_NAME') . '</label> <label><INPUT type="radio" name="letter_grade_term" value="' . UserMP() . '"> ' . GetMP(UserMP(), 'SHORT_NAME') . '</label>';
if (mb_strlen($pros = GetChildrenMP('PRO', UserMP()))) {
$pros = explode(',', str_replace("'", '', $pros));
foreach ($pros as $pro) {
$extra['search'] .= '<label><INPUT type="radio" name="letter_grade_term" value="' . $pro . '"> ' . GetMP($pro, 'SHORT_NAME') . '</label> ';
}
}
$extra['search'] .= "</TD><TD>";
//modif Francois: fix error Invalid argument supplied for foreach()
if ($_REQUEST['search_modfunc'] == 'search_fnc' || !$_REQUEST['search_modfunc']) {
$letter_grades_RET = DBGet(DBQuery("SELECT rg.ID,rg.TITLE,rg.GRADE_SCALE_ID FROM REPORT_CARD_GRADES rg,REPORT_CARD_GRADE_SCALES rs WHERE rg.SCHOOL_ID='" . UserSchool() . "' AND rg.SYEAR='" . UserSyear() . "' AND rs.ID=rg.GRADE_SCALE_ID" . (User('PROFILE') == 'teacher' ? ' AND rg.GRADE_SCALE_ID=(SELECT GRADE_SCALE_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\')' : '') . " ORDER BY rs.SORT_ORDER,rs.ID,rg.BREAK_OFF IS NOT NULL DESC,rg.BREAK_OFF DESC,rg.SORT_ORDER"), array(), array('GRADE_SCALE_ID'));
foreach ($letter_grades_RET as $grades) {
$i = 0;
if (count($grades)) {
foreach ($grades as $grade) {
if ($i % 9 == 0) {
$extra['search'] .= '<BR />';
}
$extra['search'] .= '<label><INPUT type="checkbox" value="Y" name="letter_grade[' . $grade['ID'] . ']"> ' . $grade['TITLE'] . '</label> ';
$i++;
}
}
}
}
$extra['search'] .= '</TD></TR>';
}
break;
case 'eligibility':
if ($RosarioModules['Eligibility']) {
if ($_REQUEST['ineligible'] == 'Y') {
$start_end_RET = DBGet(DBQuery("SELECT TITLE,VALUE FROM PROGRAM_CONFIG WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND PROGRAM='eligibility' AND TITLE IN ('START_DAY','END_DAY')"));
if (count($start_end_RET)) {
foreach ($start_end_RET as $value) {
${$value}['TITLE'] = $value['VALUE'];
}
}
switch (date('D')) {
case 'Mon':
$today = 1;
break;
case 'Tue':
$today = 2;
break;
示例6: DBGet
}
}
if ($_SESSION['miss_attn'] == 1) {
$get_profile_type = DBGet(DBQuery('SELECT PROFILE FROM user_profiles WHERE ID=' . UserProfileID()));
if ($_REQUEST['username'] == 'admin' || $get_profile_type[1]['PROFILE'] == 'admin') {
$note1 = '<a href=Modules.php?modname=users/TeacherPrograms.php?include=attendance/MissingAttendance.php&From=' . $From . '&to=' . $to . '><< Back to Missing Attendance List </a>';
}
}
}
if (optional_param('attn', PARAM_NOTGAS) == 'miss') {
DrawHeaderHome('<A HREF="Modules.php?modname=miscellaneous/Portal.php?back_mssn_attn_list=Y">Back to Missing Attendance List</A>');
}
echo "<FORM ACTION=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&table=" . strip_tags(trim($_REQUEST[table])) . "&username=" . strip_tags(trim($_REQUEST[username])) . "&From={$From}&to={$to}&attn=" . strip_tags(trim($_REQUEST[attn])) . " method=POST>";
$profile = DBGet(DBQuery('SELECT PROFILE FROM staff WHERE STAFF_ID=' . UserID()));
if ($profile[1]['PROFILE'] != "admin" && UserCoursePeriod() != '') {
$QI = DBQuery('SELECT DISTINCT cpv.ID,cpv.PERIOD_ID,cp.COURSE_PERIOD_ID,sp.TITLE,sp.SHORT_NAME,cp.MARKING_PERIOD_ID,cpv.DAYS,sp.SORT_ORDER,c.TITLE AS COURSE_TITLE FROM course_periods cp,course_period_var cpv, school_periods sp,courses c WHERE c.COURSE_ID=cp.COURSE_ID AND cpv.PERIOD_ID=sp.PERIOD_ID AND cp.COURSE_PERIOD_ID=cpv.COURSE_PERIOD_ID AND cpv.COURSE_PERIOD_ID=' . UserCoursePeriod() . ' AND cp.SYEAR=\'' . UserSyear() . '\' AND cp.SCHOOL_ID=\'' . UserSchool() . '\' AND (cp.TEACHER_ID=\'' . User('STAFF_ID') . '\' OR cp.SECONDARY_TEACHER_ID=\'' . User('STAFF_ID') . '\') ORDER BY sp.SORT_ORDER ');
$RET = DBGet($QI);
$period_select = "Choose Period: <SELECT name=period onChange='this.form.submit();'>";
$period_select .= "<OPTION value='na' selected>N/A</OPTION>";
$fi = array();
foreach ($RET as $period) {
$date1 = ucfirst(date("l", strtotime($redate)));
$fi = str_split($period['DAYS']);
$days_arr = array("Monday" => 'M', "Tuesday" => 'T', "Wednesday" => 'W', "Thursday" => 'H', "Friday" => 'F', "Saturday" => 'S', "Sunday" => 'U');
$d = $days_arr[$date1];
$period_select .= "<OPTION value={$period['ID']}" . (in_array($d, $fi) ? ' 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>";
示例7: DBGet
if (User('PROFILE') == 'admin') {
$courses_RET = DBGet(DBQuery("SELECT TITLE,COURSE_ID FROM COURSES WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' AND COURSE_ID IN (SELECT DISTINCT COURSE_ID FROM COURSE_PERIODS WHERE GRADE_SCALE_ID IS NOT NULL) ORDER BY TITLE"));
if (!$_REQUEST['course_id']) {
$_REQUEST['course_id'] = $courses_RET[1]['COURSE_ID'];
}
$course_select = '<SELECT name=course_id onchange="document.location.href=\'Modules.php?modname=' . $_REQUEST['modname'] . '&course_id=\'+this.options[selectedIndex].value">';
foreach ($courses_RET as $course) {
$course_select .= '<OPTION value=' . $course['COURSE_ID'] . ($_REQUEST['course_id'] == $course['COURSE_ID'] ? ' SELECTED' : '') . '>' . $course['TITLE'] . '</OPTION>';
}
$course_select .= '</SELECT>';
} else {
$course_period_RET = DBGet(DBQuery('SELECT GRADE_SCALE_ID,DOES_BREAKOFF,TEACHER_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\''));
if (!$course_period_RET[1]['GRADE_SCALE_ID']) {
ErrorMessage(array('This course is not graded.'), 'fatal');
}
$courses_RET = DBGet(DBQuery("SELECT TITLE,COURSE_ID FROM COURSES WHERE COURSE_ID=(SELECT COURSE_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . UserCoursePeriod() . "')"));
//$course_select = $courses_RET[1]['TITLE'];
$_REQUEST['course_id'] = $courses_RET[1]['COURSE_ID'];
}
if ($_REQUEST['tab_id'] != '0' && $_REQUEST['tab_id'] != 'new') {
$_REQUEST['tab_id'] = $_REQUEST['course_id'];
}
$course_RET = DBGet(DBQuery("SELECT TITLE FROM COURSES WHERE COURSE_ID='{$_REQUEST['course_id']}'"));
$tabs = array(1 => array('title' => $course_RET[1]['TITLE'], 'link' => "Modules.php?modname={$_REQUEST['modname']}&course_id={$_REQUEST['course_id']}&tab_id={$_REQUEST['course_id']}"), 2 => array('title' => 'All Courses', 'link' => "Modules.php?modname={$_REQUEST['modname']}&course_id={$_REQUEST['course_id']}&tab_id=0"), 3 => array('title' => 'General', 'link' => "Modules.php?modname={$_REQUEST['modname']}&course_id={$_REQUEST['course_id']}&tab_id=new"));
if ($_REQUEST['tab_id'] != 'new') {
if ($_REQUEST['tab_id']) {
$sql = 'SELECT * FROM REPORT_CARD_COMMENTS WHERE COURSE_ID=\'' . $_REQUEST['tab_id'] . '\' ORDER BY SORT_ORDER';
} else {
// need to be more specific since course_period_id=0 is not unique
$sql = 'SELECT * FROM REPORT_CARD_COMMENTS WHERE COURSE_ID=\'' . $_REQUEST['tab_id'] . '\' AND SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY SORT_ORDER';
}
示例8: DBGet
$course_periods = DBGet(DBQuery('select marking_period_id from course_periods where course_period_id=' . UserCoursePeriod()));
if ($course_periods[1]['MARKING_PERIOD_ID'] == NULL) {
$school_years = DBGet(DBQuery('select marking_period_id from school_years where syear=' . UserSyear() . ' and school_id=' . UserSchool()));
$fy_mp_id = $school_years[1]['MARKING_PERIOD_ID'];
$sql = 'SELECT a.TITLE,a.ASSIGNED_DATE,a.DUE_DATE, t.ASSIGNMENT_TYPE_ID, t.FINAL_GRADE_PERCENT,g.POINTS,a.POINTS AS TOTAL_POINTS,g.COMMENT,g.POINTS AS LETTER_GRADE,CASE WHEN (a.ASSIGNED_DATE IS NULL OR CURRENT_DATE>=a.ASSIGNED_DATE) AND (a.DUE_DATE IS NULL OR CURRENT_DATE>=a.DUE_DATE) THEN \'Y\' ELSE NULL END AS DUE FROM gradebook_assignment_types t,gradebook_assignments a LEFT OUTER JOIN gradebook_grades g ON (a.ASSIGNMENT_ID=g.ASSIGNMENT_ID AND g.STUDENT_ID=\'' . $student['STUDENT_ID'] . '\' AND g.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\') WHERE a.ASSIGNMENT_TYPE_ID=t.ASSIGNMENT_TYPE_ID AND (a.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\' OR a.COURSE_ID=\'' . $course_id . '\' AND a.STAFF_ID=\'' . User('STAFF_ID') . '\') AND t.COURSE_ID=\'' . $course_id . '\' AND (a.MARKING_PERIOD_ID=\'' . UserMP() . '\' OR a.MARKING_PERIOD_ID=\'' . $fy_mp_id . '\')';
} else {
$sql = 'SELECT a.TITLE,a.ASSIGNED_DATE,a.DUE_DATE, t.ASSIGNMENT_TYPE_ID, t.FINAL_GRADE_PERCENT,g.POINTS,a.POINTS AS TOTAL_POINTS,g.COMMENT,g.POINTS AS LETTER_GRADE,CASE WHEN (a.ASSIGNED_DATE IS NULL OR CURRENT_DATE>=a.ASSIGNED_DATE) AND (a.DUE_DATE IS NULL OR CURRENT_DATE>=a.DUE_DATE) THEN \'Y\' ELSE NULL END AS DUE FROM gradebook_assignment_types t,gradebook_assignments a LEFT OUTER JOIN gradebook_grades g ON (a.ASSIGNMENT_ID=g.ASSIGNMENT_ID AND g.STUDENT_ID=\'' . $student['STUDENT_ID'] . '\' AND g.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\') WHERE a.ASSIGNMENT_TYPE_ID=t.ASSIGNMENT_TYPE_ID AND (a.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\' OR a.COURSE_ID=\'' . $course_id . '\' AND a.STAFF_ID=\'' . User('STAFF_ID') . '\') AND t.COURSE_ID=\'' . $course_id . '\' AND a.MARKING_PERIOD_ID=\'' . UserMP() . '\'';
}
} else {
$course_periods = DBGet(DBQuery('select marking_period_id from course_periods where course_period_id=' . UserCoursePeriod()));
if ($course_periods[1]['MARKING_PERIOD_ID'] == NULL) {
$school_years = DBGet(DBQuery('select marking_period_id from school_years where syear=' . UserSyear() . ' and school_id=' . UserSchool()));
$fy_mp_id = $school_years[1]['MARKING_PERIOD_ID'];
$sql = 'SELECT a.TITLE,a.ASSIGNED_DATE,a.DUE_DATE,\'-1\' AS ASSIGNMENT_TYPE_ID,\'1\' AS FINAL_GRADE_PERCENT,g.POINTS,a.POINTS AS TOTAL_POINTS,g.COMMENT,g.POINTS AS LETTER_GRADE,CASE WHEN (a.ASSIGNED_DATE IS NULL OR CURRENT_DATE>=a.ASSIGNED_DATE) AND (a.DUE_DATE IS NULL OR CURRENT_DATE>=a.DUE_DATE) THEN \'Y\' ELSE NULL END AS DUE FROM gradebook_assignments a LEFT OUTER JOIN gradebook_grades g ON (a.ASSIGNMENT_ID=g.ASSIGNMENT_ID AND g.STUDENT_ID=\'' . $student[STUDENT_ID] . '\' AND g.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\') WHERE (a.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\' OR a.COURSE_ID=\'' . $course_id . '\' AND a.STAFF_ID=\'' . User('STAFF_ID') . '\') AND (a.MARKING_PERIOD_ID=\'' . UserMP() . '\' OR a.MARKING_PERIOD_ID=\'' . $fy_mp_id . '\')';
} else {
$sql = 'SELECT a.TITLE,a.ASSIGNED_DATE,a.DUE_DATE,\'-1\' AS ASSIGNMENT_TYPE_ID,\'1\' AS FINAL_GRADE_PERCENT,g.POINTS,a.POINTS AS TOTAL_POINTS,g.COMMENT,g.POINTS AS LETTER_GRADE,CASE WHEN (a.ASSIGNED_DATE IS NULL OR CURRENT_DATE>=a.ASSIGNED_DATE) AND (a.DUE_DATE IS NULL OR CURRENT_DATE>=a.DUE_DATE) THEN \'Y\' ELSE NULL END AS DUE FROM gradebook_assignments a LEFT OUTER JOIN gradebook_grades g ON (a.ASSIGNMENT_ID=g.ASSIGNMENT_ID AND g.STUDENT_ID=\'' . $student[STUDENT_ID] . '\' AND g.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\') WHERE (a.COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\' OR a.COURSE_ID=\'' . $course_id . '\' AND a.STAFF_ID=\'' . User('STAFF_ID') . '\') AND a.MARKING_PERIOD_ID=\'' . UserMP() . '\'';
}
}
if ($_REQUEST['exclude_notdue'] == 'Y') {
$sql .= ' AND ((a.ASSIGNED_DATE IS NULL OR CURRENT_DATE>=a.ASSIGNED_DATE) AND (a.DUE_DATE IS NULL OR CURRENT_DATE>=DUE_DATE) OR g.POINTS IS NOT NULL)';
}
if ($_REQUEST['exclude_ec'] == 'Y') {
$sql .= ' AND (a.POINTS!=\'0\' OR g.POINTS IS NOT NULL AND g.POINTS!=\'-1\')';
}
$sql .= ' AND a.DUE_DATE>=\'' . $student[START_DATE] . '\' ORDER BY a.ASSIGNMENT_ID';
$grades_RET = DBGet(DBQuery($sql), array('ASSIGNED_DATE' => '_removeSpaces', 'DUE_DATE' => '_removeSpaces', 'TITLE' => '_removeSpaces', 'POINTS' => '_makeExtra', 'LETTER_GRADE' => '_makeExtra'));
$sum_points = $sum_percent = 0;
$flag = false;
foreach ($percent_weights as $assignment_type_id => $percent) {
$flag = true;
$sum_points += $student_points[$assignment_type_id] * $percent_weights[$assignment_type_id] / $total_points[$assignment_type_id];
示例9: array
if ($_REQUEST['allow_edit'] == 'Y' || !$_REQUEST['tab_id']) {
$LO_columns += array('ASSIGNMENT_TYPE_ID' => _('Type'));
}
$link['add']['html'] = array('TITLE' => _makeAssnInput('', 'TITLE'), 'POINTS' => _makeAssnInput('', 'POINTS'), 'ASSIGNED_DATE' => _makeAssnInput('', 'ASSIGNED_DATE'), 'DUE_DATE' => _makeAssnInput('', 'DUE_DATE'), 'COURSE_ID' => _makeAssnInput('', 'COURSE_ID'), 'DESCRIPTION' => _makeAssnInput('', 'DESCRIPTION'));
if (!$_REQUEST['tab_id']) {
$link['add']['html'] += array('ASSIGNMENT_TYPE_ID' => _makeAssnInput('', 'ASSIGNMENT_TYPE_ID'));
}
$link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove&tab_id={$_REQUEST['tab_id']}&allow_edit={$_REQUEST['allow_edit']}";
$link['remove']['variables'] = array('id' => 'ASSIGNMENT_ID');
$link['add']['html']['remove'] = button('add');
$link['add']['first'] = 1;
// number before add link moves to top
$tabs[] = array('title' => button('add'), 'link' => "Modules.php?modname={$_REQUEST['modname']}&tab_id=new&allow_edit={$_REQUEST['allow_edit']}");
$subject = 'Assignments';
} else {
$sql = "SELECT ASSIGNMENT_TYPE_ID,TITLE,FINAL_GRADE_PERCENT,SORT_ORDER,COLOR FROM GRADEBOOK_ASSIGNMENT_TYPES WHERE STAFF_ID='" . User('STAFF_ID') . "' AND COURSE_ID=(SELECT COURSE_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . UserCoursePeriod() . "') ORDER BY SORT_ORDER,TITLE";
$functions = array('TITLE' => '_makeTypeInput', 'SORT_ORDER' => '_makeTypeInput', 'COLOR' => '_makeColorInput');
if (Preferences('WEIGHT', 'Gradebook') == 'Y') {
$functions['FINAL_GRADE_PERCENT'] = '_makeTypeInput';
}
$LO_ret = DBGet(DBQuery($sql), $functions);
$LO_columns = array('TITLE' => _('Type'));
if (Preferences('WEIGHT', 'Gradebook') == 'Y') {
$LO_columns += array('FINAL_GRADE_PERCENT' => _('Percent'));
}
$LO_columns += array('SORT_ORDER' => _('Sort Order'), 'COLOR' => _('Color'));
$link['add']['html'] = array('TITLE' => _makeTypeInput('', 'TITLE'), 'SORT_ORDER' => _makeTypeInput('', 'SORT_ORDER'), 'COLOR' => _makeColorInput('', 'COLOR'));
if (Preferences('WEIGHT', 'Gradebook') == 'Y') {
$link['add']['html']['FINAL_GRADE_PERCENT'] = _makeTypeInput('', 'FINAL_GRADE_PERCENT');
}
$link['remove']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc=remove&tab_id=new&allow_edit={$_REQUEST['allow_edit']}";
示例10: 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']);
}
示例11: _makeGrade
function _makeGrade($value, $column)
{
global $THIS_RET, $current_RET, $import_RET, $grades_RET, $grades_select, $student_count, $tabindex;
$tc_grade = 'n';
if ($column == 'REPORT_CARD_GRADE') {
if (!isset($_REQUEST['_openSIS_PDF'])) {
$student_count++;
$tabindex = $student_count;
if ($import_RET[$THIS_RET['STUDENT_ID']]) {
$select = $import_RET[$THIS_RET['STUDENT_ID']][1]['REPORT_CARD_GRADE_ID'];
$extra_select = array($select => $grades_select[$import_RET[$THIS_RET['STUDENT_ID']][1]['REPORT_CARD_GRADE_ID']]);
$div = false;
} else {
if ($current_RET[$THIS_RET['STUDENT_ID']][1]['GRADE_PERCENT'] != '') {
$select = _makeLetterGrade($current_RET[$THIS_RET['STUDENT_ID']][1]['GRADE_PERCENT'] / 100, "", User('STAFF_ID'), "%");
}
$rounding = DBGet(DBQuery('SELECT VALUE FROM program_user_config WHERE USER_ID=\'' . User('STAFF_ID') . '\' AND TITLE=\'ROUNDING\' AND PROGRAM=\'Gradebook\' '));
if (count($rounding)) {
$_SESSION['ROUNDING'] = $rounding[1]['VALUE'];
} else {
$_SESSION['ROUNDING'] = '';
}
if ($_SESSION['ROUNDING'] == 'UP') {
$select = ceil($select);
} elseif ($_SESSION['ROUNDING'] == 'DOWN') {
$select = floor($select);
} elseif ($_SESSION['ROUNDING'] == 'NORMAL') {
$select = round($select);
}
$dbf = DBGet(DBQuery('SELECT DOES_BREAKOFF,GRADE_SCALE_ID FROM course_periods WHERE COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\''));
if ($dbf[1]['DOES_BREAKOFF'] == 'Y' && $select !== '') {
$get_details = DBGet(DBQuery('SELECT TITLE,VALUE FROM program_user_config WHERE TITLE LIKE \'' . UserCoursePeriod() . '-%' . '\' AND USER_ID=\'' . User('STAFF_ID') . '\' AND PROGRAM=\'Gradebook\' ORDER BY VALUE DESC '));
if (count($get_details)) {
foreach ($get_details as $i => $d) {
if ($select >= $d['VALUE']) {
$id = $i;
break;
}
}
$grade_id = explode('-', $get_details[$id]['TITLE']);
$select = $grade_id[1];
$tc_grade = 'y';
}
}
if ($tc_grade == 'n') {
$select = $current_RET[$THIS_RET['STUDENT_ID']][1]['REPORT_CARD_GRADE_ID'];
}
$extra_select = array();
$div = true;
}
if ($_REQUEST['modfunc'] == 'clearall') {
$select = '';
}
$return = SelectInput($select, 'values[' . $THIS_RET['STUDENT_ID'] . '][grade]', '', $extra_select + $grades_select, false, 'tabindex=' . $tabindex, $div);
} else {
if ($import_RET[$THIS_RET['STUDENT_ID']]) {
$select = $import_RET[$THIS_RET['STUDENT_ID']][1]['REPORT_CARD_GRADE_ID'];
} else {
$select = $current_RET[$THIS_RET['STUDENT_ID']][1]['REPORT_CARD_GRADE_ID'];
}
$return = '<b>' . $grades_RET[$select][1]['TITLE'] . '</b>';
}
} elseif ($column == 'GRADE_PERCENT') {
if ($import_RET[$THIS_RET['STUDENT_ID']]) {
$select = $import_RET[$THIS_RET['STUDENT_ID']][1]['GRADE_PERCENT'];
} else {
$select = $current_RET[$THIS_RET['STUDENT_ID']][1]['GRADE_PERCENT'];
$rounding = DBGet(DBQuery('SELECT VALUE FROM program_user_config WHERE USER_ID=\'' . User('STAFF_ID') . '\' AND TITLE=\'ROUNDING\' AND PROGRAM=\'Gradebook\' '));
if (count($rounding)) {
$_SESSION['ROUNDING'] = $rounding[1]['VALUE'];
} else {
$_SESSION['ROUNDING'] = '';
}
if ($_SESSION['ROUNDING'] == 'UP') {
$select = ceil($select);
} elseif ($_SESSION['ROUNDING'] == 'DOWN') {
$select = floor($select);
} elseif ($_SESSION['ROUNDING'] == 'NORMAL') {
$select = round($select);
}
$return = $select == '' ? '' : $select + 0 . '%';
}
}
return $return;
}
示例12: DBGet
}
}
$current_RET = DBGet(DBQuery("SELECT ATTENDANCE_TEACHER_CODE,ATTENDANCE_CODE,ATTENDANCE_REASON,STUDENT_ID,ADMIN,COURSE_PERIOD_ID FROM ATTENDANCE_PERIOD WHERE SCHOOL_DATE='" . $date . "'"), array(), array('STUDENT_ID', 'COURSE_PERIOD_ID'));
unset($_REQUEST['attendance']);
}
if ($_REQUEST['search_modfunc'] || $_REQUEST['student_id'] || UserStudentID() || User('PROFILE') == 'parent' || User('PROFILE') == 'student') {
$PHP_tmp_SELF = PreparePHP_SELF();
$period_select = "<SELECT name=period_id onchange='this.form.submit();'><OPTION value=\"\">" . _('Daily') . "</OPTION>";
if (!UserStudentID() && !$_REQUEST['student_id']) {
if (User('PROFILE') == 'admin') {
$periods_RET = DBGet(DBQuery("SELECT sp.PERIOD_ID,sp.TITLE FROM SCHOOL_PERIODS sp WHERE sp.SYEAR='" . UserSyear() . "' AND sp.SCHOOL_ID='" . UserSchool() . "' AND (SELECT count(1) FROM COURSE_PERIODS WHERE position(',0,' IN DOES_ATTENDANCE)>0 AND PERIOD_ID=sp.PERIOD_ID AND SYEAR=sp.SYEAR AND SCHOOL_ID=sp.SCHOOL_ID)>0 ORDER BY sp.SORT_ORDER"));
foreach ($periods_RET as $period) {
$period_select .= "<OPTION value=" . $period['PERIOD_ID'] . ($_REQUEST['period_id'] == $period['PERIOD_ID'] ? ' SELECTED' : '') . ">" . $period['TITLE'] . '</OPTION>';
}
} else {
$periods_RET = DBGet(DBQuery("SELECT sp.PERIOD_ID,sp.TITLE FROM SCHOOL_PERIODS sp,COURSE_PERIODS cp WHERE position(',0,' IN cp.DOES_ATTENDANCE)>0 AND sp.PERIOD_ID=cp.PERIOD_ID AND cp.COURSE_PERIOD_ID='" . UserCoursePeriod() . "'"));
if ($periods_RET) {
$period_select .= "<OPTION value=" . $periods_RET[1]['PERIOD_ID'] . ($_REQUEST['period_id'] == $periods_RET[1]['PERIOD_ID'] || !isset($_REQUEST['period_id']) ? ' SELECTED' : '') . ">" . $periods_RET[1]['TITLE'] . '</OPTION>';
if (!isset($_REQUEST['period_id'])) {
$_REQUEST['period_id'] = $periods_RET['PERIOD_ID'];
}
}
}
} else {
$period_select .= '<OPTION value="PERIOD"' . ($_REQUEST['period_id'] ? ' SELECTED' : '') . '>' . _('By Period') . '</OPTION>';
}
$period_select .= '</SELECT>';
echo "<FORM action={$PHP_tmp_SELF} method=POST>";
DrawHeader(PrepareDate($start_date, '_start') . ' - ' . PrepareDate($end_date, '_end') . ' : ' . $period_select . ' : <INPUT type=submit value=' . _('Go') . '>');
}
$cal_RET = DBGet(DBQuery("SELECT DISTINCT SCHOOL_DATE,'_'||to_char(SCHOOL_DATE,'yyyymmdd') AS SHORT_DATE FROM ATTENDANCE_CALENDAR WHERE SCHOOL_ID='" . UserSchool() . "' AND SCHOOL_DATE BETWEEN '{$start_date}' AND '{$end_date}' ORDER BY SCHOOL_DATE"));
示例13: makeGradesInput
function makeGradesInput($value, $name)
{
global $THIS_RET, $grade_scale_select, $teacher_id, $config_RET;
if ($THIS_RET['ID']) {
$id = $THIS_RET['ID'];
} else {
$id = 'new';
}
if ($name == 'GRADE_SCALE_ID') {
return SelectInput($value, "values[{$id}][{$name}]", '', $grade_scale_select, false);
} elseif ($name == 'COMMENT') {
$extra = 'size=15 maxlength=100';
} elseif ($name == 'GPA_VALUE') {
$extra = 'size=5 maxlength=5';
} elseif ($name == 'SORT_ORDER') {
$extra = 'size=5 maxlength=5';
} elseif ($name == 'BREAK_OFF' && $teacher_id && $config_RET[UserCoursePeriod() . '-' . $THIS_RET['ID']][1]['VALUE'] != '') {
return '<FONT color=blue>' . $config_RET[UserCoursePeriod() . '-' . $THIS_RET['ID']][1]['VALUE'] . '</FONT>';
} else {
$extra = 'size=5 maxlength=5';
}
return TextInput($value, "values[{$id}][{$name}]", '', $extra);
}
示例14: DBGet
# 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/>.
#
#***************************************************************************************
#DrawHeader('Gradebook - '.ProgramTitle());
/*
$course_id = DBGet(DBQuery("SELECT COURSE_ID,COURSE_PERIOD_ID FROM course_periods WHERE TEACHER_ID='".User('STAFF_ID')."' AND PERIOD_ID='".UserPeriod()."' AND MARKING_PERIOD_ID IN (".GetAllMP('QTR',UserMP()).')'));
$course_period_id = $course_id[1]['COURSE_PERIOD_ID'];
$course_id = $course_id[1]['COURSE_ID'];
*/
include '../../Redirect_modules.php';
$course_period_id = UserCoursePeriod();
$course_id = DBGet(DBQuery('SELECT COURSE_ID FROM course_periods WHERE COURSE_PERIOD_ID=\'' . UserCoursePeriod() . '\''));
$course_id = $course_id[1]['COURSE_ID'];
$_openSIS['allow_edit'] = true;
unset($_SESSION['_REQUEST_vars']['assignment_type_id']);
unset($_SESSION['_REQUEST_vars']['assignment_id']);
$config_RET = DBGet(DBQuery('SELECT TITLE,VALUE FROM program_user_config WHERE USER_ID=\'' . User('STAFF_ID') . '\' AND PROGRAM=\'Gradebook\''), array(), array('TITLE'));
if (count($config_RET)) {
foreach ($config_RET as $title => $value) {
$programconfig[$title] = $value[1]['VALUE'];
}
} else {
$programconfig = true;
}
//echo '<pre>';print_r($_REQUEST['day_tables']);echo'</pre>';
if (clean_param($_REQUEST['day_tables'], PARAM_NOTAGS) && ($_POST['day_tables'] || $_REQUEST['ajax'])) {
foreach ($_REQUEST['day_tables'] as $id => $values) {
示例15: UserSyear
$extra['SELECT'] .= ",(SELECT cp.ROOM FROM COURSE_PERIODS cp WHERE cp.COURSE_PERIOD_ID='{$_REQUEST['w_course_period_id']}') AS ROOM";
}
} else {
if ($_REQUEST['teacher']) {
$extra['SELECT'] .= ",(SELECT st.FIRST_NAME||' '||st.LAST_NAME FROM STAFF st,COURSE_PERIODS cp,SCHOOL_PERIODS p,SCHEDULE ss WHERE st.STAFF_ID=cp.TEACHER_ID AND cp.PERIOD_id=p.PERIOD_ID AND p.ATTENDANCE='Y' AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND ss.STUDENT_ID=s.STUDENT_ID AND ss.SYEAR='" . UserSyear() . "' AND ss.MARKING_PERIOD_ID IN(" . GetAllMP('QTR', GetCurrentMP('QTR', DBDate(), false)) . ") AND (ss.START_DATE<='" . DBDate() . "' AND (ss.END_DATE>='" . DBDate() . "' OR ss.END_DATE IS NULL)) ORDER BY p.SORT_ORDER LIMIT 1) AS TEACHER";
}
if ($_REQUEST['room']) {
$extra['SELECT'] .= ",(SELECT cp.ROOM FROM COURSE_PERIODS cp,SCHOOL_PERIODS p,SCHEDULE ss WHERE cp.PERIOD_id=p.PERIOD_ID AND p.ATTENDANCE='Y' AND cp.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID AND ss.STUDENT_ID=s.STUDENT_ID AND ss.SYEAR='" . UserSyear() . "' AND ss.MARKING_PERIOD_ID IN(" . GetAllMP('QTR', GetCurrentMP('QTR', DBDate(), false)) . ") AND (ss.START_DATE<='" . DBDate() . "' AND (ss.END_DATE>='" . DBDate() . "' OR ss.END_DATE IS NULL)) ORDER BY p.SORT_ORDER LIMIT 1) AS ROOM";
}
}
} else {
if ($_REQUEST['teacher']) {
$extra['SELECT'] .= ",(SELECT st.FIRST_NAME||' '||st.LAST_NAME FROM STAFF st,COURSE_PERIODS cp WHERE st.STAFF_ID=cp.TEACHER_ID AND cp.COURSE_PERIOD_ID='" . UserCoursePeriod() . "') AS TEACHER";
}
if ($_REQUEST['room']) {
$extra['SELECT'] .= ",(SELECT cp.ROOM FROM COURSE_PERIODS cp WHERE cp.COURSE_PERIOD_ID='" . UserCoursePeriod() . "') AS ROOM";
}
}
$RET = GetStuList($extra);
if (count($RET)) {
$skipRET = array();
for ($i = ($_REQUEST['start_row'] - 1) * $max_cols + $_REQUEST['start_col']; $i > 1; $i--) {
$skipRET[-$i] = array('LAST_NAME' => ' ');
}
$handle = PDFstart();
echo '<!-- MEDIA SIZE 8.5x11in -->';
echo '<!-- MEDIA TOP 0.5in -->';
echo '<!-- MEDIA BOTTOM 0.25in -->';
echo '<!-- MEDIA LEFT 0.25in -->';
echo '<!-- MEDIA RIGHT 0.25in -->';
echo '<!-- FOOTER RIGHT "" -->';