<?php /* TODO: Add code here */ require 'config/globalconfig.php'; include_once 'include/_permission.inc'; include_once 'class/model_user.php'; include_once 'class/model_article.php'; $objArticle = new Model_Article($objConnection); $objUser = new Model_User($objConnection); if (global_common::isCLogin()) { //get user info $userInfo = $_SESSION[global_common::SES_C_USERINFO]; $userID = $userInfo[global_mapping::UserID]; $condidtion = '(' . global_mapping::EndDate . ' >= \'' . global_common::nowDateSQL() . '\' Or ' . global_mapping::EndDate . ' is null)'; $articles = $objArticle->getArticleByUser($userID, 1, global_common::DEFAULT_PAGE_SIZE, null, $condidtion, ''); $condidtion = global_mapping::EndDate . ' < \'' . global_common::nowDateSQL() . '\''; $expireArticles = $objArticle->getArticleByUser($userID, 1, global_common::DEFAULT_PAGE_SIZE, null, $condidtion, ''); //print_r($articles); } ?> <?php include_once 'include/_header.inc'; include_once 'include/_menu.inc'; ?> <script type="text/javascript" src="<?php echo $_objSystem->locateJs('user_user.js'); ?> "></script> <script type="text/javascript" src="<?php echo $_objSystem->locateJs('user_article.js');
/** * Phương thức cập nhật delete_flag * * @param string $ContentID ID cần cập nhập * @param string $IDName Tên của ID cần cập nhập * @param string $strTableName Tên table cần cập nhật * @param int $status status của delete_flag * @param object $objConnection connect to db * @return int 1:Cập nhật thành công hay 0:thất bại * */ public function updateDeleteFlag($ContentID, $IDName, $deletedBy, $strTableName, $status, $objConnection) { //const SQL_UPDATE_BY_CONDITION = "UPDATE `{0}` SET {1} WHERE {2};"; $strSQL = self::prepareQuery(self::SQL_UPDATE_BY_CONDITION, array($strTableName, 'IsDeleted=' . $status . ',' . global_mapping::DeletedBy . '=' . $deletedBy . ',' . global_mapping::DeletedDate . '=\'' . global_common::nowDateSQL() . '\'', $IDName . '=' . $ContentID)); //echo $strSQL; if ($objConnection->executeSQL($strSQL) == -1) { return 0; } return 1; }
if ($catID == 0) { $allCatIDs = ''; } else { $allSubCats = $objArticleType->getAllArticleType(0, null, 'ParentID=' . $catID, null); //print_r($allSubCats); if (count($allSubCats) <= 0) { $allCatIDs = $catID; } else { $allCatIDs = global_common::getArrayColumn($allSubCats, global_mapping::ArticleTypeID); } } //print_r($allCatIDs); if ($expired) { $condidtion = ' And ' . global_mapping::EndDate . ' < \'' . global_common::nowDateSQL() . '\''; } else { $condidtion = ' And (' . global_mapping::EndDate . ' >= \'' . global_common::nowDateSQL() . '\' OR ' . global_mapping::EndDate . ' is null )'; } if ($inactive == 'true') { $condidtion .= ' And `' . global_mapping::Status . '`=0'; } else { $condidtion .= ' And `' . global_mapping::Status . '`=1'; } $articles = $objArticle->searchArticle($page, $allCatIDs, '', '', $condidtion, '', $total); $_SESSION[global_common::SES_C_CUR_PAGE] = "admin/admin_article.php"; include_once 'include/_admin_header.inc'; ?> <script type="text/javascript" src="<?php echo $_objSystem->locateJs('user_article.js'); ?> "></script> <script type="text/javascript" src="<?php
if ($catID == 0) { $allCatIDs = ''; } else { $allSubCats = $objArticleType->getAllArticleType(0, null, 'ParentID=' . $catID, null); //print_r($allSubCats); if (count($allSubCats) <= 0) { $allCatIDs = $catID; } else { $allCatIDs = global_common::getArrayColumn($allSubCats, global_mapping::ArticleTypeID); } } //print_r($allCatIDs); if ($expired) { $condidtion = ' And ' . global_mapping::EndDate . ' < \'' . global_common::nowDateSQL() . '\''; } else { $condidtion = ' And ' . global_mapping::StartDate . ' <= \'' . global_common::nowDateSQL() . '\'' . ' And ' . global_mapping::EndDate . ' >= \'' . global_common::nowDateSQL() . '\''; } if ($inactive == 'true') { $condidtion .= ' And `' . global_mapping::Status . '` = 0'; } else { $condidtion .= ' And `' . global_mapping::Status . '` = 1'; } $articles = $objArticle->searchArticle(0, $allCatIDs, '', '', $condidtion); $_SESSION[global_common::SES_C_CUR_PAGE] = "admin/admin_article.php"; include_once 'include/_admin_header.inc'; ?> <script type="text/javascript" src="<?php echo $_objSystem->locateJs('user_article.js'); ?> "></script> <script type="text/javascript" src="<?php