';
}
//else
diff --git a/ChooseCP.php b/ChooseCP.php
index 7aef3e38..57c456b8 100644
--- a/ChooseCP.php
+++ b/ChooseCP.php
@@ -38,7 +38,7 @@
if ($_REQUEST['table_name'] != '' && $_REQUEST['table_name'] == 'courses') {
- $sql = "SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.title,sg.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
+ $sql = "SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.short_name,c.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
$QI = DBQuery($sql);
$courses_RET = DBGet($QI);
$html = 'course_modal_cp||';
diff --git a/ChooseCPModal.php b/ChooseCPModal.php
index 457498db..a1f2e4b9 100644
--- a/ChooseCPModal.php
+++ b/ChooseCPModal.php
@@ -56,7 +56,7 @@
if( $_REQUEST['table_name']!='' && $_REQUEST['table_name']=='courses')
{
- $sql="SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.title,sg.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
+ $sql="SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.short_name,c.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
$QI = DBQuery($sql);
$courses_RET = DBGet($QI);
$html='course_modal||';
diff --git a/ChooseCpSearch.php b/ChooseCpSearch.php
index 8da863c4..444a6292 100644
--- a/ChooseCpSearch.php
+++ b/ChooseCpSearch.php
@@ -53,7 +53,7 @@
if ($_REQUEST['table_name'] != '' && $_REQUEST['table_name'] == 'courses') {
- $sql = "SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.title,sg.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
+ $sql = "SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.short_name,c.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
$QI = DBQuery($sql);
$courses_RET = DBGet($QI);
$html = 'course_modal||';
diff --git a/ChooseRequestSearch.php b/ChooseRequestSearch.php
index 913e7e23..3ad32341 100644
--- a/ChooseRequestSearch.php
+++ b/ChooseRequestSearch.php
@@ -33,7 +33,7 @@
if ($_REQUEST['table_name'] != '' && $_REQUEST['table_name'] == 'courses') {
- $sql = "SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.title,sg.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
+ $sql = "SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.short_name,c.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
$QI = DBQuery($sql);
$courses_RET = DBGet($QI);
$html = 'course_modal_request||';
diff --git a/MassDropModal.php b/MassDropModal.php
index d16c3e46..1da29017 100644
--- a/MassDropModal.php
+++ b/MassDropModal.php
@@ -52,7 +52,7 @@
if ($_REQUEST['table_name'] != '' && $_REQUEST['table_name'] == 'courses') {
- $sql = "SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.title,sg.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
+ $sql = "SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.short_name,c.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
$QI = DBQuery($sql);
$courses_RET = DBGet($QI);
$html = 'course_modal||';
diff --git a/MassScheduleModal.php b/MassScheduleModal.php
index 9038863d..ab4d27eb 100644
--- a/MassScheduleModal.php
+++ b/MassScheduleModal.php
@@ -55,7 +55,7 @@
if ($_REQUEST['table_name'] != '' && $_REQUEST['table_name'] == 'courses') {
- $sql = "SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.title,sg.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
+ $sql = "SELECT COURSE_ID,c.TITLE, CONCAT_WS(' - ',c.short_name,c.title) AS GRADE_COURSE FROM courses c LEFT JOIN school_gradelevels sg ON c.grade_level=sg.id WHERE SUBJECT_ID='$_REQUEST[id]' ORDER BY c.TITLE";
$QI = DBQuery($sql);
$courses_RET = DBGet($QI);
$html = 'course_modal||';
@@ -65,7 +65,7 @@
$html.='';
foreach ($courses_RET as $val) {
- $html.= '
';
diff --git a/modules/grades/InputFinalGrades.php b/modules/grades/InputFinalGrades.php
index 8ed4aa38..07c760d0 100644
--- a/modules/grades/InputFinalGrades.php
+++ b/modules/grades/InputFinalGrades.php
@@ -205,6 +205,7 @@
if ($programconfig[User('STAFF_ID')]['WEIGHT'] == 'Y') {
$assign_typ_wg = array();
$tot_weight_grade = '';
+ $total_weightage='';
if ($course_periods[1]['MARKING_PERIOD_ID'] == NULL) {
$sql = 'SELECT a.TITLE,t.TITLE AS ASSIGN_TYP,a.ASSIGNED_DATE,a.DUE_DATE, t.ASSIGNMENT_TYPE_ID, t.FINAL_GRADE_PERCENT AS WEIGHT_GRADE , t.FINAL_GRADE_PERCENT,t.FINAL_GRADE_PERCENT as ASSIGN_TYP_WG,g.POINTS,a.POINTS AS TOTAL_POINTS,g.COMMENT,g.POINTS AS LETTER_GRADE,g.POINTS AS LETTERWTD_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_id . '\' AND g.COURSE_PERIOD_ID=\'' . $course_period_id . '\') WHERE a.ASSIGNMENT_TYPE_ID=t.ASSIGNMENT_TYPE_ID AND (a.COURSE_PERIOD_ID=\'' . $course_period_id . '\' 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 {
@@ -231,6 +232,8 @@
}
}
foreach ($assignment_type_count as $assign_key => $value) {
+ $total_weightage = $total_weightage + $assign_typ_wg[$assign_key];
+
if ($tot_weight_grade == '')
$tot_weight_grade = round((round(($tot_weighted_percent[$assign_key] / $value), 2) * $assign_typ_wg[$assign_key]) / 100, 2);
else
@@ -238,7 +241,6 @@
}
-
//------------------------------------------------------//
if (check_exam(UserMP()) == 'Y') {
@@ -285,7 +287,7 @@
- $import_RET[$student_id] = array(1 => array('REPORT_CARD_GRADE_ID' => _makeLetterGrade($tot_weight_grade, $course_period_id, 0, 'ID'), 'GRADE_PERCENT' => _makeLetterGrade($tot_weight_grade / 100, $course_period_id, User('STAFF_ID'), '%') . '%'));
+ $import_RET[$student_id] = array(1 => array('REPORT_CARD_GRADE_ID' => _makeLetterGrade($tot_weight_grade/$total_weightage, $course_period_id, 0, 'ID'), 'GRADE_PERCENT' => _makeLetterGrade($tot_weight_grade / $total_weightage, $course_period_id, User('STAFF_ID'), '%') . '%'));
} else {
foreach ($student as $partial_points)
if ($partial_points['PARTIAL_TOTAL'] != 0) {
diff --git a/modules/grades/StudentGrades.php b/modules/grades/StudentGrades.php
index 2d8dc438..a821c24c 100644
--- a/modules/grades/StudentGrades.php
+++ b/modules/grades/StudentGrades.php
@@ -95,12 +95,27 @@
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;
+ $config_RET = DBGet(DBQuery('SELECT TITLE,VALUE FROM program_user_config WHERE USER_ID=\'' . User('STAFF_ID') . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND PROGRAM=\'Gradebook\' AND VALUE LIKE \'%_' . $course_period_id . '\''), array(), array('TITLE'));
+
+
+ if (count($config_RET))
+ foreach ($config_RET as $title => $value) {
+
+ if ($title == 'ANOMALOUS_MAX') {
+ $arr = explode('_', $value[1]['VALUE']);
+
+ $programconfig[User('STAFF_ID')][$title] = $arr[0];
+ } elseif (substr($title, 0, 3) == 'SEM' || substr($title, 0, 1) == 'Q' || substr($title, 0, 1) == 'FY') {
+ $arr = explode('_', $value[1]['VALUE']);
+
+ $programconfig[User('STAFF_ID')][$title] = $arr[0];
+ } else {
+ $unused_var = explode('_', $value[1]['VALUE']);
+ $programconfig[User('STAFF_ID')][$title] = $unused_var[0];
+ // $programconfig[User('STAFF_ID')][$title] = rtrim($value[1]['VALUE'],'_'.UserCoursePeriod());
+ }
+ } else
+ $programconfig[User('STAFF_ID')] = true;
}
if ($programconfig[$staff_id]['WEIGHT'] == 'Y') {
diff --git a/modules/miscellaneous/Portal.php b/modules/miscellaneous/Portal.php
index ea94f6b3..8d649633 100644
--- a/modules/miscellaneous/Portal.php
+++ b/modules/miscellaneous/Portal.php
@@ -386,11 +386,20 @@
echo '
';
}
+// $events_RET = DBGet(DBQuery('SELECT ce.TITLE,ce.DESCRIPTION,ce.SCHOOL_DATE AS INDEX_DATE,ce.SCHOOL_DATE,s.TITLE AS SCHOOL
+// FROM calendar_events ce,calendar_events_visibility cev,schools s
+// WHERE ce.SCHOOL_DATE BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL 30 DAY
+// AND ce.SYEAR=\'' . UserSyear() . '\'
+// AND ce.SCHOOL_ID IN(' . GetUserSchools(UserID(), true) . ')
+// AND s.ID=ce.SCHOOL_ID AND (ce.CALENDAR_ID=cev.CALENDAR_ID)
+// AND ' . (User('PROFILE_ID') == '' ? 'cev.PROFILE=\'admin\'' : 'cev.PROFILE_ID=\'' . User('PROFILE_ID')) . '\'
+// ORDER BY ce.SCHOOL_DATE,s.TITLE'), array('SCHOOL_DATE' => 'ProperDate', 'DESCRIPTION' => 'makeDescription'));
+
$events_RET = DBGet(DBQuery('SELECT ce.TITLE,ce.DESCRIPTION,ce.SCHOOL_DATE AS INDEX_DATE,ce.SCHOOL_DATE,s.TITLE AS SCHOOL
FROM calendar_events ce,calendar_events_visibility cev,schools s
WHERE ce.SCHOOL_DATE BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL 30 DAY
AND ce.SYEAR=\'' . UserSyear() . '\'
- AND ce.SCHOOL_ID IN(' . GetUserSchools(UserID(), true) . ')
+ AND ce.SCHOOL_ID IN(' . UserSchool(). ')
AND s.ID=ce.SCHOOL_ID AND (ce.CALENDAR_ID=cev.CALENDAR_ID)
AND ' . (User('PROFILE_ID') == '' ? 'cev.PROFILE=\'admin\'' : 'cev.PROFILE_ID=\'' . User('PROFILE_ID')) . '\'
ORDER BY ce.SCHOOL_DATE,s.TITLE'), array('SCHOOL_DATE' => 'ProperDate', 'DESCRIPTION' => 'makeDescription'));
@@ -499,11 +508,20 @@
}
+// $events_RET = DBGet(DBQuery('SELECT ce.TITLE,ce.DESCRIPTION,ce.SCHOOL_DATE,s.TITLE AS SCHOOL
+// FROM calendar_events ce,calendar_events_visibility cev,schools s
+// WHERE ce.SCHOOL_DATE BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL 30 DAY
+// AND ce.SYEAR=\'' . UserSyear() . '\'
+// AND ce.school_id IN(' . GetUserSchools(UserID(), true) . ')
+// AND s.ID=ce.SCHOOL_ID AND ce.CALENDAR_ID=cev.CALENDAR_ID
+// AND ' . (User('PROFILE_ID') == '' ? 'cev.PROFILE=\'teacher\'' : 'cev.PROFILE_ID=' . User('PROFILE_ID')) . '
+// ORDER BY ce.SCHOOL_DATE,s.TITLE'), array('SCHOOL_DATE' => 'ProperDate', 'DESCRIPTION' => 'makeDescription'));
+
$events_RET = DBGet(DBQuery('SELECT ce.TITLE,ce.DESCRIPTION,ce.SCHOOL_DATE,s.TITLE AS SCHOOL
FROM calendar_events ce,calendar_events_visibility cev,schools s
WHERE ce.SCHOOL_DATE BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL 30 DAY
AND ce.SYEAR=\'' . UserSyear() . '\'
- AND ce.school_id IN(' . GetUserSchools(UserID(), true) . ')
+ AND ce.school_id IN(' . UserSchool() . ')
AND s.ID=ce.SCHOOL_ID AND ce.CALENDAR_ID=cev.CALENDAR_ID
AND ' . (User('PROFILE_ID') == '' ? 'cev.PROFILE=\'teacher\'' : 'cev.PROFILE_ID=' . User('PROFILE_ID')) . '
ORDER BY ce.SCHOOL_DATE,s.TITLE'), array('SCHOOL_DATE' => 'ProperDate', 'DESCRIPTION' => 'makeDescription'));
@@ -571,11 +589,20 @@
echo '
';
}
+// $events_RET = DBGet(DBQuery('SELECT ce.TITLE,ce.DESCRIPTION,ce.SCHOOL_DATE,s.TITLE AS SCHOOL
+// FROM calendar_events ce,calendar_events_visibility cev,schools s
+// WHERE ce.SCHOOL_DATE BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL 30 DAY
+// AND ce.SYEAR=\'' . UserSyear() . '\'
+// AND ce.school_id IN(' . GetUserSchools(UserID(), true) . ')
+// AND s.ID=ce.SCHOOL_ID AND ce.CALENDAR_ID=cev.CALENDAR_ID
+// AND ' . (User('PROFILE_ID') == '' ? 'cev.PROFILE=\'parent\'' : 'cev.PROFILE_ID=' . User('PROFILE_ID')) . '
+// ORDER BY ce.SCHOOL_DATE,s.TITLE'), array('SCHOOL_DATE' => 'ProperDate', 'DESCRIPTION' => 'makeDescription'));
+
$events_RET = DBGet(DBQuery('SELECT ce.TITLE,ce.DESCRIPTION,ce.SCHOOL_DATE,s.TITLE AS SCHOOL
FROM calendar_events ce,calendar_events_visibility cev,schools s
WHERE ce.SCHOOL_DATE BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL 30 DAY
AND ce.SYEAR=\'' . UserSyear() . '\'
- AND ce.school_id IN(' . GetUserSchools(UserID(), true) . ')
+ AND ce.school_id IN(' . UserSchool() . ')
AND s.ID=ce.SCHOOL_ID AND ce.CALENDAR_ID=cev.CALENDAR_ID
AND ' . (User('PROFILE_ID') == '' ? 'cev.PROFILE=\'parent\'' : 'cev.PROFILE_ID=' . User('PROFILE_ID')) . '
ORDER BY ce.SCHOOL_DATE,s.TITLE'), array('SCHOOL_DATE' => 'ProperDate', 'DESCRIPTION' => 'makeDescription'));
diff --git a/modules/scheduling/MassSchedule.php b/modules/scheduling/MassSchedule.php
index 4dfc4184..8291891a 100644
--- a/modules/scheduling/MassSchedule.php
+++ b/modules/scheduling/MassSchedule.php
@@ -645,7 +645,7 @@ function con_date($date) {
echo '';
echo '
';
echo ''; //.row
- PopTable('footer');
+ PopTable_wo_header('footer');
}
if ($note) {
diff --git a/modules/schoolsetup/Calendar.php b/modules/schoolsetup/Calendar.php
index e880227a..66bd2af1 100644
--- a/modules/schoolsetup/Calendar.php
+++ b/modules/schoolsetup/Calendar.php
@@ -730,20 +730,23 @@
foreach ($title_RET as $title) {
$options[$title['CALENDAR_ID']] = $title['TITLE'];
}
-
+ //echo date('M Y',strtotime('first day of +1 month'));
if (AllowEdit()) {
$tmp_REQUEST = $_REQUEST;
unset($tmp_REQUEST['calendar_id']);
if ($_REQUEST['calendar_id']) {
- $link .= '