Example #1
0
    }
    var_dump($teacherInfoArray);
    unset($value);
    table_data_add($TEACHER_TABLE_NAME, $TEACHER_TABLE_KEY_NAMES_ARRAY, $teacherInfoArray);
}
//DELETE the information from database if POST
if ($_POST["teacherListDelete"]) {
    table_data_delete_by_id($TEACHER_TABLE_NAME, $targetId);
}
//CHANGE the information to database if POST
if ($_POST["teacherInfoChanged"]) {
    foreach ($TEACHER_TABLE_KEY_NAMES_ARRAY as $value) {
        $teacherInfoChangeArray[$value] = $_POST[$value];
    }
    unset($value);
    table_data_change($TEACHER_TABLE_NAME, $TEACHER_TABLE_KEY_NAMES_ARRAY, $targetId, $teacherInfoChangeArray);
}
//REQUERY the $teacherListArray for display
$teacherListArray = table_data_query($TEACHER_TABLE_NAME, $TEACHER_TABLE_KEY_NAMES_ARRAY);
//------  -[ Views Functions ]-  ------
div_head_output_with_class_option("mainMiddle");
//Print Main Title
main_title_output($PAGE_INFO_ARRAY, $PAGE_SWITCH);
//Print main form
div_head_output_with_class_option("form");
//Print form Block
form_head_output($FILE_NAME, "post");
//Print semesterList Block
div_head_output_with_class_option("mainMiddleBlockLeft");
semester_list_output($PAGE_SWITCH, $semesterListArray, $SEMESTER_TABLE_KEY_NAMES_ARRAY, $semesterTargetArray);
div_end_output();
        $courseTypeInfoArray[$value] = $_POST[$THIS_TABLE_KEY_NAMES_ARRAY[$value]];
    }
    unset($value);
    table_data_add($TABLE_NAME, $THIS_TABLE_KEY_NAMES_ARRAY, $courseTypeInfoArray);
}
//DELETE the information to database if POST
if ($_POST["courseTypeListDelete"]) {
    table_data_delete_by_id($TABLE_NAME, $targetId);
}
//CHANGE the information to database if POST
if ($_POST["courseTypeInfoChanged"]) {
    foreach ($THIS_TABLE_KEY_NAMES_ARRAY as $value) {
        $courseTypeInfoChangeArray[$value] = $_POST[$THIS_TABLE_KEY_NAMES_ARRAY[$value]];
    }
    unset($value);
    table_data_change($TABLE_NAME, $THIS_TABLE_KEY_NAMES_ARRAY, $targetId, $courseTypeInfoChangeArray);
}
//REQUERY the $courseTypeListArray for display
$courseTypeListArray = table_data_query($TABLE_NAME, $THIS_TABLE_KEY_NAMES_ARRAY);
//------  -[ Views Functions ]-  ------
//TODO: Create views functions.
div_head_output_with_class_option("mainMiddle");
//Print Main Title
main_title_output($PAGE_INFO_ARRAY, $PAGE_SWITCH);
//Print main form
div_head_output_with_class_option("form");
//Print form Block
form_head_output($FILE_NAME, "post");
//Print semesterList Block
div_head_output_with_class_option("mainMiddleBlockLeft");
semester_list_output($PAGE_SWITCH, $semesterListArray, $SEMESTER_TABLE_KEY_NAMES_ARRAY, $semesterTargetArray);
        $semesterInfoArray[$value] = $_POST[$THIS_TABLE_KEY_NAMES_ARRAY[$value]];
    }
    unset($value);
    table_data_add($TABLE_NAME, $THIS_TABLE_KEY_NAMES_ARRAY, $semesterInfoArray);
}
//DELETE the semester information to database if POST
if ($_POST["semesterListDelete"]) {
    table_data_delete_by_id($TABLE_NAME, $targetId);
}
//CHANGE the semester information to database if POST
if ($_POST["semesterInfoChange"]) {
    foreach ($THIS_TABLE_KEY_NAMES_ARRAY as $value) {
        $semesterInfoChangeArray[$value] = $_POST[$THIS_TABLE_KEY_NAMES_ARRAY[$value]];
    }
    unset($value);
    table_data_change($TABLE_NAME, $THIS_TABLE_KEY_NAMES_ARRAY, $targetId, $semesterInfoChangeArray);
}
//REQUERY the $semesterListArray for display
$semesterListArray = table_data_query($TABLE_NAME, $THIS_TABLE_KEY_NAMES_ARRAY);
//------  -[ Views Output ]-  ------
div_head_output_with_class_option("mainMiddle");
//Print Main Title
main_title_output($PAGE_INFO_ARRAY, $PAGE_SWITCH);
//Print main form
div_head_output_with_class_option("form");
//Print form Block
form_head_output($FILE_NAME, "post");
//Print semesterList Block
div_head_output_with_class_option("mainMiddleBlockLeft");
semester_list_output($PAGE_SWITCH, $semesterListArray, $THIS_TABLE_KEY_NAMES_ARRAY, $targetArray);
div_end_output();
        $classroomInfoArray[$value] = $_POST[$value];
    }
    unset($value);
    table_data_add($CLASSROOM_TABLE_NAME, $CLASSROOM_TABLE_KEY_NAMES_ARRAY, $classroomInfoArray);
}
//DELETE the information from database if POST
if ($_POST["classroomListDelete"]) {
    table_data_delete_by_id($CLASSROOM_TABLE_NAME, $targetId);
}
//CHANGE the information to database if POST
if ($_POST["classroomInfoChanged"]) {
    foreach ($CLASSROOM_TABLE_KEY_NAMES_ARRAY as $value) {
        $classroomInfoChangeArray[$value] = $_POST[$CLASSROOM_TABLE_KEY_NAMES_ARRAY[$value]];
    }
    unset($value);
    table_data_change($CLASSROOM_TABLE_NAME, $CLASSROOM_TABLE_KEY_NAMES_ARRAY, $targetId, $classroomInfoChangeArray);
}
//REQUERY the $classroomListArray for display
$classroomListArray = table_data_query($CLASSROOM_TABLE_NAME, $CLASSROOM_TABLE_KEY_NAMES_ARRAY);
//------  -[ Views Functions ]-  ------
div_head_output_with_class_option("mainMiddle");
//Print Main Title
main_title_output($PAGE_INFO_ARRAY, $PAGE_SWITCH);
//Print main form
div_head_output_with_class_option("form");
//Print form Block
form_head_output($FILE_NAME, "post");
//Print semesterList Block
div_head_output_with_class_option("mainMiddleBlockLeft");
semester_list_output($PAGE_SWITCH, $semesterListArray, $SEMESTER_TABLE_KEY_NAMES_ARRAY, $semesterTargetArray);
div_end_output();
                            //Update the teach frequency data
                            $teacherListArray[$teacherCounter]['TEACH_FREQUENCY_TRAIN']++;
                            //Break loop
                            break;
                        }
                    }
                }
            }
            /////
        }
    }
    //Write $teacherListArray into database
    $teacherListArrayCount0 = count($teacherListArray);
    for ($i = 0; $i < $teacherListArrayCount0; $i++) {
        $targetId = $teacherListArray[$i]['ID'];
        table_data_change($TEACHER_TABLE_NAME, $TEACHER_TABLE_KEY_NAMES_ARRAY, $targetId, $teacherListArray[$i]);
    }
    //Write $classroomScheduleArray into database
    $classroomScheduleArrayCount0 = count($classroomScheduleArray);
    vars_checkout($classroomScheduleArrayCount0, "classroomScheduleArrayCount0");
    for ($i = 0; $i < $classroomScheduleArrayCount0; $i++) {
        table_data_add($CLASSROOM_SCHEDULE_TABLE_NAME, $CLASSROOM_SCHEDULE_TABLE_KEY_NAMES_ARRAY, $classroomScheduleArray[$i]);
    }
}
//Bracket for reschedule determinative syntax
//Load in session for global table name load.
$_SESSION['targetTableName'] = $CLASSROOM_SCHEDULE_TABLE_NAME;
$_SESSION['targetPageSwitch'] = $PAGE_SWITCH;
//Load the course key-name union array
$courseKeyNameUnionArray = course_key_name_union_array_get($courseListArray);
//Reunion the classroom array for classroom schedule output
                    }
                    $serial = $totalScheduleArrayCount0;
                    $serial = serial_counter($totalScheduleArray, $serial, $key);
                    $totalScheduleArray[$serial]['SEMESTER_WEEK'] = $SEMESTER_WEEK_SET;
                    //1
                    $totalScheduleArray[$serial]['WEEK'] = $week;
                    $totalScheduleArray[$serial][$key] = $value;
                }
            }
        }
    }
    //将$appointedClassArray写入数据库
    $appointedClassArrayCount0 = count($appointedClassArray);
    for ($i = 0; $i < $appointedClassArrayCount0; $i++) {
        $targetId = $appointedClassArray[$i]['ID'];
        table_data_change($CLASS_TABLE_NAME, $CLASS_TABLE_KEY_NAMES_ARRAY, $targetId, $appointedClassArray[$i]);
    }
    //将$totalScheduleArray写入数据库
    $totalScheduleArrayCount0 = count($totalScheduleArray);
    for ($i = 0; $i < $totalScheduleArrayCount0; $i++) {
        table_data_add($TOTAL_SCHEDULE_TABLE_NAME, $TOTAL_SCHEDULE_TABLE_KEY_NAMES_ARRAY, $totalScheduleArray[$i]);
    }
    //var_dump($totalScheduleArray);
}
//Bracket for reschedule determinative syntax
//Load in session for global table name load.
$_SESSION['targetTableName'] = $TOTAL_SCHEDULE_TABLE_NAME;
$_SESSION['targetPageSwitch'] = $PAGE_SWITCH;
$_SESSION['targetSemesterWeek'] = $SEMESTER_WEEK_SET;
//Export the Excel
$semesterName = $semesterListArray[$semesterTargetArray]['SEMESTER'] . "_" . $semesterListArray[$semesterTargetArray]['PART'];