$jsubject = $_POST["postSubject"]; $jchapter = $_POST["postChapter"]; $jsection = $_POST["postSection"]; $pieces = explode("-", $jsubject); $subject_id = $pieces[0]; $sub_id = $pieces[1]; if (empty($jsection)) { $returnMesg = "請重新選擇節"; } else { if (empty($jchapter)) { $returnMesg = "請重新選擇章"; } else { if (empty($jsubject)) { $returnMesg = "請重新選擇學科"; } else { $conn_ategory->addPart($subject_id, $sub_id, $jchapter, $jsection, $addData); $returnMesg = "小節輸入成功"; } } } } else { if ($_POST["submitType"] == "新增項目") { $jsubject = $_POST["postSubject"]; $jchapter = $_POST["postChapter"]; $jsection = $_POST["postSection"]; $jsection = $_POST["postSection"]; $jpart = $_POST["postPart"]; $pieces = explode("-", $jsubject); $subject_id = $pieces[0]; $sub_id = $pieces[1]; if (empty($jpart)) {