本文整理汇总了PHP中global_common类的典型用法代码示例。如果您正苦于以下问题:PHP global_common类的具体用法?PHP global_common怎么用?PHP global_common使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了global_common类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildPathProduct
public function buildPathProduct($connection, $productID, $type)
{
$objRetailer = new Model_Retailer($connection);
$inPrices = $objRetailer->getRetailerByProduct($productID);
//'<a href="#" class="link">Chi tiết sản phẩm</a> =>
//<a href="#" class="link">Hàng mới từ 12.000.000đ</a> |
//<span>Hàng mới cũ 10.000.000đ</span> | <a href="#" class="link">Hàng refurbished từ 12.000.000đ</a> ';
$path = '<a href="' . global_common::buildProductLink($productID) . '" class="link">Chi tiết sản phẩm</a> =>';
$priceNew = 0;
$priceUsed = 0;
$priceRefur = 0;
foreach ($inPrices as $item) {
if ($item[global_mapping::ProductStatusID] == global_common::STATUS_PRODUCT_NEW) {
$priceNew = global_common::FormatPrice($item[global_mapping::Price]);
}
if ($item[global_mapping::ProductStatusID] == global_common::STATUS_PRODUCT_USED) {
$priceUsed = global_common::FormatPrice($item[global_mapping::Price]);
}
if ($item[global_mapping::ProductStatusID] == global_common::STATUS_PRODUCT_Refurbished) {
$priceRefur = global_common::FormatPrice($item[global_mapping::Price]);
}
}
if ($type == global_common::STATUS_PRODUCT_NEW) {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_NEW) . '" class="link active">Hàng mới từ ' . $priceNew . '</a> | ';
} else {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_NEW) . '" class="link">Hàng mới từ ' . $priceNew . '</a> | ';
}
if ($type == global_common::STATUS_PRODUCT_USED) {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_USED) . '" class="link active">Hàng cũ từ ' . $priceUsed . '</a> | ';
} else {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_USED) . '" class="link">Hàng cũ từ ' . $priceUsed . '</a> | ';
}
if ($type == global_common::STATUS_PRODUCT_Refurbished) {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_Refurbished) . '" class="link active">Hàng Refurbished từ ' . $priceRefur . '</a>';
} else {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_Refurbished) . '" class="link">Hàng Refurbished từ ' . $priceRefur . '</a>';
}
return $path;
}
示例2: array
$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;
}
示例3: elseif
}
} 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
示例4: array
//$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);
示例5: foreach
<table class="table table-bordered table-hover article-profile">
<thead>
<tr>
<th class="span4">Tên khuyến mãi</th>
<th>Bắt đầu</th>
<th>Kết thúc</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($expireArticles as $item) {
echo ' <tr>';
echo ' <td><a href="article_detail.php?aid=' . $item[global_mapping::ArticleID] . '" class="">' . $item[global_mapping::Title] . '</a></td>';
echo ' <td class="article-date">' . global_common::formatDateVN($item[global_mapping::StartDate]) . '</td>';
echo ' <td class="article-date">' . global_common::formatDateVN($item[global_mapping::EndDate]) . '</td>';
echo ' <td class="article-control">';
echo ' <a href="post_article.php?aid=' . $item[global_mapping::ArticleID] . '" class="btn btn-mini">Sửa</a>';
echo ' <a href="javascript:article.activeArticle(\'' . $item[global_mapping::ArticleID] . '\',0)" class="btn btn-mini">Xóa</a>';
echo ' </td>';
echo ' </tr>';
}
?>
</tbody>
</table>
</div>
<!-- BEGIN PAGINATION-->
<!--div class="row-fluid no-background no-display">
<div class="span12">
<div class="pagination pull-right margin-right">
<ul>
示例6:
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');
}
?>
</div>
</div>
</div>
</div>
</div>
<?php
include_once 'include/_admin_footer.inc';
示例7:
echo $item[global_mapping::PartnerID];
echo '</td>';
echo '<td style="">';
echo $item[global_mapping::AdTypeID];
echo '</td>';
echo '<td style="">';
echo $item[global_mapping::Order];
echo '</td>';
echo '<td style="">';
echo '<a href="' . $item[global_mapping::ImageLink] . '" target="_blank"><img src= "' . $item[global_mapping::ImageLink] . '" width="50" height="50"></a>';
echo '</td>';
echo '<td>';
echo global_common::formatDateVN($item[global_mapping::StartDate]);
echo '</td>';
echo '<td>';
echo global_common::formatDateVN($item[global_mapping::EndDate]);
echo '</td>';
echo '<td style="padding:0;width:180px">';
echo '<a href="javascript:advertising.showPopupEdit(\'' . $item[global_mapping::AdvertisingID] . '\',\'modal-add\')" class="btn btn-mini">Edit</a> ';
if (!$item[global_mapping::IsDeleted]) {
echo '<a href="javascript:advertising.deleteRetailer(\'' . $item[global_mapping::AdvertisingName] . '\',\'' . $item[global_mapping::AdvertisingID] . '\',1)" class="btn btn-mini">Delete</a> ';
} else {
echo '<a href="javascript:advertising.deleteRetailer(\'' . $item[global_mapping::AdvertisingName] . '\',\'' . $item[global_mapping::AdvertisingID] . '\',0)" class="btn btn-mini">Restore</a>';
}
echo '</td>';
echo '</tr>';
}
echo '</table>';
}
?>
</div>
示例8: getListPartner
public function getListPartner($intPage, $orderBy = 'ParterID', $whereClause)
{
if ($whereClause) {
$whereClause = 'WHERE' + $whereClause;
}
if ($orderBy) {
$orderBy = 'ORDER BY' + $orderBy;
}
$strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_PARTNER, $orderBy . ' ' . $whereClause . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
//echo 'sql:'.$strSQL;
$arrResult = $this->_objConnection->selectCommand($strSQL);
//print_r($arrResult);
$strHTML = '<table class="tbl-list">
<thead>
<td>ParterID</td>
<td>UserID</td>
<td>PartnerName</td>
<td>Company</td>
<td>Address1</td>
<td>AddressName1</td>
<td>Address2</td>
<td>AddressName2</td>
<td>Address3</td>
<td>AddressName3</td>
<td>Address4</td>
<td>AddressName4</td>
<td>Address5</td>
<td>AddressName5</td>
<td>Email1</td>
<td>EmailName1</td>
<td>Email2</td>
<td>EmailName2</td>
<td>Email3</td>
<td>EmailName3</td>
<td>Email4</td>
<td>EmailName4</td>
<td>Email5</td>
<td>EmailName5</td>
<td>Phone1</td>
<td>PhoneName1</td>
<td>Phone2</td>
<td>PhoneName2</td>
<td>Phone3</td>
<td>PhoneName3</td>
<td>Phone4</td>
<td>PhoneName4</td>
<td>Phone5</td>
<td>PhoneName5</td>
<td>Fax1</td>
<td>FaxName1</td>
<td>Fax2</td>
<td>FaxName2</td>
<td>Fax3</td>
<td>FaxName3</td>
<td>Fax4</td>
<td>FaxName4</td>
<td>Fax5</td>
<td>FaxName5</td>
<td>Website1</td>
<td>WebsiteName1</td>
<td>Website2</td>
<td>WebsiteName2</td>
<td>Website3</td>
<td>WebsiteName3</td>
<td>Website4</td>
<td>WebsiteName4</td>
<td>Website5</td>
<td>WebsiteName5</td>
<td>TaxNumber</td>
<td>AccountNumber</td>
<td>CreatedBy</td>
<td>CreatedDate</td>
<td>ModifiedBy</td>
<td>ModifiedDate</td>
<td>DeletedBy</td>
<td>DeletedDate</td>
<td>Status</td>
<td>IsDeleted</td>
</thead>
<tbody>';
$icount = count($arrmenu);
for ($i = 0; $i < $icount; $i++) {
$strHTML .= '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '">
<td>' . $arrResult[$i]['ParterID'] . '</td>
<td>' . $arrResult[$i]['UserID'] . '</td>
<td>' . $arrResult[$i]['PartnerName'] . '</td>
<td>' . $arrResult[$i]['Company'] . '</td>
<td>' . $arrResult[$i]['Address1'] . '</td>
<td>' . $arrResult[$i]['AddressName1'] . '</td>
<td>' . $arrResult[$i]['Address2'] . '</td>
<td>' . $arrResult[$i]['AddressName2'] . '</td>
<td>' . $arrResult[$i]['Address3'] . '</td>
<td>' . $arrResult[$i]['AddressName3'] . '</td>
<td>' . $arrResult[$i]['Address4'] . '</td>
<td>' . $arrResult[$i]['AddressName4'] . '</td>
<td>' . $arrResult[$i]['Address5'] . '</td>
<td>' . $arrResult[$i]['AddressName5'] . '</td>
<td>' . $arrResult[$i]['Email1'] . '</td>
<td>' . $arrResult[$i]['EmailName1'] . '</td>
<td>' . $arrResult[$i]['Email2'] . '</td>
//.........这里部分代码省略.........
示例9: array
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;
}
示例10: str_replace
$content = $fbattachs[global_mapping::fbmessage];
$content = str_replace(array("\r\n", "\r", "\n"), '<br>', $content);
foreach ($fbattachs[global_mapping::fbattachments] as $item) {
$content .= '<img src="' . $item[global_mapping::fbmedia][global_mapping::fbimage][global_mapping::fbsrc] . '"/>';
}
$c_userInfo = $_SESSION[global_common::SES_C_USERINFO];
$title = $fbattachs[global_mapping::fbdescription];
$title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
//$content = $posts[global_mapping::fbmessage];
$content = html_entity_decode($content, ENT_COMPAT, 'UTF-8');
$renewedNum = 0;
$status = 1;
$createdBy = $c_userInfo[global_mapping::UserID];
$arrCat = global_common::splitString($catalogueID);
$stores = $objStore->getStoreByFBID($pageID);
$arrStoreID = global_common::getArrayColumn($stores, global_mapping::StoreID);
$resultID = $objArticle->insert($title, $fileName, $content, null, $tags, $arrCat, $createdBy, $renewedNum, $companyName, $companyAddress, $companyWebsite, $companyPhone, $adType, $startDate, $endDate, $happyDays, $startHappyHour, $endHappyHour, $addresses, $dictricts, $cities, $status, $arrStoreID, $postID);
}
}
//break;
}
}
//print_r($posts);
}
$_SESSION[global_common::SES_C_CUR_PAGE] = "admin/admin_advertising.php";
include_once 'include/_admin_header.inc';
?>
<script type="text/javascript" src="<?php
echo $_objSystem->locateJs('user_article.js');
?>
"></script>
示例11:
" readonly="readonly" data-date-format="dd/mm/yyyy" data-date-viewmode="days">
<input name="txtStartDate" id="txtStartDate" class="m-wrap m-ctrl-medium date-picker"
size="16" type="text" placeholder="dd/mm/yyyy" value="<?php
echo $intMode ? global_common::formatDateVN($article[global_mapping::StartDate]) : '';
?>
"/>
<span class="add-on"><i class="icon-calendar"></i></span>
</div>
<label class="m-wrap inline">Đến </label>
<div class="input-append date date-picker text " data-date="<?php
echo $intMode ? global_common::formatDateVN($article[global_mapping::EndDate]) : '';
?>
" data-date-format="dd/mm/yyyy" data-date-viewmode="days">
<input name="txtEndDate" id="txtEndDate" class="m-wrap m-ctrl-medium date-picker" size="16"
type="text" placeholder="dd/mm/yyyy" value="<?php
echo $intMode ? global_common::formatDateVN($article[global_mapping::EndDate]) : '';
?>
"/>
<span class="add-on"><i class="icon-calendar"></i></span>
</div>
<div class="help-inline message"></div>
</div>
</div>
<div class="control-group">
<label class="control-label">Happy days</label>
<div class="controls">
<select class="span3 chosen" name="cmHappyDays" id="cmHappyDays" data-placeholder="Chọn ngày trong tuần" multiple="multiple" tabindex="1">
<option value="Monday">Monday</option>
<option value="Tuesday">Tuesday</option>
<option value="Wednesday">Wednesday</option>
<option value="Thursday">Thursday</option>
示例12: getArticlesFromDB
/**
* Get Article with input is sql script
*
* @param mixed $strSQL This is a description
* @return mixed This is the return value description
*
*/
private function getArticlesFromDB($strSQL)
{
$arrResult = $this->_objConnection->selectCommand($strSQL);
if (!$arrResult) {
global_common::writeLog('get sl_article from DB:' . $strSQL, 1, $_mainFrame->pPage);
return null;
}
$count = count($arrResult);
for ($i = 0; $i < $count; $i++) {
//print_r($arrResult[$i]);
$arrResult[$i][global_mapping::Content] = stripslashes($arrResult[$i][global_mapping::Content]);
}
return global_common::mergeUserInfo($arrResult);
}
示例13: getPriceFromURL
function getPriceFromURL($url, $pathCode)
{
try {
$html = file_get_html($url);
//echo $url;
if ($html) {
foreach ($html->find($pathCode) as $e) {
$myContent = $e->innertext;
}
$myContent = preg_replace('/\\D/', '', $myContent);
return $myContent;
} else {
global_common::writeLog("Can't get price from url:" . $url);
}
} catch (exception $ex) {
global_common::writeLog("Can't get price from url" . $url);
}
return -1;
}
示例14: foreach
echo '';
echo '</th>';
echo '</thead>';
foreach ($productResults as $item) {
echo '<tr>';
echo '<td>';
echo '<a href=' . global_common::buildProductLink($item[global_mapping::ProductID]) . ' target=_blank>' . $item[global_mapping::ProductName] . '</a>';
echo '</td>';
echo '<td style="">';
echo $item[global_mapping::ArticleTypeName];
echo '</td>';
echo '<td>';
echo $item[global_mapping::ManufactoryName];
echo '</td>';
echo '<td style="padding:0;width:200px">';
echo '<a href="' . global_common::buildProductLink($item[global_mapping::ProductID]) . '" target="_blank" class="btn btn-mini">Xem</a> ';
echo '<a href="post_price.php?pid=' . $item[global_mapping::ProductID] . '" class="btn btn-mini">Đăng giá bán</a> ';
echo '<a href="javascript:product.cloneProduct(\'' . $item[global_mapping::ProductID] . '\')" class="btn btn-mini">Clone</a> ';
echo '</td>';
echo '</tr>';
}
echo '</table>';
} else {
echo '<p>Không có sản phẩm nào được tìm thấy!</p>';
}
?>
</div>
<!--End Form Input -->
<?php
//footer
示例15:
if ($item[global_mapping::IsDeleted] == true) {
//echo '<a href="javascript:product.activateProduct(\''.$item[global_mapping::ProductID].'\',0)" class="btn btn-mini">Phục hồi</a>';
} else {
echo '<a href="javascript:product.activateProduct(\'' . $item[global_mapping::ProductID] . '\',1)" class="btn btn-mini">Xóa</a>';
}
//echo ' <a href="javascript:article.activeArticle(\''.$item[global_mapping::ArticleID].'\',0)" class="btn btn-mini">Xóa</a>';
echo ' </td>';
echo ' </tr>';
}
}
?>
</tbody>
</table>
</div>
<?php
echo global_common::getPagingHTMLByNum($page, Model_Product::NUM_PER_PAGE, $total, 'core.util.changePage', 'form-member-product');
?>
</div>
</div>
</div>
</div>
</div>
<!--end span9-->
</div>
</div>
</div>
<script language="javascript" type="text/javascript">