$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; } } } echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(0, "Xử lý thất bại. Xin vui lòng thử lại sau."), array(0, 1)); return; } return; }
} } elseif ($_pgR['act'] == model_AdType::ACT_DELETE) { $IDName = "menu_id"; $contentID = $_pgR["id"]; $strTableName = user_menu::TBL_T_MENU; $result = global_common::updateDeleteFlag($contentID, $IDName, $strTableName, $_pgR["status"], $objConnection); if ($result) { $IDName = "content_id"; $strTableName = user_faq::TBL_T_FAQ; $result = global_common::updateDeleteFlag($contentID, $IDName, $strTableName, $_pgR["status"], $objConnection); } $arrHeader = global_common::getMessageHeaderArr($banCode = 0, 0); $arrKey = array("rs", "id"); $arrValue = array($result ? 1 : 0, $contentID); $arrIsMetaData = array(0, 1); echo global_common::convertToXML($arrHeader, $arrKey, $arrValue, $arrIsMetaData); return; } ?> <?php include_once 'include/_admin_header.inc'; include_once 'include/_admin_menu.inc'; ?> <script type="text/javascript" src="<?php echo $_objSystem->locateJs('sela_AdType.js'); ?> "></script> <!--Begin Form Input --> <input type="hidden" id="adddocmode" name="adddocmode" value="1<?php
//$banCode echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, 'Cập nhật thành công'), array(0, 1)); return; } else { echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(0, "Input data is invalid"), array(0, 1)); return; } } return; } elseif ($_pgR['act'] == Model_Product::ACT_STORE_PRICE_DELETE) { $productPriceID = $_pgR['id']; $productPrice = global_common::deleteObject($productPriceID, global_mapping::ProductPriceID, Model_ProductPrice::TBL_SL_PRODUCT_PRICE, $objConnection); if ($productPrice) { echo global_common::convertToXML($strMessageHeader, array("rs", "inf"), array(1, "Delete successfully"), array(0, 1)); } else { echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(0, "Data is invalid. Pleae try again later"), array(0, 1)); } return; } } //elseif($_pgR['act'] == Model_ProductType::ACT_GET_ALL) //{ // $types = $objArticleType->getAllArticleType(0); // echo json_encode($types); // return ; //} /*elseif($_pgR['act'] == Model_Product::ACT_ACTIVE) { $articleID = $_pgR['id']; $isActivate = $_pgR['isactivate']; $result = $objArticle->activeArticle($articleID,$isActivate);
echo global_common::convertToXML($strMessageHeader, array('rs', 'content'), array(1, json_encode($advertising)), array(0, 1)); } else { echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(0, "Data is invalid. Pleae try again later"), array(0, 1)); } return; } elseif ($_pgR['act'] == Model_Advertising::ACT_ACTIVE) { $adID = $_pgR['id']; $isActivate = $_pgR['isactivate']; $result = $objAdvertising->activeAdvertising($adID, $isActivate); if ($result) { $arrHeader = global_common::getMessageHeaderArr($banCode); //$banCode echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, ($isActivate ? 'Xóa' : 'Deactivate') . ' thành công'), array(0, 1)); return; } else { echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(0, ($isActivate ? 'Xóa' : 'Deactivate') . ' unsuccessfully'), array(0, 1)); return; } } $catID = $_pgR["cid"]; $adTypeID = $_pgR["tid"]; $deleted = $_pgR["deleted"]; $condition = ''; if ($catID) { $condition .= global_mapping::ArticleTypeID . '=' . $catID . ''; } if ($adTypeID) { if ($condition) { $condition .= ' and ' . global_mapping::AdTypeID . '=' . $adTypeID; } else { $condition .= global_mapping::AdTypeID . '=' . $adTypeID;
$fullName = $_pgR['fullName']; $fullName = html_entity_decode($fullName, ENT_COMPAT, 'UTF-8'); $email = $_pgR['email']; $email = html_entity_decode($email, ENT_COMPAT, 'UTF-8'); $subject = $_pgR['subject']; $subject = html_entity_decode($subject, ENT_COMPAT, 'UTF-8'); $content = $_pgR['content']; $content = html_entity_decode($content, ENT_COMPAT, 'UTF-8'); $emailContent = 'From:' . $fullName . '<br>' . 'Email:' . $email . '<br>' . 'Content: <br>' . $content; $isSent = global_mail::send(global_common::SUPPORT_MAIL_USERNAME, global_common::SUPPORT_MAIL_DISPLAY_NAME, $subject, $emailContent, null, global_common::SUPPORT_MAIL_USERNAME, global_common::SUPPORT_MAIL_PASSWORD, global_common::SUPPORT_MAIL_DISPLAY_NAME); if ($isSent) { $arrHeader = global_common::getMessageHeaderArr($banCode); //$banCode echo global_common::convertToXML($arrHeader, array('rs', 'inf'), array(1, 'Đã gửi thành công.'), array(0, 1)); return; } else { echo global_common::convertToXML($arrHeader, array('rs', 'inf'), array(0, 'Xử lý thất bại. Xin vui lòng thử lại sau!'), array(0, 1)); return; } } else { if ($_pgR["act"] == Model_User::ACT_LOGOUT) { echo global_common::convertToXML($arrHeader, array('rs', 'inf', 'rurl'), array(1, '', $_SESSION[global_common::SES_C_CUR_PAGE]), array(0, 1, 1)); global_common::clearSession(); return; } } } } } } }
require 'config/globalconfig.php'; include_once 'class/model_user.php'; if ($_pgR["act"] == model_Article::ACT_ADD) { $createdBy = $_pgR['CreatedBy']; $createdBy = global_editor::rteSafe(html_entity_decode($createdBy, ENT_COMPAT, 'UTF-8')); $createdDate = $_pgR['CreatedDate']; $createdDate = global_editor::rteSafe(html_entity_decode($createdDate, ENT_COMPAT, 'UTF-8')); $modifiedBy = $_pgR['ModifiedBy']; $modifiedBy = global_editor::rteSafe(html_entity_decode($modifiedBy, ENT_COMPAT, 'UTF-8')); $modifiedDate = $_pgR['ModifiedDate']; $modifiedDate = global_editor::rteSafe(html_entity_decode($modifiedDate, ENT_COMPAT, 'UTF-8')); $deletedBy = $_pgR['DeletedBy']; $deletedBy = global_editor::rteSafe(html_entity_decode($deletedBy, ENT_COMPAT, 'UTF-8')); $deletedDate = $_pgR['DeletedDate']; $deletedDate = global_editor::rteSafe(html_entity_decode($deletedDate, ENT_COMPAT, 'UTF-8')); $isDeleted = $_pgR['IsDeleted']; $isDeleted = global_editor::rteSafe(html_entity_decode($isDeleted, ENT_COMPAT, 'UTF-8')); //$strName = $_pgR['name']; //$strName = global_editor::rteSafe(html_entity_decode($strName,ENT_COMPAT ,'UTF-8' )); $resultID = $objArticle->insert($articleid, $prefix, $title, $filename, $articletype, $content, $notificationtype, $tags, $catalogueid, $sectionid, $numview, $numcomment, $status); if ($resultID) { $arrHeader = global_common::getMessageHeaderArr($banCode); //$banCode echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, $result), array(0, 1)); return; } else { echo global_common::convertToXML($arrHeader, array("rs", "info"), array(0, "Input data is invalid"), array(0, 1)); return; } return; }
$arrHeader = global_common::getMessageHeaderArr($banCode); //$banCode echo global_common::convertToXML($arrHeader, array('rs', 'inf'), array(2, 'Tên đăng nhập đã tồn tại'), array(0, 1)); return; } if ($objUser->checkExistEmail($email)) { $arrHeader = global_common::getMessageHeaderArr($banCode); //$banCode echo global_common::convertToXML($arrHeader, array('rs', 'inf'), array(3, 'Email đã tồn tại'), array(0, 1)); return; } $resultID = $objUser->register($userName, $password, $fullname, $birthDate, $email, $sex); if ($resultID) { $arrHeader = global_common::getMessageHeaderArr($banCode); //$banCode echo global_common::convertToXML($arrHeader, array('rs', 'inf'), array(1, 'Đăng ký thành công'), array(0, 1)); return; } else { echo global_common::convertToXML($arrHeader, array('rs', 'info'), array(0, 'Đăng ký thất bại'), array(0, 1)); return; } } else { if ($_pgR["act"] == Model_User::ACT_LOGOUT) { // or this would remove all the variables in the session, but not the session itself session_unset(); // this would destroy the session variables session_destroy(); echo global_common::convertToXML($arrHeader, array('rs', 'inf'), array(1, ''), array(0, 1)); return; } }