} } else { $returnMesg = "項目錯誤!請選擇正確項目!"; } } else { if ($_POST["submitType"] == "editQuestion") { if (!empty($_POST["postQ"])) { $question_id = $_POST["postQ"]; $jitem = $_POST["postItem"]; $year = $_POST["postYear"]; $keyword = $_POST["postKeyword"]; $resolution = $_POST["postResolution"]; $answer = $_POST["postAnswer"]; $question = $_POST["postQuestion"]; $exam_id = $_POST["postExam"]; $conn_ategory->updQuestion($question_id, $question, $answer, $resolution, $keyword, $exam_id, $year, $jitem); $returnMesg = "題目修改成功"; } else { $returnMesg = "資料不齊全"; } } else { if (!empty($_POST["addData"])) { if ($_POST["submitType"] == "新增類別") { $category_id = $_POST["categoryID"]; if (empty($category_id)) { $returnMesg = "請輸入類別編號"; } else { if (empty($addData)) { $returnMesg = "請輸入類別內容"; } else { $conn_ategory->addCategory($category_id, $addData);