本文整理汇总了PHP中Subject::getSubjectArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Subject::getSubjectArray方法的具体用法?PHP Subject::getSubjectArray怎么用?PHP Subject::getSubjectArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subject
的用法示例。
在下文中一共展示了Subject::getSubjectArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dropDownListEditable
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;
}
示例2: selectsubjects
protected function selectsubjects()
{
global $user;
global $objPDO;
$student = new student($objPDO, $user->getuserId());
$headMenu = array("username" => $student->getName());
if ($user->checkAdmin() == true) {
include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/section_class.php';
include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/subject_relations_class.php';
include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/subject_class.php';
$sec = new Section($objPDO);
$sections = $sec->getSectionArray();
$rel = new SubjectRelations($objPDO);
$subjects = array();
foreach ($sections as $key => $value) {
$subjects[$key] = $rel->getByClassId($key);
}
$sub = new Subject($objPDO);
$subject_name = $sub->getSubjectArray();
include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/examination_subjects.php';
} else {
header('Location:http://localhost/cloud');
}
}