$description = "Restore Comment"; if ($isBad) { $description = "Bad Comment"; $userEmail = $user[global_mapping::Email]; $fullName = $user[global_mapping::FullName]; $linkArticle = global_common::getHostName() . '/article_detail.php?aid=' . $comment[global_mapping::ArticleID]; $commentDate = global_common::formatDateTimeVN($comment[global_mapping::CreatedDate]); $commentContent = $comment[global_mapping::Content]; $linkPolicy = global_common::getHostName() . '/' . global_common::PAGE_TERM_KM; $arrMailContent = global_common::formatMailContent(global_common::TEAMPLATE_BAD_COMMENT, null, array(global_common::formatOutputText($fullName), $linkArticle, $commentDate, $commentContent, $linkPolicy)); $emailSubject = $arrMailContent[0]; $emailContent = $arrMailContent[1]; $isSent = global_mail::send($userEmail, $fullName, $emailSubject, $emailContent, null, global_common::SUPPORT_MAIL_USERNAME, global_common::SUPPORT_MAIL_PASSWORD, global_common::SUPPORT_MAIL_DISPLAY_NAME); } if ($isSent) { $badComment = $objCommentBad->getCommentBadByID($commentID); if (count($badComment) <= 0) { $createdBy = $c_userInfo[global_mapping::UserID]; $resultID = $objCommentBad->insert($commentID, $description, $createdBy, $isBad); } else { $updatedBy = $c_userInfo[global_mapping::UserID]; $resultID = $objCommentBad->activateBadComment($commentID, $description, $updatedBy, $isBad); } if ($resultID) { $arrHeader = global_common::getMessageHeaderArr($banCode); //$banCode echo global_common::convertToXML($arrHeader, array("rs", "inf", "form"), array(1, 'Xử lý bad comment thành công'), array(0, 1)); return; } } }
} else { echo global_common::convertToXML($arrHeader, array("rs"), array(0), array(0)); return; } } else { echo global_common::convertToXML($arrHeader, array("rs", 'info'), array(0, global_common::STRING_REQUIRE_LOGIN), array(0, 1)); } return; } elseif ($_pgR['act'] == model_CommentBad::ACT_CHANGE_PAGE) { $intPage = $_pgR['p']; $outPutHTML = $objCommentBad->getListCommentBad($intPage); echo global_common::convertToXML($strMessageHeader, array('rs', 'inf'), array(1, $outPutHTML), array(0, 1)); return; } elseif ($_pgR['act'] == model_CommentBad::ACT_SHOW_EDIT) { $strCommentBadID = $_pgR['id']; $arrCommentBad = $objCommentBad->getCommentBadByID($strCommentBadID); echo global_common::convertToXML($strMessageHeader, array('rs', 'CommnentID', 'Description', 'ReportedBy', 'ReportedDate', 'Status'), array(1, 'CommnentID', 'Description', 'ReportedBy', 'ReportedDate', 'Status'), array(0, 1, 1, 1, 1, 1)); return; } elseif ($_pgR["act"] == model_CommentBad::ACT_GET) { $sectionID = $_pgR["sect"]; $arrSection = $objMenu->getAllMenuBySection($sectionID); if ($arrSection) { $strHTML = $objMenu->outputHTMLMenu($arrSection); echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, $strHTML), array(0, 1)); return; } else { echo global_common::convertToXML($arrHeader, array("rs", 'inf'), array(0, 'Kh?ng c? nh?m h?ng'), array(0, 0)); return; } } elseif ($_pgR['act'] == model_CommentBad::ACT_DELETE) { $IDName = "menu_id";