if (global_common::isCLogin()) { $c_userInfo = $_SESSION[global_common::SES_C_USERINFO]; $commentID = $_pgR["id"]; $isBad = $_pgR["isbad"]; $strTableName = Model_CommentBad::TBL_SL_COMMENT_BAD; $comment = $objComment->getCommentByID($commentID); $user = $objUser->getUserByID($comment[global_mapping::CreatedBy]); if ($user && $comment) { $isSent = true; $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);
foreach ($allRetailers as $item) { echo '<tr>'; echo '<td>'; echo $item[global_mapping::ProductName]; echo '</td>'; echo '<td style="padding:0;width:200px">'; echo global_common::FormatPrice($item[global_mapping::Price]); echo '</td>'; echo '<td>'; echo $item[global_mapping::CreatedBy][global_mapping::UserName]; echo '</td>'; echo '<td>'; echo global_common::formatDateTimeVN($item[global_mapping::CreatedDate]); echo '</td>'; echo '<td>'; echo global_common::formatDateTimeVN($item[global_mapping::ModifiedDate]); echo '</td>'; echo '<td style="padding:0;width:180px">'; echo '<a href="' . global_common::buildRetailerLink($item[global_mapping::RetailerID], true) . '" target="_blank" class="btn btn-mini"> View</a> '; if ($item[global_mapping::StatusID] == global_common::STATUS_INACTIVE) { echo '<a href="javascript:retailer.activateRetailer(\'' . $item[global_mapping::RetailerID] . '\',' . global_common::STATUS_ACTIVE . ', retailer.AdminPage)" class="btn btn-mini">Bán lại</a>'; } else { echo '<a href="javascript:retailer.activateRetailer(\'' . $item[global_mapping::RetailerID] . '\',' . global_common::STATUS_INACTIVE . ', retailer.AdminPage)" class="btn btn-mini">Dừng bán</a>'; } echo '</td>'; echo '</tr>'; } echo '</table>'; echo global_common::getPagingHTMLByNum($page, Model_Retailer::NUM_PER_PAGE, $total, 'core.util.changePage', 'admin_price'); } ?>
public function getCommentHTMLByArticle($articleID) { $comments = Model_Comment::getCommentByArticle($articleID, 0, '*', '', 'ModifiedDate Desc'); $commentHTML = ''; foreach ($comments as $item) { $commentHTML .= '<div class="item">'; $commentHTML .= ' <div class="avatar">'; $commentHTML .= ' <img src="' . $item[global_mapping::CreatedBy][global_mapping::Avatar] . '" />'; $commentHTML .= ' </div>'; $commentHTML .= ' <div class="comment-detail">'; $commentHTML .= ' <div class="username">'; $commentHTML .= ' <a href="#">' . $item[global_mapping::CreatedBy][global_mapping::FullName] . '</a> '; $commentHTML .= ' <p class="created-date">' . global_common::formatDateTimeVN($item[global_mapping::CreatedDate]) . '</p> '; $commentHTML .= ' </div>'; $commentHTML .= ' <div class="comment-detail-content">'; $commentHTML .= ' ' . $item[global_mapping::Content]; $commentHTML .= ' </div> '; $commentHTML .= ' </div>'; $commentHTML .= '</div>'; } return $commentHTML; }
public function refreshArticle($articleID, $currentUser) { $currentArticle = $this->getArticleByID($articleID); $renewNum = $currentArticle[global_mapping::RenewedNum]; $renewedDate = $currentArticle[global_mapping::RenewedDate]; $diffDay = global_common::datediff(global_common::getDate(), date('d-m-Y', strtotime($renewedDate)), d); if ($diffDay > 0) { $renewNum = 0; } if ($renewNum < self::NUM_REFRESH) { $renewNum += 1; $title = $currentArticle[global_mapping::Title]; $fileName = $currentArticle[global_mapping::FileName]; $catalogueID = $currentArticle[global_mapping::CatalogueID]; $content = $currentArticle[global_mapping::Content]; $tags = $currentArticle[global_mapping::Tags]; $createdBy = $currentArticle[global_mapping::CreatedBy]; $createdDate = global_common::formatDateTimeVN($currentArticle[global_mapping::CreatedDate]); $modifiedBy = $currentUser[global_mapping::UserID]; $renewedDate = global_common::nowSQL(); $companyName = $currentArticle[global_mapping::CompanyName]; $companyAddress = $currentArticle[global_mapping::CompanyAddress]; $companyWebsite = $currentArticle[global_mapping::CompanyWebsite]; $companyPhone = $currentArticle[global_mapping::CompanyPhone]; $adType = $currentArticle[global_mapping::AdType]; $startDate = global_common::formatDateTimeVN($currentArticle[global_mapping::StartDate]); $endDate = global_common::formatDateTimeVN($currentArticle[global_mapping::EndDate]); $happyDays = $currentArticle[global_mapping::HappyDays]; $startHappyHour = $currentArticle[global_mapping::StartHappyHour]; $endHappyHour = $currentArticle[global_mapping::EndHappyHour]; $addresses = $currentArticle[global_mapping::Addresses]; $dictricts = $currentArticle[global_mapping::Dictricts]; $cities = $currentArticle[global_mapping::Cities]; $resultID = $this->update($articleID, null, $title, $fileName, $catalogueID, $content, null, $tags, $numView, $numComment, $createdBy, $createdDate, $modifiedBy, global_common::nowSQL(), null, null, 0, null, null, $renewedDate, $renewNum, $companyName, $companyAddress, $companyWebsite, $companyPhone, $adType, $startDate, $endDate, $happyDays, $startHappyHour, $endHappyHour, $addresses, $dictricts, $cities); if (!$resultID) { //echo $strSQL; global_common::writeLog('Error refreshArticle sl_article:' . $articleID, 1); return -1; } return self::NUM_REFRESH - $renewNum; } return -1; }
echo $item[global_mapping::ArticleID][global_mapping::Title]; echo '</td>'; echo '<td style="padding:0;width:200px">'; echo $item[global_mapping::Content]; echo '</td>'; echo '<td>'; echo $item[global_mapping::CreatedBy][global_mapping::UserName]; echo '</td>'; echo '<td>'; echo global_common::formatDateTimeVN($item[global_mapping::CreatedDate]); echo '</td>'; echo '<td>'; echo $item[global_mapping::CommentBad][global_mapping::ReportedBy][global_mapping::UserName]; echo '</td>'; echo '<td>'; echo global_common::formatDateTimeVN($item[global_mapping::CommentBad][global_mapping::ReportedDate]); echo '</td>'; echo '<td style="padding:0;width:180px">'; echo '<a href="../article_detail.php?aid=' . $item[global_mapping::ArticleID][global_mapping::ArticleID] . '" target="_blank" class="btn btn-mini"> View Article</a> '; if (!$item[global_mapping::CommentBad][global_mapping::Status]) { echo '<a href="javascript:comment.badComment(\'' . $item[global_mapping::CommentID] . '\',1,true)" class="btn btn-mini">Delete</a> '; } else { echo '<a href="javascript:comment.badComment(\'' . $item[global_mapping::CommentID] . '\',0,true)" class="btn btn-mini">Restore</a>'; } echo '</td>'; echo '</tr>'; } echo '</table>'; } ?> </div>
<tr> <th class="span4">Tên sản phẩm</th> <th class="span2">Giá bán</th> <th style="width:120px">Tình trạng</th> <th style="width:100px">Cập nhật</th> <th style="width:120px"></th> </tr> </thead> <tbody> <?php foreach ($allRetailers as $item) { echo ' <tr>'; echo ' <td><a href="' . global_common::buildProductLink($item[global_mapping::ProductID]) . '" >' . $item[global_mapping::ProductName] . '</a></td>'; echo ' <td class="">' . global_common::FormatPrice($item[global_mapping::Price]) . '</td>'; echo ' <td class="">' . $item[global_mapping::ProductStatus] . ' ' . $item[global_mapping::StatusDetail] . '</td>'; echo ' <td >' . global_common::formatDateTimeVN($item[global_mapping::ModifiedDate]) . '</td>'; echo ' <td class="article-control">'; echo ' <a href="post_price.php?pid=' . $item[global_mapping::ProductID] . '&rid=' . $item[global_mapping::RetailerID] . '" class="btn btn-mini">Sửa</a>'; //echo ' <a href="javascript:article.refreshArticle(\''.$item[global_mapping::ArticleID].'\')" class="btn btn-mini">Làm mới</a>'; echo ' <a href="javascript:retailer.deleteRetailer(\'' . $item[global_mapping::ProductName] . '\',\'' . $item[global_mapping::RetailerID] . '\')" class="btn btn-mini">Xóa</a>'; if ($item[global_mapping::StatusID] == global_common::STATUS_INACTIVE) { echo ' <a href="javascript:retailer.activateRetailer(\'' . $item[global_mapping::RetailerID] . '\',' . global_common::STATUS_INACTIVE . ')" class="btn btn-mini">Bán lại</a>'; } else { echo ' <a href="javascript:retailer.activateRetailer(\'' . $item[global_mapping::RetailerID] . '\',' . global_common::STATUS_ACTIVE . ')" class="btn btn-mini">Dừng bán</a>'; } echo ' </td>'; echo ' </tr>'; } ?> </tbody> </table>
public function getCommentHTMLByArticle($articleID, $page) { if (!$page) { $page = 1; } $comments = $this->getCommentByArticle($articleID, $page, '*', '', 'ModifiedDate Desc'); $condition = ' where `' . global_mapping::ArticleID . '` = \'' . $articleID . '\' AND CommentID NOT IN (SELECT CommentID FROM sl_comment_bad WHERE `STATUS` =\'1\')'; $total = global_common::getTotalRecord(Model_Comment::TBL_SL_COMMENT, $this->_objConnection, $condition); $commentHTML = ''; foreach ($comments as $item) { $commentHTML .= '<div class="item">'; $commentHTML .= ' <div class="avatar">'; $commentHTML .= ' <img src="' . $item[global_mapping::CreatedBy][global_mapping::Avatar] . '" />'; $commentHTML .= ' </div>'; $commentHTML .= ' <div class="comment-detail">'; $commentHTML .= ' <div class="username">'; $commentHTML .= ' <a href="#">' . $item[global_mapping::CreatedBy][global_mapping::FullName] . '</a> '; $commentHTML .= ' <p class="created-date">' . global_common::formatDateTimeVN($item[global_mapping::CreatedDate]) . '</p> '; $commentHTML .= ' </div>'; $commentHTML .= ' <div class="comment-detail-content">'; $commentHTML .= ' ' . $item[global_mapping::Content]; $commentHTML .= ' </div> '; if (global_common::isAdmin()) { $commentHTML .= ' <div class="comment-controls">'; $commentHTML .= ' <a href="javascript:comment.badComment(\'' . $item[global_mapping::CommentID] . '\',1)">Delete</a>'; $commentHTML .= ' </div> '; } $commentHTML .= ' </div>'; $commentHTML .= '</div>'; } $commentHTML .= global_common::getPagingHTMLByNum($page, Model_Comment::NUM_PER_PAGE, $total, 'comment.changePage'); return $commentHTML; }
echo $currentUser[global_mapping::Avatar]; ?> " alt="" /> </div> <ul class="unstyled " style="float:left"> <li><span>Tên đăng nhập:</span> <?php echo global_common::formatOutputText($currentUser[global_mapping::UserName]); ?> </li> <li><span>Họ và Tên:</span> <?php echo global_common::formatOutputText($currentUser[global_mapping::FullName]); ?> </li> <li><span>Tham gia:</span> <?php echo global_common::formatOutputText(global_common::formatDateTimeVN($currentUser[global_mapping::CreatedDate])); ?> </li> <li><span>Giới tính:</span> <?php echo $currentUser[global_mapping::UserName] ? 'Nam' : 'Nữ'; ?> </li> <li><span>Email:</span> <a href="mailto:"> <?php echo global_common::formatOutputText($currentUser[global_mapping::Email]); ?> </a></li> <li><span>Số điện thoại:</span> <?php echo $currentUser[global_mapping::Phone]; ?> </li> <li><span>Địa chỉ:</span> <?php