} elseif ($_POST['attendValue'] == 'Unexcused-Abs' || $_POST['attendValue'] == 'Excused-Abs' || $_POST['attendValue'] == 'Suspended' || $_POST['attendValue'] == 'WBL-Abssent') { $absRecord['ExtraHours'] = 0; } else { $absRecord['ExtraHours'] = $course['minutes'] - $_POST['a_minutes']; } if ($absRecord['ExtraHours'] < 0) { $absRecord['ExtraHours'] = 0; // just in case a class is shorter than the post minutes.... } $absRecord['SectionID'] = $course['SectionID']; //."{".$course['course_name']."}"; $result2 = get_students_for_course($course['course_id']); //$SMSmsg .= "$ schoolID = ".$schoolID." course = ".$course['course_name']."<br>"; while ($row2 = $result2->fetch_assoc()) { //$SMSmsg .= displayArray2($row2)."<hr>"; if ($schoolID == $row2['school_id']) { $absRecord['STGUID'] = $row2['STGUID']; //."{".$row2['first_name']." ".$row2['last_name']."}"; //array_push($studentList, $absRecord); $SMSmsg .= $course['course_name'] . " - " . $row2['first_name'] . " " . $row2['last_name'] . "<br>"; $SMSmsg .= updateSMSAttend($absRecord) . "<br />"; //$sql2 = "INSERT into AbsTransactions (".implode(',', array_keys($absRecord)).") VALUES('". implode("','", $absRecord)."')"; } } } } $main .= make_box("Bulk Attend", $SMSmsg); } } else { $main .= login_error(); }
/** Insert attendance mark regardless of email success and status (ie attendance mark for ALL students )**/ $sql2 = "REPLACE into attendance (student_id, date, status, school_year, course_id, note, minutes)\n\t\t\t\t\t\tvalues(" . $student . ",'" . $date . "','" . $record['status'] . "'," . $_SESSION[$_CONF['sess_name'] . '_current_school_year'] . "," . $cid . ",'" . $note . "'," . $record['minutes'] . ")"; $result2 = $db->query($sql2); /** * Now to deal with SMS. Build a query for SMS * Remember the STGUID and SectionID and status and date... * DONT Forget, this needs to check for studentGUID since not all are participating yet... */ $smsRec = array(); $smsRec['STGUID'] = $myStudents_ID[$student]['STGUID']; $smsRec['SectionID'] = $SectionID; $smsRec['AbsType'] = $ait2smsAttend[$record['status']]; $smsRec['AbsDate'] = $date; $smsRec['minutes'] = $record['minutes']; if (!strlen($SectionID) < 36) { $SMSmsg .= updateSMSAttend($smsRec) . "<br />"; } } /** end if student was checked...**/ } /** end foreach student **/ // $main .= "<br />".make_box("-- Ed Center --",$b_center,$box_color_center); //$main .= "<br />".make_box("-- SMS Transaction --",$SMSmsg,$box_color_center); if ($b_parent != "") { $main .= make_box("-- Parent --", $b_parent, $box_color_parent); } if ($b_homeschool != "") { $main .= make_box("-- Home School --", $b_homeschool, $box_color_homeschool); } $b_mesg = "\n\t\t\t<center>The attendance has been updated.<br>\n\t\t\t<br><FORM action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST>\n\t\t\t<input type=submit class=submit name=submit value=\"OK\">\n\t\t\t</FORM></center>"; $t_mesg = "Attendance Results";