| 2 |
require_once "../lib/db_open.inc.php"; |
require_once "../lib/db_open.inc.php"; |
| 3 |
require_once "./section_list.inc.php"; |
require_once "./section_list.inc.php"; |
| 4 |
require_once "./session_init.inc.php"; |
require_once "./session_init.inc.php"; |
| 5 |
|
require_once "./user_priv.inc.php"; |
| 6 |
require_once "./theme.inc.php"; |
require_once "./theme.inc.php"; |
| 7 |
|
|
| 8 |
force_login(); |
force_login(); |
| 43 |
{ |
{ |
| 44 |
$result_set["data"] = array( |
$result_set["data"] = array( |
| 45 |
"sid" => $sid, |
"sid" => $sid, |
| 46 |
|
"cid" => $row["CID"], |
| 47 |
|
"sname" => $row["sname"], |
| 48 |
|
"title" => $row["title"], |
| 49 |
|
"exp_get" => $row["exp_get"], |
| 50 |
|
"recommend" => $row["recommend"], |
| 51 |
|
"read_user_level" => $row["read_user_level"], |
| 52 |
|
"write_user_level" => $row["write_user_level"], |
| 53 |
"announcement" => $row["announcement"], |
"announcement" => $row["announcement"], |
| 54 |
"comment" => $row["comment"], |
"comment" => $row["comment"], |
| 55 |
"ex_update" => $row["ex_update"], |
"ex_update" => $row["ex_update"], |
| 56 |
|
"sort_order" => $row["sort_order"], |
| 57 |
|
"class_sections" => array(), |
| 58 |
"section_hierachy" => array(), |
"section_hierachy" => array(), |
| 59 |
"masters" => array(), |
"masters" => array(), |
| 60 |
); |
); |
| 98 |
} |
} |
| 99 |
mysqli_free_result($rs); |
mysqli_free_result($rs); |
| 100 |
|
|
| 101 |
|
// Load sections in current class |
| 102 |
|
$sql = "SELECT SID, title, sort_order FROM section_config WHERE CID = " . |
| 103 |
|
$result_set["data"]["cid"] . " AND enable ORDER BY sort_order"; |
| 104 |
|
|
| 105 |
|
$rs = mysqli_query($db_conn, $sql); |
| 106 |
|
if ($rs == false) |
| 107 |
|
{ |
| 108 |
|
$result_set["return"]["code"] = -2; |
| 109 |
|
$result_set["return"]["message"] = "Query section list error: " . mysqli_error($db_conn); |
| 110 |
|
|
| 111 |
|
mysqli_close($db_conn); |
| 112 |
|
exit(json_encode($result_set)); |
| 113 |
|
} |
| 114 |
|
|
| 115 |
|
while ($row = mysqli_fetch_array($rs)) |
| 116 |
|
{ |
| 117 |
|
array_push($result_set["data"]["class_sections"], array( |
| 118 |
|
"sid" => $row["SID"], |
| 119 |
|
"title" => $row["title"], |
| 120 |
|
"sort_order" => $row["sort_order"], |
| 121 |
|
)); |
| 122 |
|
} |
| 123 |
|
mysqli_free_result($rs); |
| 124 |
|
|
| 125 |
// Load section list |
// Load section list |
| 126 |
$ret = load_section_list($result_set["data"]["section_hierachy"], |
$ret = load_section_list($result_set["data"]["section_hierachy"], |
| 127 |
function (array $section, array $filter_param) : bool |
function (array $section, array $filter_param) : bool |