Example #1
0
 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;
 }
Example #2
0
                $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;
}
Example #3
0
    }
} 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 
Example #4
0
                //$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);
									<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>
Example #6
0
        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';
        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>
Example #8
0
    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>
						<td>' . $arrResult[$i]['EmailName2'] . '</td>
						<td>' . $arrResult[$i]['Email3'] . '</td>
						<td>' . $arrResult[$i]['EmailName3'] . '</td>
						<td>' . $arrResult[$i]['Email4'] . '</td>
						<td>' . $arrResult[$i]['EmailName4'] . '</td>
						<td>' . $arrResult[$i]['Email5'] . '</td>
						<td>' . $arrResult[$i]['EmailName5'] . '</td>
						<td>' . $arrResult[$i]['Phone1'] . '</td>
						<td>' . $arrResult[$i]['PhoneName1'] . '</td>
						<td>' . $arrResult[$i]['Phone2'] . '</td>
						<td>' . $arrResult[$i]['PhoneName2'] . '</td>
						<td>' . $arrResult[$i]['Phone3'] . '</td>
						<td>' . $arrResult[$i]['PhoneName3'] . '</td>
						<td>' . $arrResult[$i]['Phone4'] . '</td>
						<td>' . $arrResult[$i]['PhoneName4'] . '</td>
						<td>' . $arrResult[$i]['Phone5'] . '</td>
						<td>' . $arrResult[$i]['PhoneName5'] . '</td>
						<td>' . $arrResult[$i]['Fax1'] . '</td>
						<td>' . $arrResult[$i]['FaxName1'] . '</td>
						<td>' . $arrResult[$i]['Fax2'] . '</td>
						<td>' . $arrResult[$i]['FaxName2'] . '</td>
						<td>' . $arrResult[$i]['Fax3'] . '</td>
						<td>' . $arrResult[$i]['FaxName3'] . '</td>
						<td>' . $arrResult[$i]['Fax4'] . '</td>
						<td>' . $arrResult[$i]['FaxName4'] . '</td>
						<td>' . $arrResult[$i]['Fax5'] . '</td>
						<td>' . $arrResult[$i]['FaxName5'] . '</td>
						<td>' . $arrResult[$i]['Website1'] . '</td>
						<td>' . $arrResult[$i]['WebsiteName1'] . '</td>
						<td>' . $arrResult[$i]['Website2'] . '</td>
						<td>' . $arrResult[$i]['WebsiteName2'] . '</td>
						<td>' . $arrResult[$i]['Website3'] . '</td>
						<td>' . $arrResult[$i]['WebsiteName3'] . '</td>
						<td>' . $arrResult[$i]['Website4'] . '</td>
						<td>' . $arrResult[$i]['WebsiteName4'] . '</td>
						<td>' . $arrResult[$i]['Website5'] . '</td>
						<td>' . $arrResult[$i]['WebsiteName5'] . '</td>
						<td>' . $arrResult[$i]['TaxNumber'] . '</td>
						<td>' . $arrResult[$i]['AccountNumber'] . '</td>
						<td>' . $arrResult[$i]['CreatedBy'] . '</td>
						<td>' . $arrResult[$i]['CreatedDate'] . '</td>
						<td>' . $arrResult[$i]['ModifiedBy'] . '</td>
						<td>' . $arrResult[$i]['ModifiedDate'] . '</td>
						<td>' . $arrResult[$i]['DeletedBy'] . '</td>
						<td>' . $arrResult[$i]['DeletedDate'] . '</td>
						<td>' . $arrResult[$i]['Status'] . '</td>
						<td class="lastCell"><input type="checkbox" onclick="_objPartner.showHide(\'' . $arrResult[$i]['ParterID'] . '\',\'' . $arrResult[$i]['name'] . '\',this)" ' . ($arrResult[$i]['IsDeleted'] ? '' : 'checked=checked') . ' /></td>
					  </tr>';
        }
        $strHTML .= '</tbody></table>';
        $strHTML .= "<div>" . global_common::getPagingHTMLByNum($intPage, self::NUM_PER_PAGE, global_common::getTotalRecord(self::TBL_SL_PARTNER, $this->_objConnection), "_objMenu.changePage") . "</div>";
        return $strHTML;
    }
