Example #1
0
File: index2.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('');
//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"];
}