public static function dropDownListEditable($val, $id, $name, $type, $class = NULL, $input = NULL, $textVal = NULL, $class_select = NULL) { Utility::editableSelectScript($id); global $objPDO; include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/subject_class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/section_class.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/teacher_class.php'; $sec = new Section($objPDO); $section = $sec->getSectionArray(); $tea = new Teacher($objPDO); $teacher = $tea->getTeacherArray($input); $sub = new Subject($objPDO); $subject = $sub->getSubjectArray(); $numeric_level = array("select" => "--Select--", "0" => "0", "1" => "1", "2" => "2", "3" => "3", "4" => "4", "5" => "5", "6" => "6", "7" => "7", "8" => "8", "9" => "9", "10" => "10", "11" => "11", "12" => "12"); $blood_group = array("select" => "--Select--", "A+" => "A+", "B+" => "B+", "O+" => "O+", "AB+" => "AB+", "A-" => "A-", "B-" => "B-", "O-" => "O-", "AB-" => "AB-"); $category = array("select" => "--Select--", "OC" => "General(OC)", "SC" => "SC", "ST" => "ST", "OBC" => "OBC", "NRI" => "NRI", "Defence" => "Defence"); if ($class == NULL) { $class = "text_editable"; } $list = array(); if ($type == "numeric_level") { $list = $numeric_level; } else { if ($type == "blood_group") { $list = $blood_group; } else { if ($type == "category") { $list = $category; } else { if ($type == "subject") { $list = $subject; } else { if ($type == "section") { $list = $section; } else { if ($type == "teacher") { $list = $teacher; } } } } } } $textVal = ""; if (array_key_exists($val, $list)) { $textVal = $list[$val]; } $html = '<input type="text" readonly="readonly" id="' . $id . '" class="' . $class . '" value="' . $textVal . '"/>'; $html .= '<select class="' . $class_select . '" style="display:none" id="' . $id . '" name="' . $name . '" >'; foreach ($list as $key => $value) { if ($key == $val) { $html .= '<option class="' . $class_select . '" selected="selected" value="' . $key . '">' . $value . '</option>'; } else { $html .= '<option value="' . $key . '">' . $value . '</option>'; } } $html .= '</select>'; echo $html; }
protected function employee() { global $user; global $objPDO; $student = new student($objPDO, $user->getuserId()); $headMenu = array("username" => $student->getName()); if ($user->checkAdmin() == true) { include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/teacher_class.php'; $emp = new Teacher($objPDO); $employees = $emp->getTeacherArray(0); include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/employee_attendance.php'; } else { header('Location:http://localhost/cloud'); } }