Example #9
0
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;
}
Example #10
0
                    $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>
" 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>
 /**
  * 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);
 }
 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;
 }
Example #14
0
    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
Example #15
0
        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">
Example #16
0
        echo '<td>';
        echo global_common::formatDateTimeVN($item[global_mapping::ModifiedDate]);
        echo '</td>';
        echo '<td style="padding:0;width:200px">';
        echo '<a href="' . global_common::buildProductLink($item[global_mapping::ProductID], true) . '" target="_blank" class="btn btn-mini"> View</a> ';
        echo '<a href="javascript:product.showPopupEditStorePrice(\'' . $item[global_mapping::ProductID] . '\',\'' . str_replace("'", " ", $item[global_mapping::ProductName]) . '\',\'modal-add\', product.AdminPage)" class="btn btn-mini">Store Price</a>';
        if ($item[global_mapping::IsDeleted] == true) {
            echo '<a href="javascript:product.activateProduct(\'' . $item[global_mapping::ProductID] . '\',0, product.AdminPage)" class="btn btn-mini">Bán lại</a>';
        } else {
            echo '<a href="javascript:product.activateProduct(\'' . $item[global_mapping::ProductID] . '\',1, product.AdminPage)" class="btn btn-mini">Dừng bán</a>';
        }
        echo '</td>';
        echo '</tr>';
    }
    echo '</table>';
    echo global_common::getPagingHTMLByNum($page, Model_ProductPrice::NUM_PER_PAGE, $total, 'core.util.changePage', 'admin_product');
}
?>
				</div>
					</div>
		</div>
	</div>
</div>
<?php 
include_once 'include/_admin_footer.inc';
?>

<input type="hidden" id="adddocmode" name="adddocmode" value="" />
<input type="hidden" id="ProductID" name="ProductID" value="" />
<input type="hidden" id="ProductPriceID" name="ProductPriceID" value="" />
<div id="modal-add" class="modal hide fade" tabindex="-1" data-width="800" data-keyboard="false"  aria-hidden="true" data-backdrop="static">
Example #17
0
" />
									<div class="help-inline message"></div>  
								</div>     
							</div>     
							<div class="control-group">                         
								<label class="control-label">
									Ngày sinh *</label>
								<div class="controls">
									<div class="input-append date date-picker text " data-date="<?php 
echo global_common::formatDateVN($currentUser[global_mapping::BirthDate]);
?>
"  
									data-date-format="dd/mm/yyyy"  data-date-viewmode="days">
										<input name="txtBirthDate" id="txtBirthDate" class="m-wrap m-ctrl-medium date-picker" size="16" type="text" disabled
										value="<?php 
echo global_common::formatDateVN($currentUser[global_mapping::BirthDate]);
?>
" placeholder="dd/mm/yyyy" />
											<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">
									Giới tính *</label>
								<div class="controls">
									<label class="radio " style="">
										<input type="radio" name="sex" id="rdMale" value="1" style="margin-left:0 !important;margin-right: 3px;"  
										<?php 
echo $currentUser[global_mapping::Sex] ? 'checked="checked"' : '';
        echo '</td>';
        echo '<td>';
        echo global_common::formatDateVN($item[global_mapping::EndDate]);
        echo '</td>';
        echo '<td>';
        echo global_common::formatDateVN($item[global_mapping::CreatedDate]);
        echo '</td>';
        echo '<td>';
        echo global_common::formatDateVN($item[global_mapping::ModifiedDate]);
        echo '</td>';
        echo '<td style="padding:0;width:180px">';
        echo '<a href="../article_detail.php?aid=' . $item[global_mapping::ArticleID] . '" target="_blank" class="btn btn-mini"> View</a> ';
        if (!$item[global_mapping::Status]) {
            echo '<a href="javascript:article.activeArticle(\'' . $item[global_mapping::ArticleID] . '\',1)" class="btn btn-mini">Active</a> ';
        } else {
            echo '<a href="javascript:article.activeArticle(\'' . $item[global_mapping::ArticleID] . '\',0)" class="btn btn-mini">Deactive</a>';
        }
        echo '</td>';
        echo '</tr>';
    }
    echo '</table>';
    echo global_common::getPagingHTMLByNum($page, Model_Article::NUM_PER_PAGE, $total, "article.SearchAdmin");
}
?>
				</div>
					</div>
		</div>
	</div>
</div>
<?php 
include_once 'include/_admin_footer.inc';
Example #19
0
    } else {
        $search = ' and `' . global_mapping::CityID . '` = ' . $city . ' ';
    }
}
if ($keyword) {
    if ($search) {
        $search .= ' and (`' . global_mapping::ProductName . '` like \'%' . global_common::escape_mysql_string($keyword) . '%\' or `' . global_mapping::Description . '` like \'%' . global_common::escape_mysql_string($keyword) . '%\')';
    } else {
        $search .= '(`' . global_mapping::ProductName . '` like \'%' . global_common::escape_mysql_string($keyword) . '%\' or `' . global_mapping::Description . '` like \'%' . global_common::escape_mysql_string($keyword) . '%\')';
    }
}
if ($manu) {
    if ($search) {
        $search .= ' and (`' . global_mapping::ManufactoryID . '` = ' . global_common::escape_mysql_string($manu) . ')';
    } else {
        $search .= '(`' . global_mapping::ManufactoryID . '` = ' . global_common::escape_mysql_string($manu) . ')';
    }
}
if ($productInIDs) {
    if ($search) {
        $search .= ' and (`' . global_mapping::ProductID . '` IN (' . $productInIDs . '))';
    } else {
        $search .= '(`' . global_mapping::ProductID . '` IN (' . $productInIDs . '))';
    }
}
//echo 'search:'. $search;
if ($search) {
    $products = $objProduct->getAllProduct($page, '*', $search, null, $total);
}
//echo $total;
//print_r($topProperties);
Example #20
0
    public function getListUser($intPage, $orderBy = 'UserID', $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_USER, $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>UserID</td>
				<td>UserName</td>
				<td>Password</td>
				<td>Fullname</td>
				<td>BirthDate</td>
				<td>Address</td>
				<td>Phone</td>
				<td>Email</td>
				<td>Sex</td>
				<td>Identity</td>
				<td>RoleID</td>
				<td>UserRankID</td>
				<td>Avatar</td>
				<td>AccountID</td>
				<td>IsActived</td>
				</thead>
				<tbody>';
        $icount = count($arrmenu);
        for ($i = 0; $i < $icount; $i++) {
            $strHTML .= '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '">
					<td>' . $arrResult[$i]['UserID'] . '</td>
					<td>' . $arrResult[$i]['UserName'] . '</td>
					<td>' . $arrResult[$i]['Password'] . '</td>
					<td>' . $arrResult[$i]['Fullname'] . '</td>
					<td>' . $arrResult[$i]['BirthDate'] . '</td>
					<td>' . $arrResult[$i]['Address'] . '</td>
					<td>' . $arrResult[$i]['Phone'] . '</td>
					<td>' . $arrResult[$i]['Email'] . '</td>
					<td>' . $arrResult[$i]['Sex'] . '</td>
					<td>' . $arrResult[$i]['Identity'] . '</td>
					<td>' . $arrResult[$i]['RoleID'] . '</td>
					<td>' . $arrResult[$i]['UserRankID'] . '</td>
					<td>' . $arrResult[$i]['Avatar'] . '</td>
					<td>' . $arrResult[$i]['AccountID'] . '</td>
					<td class="lastCell"><input type="checkbox" onclick="_objUser.showHide(\'' . $arrResult[$i]['UserID'] . '\',\'' . $arrResult[$i]['name'] . '\',this)" ' . ($arrResult[$i]['IsDeleted'] ? '' : 'checked=checked') . ' /></td>
					</tr>';
        }
        $strHTML .= '</tbody></table>';
        $strHTML .= "<div>" . global_common::getPagingHTMLByNum($intPage, self::NUM_PER_PAGE, global_common::getTotalRecord(self::TBL_SL_USER, $this->_objConnection), "_objMenu.changePage") . "</div>";
        return $strHTML;
    }
<?php

/* TODO: Add code here */
require 'config/globalconfig.php';
include_once 'class/model_articletype.php';
include_once 'class/model_article.php';
include_once 'class/model_user.php';
if (!$_pgR["cid"]) {
    global_common::redirectByScript("index.php");
}
$city = $_pgR['ct'];
$district = $_pgR['ds'];
$keyword = $_pgR['kw'];
?>

