示例#1
0
     $username = $smsClassInfo['username'];
     $sql1 = "DELETE FROM InterimReports\n                WHERE CLASSID='" . $classID . "'\n                    AND STGUID='" . $stguid . "'\n                    AND iDate BETWEEN '" . $termStartDate . "' AND '" . $termEndDate . "'";
     $result = queryMSsql($sql1);
     $iDate = date('n/j/Y g:i:s A');
     $iComment = ms_escape_string($_POST['interimComment']);
     $sql2 = "INSERT INTO InterimReports (username,CLASSID, STGUID, iDate, Quality, Improvment, Comments, BuildingID)\n                    VALUES('" . $username . "','" . $classID . "','" . $stguid . "','" . $iDate . "','" . ms_escape_string($commentsByID[$_POST['quality']]['ItemText']) . "','" . implode(",", $smsInsertImprovement) . "','" . $iComment . "',95)";
     $result = queryMSsql($sql2);
 }
 /**
  * ==========  Grades ==========
  */
 if (isset($_POST['addGradeComments'])) {
     /**
      * Need to insert STGUID, SectionID, Comment, SchoolYear, classid
      */
     $q3aitStudents = make_assoc_array_from_sql(getCurrentStudentsForSMS(), 'user_id', 'my');
     $stguid = $q3aitStudents[$_POST['student_id']]['STGUID'];
     $ci = get_class_info($_POST['class_id']);
     $classInfo = $ci->fetch_assoc();
     $SectionID = $classInfo['SectionID'];
     $schoolYearID = get_current_school_year();
     $schoolYearList = get_school_years_list();
     $schoolYear = $schoolYearList[$schoolYearID];
     $smsClassInfo = getClassInfoFromSectionID($SectionID);
     $classID = $smsClassInfo['CLASSID'];
     /**
      * Now for Q3AIT DB...
      */
     /**
             $c = $_POST['class_id'];
             $s = $_POST['student_id'];
示例#2
0
 * Otherwise teacher created classes (ie integrated) will get disabled....
 */
if ($manual) {
    print "Working on Rosters\n";
}
$msg = '';
$error = false;
$currentSchoolYear = get_current_school_year();
$sql = "UPDATE student2class SET isActive='N' where class_id IN (\n        SELECT class_id FROM classes, courses\n        WHERE classes.course_id=courses.course_id\n        AND courses.school_year_id = " . $currentSchoolYear . "\n        AND courses.isCore='Y')";
//$err = $db->query($sql);
$regi = array();
$smsClassRosters = make_array_from_sql(getClassRostersFromSMS(), 'ms');
displayArray($smsClassRosters);
exit;
$q3aitClassRosters = make_assoc_array_from_sql(getClassRostersForSMS(), 'SectionID', 'my');
$q3aitUsers = make_assoc_array_from_sql(getCurrentStudentsForSMS(), 'STGUID', 'my');
$q3aitCourses = make_assoc_array_from_sql(getCoursesForSMS(), 'SectionID', 'my');
$register = array();
// user_id, class_id
//displayArray($smsClassRosters);exit;
//displayArray($q3aitCourses);
//displayArray($q3aitUsers);
foreach ($smsClassRosters as $row) {
    if (array_key_exists($row['SectionID'], $q3aitCourses)) {
        if (array_key_exists($row['STGUID'], $q3aitUsers)) {
            if ($row['DateExited'] == NULL) {
                $student_id = $regi['student_id'] = $q3aitUsers[$row['STGUID']]['user_id'];
                $course_id = $regi['course_id'] = $q3aitCourses[$row['SectionID']]['course_id'];
                $classes = get_classes_for_course($course_id);
                while ($row2 = $classes->fetch_assoc()) {
                    array_push($register, array('user_id' => $student_id, 'class_id' => $row2['class_id']));