Example #1
0
File: search.php Project: JoDu/gb
<?php

include_once "include/db.php";
include_once "include/func_category.php";
$conn_ategory = new Category();
$result = $conn_ategory->getCategoryList('');
$subject_result = $conn_ategory->getSubjectList('', '');
$chapter_result = $conn_ategory->getChapterList('');
$section_result = $conn_ategory->getSectionList('');
$part_result = $conn_ategory->getPartList('');
$item_result = $conn_ategory->getItemList('');
$exam_result = $conn_ategory->getExamList('');
//print_r($part_result);
//exit;
$arr_subject = array();
foreach ($subject_result as $key => $val) {
    $id = $val["subject_id"] . "-" . $val["sub_id"];
    $arr_subject[$val["category_id"]][$id] = $val["subject_name"];
}
$arr_chapter = array();
foreach ($chapter_result as $key => $val) {
    $subject_id = $val["subject_id"] . "-" . $val["sub_id"];
    $arr_chapter[$subject_id][$val["chapter_id"]] = $val["chapter_name"];
}
$arr_section = array();
foreach ($section_result as $key => $val) {
    $arr_section[$val["chapter_id"]][$val["section_id"]] = $val["section_name"];
}
$arr_part = array();
foreach ($part_result as $key => $val) {
    $arr_part[$val["section_id"]][$val["part_id"]] = $val["part_name"];
Example #2
0
}
if (!empty($_POST["jitem"])) {
    $jitem = $_POST["jitem"];
    $item_result = $conn_ategory->getItemList($jitem);
}
if ($_POST["submitType"] == "addQuestion") {
    $submitType = $_POST["submitType"];
    $question = $_POST["question"];
    $answer = $_POST["answer"];
    $resolution = $_POST["resolution"];
    $keyword = $_POST["keyword"];
    $year = $_POST["year"];
    $exam_id = $_POST["jexam"];
    $page_title = "題目預覽";
    if (!empty($exam_id)) {
        $exam_result = $conn_ategory->getExamList($exam_id);
        $exam_name = $exam_result[0]["exam_name"];
    }
}
if ($_POST["submitType"] == "editQuestion") {
    $question_id = $_POST["postQ"];
    $submitType = $_POST["submitType"];
    $question = $_POST["question"];
    $answer = $_POST["answer"];
    $resolution = $_POST["resolution"];
    $keyword = $_POST["keyword"];
    $year = $_POST["year"];
    $exam_id = $_POST["jexam"];
    //$item_id = $_POST["jitem"];
    $page_title = "修改題目預覽";
    if (!empty($exam_id)) {