<?php 
if ($_pgR["cid"]) {
    $catID = $_pgR["cid"];
    $_SESSION[global_common::SES_C_CUR_PAGE] = "article_list.php?cid=" . $catID;
}
include_once 'include/_header.inc';
include_once 'include/_menu.inc';
?>
<script type="text/javascript" src="<?php 
echo $_objSystem->locateJs('user_article.js');
?>
"></script>
	
<?php 
//left side
include_once 'include/_slogan.inc';
Example #22
0
File: login.php Project: roni5/sela
$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';
include_once 'include/_menu.inc';
?>
<div id="login-page">
	<form method="POST"  class="form-horizontal">
		<div class="table-login">
Example #23
0
 function displayAllCategory()
 {
     $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_ARTICLE_TYPE, $orderBy . ' ' . $whereClause . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
     //echo 'sql:'.$strSQL;
     $arrResult = $this->_objConnection->selectCommand($strSQL);
     //print_r($arrResult);
 }
Example #24
0
    echo '<br>';
    echo 'Got Foody stores of cat_' . $catID . '_total_' . $total;
    //return;
    for ($pageIndex = 1; $pageIndex < $count; $pageIndex++) {
        $filePath = $folder . 'Foody/Foody_stores_of_cat_' . $catID . '_page_' . $pageIndex . '.txt';
        if (file_exists($filePath) == false) {
            $hostStores = 'http://www.foody.vn/' . $cityName . '/dia-diem?ds=Restaurant&vt=row&st=1&dt=undefined&c=' . $catID . '&page=' . $pageIndex . '&provinceId=' . $cityid . '&categoryId=' . $catID . '&append=true';
            $headerStores = array('Host: www.foody.vn', 'Connection: keep-alive', 'Accept: application/json, text/javascript, */*; q=0.01', 'CSP: active', 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36', 'X-Requested-With: XMLHttpRequest', 'X-Foody-User-Token: 9d0c3de3-dbc4-41a5-8334-9252ede6c077', 'Cache-Control: no-cache', 'Referer: http://www.foody.vn/' . $cityName . '/quan-an', 'Accept-Encoding: gzip, deflate, sdch', 'Accept-Language: en-US,en;q=0.5');
            //$cookieHeader = 'flg=vn; ASP.NET_SessionId=w1pwfv01xno1sixk2wqxtvwp; __RequestVerificationToken=QXh8ezc4yMSkKxZgBi4waCJJkRuXEPDbL3ISEKdZXXxmTlJTrQJ4UD5S4TT0Vv6eM48t1Eqy5Wbare1yfv4OtJWiEfCtbvnBFt7HL3CYzxM1; gcat=entertain; floc=217';
            //Replace new cookie
            $cookieHeader = 'flg=vn; ASP.NET_SessionId=patvstdo4fbgspgdrwikle4e; gcat=food; floc=217; FOODY.AUTH=4C570C6EC4F0CE54432BDE46511940101605CC450363214566F54425C7369354A15DDB54861CBA0A062DBC227B00BA2C4EDD012031EAE8669A3AADEB6E1DE43B99D7AE303ACEF43151DBF12A401DD738F6CDF0E23142313521071A3D889ADC7343851F95534FE4D655735DD14C331BD3D4415A57BCF5B7DE79F6091D74826B9B9BC367CA4CAF45A284C336B61D6451F781F8E0299CB224ED14D5CF6F45691613E8F351C03B43E09E549678BE9F4F1E3311B4FADEDFEE698EAD1F9AE27D0D59C80164FE3060DCA1A73F8C9CB993C239DF8B0242FD61B724E330B0694613F76BAB; FOODY.RequestVerificationToken=9d0c3de3-dbc4-41a5-8334-9252ede6c077; fbm_395614663835338=base_domain=.foody.vn; _ga=GA1.2.1461401499.1457490421; _gat=1; _gat_ads=1; fbsr_395614663835338=w7ufXZyNTTFPagz45NawdAzn1U2eEIh4zxCCeiJNZW0.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiJBUUI5M3hGc2lod2x5S202QzU3Q2pzYV9OWTN1TWpYb1dwQzVXVTdYNHVnazgteEJSSktRRFVZZEtuSWFGZHFyMGFiWDZqc0pjX0cwekkyWThSSVg5V3JVQ1NkbHJBLXhxS0hmVnBnZjZ5ZjJPUmNValRCZTNEcUxrb19KbjlIQWpmc2hsa2xSWDlQbExzS0N1WlNsZ2JieWpENHVwcTdXa1pNc29lOGx3Y09FSkFOVG5lajNPcXlpNzNON1BSZjJ6MUllTmc0enJvcGFQa1lJQ1ZZb2hwSU5KZkhuQkJwR0RiUUxkQW9yUXhOZ0NoMHpER2lEZDB4TXlVMkRHTXhQZWFXQV9od182NUNKc3pDajVtYTN5Q1ExRFhHbjd5SktVNVVvUGExcGE2ZXh3M3o1R01iYW9lMUdqdXNRQUVjTkgxSThMVzZ4Z2FvTU1TX3RzcUx0XzY5eSIsImlzc3VlZF9hdCI6MTQ1OTg4NDI5OCwidXNlcl9pZCI6IjEwMDAwMTg1NjA3NTI5OCJ9';
            // echo '<br> Host: ';
            //echo $hostStores;
            //echo '<br>';
            //print_r($headerStores) ;
            $jsonStores = global_common::getDataUrl($hostStores, $headerStores, $cookieHeader);
            //echo $jsonStores;
            global_common::writeToFile($filePath, $jsonStores);
            echo '<br>';
            echo 'Got Foody stores of cat_' . $catID . '_page_' . $pageIndex;
            $allStores = json_decode($jsonStores, true);
            //sleep 10 second
            sleep(30 * (1436885463 % 9 + 1));
            //break;
            // return;
        }
        //break;
        // return;
    }
    //return;
}
 /**
  * thực hiện lấy media link từ một url
  *
  * @param string $urlMedia địa chỉ của một page media
  * @return string chuỗi media link
  * @author TinhDoan added [20101027]
  *
  */
 public function getMediaLinkFromURL($urlMedia)
 {
     // lấy nội dung của page
     $content = self::getContentWebPage($urlMedia);
     global_common::writeLog("1.getMediaLinkFromURL: http_code: " . $content["http_code"], 1, "global_editor.php");
     global_common::writeLog("1.getMediaLinkFromURL: location: " . $content["location"], 1, "global_editor.php");
     global_common::writeLog("1.getMediaLinkFromURL: content: " . $content["content"], 1, "global_editor.php");
     if ($content['http_code'] == 200) {
         if (strncasecmp("application/x-shockwave-flash", $content["content_type"], 29) == 0) {
             global_common::writeLog("1.getMediaLinkFromURL: location: " . $content["location"], 1, "global_editor.php");
             if (!array_key_exists('location', $content)) {
                 $content["location"] = $urlMedia;
             }
             return "width:'420',height:'320',movie:'" . $content["location"] . "'";
         }
         // thực hiện lấy url media new từ nội dung vừa đọc được
         $newURLMedia = self::getMediaLinkFromContent($content["content"]);
         // nếu không lấy được new media link từ nội dung của page media
         if ($newURLMedia == "") {
             // thực hiện lấy new media link từ url media trước đó
             $newURLMedia = self::trygetMediaLinkFromURL($urlMedia);
         }
         // nếu lấy được new media link
         if ($newURLMedia) {
             // thực hiện lấy media link lại từ địa chỉ new media link
             return self::getMediaLinkFromURL($newURLMedia);
         }
     }
     return "";
 }
