public function show() { // TODO: when coming back from update, show previous timetable $connection = new database(); $table = new simple_table_ops(); if (isset($_POST['timetable_period_id'])) { //if (isset($_GET['timetable_period_id'])) { //$timetable_period_id = $_GET['timetable_period_id']; $timetable_period_id = $_POST['timetable_period_id']; $post_values = array('timetable_period_id' => $timetable_period_id); $table->set_values_form_manually($post_values); } if (isset($_GET['timetable_period_id'])) { $timetable_period_id = $_GET['timetable_period_id']; //$timetable_period_id = $_POST['timetable_period_id']; $post_values = array('timetable_period_id' => $timetable_period_id); $table->set_values_form_manually($post_values); } $this->timetable_period_id = $timetable_period_id; $content = "<div class='link_button'>\n <a href='?controller=teachers&action=index'>Teacher</a>\n <a href='?controller=curricula&action=index'>Curricula</a>\n </div>"; /* CONFIGURES DROP DOWN Menu */ $sql = "SELECT timetable_period_id, CONCAT (nom, ' - ', date_from, ' to ', date_to) as period\n FROM timetable_periods\n WHERE school_year_id = {$_SESSION['current_school_year_id']}\n "; $timetable_periods_result = $connection->query($sql); $drop_down = array('timetable_period_id' => array('period' => $timetable_periods_result)); $table->set_drop_down($drop_down); /********************************************************************/ /* CONFIGURES Form structure */ $top_form = array('action' => '?controller=timetable&action=show&submit=yes', 'div' => "class='solitary_input'", 'div_button' => "class='submit_button1'", 'method' => 'post', 'id' => 'top_form', 'elements' => array(1 => array('drop_down' => 'timetable_period_id'), 3 => array('submit' => 'Show Timetable'))); $table->set_top_form($top_form); /********************************************************************/ $columns = array('Timetable', 'Action'); $table->set_html_table_column_names($columns); $content .= "<table width='auto'>" . $table->get_html_table_column_names() . $table->get_form() . '</table>'; if (isset($_GET['submit'])) { if ($_GET['submit'] == 'yes') { $this->set_timetable_html(); $content .= $this->get_timetable_html(); } } $output['content'] = $content; return $output; }
public function index() { $content = ""; /* CONFIGURES DROP DOWN Menus (2 in this case: programs and genre) */ $connection = new database(); $table = new simple_table_ops(); $sql = "SELECT courses.course_id, levels.level\n FROM courses\n JOIN levels ON courses.level_id = levels.level_id\n WHERE courses.school_year_id = {$_SESSION['current_school_year_id']}\n ORDER BY levels.level_id ASC\n\n "; $courses_result = $connection->query($sql); if ($connection->get_row_num() == 0) { // no courses were setup - redirect $content .= "<p> No courses were found for the year {$_SESSION['current_school_year']}.<p>Go to [COURSES] to add a new one."; $output['content'] = $content; return $output; } $drop_down = array('course_id' => array('course' => $courses_result)); $table->set_drop_down($drop_down); /* CONFIGURES top column in neat names and html formatted */ $neat_column_names = array('Select', 'Surname', 'Name', 'Surname Kh', 'Name Kh', 'Genre', 'Program', 'Age'); $table->set_html_table_column_names($neat_column_names); /********************************************************************/ /* CONFIGURES main left table */ // selects ALL students from students where student_id is not inside [COURSES] table // need: select students that are not found in [COURSES] of the current_year_id. /* $sql = "SELECT students.student_id, students.nom, students.prenom, students.nom_khmer, students.prenom_khmer, sexes.sex, programs.program, TIMESTAMPDIFF(YEAR,students.dob,NOW()) AS age FROM students LEFT JOIN courses ON courses.student_id=students.student_id JOIN sexes ON students.sex_id=sexes.sex_id JOIN programs ON students.program_id=programs.program_id WHERE courses.school_year_id Is Null AND students.active_id=1 ORDER BY age ASC, nom ASC, prenom ASC"; */ $sql = "SELECT students.student_id, students.nom, students.prenom, students.nom_khmer, students.prenom_khmer, sexes.sex, programs.program, TIMESTAMPDIFF(YEAR,students.dob,NOW()) AS age\n FROM students\n JOIN sexes ON students.sex_id=sexes.sex_id\n JOIN programs ON students.program_id=programs.program_id\n WHERE students.active_id=1 AND NOT students.student_id IN (\n SELECT students.student_id\n FROM students\n JOIN classes ON classes.student_id = students.student_id\n JOIN courses ON courses.course_id = classes.course_id\n JOIN school_years ON school_years.school_year_id = courses.school_year_id\n WHERE courses.school_year_id = {$_SESSION['current_school_year_id']})\n ORDER BY age ASC, students.prenom, students.nom"; // CHECK: if no result, warn that you need to add students to students table before making courses! // $content .= 'Before building courses, you need to add STUDENTS to the [STUDENTS] table!'; $result = $connection->query($sql); if ($connection->get_row_num() == 0) { // no records found - $output['menu2'] = "No free students were found. To add a new STUDENT, click <a href='?controller=students&action=index'>HERE</a>."; } $table->set_id_column('student_id'); $table->set_html_check_box($result); $content .= "<div class='submit_top_left'><table width='100%'><tr><td>" . $table->get_html_drop_down('course_id') . "</td></tr></table></div>"; $content .= "<div class='half_left'><br><br><table width='100%'>"; $content .= $table->get_html_table_column_names(); $content .= "<form action = '?controller=classes&action=move' method = 'post' id='top_form'>"; $content .= $table->get_html_check_box(); $content .= "<div class='submit_top_left2'><input type ='submit' value='Move selected STUDENTS to Course ->'></div>"; $content .= "</form></table></div>"; //TODO (secondary): // foreach (total of courses.levels_id) // select student from classes // assemble table with new tables from select and add row containing levels.level on top // alternate div class table_row1/table_row2 for each group of class // end foreach // $courses_sql = "SELECT classes.classe_id,\n levels.level,\n students.nom, students.prenom, students.nom_khmer, students.prenom_khmer,\n sexes.sex,\n programs.program\n\n FROM courses\n JOIN classes ON classes.course_id = courses.course_id\n JOIN students ON classes.student_id = students.student_id\n JOIN programs ON programs.program_id = students.program_id\n JOIN sexes ON sexes.sex_id = students.sex_id\n JOIN school_years ON school_years.school_year_id = courses.school_year_id\n JOIN levels ON levels.level_id = courses.level_id\n WHERE courses.school_year_id = " . $_SESSION['current_school_year_id'] . "\n ORDER BY school_years.school_year DESC, levels.level_id ASC, students.nom ASC, students.prenom ASC\n "; // TODO: priority high - generate tables per level_id $courses_table = new simple_table_ops(); $columns = array('Surname', 'Name', 'Surname Kh', 'Name Kh', 'Genre', 'Program', 'Action'); $courses_table->set_html_table_column_names($columns); $details_link = array(1 => array('details', '?controller=classes&action=details&id=')); $courses_table->set_details_link($details_link); $content .= "<div class='half_right'>"; $sql = "SELECT level_id FROM courses GROUP BY level_id ORDER BY level_id"; $levels_result = $connection->query($sql); foreach ($levels_result as $row) { $content .= "<table width='100%'>"; foreach ($row as $field => $value) { $courses_sql = "SELECT classes.classe_id,\n\n students.nom, students.prenom, students.nom_khmer, students.prenom_khmer,\n sexes.sex,\n programs.program\n\n FROM courses\n JOIN classes ON classes.course_id = courses.course_id\n JOIN students ON classes.student_id = students.student_id\n JOIN programs ON programs.program_id = students.program_id\n JOIN sexes ON sexes.sex_id = students.sex_id\n JOIN school_years ON school_years.school_year_id = courses.school_year_id\n JOIN levels ON levels.level_id = courses.level_id\n WHERE courses.school_year_id = " . $_SESSION['current_school_year_id'] . " AND courses.level_id={$value}\n ORDER BY school_years.school_year DESC, levels.level_id ASC, students.nom ASC, students.prenom ASC\n "; $courses_table->set_main_table($connection->query($courses_sql)); $content .= "<tr><td colspan='7'>Grade: " . $value . "</td></tr>"; $content .= $courses_table->get_html_table_column_names(); $content .= $courses_table->get_html_main_table(); $content .= '</td></tr>'; } $content .= "</table>"; } $content .= "</div>"; /********************************************************************/ $output['content'] = $content; return $output; }
public function index() { $content = '<div class="third_left">'; $content .= file_get_contents('views/help/help1.php'); $content .= file_get_contents('views/messages/messages.php'); $content .= '</div>'; /************ left/middle ************/ $content .= "<div class='third_middle'>"; // drop down with school_years and submit button => set $_SESSION['current_year_id'] and $_SESSION['current_year'] variables here $connection = new database(); $table = new simple_table_ops(); $sql = 'SELECT school_year_id, school_year FROM school_years ORDER BY school_year DESC'; $school_year_result = $connection->query($sql); if ($connection->get_row_num() == 0) { // no school year were found, please add one $content .= "<p> No school year was found! <p>Please, add a school year in [CONFIGURATION] if you are the administrator."; } $drop_down = array('school_year_id' => array('school_year' => $school_year_result)); $form_values = array('school_year_id' => $_SESSION['current_school_year_id']); $table->set_values_form_manually($form_values); // set drop_down menu with current_school_year_id $table->set_drop_down($drop_down); /* CONFIGURES top column in neat names and html formatted */ $neat_column_names = array('School Year', 'Action'); $table->set_html_table_column_names($neat_column_names); /* CONFIGURES Form structure */ $top_form = array('action' => '?controller=home&action=setschoolyear', 'div' => "class='solitary_input'", 'div_button' => "class='form_button'", 'method' => 'post', 'id' => 'top_form', 'elements' => array(1 => array('drop_down' => 'school_year_id'), 11 => array('submit' => 'Set School Year'))); $table->set_top_form($top_form); /********************************************************************/ $content .= "<table id=pan>"; $content .= "<tr><td>"; $content .= "<table width='226px'>"; $content .= $table->get_html_table_column_names(); $content .= $table->get_form() . "</table>"; $content .= "<p>Select the School Year to use throughout the application. <p>You can see it in the upper right (in orange). Any operation (class, curriculum, timetable etc creation) are automatically attached to this School Year."; $content .= "</td></tr></table>"; /* CONFIGURES Main table contents */ $columns = array('Available School Years'); $table->set_html_table_column_names($columns); $sql = 'SELECT school_year_id, school_year FROM school_years ORDER BY school_year DESC '; $table->set_main_table($connection->query($sql)); /********************************************************************/ $content .= "<table id=pan>"; $content .= "<tr><td>"; $content .= "<table width='113px'>"; $content .= $table->get_html_table_column_names(); $content .= $table->get_html_main_table(); $content .= '</table>'; $content .= "</td><td>List of School Years already in the database.<p>To add a new school year, go to <a href='?controller=school_years&action=index'>Configuration->School Years</a></td></tr></table>"; $content .= "</div>"; /************ middle/right ************/ $content .= "<div class='third_right'>"; /* CONFIGURES Main table contents (from MySQL) */ /* LIST OF ALL PROGRAMS */ $columns = array('Programs'); $table->set_html_table_column_names($columns); $sql = 'SELECT program_id, program FROM programs ORDER BY program ASC '; $table->set_main_table($connection->query($sql)); $content .= "<table id=pan><tr><td>"; $content .= "<table width='113px'>"; $content .= $table->get_html_table_column_names(); $content .= $table->get_html_main_table(); $content .= '</table>'; $content .= "</td><td>List of programs in the database.<p>If a program is changed or created, go to <a href='?controller=program&action=index'>Configuration->Programs</a></td></tr></table>"; /********************************************************************/ $columns = array('Program', 'Students'); $table->set_html_table_column_names($columns); $sql = "SELECT students.program_id, programs.program, COUNT(students.student_id)\n FROM students\n JOIN programs ON programs.program_id = students.program_id\n GROUP BY program_id\n ORDER BY programs.program"; $table->set_main_table($connection->query($sql)); $content .= "<table id=pan><tr><td>"; $content .= "<table width='226px'>" . $table->get_html_table_column_names() . $table->get_html_main_table() . '</table>'; $sql = "SELECT COUNT(DISTINCT program_id), COUNT(student_id)\n FROM students\n "; $total_students = $connection->query($sql); $content .= "<p>Total programs: " . $total_students[0]['COUNT(DISTINCT program_id)']; $content .= "<br>Total students: " . $total_students[0]['COUNT(student_id)']; $content .= "</td></tr></table>"; $content .= "</div>"; $output['content'] = $content; $output['footer'] = 'Welcome to CSS AEC-Foyer Lataste System'; return $output; }
public function acl_index() { // [controllers] -> [acl] <- [profiles] // on the left: show ALL [controllers] table contents with a check box to select // on the right: [acl] table with details link $connection = new database(); $table = new simple_table_ops(); $content = "<div class='link_button'>\n <a href='?controller=admin&action=users_index'>Users</a>\n <a href='?controller=admin&action=controllers_index'>Controllers</a>\n <a href='?controller=admin&action=profiles_index'>Profiles</a>\n </div>"; /* CONFIGURES DROP DOWN Menus (2 in this case: programs and genre) */ $sql = 'SELECT profile_id, profile FROM profiles'; $profiles_result = $connection->query($sql); $sql = 'SELECT active_id, active FROM actives'; $actives_result = $connection->query($sql); $drop_down = array('profile_id' => array('profile' => $profiles_result), 'active_id' => array('active' => $actives_result)); $table->set_drop_down($drop_down); /********************************************************************/ /* CONFIGURES Form structure */ // add form: presents only profile_id, active_id and submit button. controller_id comes from $_POST['checkbox_array'] configured // by simple_table_ops->set_html_checkbox $sql = "SELECT controller_id, controller, c_action FROM controllers ORDER BY controller ASC, c_action ASC"; $table->set_id_column('controller_id'); $table->set_html_check_box($connection->query($sql)); /* CONFIGURES Main table contents (from MySQL) */ $table->set_id_column('controller_id'); /********************************************************************/ $content .= "<div class='third_left'>"; $content .= "<div class='submit_top_acl'><table>"; $content .= "<form action = '?controller=admin&action=acl_add' method = 'post' id='top_form'>"; $content .= "<td>Profile: </td><td>" . $table->get_html_drop_down('profile_id') . "</td>"; $content .= "<td>Access?: </td><td>" . $table->get_html_drop_down('active_id') . "</td>"; $content .= "<td><input type ='submit' value='Move ->'></td>"; $content .= "</table></div>"; $columns = array('Select', 'Controller', 'Action'); $table->set_html_table_column_names($columns); $content .= "<table width='100%'>" . $table->get_html_table_column_names(); $content .= $table->get_html_check_box(); $content .= "</form></table>"; $content .= "</div>"; // MIDDLE_SECTION START $content .= "<div class='column_margin'></div>"; // MIDDLE_SETION END // START OF RIGHT TABLE - [acl] and its appendices *******************************************************************/ $content .= "<div class='two_thirds_right'>"; $columns = array('Profile', 'Controller', 'Action', 'Access', 'Details'); $table->set_html_table_column_names($columns); $sql = "SELECT acl.acl_id, profiles.profile, controllers.controller, controllers.c_action, actives.active\n FROM acl\n JOIN controllers ON controllers.controller_id = acl.controller_id\n JOIN profiles ON profiles.profile_id = acl.profile_id\n JOIN actives ON actives.active_id = acl.active_id\n ORDER BY profiles.profile ASC, controllers.controller ASC, controllers.c_action ASC\n "; $details_link = array(1 => array('edit', '?controller=admin&action=acl_details&id=')); $table->set_details_link($details_link); $table->set_main_table($connection->query($sql)); /********************************************************************/ $content .= "<table>" . $table->get_html_table_column_names() . $table->get_html_main_table() . '</table>'; /******************************** END OF RIGHT TABLE **********************************************/ $content .= "</div>"; /* CONFIGURE profiles TABLE */ $output['content'] = $content; return $output; }
public function index() { $content = "<div class='link_button'>\n <a href='?controller=attendances&action=export'>Export to EXCEL</a>\n\n </div>"; // attendances index: // Receives curriculum_id - /* CONFIGURES DROP DOWN Menus (2 in this case: programs and genre) */ $connection = new database(); $table = new simple_table_ops(); $sql = "SELECT month_id, month FROM months ORDER BY month_id"; $months_result = $connection->query($sql); $sql = "SELECT curricula.curriculum_id,\n CONCAT (teachers.nom, ' ', teachers.prenom, ' ', teachers.nom_khmer, ' ', teachers.prenom_khmer, ' ',\n subjects.subject, ' ', levels.level) as curricula\n FROM curricula\n JOIN teachers ON teachers.teacher_id = curricula.teacher_id\n JOIN subjects ON subjects.subject_id = curricula.subject_id\n JOIN courses ON courses.course_id = curricula.course_id\n JOIN levels ON levels.level_id = courses.level_id\n WHERE courses.school_year_id = {$_SESSION['current_school_year_id']}\n ORDER BY levels.level_id ASC, teachers.nom ASC"; $curricula_result = $connection->query($sql); $drop_down = array('curriculum_id' => array('curricula' => $curricula_result), 'month_id' => array('month' => $months_result)); // TODO: set values from $_POST if $_POST isset in order to preset drop down values if (isset($_POST['curriculum_id']) and isset($_POST['month_id'])) { $curriculum_id = $_POST['curriculum_id']; $month_id = $_POST['month_id']; $post_values = array('curriculum_id' => $curriculum_id, 'month_id' => $month_id); $table->set_values_form_manually($post_values); } $table->set_drop_down($drop_down); /********************************************************************/ /* CONFIGURES Form structure */ $top_form = array('action' => '?controller=attendances&action=index&submit=yes', 'div' => "class='solitary_input'", 'div_button' => "class='submit_button1'", 'method' => 'post', 'id' => 'top_form', 'elements' => array(1 => array('drop_down' => 'curriculum_id'), 2 => array('drop_down' => 'month_id'), 3 => array('submit' => 'Show Attendance Table'))); $table->set_top_form($top_form); /********************************************************************/ $columns = array('Curricula', 'Month', 'Action'); $table->set_html_table_column_names($columns); $content .= "<table width='auto'>" . $table->get_html_table_column_names() . $table->get_form() . '</table>'; if (isset($_GET['submit'])) { if ($_GET['submit'] == 'yes') { //$second_table = new simple_table_ops(); // TODO:REFACTOR // show table // 1. Get records from [attendance] table corresponding to // $_POST['course_id'] groups the records in classes->attendances. // From classes we get the students list and creates the attendance list with a 'text' input in array // COUNT DAYS IN MONTH - separate in first/second school year $year_first_semester = substr($_SESSION['current_school_year'], 0, 4); $year_second_semester = substr($_SESSION['current_school_year'], -4, 4); if ($month_id < 9) { // user wants attendance list of first semester $total_days = cal_days_in_month(CAL_GREGORIAN, $month_id, $year_first_semester); } else { // user wants attendance list of second semester $total_days = cal_days_in_month(CAL_GREGORIAN, $month_id, $year_second_semester); } $input_form = ''; // retrieves info (if any) from [attendances] table // using: // 1. curriculum_id // 2. month_id // $days_month = ''; for ($i = 1; $i <= 31; $i++) { $days_month .= "attendances.day" . $i . ","; } $days_month = substr($days_month, 0, -1); $sql = "SELECT classes.student_id, {$days_month}\n FROM attendances\n JOIN classes ON classes.classe_id = attendances.classe_id\n JOIN curricula ON curricula.curriculum_id = attendances.curriculum_id\n WHERE curricula.curriculum_id = {$curriculum_id} AND attendances.month_id = {$month_id}"; $sda = $connection->query($sql); // Now, should extract students (in the form of classes.classe_id) found in classes absent in [attendances] // This is necessary if a student starts studying in the middle of the school year $missing_students_sql = "SELECT classes.classe_id\n FROM classes\n JOIN courses ON courses.course_id = classes.course_id\n JOIN curricula ON curricula.course_id = courses.course_id\n WHERE curricula.curriculum_id = {$curriculum_id} AND NOT classes.student_id IN\n (SELECT classes.student_id\n FROM attendances\n JOIN classes ON classes.classe_id = attendances.classe_id\n JOIN curricula ON curricula.curriculum_id = attendances.curriculum_id\n WHERE curricula.curriculum_id = {$curriculum_id} AND attendances.month_id = {$month_id})"; $missing_classes_id = $connection->query($missing_students_sql); // then, insert missing students into [attendances] table, and present it to user $sql = "INSERT INTO attendances (classe_id, curriculum_id, month_id) VALUES (?, ?, ?)"; foreach ($missing_classes_id as $row) { $classe_id = $row['classe_id']; echo $classe_id . ", "; $data[] = array($classe_id, $curriculum_id, $month_id); // $connection->insert($sql, $data); } $connection->insert($sql, $data); // this selects all students found in [attendances], which should be now up-to-date $sql = "SELECT attendances.attendance_id, CONCAT(students.nom, ' ', students.prenom) as nom_prenom, programs.program, sexes.sex, {$days_month}\n FROM curricula\n JOIN courses ON curricula.course_id = courses.course_id\n JOIN classes ON courses.course_id = classes.course_id\n JOIN students ON classes.student_id = students.student_id\n JOIN attendances ON attendances.classe_id = classes.classe_id\n JOIN sexes ON sexes.sex_id = students.sex_id\n JOIN programs ON programs.program_id = students.program_id\n WHERE curricula.curriculum_id = {$curriculum_id} AND attendances.month_id = {$month_id}\n ORDER BY students.nom ASC, students.prenom ASC"; $sql = "SELECT attendances.attendance_id, CONCAT(students.nom, ' ', students.prenom) as nom_prenom, programs.program, sexes.sex, {$days_month}\n FROM curricula\n JOIN courses ON curricula.course_id = courses.course_id\n JOIN classes ON courses.course_id = classes.course_id\n JOIN students ON classes.student_id = students.student_id\n JOIN attendances ON attendances.classe_id = classes.classe_id\n JOIN sexes ON sexes.sex_id = students.sex_id\n JOIN programs ON programs.program_id = students.program_id\n WHERE curricula.curriculum_id = {$curriculum_id} AND attendances.month_id = {$month_id}\n ORDER BY students.nom ASC, students.prenom ASC"; $sql = "SELECT attendances.attendance_id, CONCAT(students.nom, ' ', students.prenom) as nom_prenom, programs.program, sexes.sex, attendances.day1,attendances.day2,attendances.day3,attendances.day4,attendances.day5,attendances.day6,attendances.day7,attendances.day8,attendances.day9,attendances.day10,attendances.day11,attendances.day12,attendances.day13,attendances.day14,attendances.day15,attendances.day16,attendances.day17,attendances.day18,attendances.day19,attendances.day20,attendances.day21,attendances.day22,attendances.day23,attendances.day24,attendances.day25,attendances.day26,attendances.day27,attendances.day28,attendances.day29,attendances.day30,attendances.day31\n FROM attendances\n JOIN curricula ON curricula.curriculum_id = attendances.curriculum_id\n JOIN classes ON classes.classe_id = attendances.classe_id\n JOIN students ON classes.student_id = students.student_id\n JOIN sexes ON sexes.sex_id = students.sex_id\n JOIN programs ON programs.program_id = students.program_id\n WHERE curricula.curriculum_id = {$curriculum_id} AND attendances.month_id = {$month_id}\n ORDER BY students.nom ASC, students.prenom ASC"; $students_id = $connection->query($sql); /* CONFIGURES DROP DOWN Menu ****************************************/ // Bug: drop down menu on ALL input elements is PLAIN UGLY. TODO: better insert info on large form $sql = 'SELECT attendance_check_id, attendance_abb FROM attendance_checks'; $attendances_result = $connection->query($sql); /********************************************************************/ $input_form .= "<tr><td><center>Student</center></td><td>Program</td><td>Genre</td>"; for ($i = 1; $i <= $total_days; $i++) { $input_form .= "<td><center>{$i}</center></td>"; } $input_form .= "</tr>"; foreach ($students_id as $student_id) { $input_form .= "<tr><td>" . $student_id['nom_prenom'] . "</td><td><center>" . $student_id['program'] . "</center></td><td>" . $student_id['sex'] . "</td>"; for ($i = 1; $i <= $total_days; $i++) { $name_day = "attendance[" . $student_id['attendance_id'] . "][" . $i . "]"; $current_day = 'day' . $i; $value = $student_id[$current_day]; // drop down menu on EACH cell is just too ugly - leave as text, and do a validation later in 'save' method $input_form .= "<td><input type = 'text' name = '{$name_day}' value = '{$value}' size='1'></td>"; } $input_form .= "</tr>"; } $input_form .= "<input type='submit' value='save'>"; $content .= "<table><form method='post' action='?controller=attendances&action=save&id={$curriculum_id}&total_days={$total_days}' id='top_form'>"; $content .= $input_form; $content .= "</form></table>"; } } $output['content'] = $content; return $output; }