Esempio n. 1
0
$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);
$_currentProductID = $_pgR["pid"];
$city = $_pgR['ct'];
$_SESSION[global_common::SES_C_CUR_PAGE] = 'product_detail.php?pid=' . $_currentProductID;
$_arrCategories = $objArticleType->getAllArticleType(0, null, '`ParentID`=0', 'Level');
//$_currentParentCatID = $catID;
if ($_pgR["pid"]) {
    $_currentProduct = $objProduct->getProductByID($_currentProductID);
    $catID = $objArticleType->getArticleTypeByID($_currentProduct[global_mapping::CatalogueID]);
    $_currentParentCatID = $catID[global_mapping::ParentID];
}
include_once 'include/_header.inc';
include_once 'include/_menu.inc';
//include_once('include/_cat_list.inc');
?>
<script type="text/javascript" src="<?php 
echo $_objSystem->locateJs('user_product.js');
?>
"></script>
<script type="text/javascript" src="<?php 
echo $_objSystem->locateJs('user_user.js');
?>
"></script>
<script type="text/javascript"> 
Esempio n. 2
0
$intMode = 0;
//add mode
$parentTypes = $objArticleType->getAllArticleType(0, null, 'ParentID=0', 'Level');
$allTypes = $objArticleType->getAllArticleType(0, null, 'ParentID!=0', 'Level');
//set default selected section
$currentParentType = $parentTypes[0][global_mapping::ArticleTypeID];
$allManuFactories = $objManufactory->getAllManufactory(0, '*', '', global_mapping::ManufactoryName);
$cmArea = $_pgR["cmArea"];
$cmCategory = $_pgR["cmCategory"];
$cmManufactory = $_pgR["cmManufactory"];
$txtKeyword = $_pgR["txtKeyword"];
$lastPage = '';
$condition = '(' . global_mapping::IsDeleted . ' IS NULL or ' . global_mapping::IsDeleted . ' = \'0\') ';
if ($_pgR["pid"]) {
    $preferProduct = $objProduct->getProductByID($_pgR["pid"]);
    $preferedCat = $objArticleType->getArticleTypeByID($preferProduct[global_mapping::CatalogueID]);
    $cmArea = $preferedCat[global_mapping::ParentID];
    $cmCategory = $preferedCat[global_mapping::ArticleTypeID];
    $cmManufactory = $preferProduct[global_mapping::ManufactoryID];
    $txtKeyword = $preferProduct[global_mapping::ProductName];
}
if ($cmArea) {
    $lastPage .= 'cmArea=' . $cmArea . '&';
    $currentParentType = $cmArea;
}
if ($cmCategory) {
    //echo '$currentTypeID';
    if ($lastPage) {
        $lastPage .= 'cmCategory=' . $cmCategory . '&';
    } else {
        $lastPage .= 'cmCategory=' . $cmCategory;
Esempio n. 3
0
    //reset partner info
    $currentPartner = null;
    $articleID = $_pgR["aid"];
    $article = $objArticle->getArticleByID($articleID);
    $intMode = 1;
    //edit mode
    $createBy = $article[global_mapping::CreatedBy];
    $currentUserID = $_SESSION[global_common::SES_C_USERINFO][global_mapping::UserID];
    if ($createBy != $currentUserID) {
        global_common::redirectByScript("index.php");
        return;
    }
    //print_r($article[global_mapping::ArticleID]);
    $currentTypes = $objArticle->getArticleTypesByID($article[global_mapping::ArticleID]);
    //print_r($currentTypes);
    $type = $objArticleType->getArticleTypeByID($currentTypes[0]);
    $currentParentType = $type[global_mapping::ParentID];
    //print_r($currentParentType);
    $parentTypes = $objArticleType->getAllArticleType(0, null, 'ParentID=0', 'Level');
    $allTypes = $objArticleType->getAllArticleType(0, null, 'ParentID=' . $currentParentType, 'Level');
    //print_r($allTypes);
    $addresses = global_common::splitString($article[global_mapping::Addresses], ';');
    $districts = global_common::splitString($article[global_mapping::Dictricts], ';');
    $cities = global_common::splitString($article[global_mapping::Cities], ';');
    //print_r($parentTypes);
    //$intPage = 1;
    //$total = 0;
    //$comments = $objComment->getCommentByArticle($intPage,$total,$articleID,'*','',' CreatedDate DESC');
    //print_r($article);
}
?>
Esempio n. 4
0
        } else {
            echo global_common::convertToXML($arrHeader, array("rs"), array(0), array(0));
            return;
        }
    } else {
        echo global_common::convertToXML($arrHeader, array("rs", 'info'), array(0, global_common::STRING_REQUIRE_LOGIN), array(0, 1));
    }
    return;
} elseif ($_pgR['act'] == model_ArticleType::ACT_CHANGE_PAGE) {
    $intPage = $_pgR['p'];
    $outPutHTML = $objArticleType->getListArticleType($intPage);
    echo global_common::convertToXML($strMessageHeader, array('rs', 'inf'), array(1, $outPutHTML), array(0, 1));
    return;
} elseif ($_pgR['act'] == model_ArticleType::ACT_SHOW_EDIT) {
    $strArticleTypeID = $_pgR['id'];
    $arrArticleType = $objArticleType->getArticleTypeByID($strArticleTypeID);
    echo global_common::convertToXML($strMessageHeader, array('rs', 'ArticleTypeID', 'ArticleTypeName', 'Status'), array(1, 'ArticleTypeID', 'ArticleTypeName', 'Status'), array(0, 1, 1, 1));
    return;
} elseif ($_pgR["act"] == model_ArticleType::ACT_GET) {
    $sectionID = $_pgR["sect"];
    $arrSection = $objMenu->getAllMenuBySection($sectionID);
    if ($arrSection) {
        $strHTML = $objMenu->outputHTMLMenu($arrSection);
        echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, $strHTML), array(0, 1));
        return;
    } else {
        echo global_common::convertToXML($arrHeader, array("rs", 'inf'), array(0, 'Kh?ng c? nh?m h?ng'), array(0, 0));
        return;
    }
} elseif ($_pgR['act'] == model_ArticleType::ACT_DELETE) {
    $IDName = "menu_id";