Example #26
0
                        $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;
                        }
                    }
                }
            }
        }
    }
}
Example #27
0
 public function updateSupportEmail($email_record)
 {
     if ($email_record["current_pos"] >= 30) {
         $strSql = global_common::prepareQuery(global_common::SQL_UPDATE_BY_CONDITION, array(global_common::TBL_EMAIL_SUPPORT, "current_pos='0',times='" . ($email_record["times"] + 1) . "'", "email='" . $email_record["email"] . "'"));
     } else {
         $strSql = global_common::prepareQuery(global_common::SQL_UPDATE_BY_CONDITION, array(global_common::TBL_EMAIL_SUPPORT, "current_pos='" . ($email_record["current_pos"] + 1) . "'", "email='" . $email_record["email"] . "'"));
     }
     $result = $this->objConnection->executeSQL($strSql);
     if ($result == -1) {
         return false;
     }
     return true;
 }
Example #28
0
    public function getListEvaluation($intPage, $orderBy = 'EvaluationID', $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_EVALUATION, $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>ArticleID</td>
						<td>EvaluationID</td>
						<td>NumEvaluation</td>
						<td>EvaluatedBy</td>
						<td>LastEvaluated</td>
                    </thead>
                    <tbody>';
        $icount = count($arrmenu);
        for ($i = 0; $i < $icount; $i++) {
            $strHTML .= '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '">
						<td>' . $arrResult[$i]['ArticleID'] . '</td>
						<td>' . $arrResult[$i]['EvaluationID'] . '</td>
						<td>' . $arrResult[$i]['NumEvaluation'] . '</td>
						<td>' . $arrResult[$i]['EvaluatedBy'] . '</td>
						<td class="lastCell">' . $arrResult[$i]['LastEvaluated'] . '</td>
					  </tr>';
        }
        $strHTML .= '</tbody></table>';
        $strHTML .= "<div>" . global_common::getPagingHTMLByNum($intPage, self::NUM_PER_PAGE, global_common::getTotalRecord(self::TBL_SL_EVALUATION, $this->_objConnection), "_objMenu.changePage") . "</div>";
        return $strHTML;
    }
