Example #1
0
include_once 'class/model_product.php';
include_once 'class/model_property.php';
include_once 'class/model_productproperty.php';
include_once 'class/model_propertygroup.php';
include_once 'class/model_productprice.php';
include_once 'class/model_articletype.php';
include_once 'class/model_retailer.php';
include_once 'class/model_status.php';
include_once 'class/model_city.php';
$objProduct = new Model_Product($objConnection);
$objProperty = new Model_Property($objConnection);
$objProductProperty = new Model_ProductProperty($objConnection);
$objPropertyGroup = new Model_PropertyGroup($objConnection);
$objProductPrice = new Model_ProductPrice($objConnection);
$objArticleType = new Model_ArticleType($objConnection);
$objRetailer = new Model_Retailer($objConnection);
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'];
Example #2
0
include_once 'class/model_city.php';
include_once 'class/model_property.php';
include_once 'class/model_productprice.php';
include_once 'class/model_productproperty.php';
include_once 'class/model_propertygroup.php';
include_once 'class/model_datatype.php';
include_once 'class/model_manufactory.php';
include_once 'class/model_city.php';
$objProduct = new Model_Product($objConnection);
$objCity = new Model_City($objConnection);
$objProductProperty = new Model_ProductProperty($objConnection);
$objArticleType = new Model_ArticleType($objConnection);
$objProductPrice = new Model_ProductPrice($objConnection);
$objProperty = new Model_Property($objConnection);
$objManufactory = new Model_Manufactory($objConnection);
$objRetailer = new Model_Retailer($objConnection);
$page = $_pgR["p"] ? $_pgR["p"] : 1;
$catID = $_pgR["cid"];
$manu = $_pgR["manu"];
$allCats = $objArticleType->getAllArticleType(0, null, '', null);
$allCities = $objCity->getAllCity();
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);
    }
Example #3
0
include_once 'class/model_city.php';
include_once 'class/model_property.php';
include_once 'class/model_productprice.php';
include_once 'class/model_productproperty.php';
include_once 'class/model_propertygroup.php';
include_once 'class/model_datatype.php';
include_once 'class/model_manufactory.php';
$objStatus = new Model_Status($objConnection);
$objProduct = new Model_Product($objConnection);
$objProductProperty = new Model_ProductProperty($objConnection);
$objArticleType = new Model_ArticleType($objConnection);
$objProductPrice = new Model_ProductPrice($objConnection);
$objProperty = new Model_Property($objConnection);
$objComment = new Model_Comment($objConnection);
$objManufactory = new Model_Manufactory($objConnection);
$objRetailer = new Model_Retailer($objConnection);
$objCity = new Model_City($objConnection);
$_arrCategories = $objArticleType->getAllArticleType(0, null, '`ParentID`=0', 'Level');
if ($_pgR["rid"]) {
    $retailerID = $_pgR["rid"];
    $retailer = $objRetailer->getRetailerByID($retailerID, '*', '`Status`=1');
    $_currentProductID = $retailer[global_mapping::ProductID];
    //product properties
    $productProperties = $objProperty->getPropertyByProduct($retailerID, global_common::STATUS_RETAILER_PROPERTY);
    //shipping properties
    $shippingProperty = $objProperty->getPropertyByProduct($retailerID, global_common::STATUS_RETAILER_SHIPPING);
    $_SESSION[global_common::SES_C_CUR_PAGE] = 'retailer_detail.php?rid=' . $retailerID;
}
//$_currentParentCatID = $catID;
if ($_currentProductID) {
    $_currentProduct = $objProduct->getProductByID($_currentProductID);
Example #4
0
require 'config/globalconfig.php';
include_once 'class/model_comment.php';
include_once 'class/model_commentbad.php';
include_once 'class/model_articletype.php';
include_once 'class/model_article.php';
include_once 'class/model_user.php';
include_once 'class/model_retailer.php';
include_once 'class/model_product.php';
include_once 'class/model_city.php';
include_once 'class/model_status.php';
$objComment = new Model_Comment($objConnection);
$objCommentBad = new Model_CommentBad($objConnection);
$objUser = new Model_User($objConnection);
$objArticle = new Model_Article($objConnection);
$objArticleType = new Model_ArticleType($objConnection);
$objRetailer = new Model_Retailer($objConnection);
$objProduct = new Model_Product($objConnection);
if ($_pgR["act"] == Model_Comment::ACT_ADD) {
    if (global_common::isCLogin()) {
        //get user info
        $c_userInfo = $_SESSION[global_common::SES_C_USERINFO];
        $retailerID = $_pgR[global_mapping::RetailerID];
        $content = html_entity_decode($_pgR[global_mapping::Content], ENT_COMPAT, 'UTF-8');
        $createdby = $c_userInfo[global_mapping::UserID];
        $status = 1;
        $createdBy = $c_userInfo[global_mapping::UserID];
        $resultID = $objComment->insert($retailerID, $content, $createdby, $status);
        //echo global_common::convertToXML($arrHeader, array("rs","info"), array(0,$resultID), array(0,1));
        //return;
        if ($resultID) {
            $commentHTML = $objComment->getCommentHTMLByArticle($retailerID, 0);
Example #5
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 #6
0
<?php

/* TODO: Add code here */
require 'config/globalconfig.php';
include_once 'include/_permission.inc';
include_once 'class/model_articletype.php';
include_once 'class/model_product.php';
include_once 'class/model_user.php';
include_once 'class/model_article.php';
include_once 'class/model_manufactory.php';
include_once 'class/model_retailer.php';
include_once 'class/model_status.php';
$objProduct = new Model_Product($objConnection);
$objUser = new Model_User($objConnection);
$objRetailer = new Model_Retailer($objConnection);
if (global_common::isCLogin()) {
    $page = $_pgR["p"] ? $_pgR["p"] : 1;
    //get user info
    $userInfo = $_SESSION[global_common::SES_C_USERINFO];
    $userID = $userInfo[global_mapping::UserID];
    //$condidtion = global_mapping::CreatedBy.'='.$userID;//global_mapping::StartDate.' <= \''.global_common::nowSQL().'\''.' And '.global_mapping::EndDate.' >= \''.global_common::nowSQL().'\'';
    $allRetailers = $objRetailer->getRetailerByUser($page, $userID, global_mapping::ProductID . ',' . global_mapping::RetailerID . ',' . global_mapping::ProductStatusID . ',' . global_mapping::Price . ',' . global_mapping::StatusDetail . ',' . global_mapping::ShortDesc . ',' . global_mapping::ShippingDesc . ',' . global_mapping::BoxInfo . ',' . global_mapping::CreatedBy . ',' . global_mapping::ModifiedDate . ',' . global_mapping::StatusID, $total);
}
$_SESSION[global_common::SES_C_CUR_PAGE] = "profile_price.php";
$_SESSION[global_common::SES_LAST_PAGE] = $_SESSION[global_common::SES_C_CUR_PAGE];
?>

<?php 
include_once 'include/_header.inc';
?>
<script type="text/javascript" src="<?php