<script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script src="../add/jquery.timepicker.js"></script> <script src="../add/functions.js"></script> <script src="../add/semantic/dist/semantic.min.js"></script> <script> $(document).ready(function () { $('#basicExample').timepicker(); $('.ui.dropdown').selectmenu(); $('#test_cde').val(<?php $test = get_selected_test(filter_input(INPUT_POST, 'test_id')); echo $test['test_type_cde']; ?> ); $('#test_room').val(<?php $test = get_selected_test(filter_input(INPUT_POST, 'test_id')); echo $test['rm_id']; ?> ); }); </script> </head> <body> <header> <h1 style="margin:0;" class="title">Modify Test</h1> </header>
require_once "../../util/main.php"; require_once "../../model/teacher_db.php"; $testTypes = get_test_types(); $rooms = get_rooms(); $action = strtolower(filter_input(INPUT_POST, 'action')); if ($action == NULL) { $action = strtolower(filter_input(INPUT_GET, 'action')); if ($action == NULL) { $action = 'list_test'; } } switch ($action) { case 'list_test': $test_id = filter_input(INPUT_GET, 'test_id'); $tests = get_selected_test($test_id); $test_name = $tests[0]['test_name']; $test_date_data = explode('-', $tests[0]['test_dt']); $test_date = $test_date_data[1] . "/" . $test_date_data[2] . "/" . $test_date_data[0]; $test_cde = $tests[0]['test_type_cde']; $test_room = $tests[0]['rm_id']; $procs_list = [0, 0, 0, 0, 0, 0, 0, 0, 0]; foreach ($tests as $test) { $procs_list[$test['sort_order'] - 1] = $test['proc_needed']; } break; case 'modify_delete_test': $error_msg = ''; $choice = filter_input(INPUT_POST, 'choice'); $test_id = filter_input(INPUT_POST, 'test_id'); $test_name = filter_input(INPUT_POST, 'test_name');