$header .= "\n <script type=\"text/javascript\">\n \$(document).ready(function() {\n \$('#dateSelector').datepick({\n onSelect: function(dates) {\n \$(this).closest(\"form\").submit();\n },\n dateFormat: 'yyyy-mm-dd',\n maxDate: new Date(" . $ey . ", " . ($em - 1) . ", " . $ed . "),\n minDate: new Date(" . $sy . ", " . ($sm - 1) . ", " . $sd . "),\n monthsToShow: 1,\n onDate: \$.datepick.noWeekends,\n showTrigger: '#callImg'\n });\n \$('#dateSelector').change(function(){\n var newDate = \$('#dateSelector').val();\n alert('dateSelector changed to ' + newDate);\n \$('#a_date').val(newDate);\n });\n });\n </script>"; } if ($displayForm = true) { if (isset($_SESSION[$_CONF['sess_name'] . '_selected_course']) && $_SESSION[$_CONF['sess_name'] . '_selected_course'] != -1) { if (isset($_POST['dateSelector'])) { $selectedDate = $_POST['dateSelector']; } else { $selectedDate = date('Y-m-d'); } list($yr, $mo, $dy) = preg_split("/-/", $selectedDate); /** * Should try to add logic that will prevent attendance on days * like Sat & Sun or outside the terms for current year... */ //$count = getSMSattendanceCount($selectedDate, $SectionID); $count = getSMSattendanceCount($selectedDate, $cid); $default = false; $result = ''; /** * If no attendance marks for this class for today yet * PROBLEM: IF GALE DOES BULK BEFORE teachers log in.... * Then only the students from bulk push show up...????? */ if ($count == 0) { /** * No attendance has been taken as of yet, just use my class list. */ $default = true; //$key = 'STGUID'; //$result = getSMSstudentsForCourse($SectionID, $SchoolYear); //$results = make_assoc_array_from_sql($result, $key, 'ms');
$yr = date('Y'); $mo = date('m'); $dy = date('d'); if (isset($_POST['day']) || isset($_POST['month']) || isset($_POST['year'])) { $yr = $_POST['year']; $mo = $_POST['month']; $dy = $_POST['day']; } /** * Should try to add logic that will prevent attendance on days * like Sat & Sun or outside the terms for current year... */ $today = $yr . "-" . $mo . "-" . $dy; //$count = getSMSattendanceCount($today, $SectionID); //print $today." ".$cid;exit; $count = getSMSattendanceCount($today, $cid); //print $count;exit; $default = false; $result = ''; /** * 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 {