$width = $_pgR['Width']; $width = global_editor::rteSafe(html_entity_decode($width, ENT_COMPAT, 'UTF-8')); $height = $_pgR['Height']; $height = global_editor::rteSafe(html_entity_decode($height, ENT_COMPAT, 'UTF-8')); $numOfDay = $_pgR['NumOfDay']; $numOfDay = global_editor::rteSafe(html_entity_decode($numOfDay, ENT_COMPAT, 'UTF-8')); $displayPage = $_pgR['DisplayPage']; $displayPage = global_editor::rteSafe(html_entity_decode($displayPage, ENT_COMPAT, 'UTF-8')); $sharedItem = $_pgR['SharedItem']; $sharedItem = global_editor::rteSafe(html_entity_decode($sharedItem, ENT_COMPAT, 'UTF-8')); $price = $_pgR['Price']; $price = global_editor::rteSafe(html_entity_decode($price, ENT_COMPAT, 'UTF-8')); $cityID = $_pgR['CityID']; $cityID = global_editor::rteSafe(html_entity_decode($cityID, ENT_COMPAT, 'UTF-8')); $status = $_pgR['Status']; $status = global_editor::rteSafe(html_entity_decode($status, ENT_COMPAT, 'UTF-8')); //$checkProduct = $objMenu->getMenuByName($_pgR['name']); //if ($checkProduct && $checkProduct['menu_id']!= $strID) { // echo global_common::convertToXML($arrHeader, array("rs",'info'), array(0,global_common::STRING_NAME_EXIST), array(0,1)); // return; //} //$strName = $_pgR['name']; //$strDetail= $_pgR['detail']; $resultID = $objAdType->update($adTypeID, $adTypeName, $width, $height, $numOfDay, $displayPage, $sharedItem, $price, $cityID, $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"), array(0), array(0));
} return; } elseif ($_pgR['act'] == model_Evaluation::ACT_UPDATE) { if (global_common::isCLogin()) { //l?y th?ng tin user //$c_userInfo = $_SESSION[consts::SES_C_USERINFO]; $articleID = $_pgR['ArticleID']; $articleID = global_editor::rteSafe(html_entity_decode($articleID, ENT_COMPAT, 'UTF-8')); $evaluationID = $_pgR['EvaluationID']; $evaluationID = global_editor::rteSafe(html_entity_decode($evaluationID, ENT_COMPAT, 'UTF-8')); $numEvaluation = $_pgR['NumEvaluation']; $numEvaluation = global_editor::rteSafe(html_entity_decode($numEvaluation, ENT_COMPAT, 'UTF-8')); $evaluatedBy = $_pgR['EvaluatedBy']; $evaluatedBy = global_editor::rteSafe(html_entity_decode($evaluatedBy, ENT_COMPAT, 'UTF-8')); $lastEvaluated = $_pgR['LastEvaluated']; $lastEvaluated = global_editor::rteSafe(html_entity_decode($lastEvaluated, ENT_COMPAT, 'UTF-8')); //$checkProduct = $objMenu->getMenuByName($_pgR['name']); //if ($checkProduct && $checkProduct['menu_id']!= $strID) { // echo global_common::convertToXML($arrHeader, array("rs",'info'), array(0,global_common::STRING_NAME_EXIST), array(0,1)); // return; //} //$strName = $_pgR['name']; //$strDetail= $_pgR['detail']; $resultID = $objEvaluation->update($articleID, $evaluationID, $numEvaluation, $evaluatedBy, $lastEvaluated); 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"), array(0), array(0));
} else { echo global_common::convertToXML($arrHeader, array("rs", 'info'), array(0, global_common::STRING_REQUIRE_LOGIN), array(0, 1)); } return; } elseif ($_pgR['act'] == model_ContentSummary::ACT_UPDATE) { if (global_common::isCLogin()) { //l?y th?ng tin user //$c_userInfo = $_SESSION[consts::SES_C_USERINFO]; $contentID = $_pgR['ContentID']; $contentID = global_editor::rteSafe(html_entity_decode($contentID, ENT_COMPAT, 'UTF-8')); $subContents = $_pgR['SubContents']; $subContents = global_editor::rteSafe(html_entity_decode($subContents, ENT_COMPAT, 'UTF-8')); $periodTime = $_pgR['PeriodTime']; $periodTime = global_editor::rteSafe(html_entity_decode($periodTime, ENT_COMPAT, 'UTF-8')); $type = $_pgR['Type']; $type = global_editor::rteSafe(html_entity_decode($type, ENT_COMPAT, 'UTF-8')); //$checkProduct = $objMenu->getMenuByName($_pgR['name']); //if ($checkProduct && $checkProduct['menu_id']!= $strID) { // echo global_common::convertToXML($arrHeader, array("rs",'info'), array(0,global_common::STRING_NAME_EXIST), array(0,1)); // return; //} //$strName = $_pgR['name']; //$strDetail= $_pgR['detail']; $resultID = $objContentSummary->update($contentID, $subContents, $periodTime, $type); 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"), array(0), array(0));
} elseif ($_pgR['act'] == model_Menu::ACT_UPDATE) { if (global_common::isCLogin()) { //l?y th?ng tin user //$c_userInfo = $_SESSION[consts::SES_C_USERINFO]; $menuID = $_pgR['MenuID']; $menuID = global_editor::rteSafe(html_entity_decode($menuID, ENT_COMPAT, 'UTF-8')); $menuName = $_pgR['MenuName']; $menuName = global_editor::rteSafe(html_entity_decode($menuName, ENT_COMPAT, 'UTF-8')); $link = $_pgR['Link']; $link = global_editor::rteSafe(html_entity_decode($link, ENT_COMPAT, 'UTF-8')); $numOrder = $_pgR['NumOrder']; $numOrder = global_editor::rteSafe(html_entity_decode($numOrder, ENT_COMPAT, 'UTF-8')); $level = $_pgR['Level']; $level = global_editor::rteSafe(html_entity_decode($level, ENT_COMPAT, 'UTF-8')); $parentID = $_pgR['ParentID']; $parentID = global_editor::rteSafe(html_entity_decode($parentID, ENT_COMPAT, 'UTF-8')); //$checkProduct = $objMenu->getMenuByName($_pgR['name']); //if ($checkProduct && $checkProduct['menu_id']!= $strID) { // echo global_common::convertToXML($arrHeader, array("rs",'info'), array(0,global_common::STRING_NAME_EXIST), array(0,1)); // return; //} //$strName = $_pgR['name']; //$strDetail= $_pgR['detail']; $resultID = $objMenu->update($menuID, $menuName, $link, $numOrder, $level, $parentID); 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"), array(0), array(0));
if ($_pgR["act"] == Model_Product::ACT_ADD || $_pgR["act"] == Model_Product::ACT_UPDATE) { if (global_common::isCLogin()) { //get user info $c_userInfo = $_SESSION[global_common::SES_C_USERINFO]; $properties = $_pgR['Properties']; //$properties = html_entity_decode($properties,ENT_COMPAT ,'UTF-8' ); $productName = $_pgR['ProductName']; $productName = html_entity_decode($productName, ENT_COMPAT, 'UTF-8'); $catalogueID = $_pgR['CatalogueID']; $catalogueID = html_entity_decode($catalogueID, ENT_COMPAT, 'UTF-8'); $imageLink = $_pgR['ImageLink']; $imageLink = html_entity_decode($imageLink, ENT_COMPAT, 'UTF-8'); $manufactoryID = $_pgR['ManufactoryID']; $manufactoryID = html_entity_decode($manufactoryID, ENT_COMPAT, 'UTF-8'); $description = $_pgR['Description']; $description = global_editor::rteSafe(html_entity_decode($description, ENT_COMPAT, 'UTF-8')); $status = 1; if ($_pgR["act"] == Model_Product::ACT_ADD) { $createdBy = $c_userInfo[global_mapping::UserID]; $resultID = $objProduct->insert($productName, $catalogueID, $imageLink, $manufactoryID, $description, $createdBy, $status); if ($resultID) { $orderProductProperty = 0; $orderGroup = global_common::getMaxValueofField($objConnection, global_mapping::PropertyGroupID, Model_PropertyGroup::TBL_SL_PROPERTY_GROUP) + 1; foreach ($properties as $item) { $group = $item[global_mapping::PropertyGroupID]; $groupID = global_common::convertToInt($group); //is new group if ($groupID <= 0) { $searchGroup = $objPropertyGroup->getPropertyGroupByNameAndCat($group, $catalogueID); if ($searchGroup) { $groupID = $searchGroup[global_mapping::PropertyGroupID];
<?php /* TODO: Add code here */ require 'config/globalconfig.php'; include_once 'class/model_user.php'; $objUser = new Model_User($objConnection); $message = ''; if ($_pgR["act"] == Model_User::ACT_LOGIN) { $userName = $_pgR['txtUserName']; $userName = global_editor::rteSafe(html_entity_decode($userName, ENT_COMPAT, 'UTF-8')); $password = $_pgR['txtPassword']; $password = global_editor::rteSafe(html_entity_decode($password, ENT_COMPAT, 'UTF-8')); $remember = $_pgR['ckRemember']; $result = $objUser->login($userName, $password); if ($result) { $_SESSION[global_common::SES_C_USERINFO] = $result; $curPage = $_SESSION[global_common::SES_C_CUR_PAGE]; if ($curPage) { global_common::redirect($curPage); } else { global_common::redirect("index.php"); } } else { $message = 'Đăng nhập thất bại. Thông tin đăng nhập không hợp lệ. <br> Nếu quên mật khẩu hãy nhấn vào <a href="forgot_password.php">đây</a> để lấy lại mật khẩu '; } } ?> <?php include_once 'include/_header.inc';
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; }
} return; } elseif ($_pgR['act'] == model_Like::ACT_UPDATE) { if (global_common::isCLogin()) { //l?y th?ng tin user //$c_userInfo = $_SESSION[consts::SES_C_USERINFO]; $likeID = $_pgR['LikeID']; $likeID = global_editor::rteSafe(html_entity_decode($likeID, ENT_COMPAT, 'UTF-8')); $likeAmount = $_pgR['LikeAmount']; $likeAmount = global_editor::rteSafe(html_entity_decode($likeAmount, ENT_COMPAT, 'UTF-8')); $unlikeAmount = $_pgR['UnlikeAmount']; $unlikeAmount = global_editor::rteSafe(html_entity_decode($unlikeAmount, ENT_COMPAT, 'UTF-8')); $lIkeUsers = $_pgR['LIkeUsers']; $lIkeUsers = global_editor::rteSafe(html_entity_decode($lIkeUsers, ENT_COMPAT, 'UTF-8')); $unlikeUsers = $_pgR['UnlikeUsers']; $unlikeUsers = global_editor::rteSafe(html_entity_decode($unlikeUsers, ENT_COMPAT, 'UTF-8')); //$checkProduct = $objMenu->getMenuByName($_pgR['name']); //if ($checkProduct && $checkProduct['menu_id']!= $strID) { // echo global_common::convertToXML($arrHeader, array("rs",'info'), array(0,global_common::STRING_NAME_EXIST), array(0,1)); // return; //} //$strName = $_pgR['name']; //$strDetail= $_pgR['detail']; $resultID = $objLike->update($likeID, $likeAmount, $unlikeAmount, $lIkeUsers, $unlikeUsers); 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"), array(0), array(0));
$catalogueID = $_pgR['CatalogueID']; $catalogueID = global_editor::rteSafe(html_entity_decode($catalogueID, ENT_COMPAT, 'UTF-8')); $sectionID = $_pgR['SectionID']; $sectionID = global_editor::rteSafe(html_entity_decode($sectionID, ENT_COMPAT, 'UTF-8')); $numView = $_pgR['NumView']; $numView = global_editor::rteSafe(html_entity_decode($numView, ENT_COMPAT, 'UTF-8')); $numComment = $_pgR['NumComment']; $numComment = global_editor::rteSafe(html_entity_decode($numComment, ENT_COMPAT, 'UTF-8')); $status = $_pgR['Status']; $status = global_editor::rteSafe(html_entity_decode($status, ENT_COMPAT, 'UTF-8')); $comments = $_pgR['comments']; $comments = global_editor::rteSafe(html_entity_decode($comments, ENT_COMPAT, 'UTF-8')); $renewedDate = $_pgR['RenewedDate']; $renewedDate = global_editor::rteSafe(html_entity_decode($renewedDate, ENT_COMPAT, 'UTF-8')); $renewedNum = $_pgR['RenewedNum']; $renewedNum = global_editor::rteSafe(html_entity_decode($renewedNum, ENT_COMPAT, 'UTF-8')); //$checkProduct = $objMenu->getMenuByName($_pgR['name']); //if ($checkProduct && $checkProduct['menu_id']!= $strID) { // echo global_common::convertToXML($arrHeader, array("rs",'info'), array(0,global_common::STRING_NAME_EXIST), array(0,1)); // return; //} //$strName = $_pgR['name']; //$strDetail= $_pgR['detail']; $resultID = $objArticle->update($articleID, $prefix, $title, $fileName, $articleType, $content, $notificationType, $tags, $catalogueID, $sectionID, $numView, $numComment, $status, $comments, $renewedDate, $renewedNum); 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"), array(0), array(0));
$status = 1; if ($_pgR["act"] == model_Article::ACT_ADD) { $createdBy = $c_userInfo[global_mapping::UserID]; $resultID = $objArticle->insert($title, $fileName, $content, null, $tags, $catalogueID, $createdBy, $renewedNum, $companyName, $companyAddress, $companyWebsite, $companyPhone, $adType, $startDate, $endDate, $happyDays, $startHappyHour, $endHappyHour, $addresses, $dictricts, $cities, $status); if ($resultID) { $arrHeader = global_common::getMessageHeaderArr($banCode); //$banCode echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, 'Bài viết đã được đưa vào danh sách chờ kiểm duyệt'), array(0, 1)); return; } else { echo global_common::convertToXML($arrHeader, array("rs", "info"), array(0, "Input data is invalid"), array(0, 1)); return; } } else { $modifiedBy = $c_userInfo[global_mapping::UserID]; $articleID = global_editor::rteSafe(html_entity_decode($_pgR[global_mapping::ArticleID], ENT_COMPAT, 'UTF-8')); $currentArticle = $objArticle->getArticleByID($articleID); $resultID = $objArticle->update($articleID, null, $title, $fileName, $catalogueID, $content, null, $tags, null, null, $currentArticle[global_mapping::CreatedBy], $currentArticle[global_mapping::CreatedDate], $modifiedBy, global_common::nowSQL(), null, null, 1, null, null, null, null, $companyName, $companyAddress, $companyWebsite, $companyPhone, $adType, $startDate, $endDate, $happyDays, $startHappyHour, $endHappyHour, $addresses, $dictricts, $cities); if ($resultID) { $arrHeader = global_common::getMessageHeaderArr($banCode); //$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", "info"), array(0, "Input data is invalid"), array(0, 1)); return; } } } //else //{