Пример #1
0
      * 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) {
             $currentStatus = $results[$id]['status'];
             $minutes = $results[$id]['minutes'];
             $note = $results[$id]['note'];
             $noteSelect = $noteText = "";
             if (strpos($note, " => ")) {
                 list($noteSelect, $noteText) = preg_split("/ => /", $note);
             } elseif (in_array($note, $smsAttendReasons)) {
                 $noteSelect = $note;
Пример #2
0
             $result = $db->query($sql);
             if (!$result) {
                 //print $sql;
             }
             $prev_assign_name = $cur_assign_name;
             $prev_due_date = $cur_due_date;
         }
         // end foreach ${$cat}
     }
     // end foreach $cat_names_array
     /** ERROR CHECKING  **/
     //$main .= "<br>".make_box("ERROR CHECKING",$queries,"yellow");
 }
 /** END of copy ALL from/to **/
 if ($classID != -1) {
     $cresult = get_course_info_from_classID($classID);
     $courseInfo = $cresult->fetch_assoc();
     /** if no categories exist, then display message and redirect to categories... **/
     $sql = "SELECT count(*) as count from categories where class_id=" . $classID;
     $result = $db->query($sql);
     $row = $result->fetch_assoc();
     $count = $row['count'];
     $copyALL = "\n\t\t\t\t<tr><td colspan=5><span style=\"color:red\">Copy ALL CLASS DATA from another class ?<br>\n\t\t\t\tWARNING : This will replace ALL data in the Categories, Assignments AND Grades Tables for the (Copy To) Class.<br>\n                It will also remove current student and replace with student in the copy FROM class.</span></td><td>\n\t\t\t\t<form action=index.php?lev=" . $_SESSION[$_CONF['sess_name'] . '_lev'] . "&cat=" . $_SESSION[$_CONF['sess_name'] . '_cat'] . " method=POST name=copyAllForm>\n\t\t\t\t<input type=submit class=submit name=copy_ALL_from id=copy_ALL_from value=\"COPY ALL\" />\n\t\t\t\t</form><br /></span>\n\t\t\t\t</td></tr>";
     if ($count != 0) {
         $bc = "blue";
         /** list the assignments for the selected class **/
         $sql = "SELECT assignments.assignment_id, assignments.assignment_name, assignments.due_date, assignments.max_score,\n                        assignments.assignment_weight, assignments.isExtraCredit, categories.category_name\n\t\t\t\t\tFROM assignments, categories\n\t\t\t\t\tWHERE categories.class_id=" . $classID . " and assignments.category_id=categories.category_id\n\t\t\t\t\tORDER by assignments.due_date";
         $result = $db->query($sql);
         $numAssigns = $result->num_rows;
         $t = "Assignments";
         $b = "\n                <script type=\"text/javascript\">\n                    \$(document).ready(function() {\n                        \$('#numAssignsForm').validationEngine({inlineValidation: true});\n                    });\n                </script>\n\t\t\t\t<center>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<form id=\"numAssignsForm\" name=\"numAssignsForm\" action=\"\" method=POST>\n\t\t\t\t\t\t<span style=white-space:nowrap>I would like to add <input class=\"validate[required,custom[integer]]\" type=text size=3 id=\"numAssigns\" name=numAssigns /> assignments to this class.\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=submit class=submit id=\"addNewAssigns\" name=\"addNewAssigns\" value=Add />\n\t\t\t\t\t\t<input type=hidden class=submit id=\"class_id\" name=\"class_id\" value=\"" . $classID . "\" />\n\t\t\t\t\t\t</form></span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t<form id=assignmentListForm name=assignmentListForm action=\"\" method=post>\n\t\t\t\t<table id=\"assignsTable\"border=0 bgcolor=white cellspacing=3 cellpadding=3>\n\t\t\t\t<thead>\n\t\t\t\t</thead>";