示例#1
0
     //$results = make_assoc_array_from_sql($result, $key, 'ms');
     $key = 'user_id';
     $result = get_students_for_course($cid);
     $results = make_assoc_array_from_sql($result, $key, 'my');
     //displayArray($results);
 } else {
     /**
      * What if gale already did a set by district?  Then only a few
      * students will have marks...
      */
     //$default = true;
     //$key = 'STGUID';
     $key = 'user_id';
     //$result = getSMSattendanceForToday($SectionID, $selectedDate);
     //$SMSresults = make_assoc_array_from_sql($result, $key, 'ms');
     $result = get_attendance_for_today($cid, $selectedDate);
     $results = make_assoc_array_from_sql($result, $key, 'my');
     //displayArray($results);
 }
 $table = "\n                <center><div style=\"color:red; font-weight:bold;\">NOTE : You must enter an attendance mark for every student now when taking attendance for the first time.  <br />\n                After that you only change a student that comes in late etc...<br />\n                The minutes are the # of minutes a student spends in your classroom.</div></center><br />";
 $table .= "\n                <form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST id=\"attendForm\">";
 $table .= "\n                <input type=hidden name=default_course_minutes id=default_course_minutes value=\"" . $courseInfo['minutes'] . "\" />\n                <center>\n\n                <table cellspacing=0 cellpadding=3 border=0 bgcolor=white>\n                <tbody class=attendanceRows>";
 if ($_SESSION[$_CONF['sess_name'] . '_isOffice'] && $_SESSION[$_CONF['sess_name'] . '_lev'] == 'office' || $_SESSION[$_CONF['sess_name'] . '_isTeacher'] && $_SESSION[$_CONF['sess_name'] . '_lev'] == 'teach') {
     $result = get_course_info_from_classID($_SESSION[$_CONF['sess_name'] . '_selected_course']);
     $courseInfo = $result->fetch_assoc();
     /**  ##############################  Tarek's Way ################################# */
     foreach ($myStudents_ID as $id => $row) {
         $note = '';
         $noteSelect = $noteText = "";
         //if(array_key_exists($id, $results)){
         if ($default == false) {
示例#2
0
 /**
  * If no attendance marks for this class for today yet
  */
 if ($count == 0) {
     $default = true;
     $key = 'STGUID';
     //$result = getSMSstudentsForCourse($SectionID, $SchoolYear);
     //$results = make_assoc_array_from_sql($result, $key, 'ms');
     //$result = get_students_for_course($cid);
     //$results = make_assoc_array_from_sql($result, $key, 'my');
     $results = $myStudents_GUID;
 } else {
     $key = 'STGUID';
     $result = getSMSattendanceForToday($SectionID, $today);
     $results = make_assoc_array_from_sql($result, $key, 'ms');
     $result = get_attendance_for_today($cid, $today);
     $results = make_assoc_array_from_sql($result, $key, 'my');
     //displayArray($results);exit;
 }
 //displayArray($results);//exit;
 $table = "<center><div style=\"color:red; font-weight:bold\">NOTE : You must enter an attendance mark for every student now when taking attendance for the first time.  <br />\n                        After that you only change a student that comes in late etc...<br />\n                        The minutes are the # of minutes a student spends in your classroom.</div></center><br />";
 $table .= "<FORM action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST>";
 $table .= "\n                        <center>\n                        <table cellspacing=0 cellpadding=3 border=0 bgcolor=white>\n                        <tbody class=attendanceRows>";
 foreach ($results as $id => $row) {
     $table .= "\n                            <tr class=\"student attendanceStudentRow\">\n                                <td><span style=white-space:nowrap><input type=\"CHECKBOX\" id=\"attend_" . $myStudents_GUID[$row['STGUID']]['user_id'] . "_student\" name=\"attend_" . $myStudents_GUID[$row['STGUID']]['user_id'] . "_student\" value=\"" . $myStudents_GUID[$row['STGUID']]['user_id'] . "\"";
     if ($default) {
         $table .= " checked";
     }
     $table .= " />";
     $table .= $row['first_name'] . " " . stripslashes($row['last_name']) . "</span></td>\n";
     $table .= "\n                                <td><span style=white-space:nowrap>&nbsp;&nbsp;&nbsp;</span></td>";