$header .= '<TD>'; $header .= '<TABLE><TR>'; foreach ($days as $day => $short_day) { if (strpos($RET['DAYS'], $day) !== false || $new && $day != 'S' && $day != 'U') { $value = 'Y'; } else { $value = ''; } $header .= '<TD>' . str_replace('"', '\\"', CheckboxInput($value, 'tables[course_period_var][' . $course_period_id . '][DAYS][' . $day . ']', $day == 'U' ? 'S' : $day, $checked, false, '', '', false)) . '</TD>'; } $header .= '</TR></TABLE>'; $header .= '</TD>'; $header .= '<TD valign=top align="center">' . CheckboxInput($RET['DOES_ATTENDANCE'], 'tables[course_period_var][' . $course_period_id . '][DOES_ATTENDANCE]', 'Takes attendance', $checked, $new, '<IMG SRC=assets/check.gif height=15 vspace=0 hspace=0 border=0>', '<IMG SRC=assets/x.gif height=15 vspace=0 hspace=0 border=0>', true, ' id=' . $day . '_does_attendance onclick="formcheck_periods_attendance_F2(' . ($day != '' ? 2 : 1) . ',this);"') . '<br><div id="ajax_output"></div></TD>'; $header .= '</TR></TABLE>'; echo '<input type="hidden" name="fixed_day" id="fixed_day" value="' . $day . '" />'; } elseif ($_REQUEST['sch_type'] == 'blocked') { $header = '<input type=hidden name=tables[course_periods][' . $course_period_id . '][SCHEDULE_TYPE] value=BLOCKED />'; $header .= SubmitButton('Save & Continue', '', 'class=btn_large onclick="validate_course_period();"'); } echo $header; break; case 'per_time': $cpdays_RET = DBGet(DBQuery("SELECT START_TIME,END_TIME FROM school_periods where period_id={$_REQUEST['period_id']}")); echo $_REQUEST[day] . "/" . ProperTime($cpdays_RET[1][START_TIME]) . ' To ' . ProperTime($cpdays_RET[1][END_TIME]); echo '<input type=hidden name=course_period_variable[' . $course_period_id . '][' . $course_period_var_id . '][START_TIME] value="' . $cpdays_RET[1][START_TIME] . '"><input type=hidden name=course_period_variable[' . $course_period_id . '][' . $course_period_var_id . '][END_TIME] value="' . $cpdays_RET[1][END_TIME] . '">'; } function conv_day($short_date) { $days = array('U' => 'Sun', 'M' => 'Mon', 'T' => 'Tue', 'W' => 'Wed', 'H' => 'Thu', 'F' => 'Fri', 'S' => 'Sat'); return $days[$short_date]; }
// { // $value = 'Y'; // $disable=''; // } // else // { // $value = ''; // $disable='disabled'; // } // // $header .='<TR class="'.$rowcolor.'"><TD>' .CheckboxInput($value, 'course_period_variable[' . $_REQUEST['course_period_id'] . '][' . $day . '][DAYS]','', '', false, '', '', false,'id='.$day.' onchange=cp_toggle(this);') .'<label for='.$day.'>'.$day_val.'</label></TD>'; $header .= '<TR class="' . $rowcolor . '"><TD align="center">' . '<a href=\'Modules.php?modname=' . $_REQUEST['modname'] . '&action=delete&subject_id=' . $_REQUEST['subject_id'] . '&course_id=' . $_REQUEST['course_id'] . '&course_period_id=' . $_REQUEST['course_period_id'] . '&cpv_id=' . $cp_var_val['ID'] . '\' >' . button('remove') . '</a>' . ''; $header .= '<input type="hidden" name="course_period_variable[' . $_REQUEST['course_period_id'] . '][' . $cp_var_val['ID'] . '][DAYS]" value=' . $cp_var_val['DAYS'] . '</TD>'; $header .= '<TD>' . SelectInput($cp_var_val['DAYS'], 'course_period_variable[' . $_REQUEST['course_period_id'] . '][' . $cp_var_val['ID'] . '][DAYS]' . $i, '', $caldays, 'N/A', 'id=days' . $i) . '</TD>'; $header .= '<TD>' . SelectInput($cp_var_val['PERIOD_ID'], 'course_period_variable[' . $_REQUEST['course_period_id'] . '][' . $cp_var_val['ID'] . '][PERIOD_ID]' . $i, '', $periods, 'N/A', 'id=' . $cp_var_val['DAYS'] . $i . '_period class=cell_floating onchange=show_period_time(this.value,"' . $cp_var_val['DAYS'] . $i . '","' . $_REQUEST['course_period_id'] . '","' . $cp_var_val['ID'] . '");', $div) . '<input type=hidden name=course_period_variable[' . $_REQUEST['course_period_id'] . '][' . $cp_var_val['ID'] . '][ID] value="' . $cp_var_val['ID'] . '"></TD>'; $header .= '<TD><div id=' . $cp_var_val['DAYS'] . $i . '_period_time>' . ($cp_var_val['PERIOD_ID'] ? ProperTime($cp_var_val[START_TIME]) . ' To ' . ProperTime($cp_var_val[END_TIME]) . '<input type=hidden name=course_period_variable[' . $_REQUEST['course_period_id'] . '][' . $cp_var_val['ID'] . '][START_TIME] value="' . $cp_var_val[START_TIME] . '"><input type=hidden name=course_period_variable[' . $_REQUEST['course_period_id'] . '][' . $cp_var_val['ID'] . '][END_TIME] value="' . $cp_var_val[END_TIME] . '">' : '') . '</div></TD>'; $header .= '<TD>' . SelectInput($cp_var_val['ROOM_ID'], 'course_period_variable[' . $_REQUEST['course_period_id'] . '][' . $cp_var_val['ID'] . '][ROOM_ID]', '', $rooms, 'N/A', 'id=' . $cp_var_val['DAYS'] . '_room ', $div) . '<input type=hidden id=course_period_variable[' . $_REQUEST['course_period_id'] . '][' . $cp_var_val['ID'] . '][ROOM_ID]' . $i . ' value="' . $cp_var_val['ROOM_ID'] . '"></TD>'; $header .= '<TD align="center">' . CheckboxInput($cp_var_val['DOES_ATTENDANCE'], 'course_period_variable[' . $_REQUEST['course_period_id'] . '][' . $cp_var_val['ID'] . '][DOES_ATTENDANCE]' . $i, '', '', false, 'Yes', 'No', $value == 'Y' ? $div : false, ' id=' . $cp_var_val['DAYS'] . $i . '_does_attendance onclick="formcheck_periods_attendance_F2(3,this,' . $i . ');"') . '<br></TD></TR>'; echo '<input type="hidden" name="cp_id" id="' . $cp_var_val['DAYS'] . $i . '_id" value="' . $_REQUEST['course_period_id'] . '"/>'; echo '<input type="hidden" name="fixed_day" id="fixed_day3_' . $i . '" value="' . $cp_var_val['DAYS'] . $i . '" />'; echo '<input type="hidden" id="disabled_option_' . $i . '" value="' . $cp_var_val['PERIOD_ID'] . '" />'; echo '<input type="hidden" id="for_editing_room" value="' . $cp_var_val['ID'] . '"/>'; } } } $header .= '<TR class="' . $rowcolor . '"><TD align="center">' . button('add') . '</TD>'; $header .= '<TD>' . SelectInput('', 'course_period_variable[' . $_REQUEST['course_period_id'] . '][n][DAYS]', '', $caldays, 'N/A', 'id=n') . '</TD>'; $header .= '<TD>' . SelectInput('', 'course_period_variable[' . $_REQUEST['course_period_id'] . '][n][PERIOD_ID]', '', $periods, 'N/A', 'id=n_period class=cell_floating ' . $disable . ' onchange=show_period_time(this.value,"n","' . $_REQUEST['course_period_id'] . '","n");', $div) . '</TD>'; $header .= '<TD><div id=n_period_time></div></TD>'; $header .= '<TD>' . SelectInput('', 'course_period_variable[' . $_REQUEST['course_period_id'] . '][n][ROOM_ID]', '', $rooms, 'N/A', 'id=n_room ' . $disable, $div) . '</TD>'; $header .= '<TD align="center">' . CheckboxInput('', 'course_period_variable[' . $_REQUEST['course_period_id'] . '][n][DOES_ATTENDANCE]', '', '', false, 'Yes', 'No', $value == 'Y' ? $div : false, ' id=n_does_attendance onclick="formcheck_periods_attendance_F2(4,this);"' . $disable) . '<br></TD></TR>';