Example #29
0
    public function getListNotificationType($intPage, $orderBy = 'NotificationTypeID', $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_NOTIFICATION_TYPE, $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>NotificationTypeID</td>
						<td>NotificationTypeName</td>
						<td>CreatedBy</td>
						<td>CreatedDate</td>
						<td>ModifiedBy</td>
						<td>ModifiedDate</td>
						<td>DeletedBy</td>
						<td>DeletedDate</td>
						<td>IsDeleted</td>
						<td>Status</td>
                    </thead>
                    <tbody>';
        $icount = count($arrmenu);
        for ($i = 0; $i < $icount; $i++) {
            $strHTML .= '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '">
						<td>' . $arrResult[$i]['NotificationTypeID'] . '</td>
						<td>' . $arrResult[$i]['NotificationTypeName'] . '</td>
						<td>' . $arrResult[$i]['CreatedBy'] . '</td>
						<td>' . $arrResult[$i]['CreatedDate'] . '</td>
						<td>' . $arrResult[$i]['ModifiedBy'] . '</td>
						<td>' . $arrResult[$i]['ModifiedDate'] . '</td>
						<td>' . $arrResult[$i]['DeletedBy'] . '</td>
						<td>' . $arrResult[$i]['DeletedDate'] . '</td>
						<td><input type="checkbox" onclick="_objNotificationType.showHide(\'' . $arrResult[$i]['NotificationTypeID'] . '\',\'' . $arrResult[$i]['name'] . '\',this)" ' . ($arrResult[$i]['IsDeleted'] ? '' : 'checked=checked') . ' /></td>
						<td class="lastCell">' . $arrResult[$i]['Status'] . '</td>
					  </tr>';
        }
        $strHTML .= '</tbody></table>';
        $strHTML .= "<div>" . global_common::getPagingHTMLByNum($intPage, self::NUM_PER_PAGE, global_common::getTotalRecord(self::TBL_SL_NOTIFICATION_TYPE, $this->_objConnection), "_objMenu.changePage") . "</div>";
        return $strHTML;
    }
 for ($index = 1; $index <= $total / Model_Store::NUM_PER_PAGE + 1; $index++) {
     $allStores = $objStore->getAllStore($index);
     //print_r($allStores);
     //break;
     foreach ($allStores as $store) {
         // print_r($store);
         //add urlencode to your address
         $rawAddr = $store[global_mapping::Address] . ', ' . $store[global_mapping::DistrictName] . ', ' . str_replace("TP.", "", $store[global_mapping::CityName]) . ', Việt Nam';
         //$address = urlencode($rawAddr);
         //$address = str_replace(" ", "+", $address);
         //echo $rawAddr;
         if ($store[global_mapping::Latitude] == '10.8230990000' && $store[global_mapping::Longitude] == '106.6296640000') {
             echo '<br>Start get lat long: ' . $rawAddr;
             //$json = file_get_contents("http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false");
             //$json = json_decode($json);
             $mapLocation = global_common::getLocation($_gmapAPI, $rawAddr);
             $lat = $mapLocation['lat'];
             $long = $mapLocation['long'];
             if ($lat && $long) {
                 $result = $objStore->update($store[global_mapping::StoreID], $store[global_mapping::Name], $store[global_mapping::Address], $store[global_mapping::DistrictID], $store[global_mapping::CityID], $store[global_mapping::Phone], $store[global_mapping::SpecialDesc], $lat, $long, $store[global_mapping::WorkingDay], $store[global_mapping::MainCategoryId], $store[global_mapping::StoreIcon], $store[global_mapping::StoreImage], $store[global_mapping::Status], $store[global_mapping::CreatedBy], $store[global_mapping::CreatedDate], $store[global_mapping::UpdatedBy], $store[global_mapping::UpdatedDate], $store[global_mapping::DeletedBy], $store[global_mapping::DeletedDate]);
                 if ($result) {
                     echo "<br>Update successfull " . "Name:" . $store[global_mapping::Name] . " Address:" . $store[global_mapping::Address];
                 } else {
                     echo "<br>Update failed " . "Name:" . $store[global_mapping::Name] . " Address:" . $store[global_mapping::Address];
                 }
             } else {
                 echo "<br>Update failed. Can't get geo of " . "Name:" . $store[global_mapping::Name] . " Address:" . $store[global_mapping::Address];
             }
         } else {
             echo "<br>Update already." . "Name:" . $store[global_mapping::Name] . " Address:" . $store[global_mapping::Address];
         }