Example #1
0
include_once 'class/model_status.php';
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 #2
0
 * Date Created 5/6/2012
 *
 */
/// <summary>
/// Implementations of Manufactory represent a Manufactory
///
/// </summary>
chdir("..");
/* TODO: Add code here */
require 'config/globalconfig.php';
require 'include/_permission_admin.inc';
include_once 'class/model_user.php';
include_once 'class/model_articletype.php';
include_once 'class/model_manufactory.php';
$objArticleType = new Model_ArticleType($objConnection);
$objManufactory = new Model_Manufactory($objConnection);
$allCats = $objArticleType->getAllArticleType(0, null, '', null);
if ($_pgR["act"] == Model_Manufactory::ACT_ADD || $_pgR["act"] == Model_Manufactory::ACT_UPDATE) {
    //get user info
    $c_userInfo = $_SESSION[global_common::SES_C_USERINFO];
    $manufactoryName = $_pgR[global_mapping::ManufactoryName];
    $manufactoryName = html_entity_decode($manufactoryName, ENT_COMPAT, 'UTF-8');
    $articleTypeID = html_entity_decode($_pgR[global_mapping::ArticleTypeID], ENT_COMPAT, 'UTF-8');
    $order = html_entity_decode($_pgR[global_mapping::Order], ENT_COMPAT, 'UTF-8');
    $status = 1;
    if ($_pgR["act"] == Model_Manufactory::ACT_ADD) {
        $createdBy = $c_userInfo[global_mapping::UserID];
        $resultID = $objManufactory->insert($manufactoryName, $articleTypeID, $order, $createdBy, $status);
        if ($resultID) {
            $arrHeader = global_common::getMessageHeaderArr($banCode);
            //$banCode
Example #3
0
<?php

/* TODO: Add code here */
require 'config/globalconfig.php';
$_SESSION[global_common::SES_C_CUR_PAGE] = "post_search.php";
include_once 'include/_permission.inc';
include_once 'include/_header.inc';
include_once 'class/model_articletype.php';
include_once 'class/model_user.php';
include_once 'class/model_product.php';
include_once 'class/model_manufactory.php';
$objArticleType = new Model_ArticleType($objConnection);
$objManufactory = new Model_Manufactory($objConnection);
$objProduct = new Model_Product($objConnection);
$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];
Example #4
0
 public function getAllProduct($intPage = 0, $selectField = '*', $whereClause = '', $orderBy = '', &$total)
 {
     if ($whereClause) {
         $whereClause = ' WHERE ' . $whereClause;
     }
     if ($orderBy) {
         $orderBy = ' ORDER BY ' . $orderBy;
     }
     if ($intPage > 0) {
         $strSQL = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, Model_Product::TBL_SL_PRODUCT, $whereClause . $orderBy . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
         $strSQLCount = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('count(*)', Model_Product::TBL_SL_PRODUCT, $whereClause . $orderBy));
     } else {
         $strSQL = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, Model_Product::TBL_SL_PRODUCT, $whereClause . $orderBy));
     }
     //echo '<br>SQL:'.$strSQL;
     $arrResult = $this->_objConnection->selectCommand($strSQL);
     if (!$arrResult) {
         global_common::writeLog('get All sl_product:' . $strSQL, 1, $_mainFrame->pPage);
         return null;
     }
     //echo '<br>$strSQLCount:'.$strSQLCount;
     if ($strSQLCount) {
         $arrTotal = $this->_objConnection->selectCommand($strSQLCount);
         $total = $arrTotal[0][0];
     }
     $objManu = new Model_Manufactory($this->_objConnection);
     $objArticleType = new Model_ArticleType($this->_objConnection);
     $allManus = $objManu->getAllManufactory();
     $allCats = $objArticleType->getAllArticleType();
     $manus = array();
     foreach ($allManus as $key => $info) {
         $manus[$info[global_mapping::ManufactoryID]] = $info;
         unset($allManus[$key]);
     }
     $cats = array();
     foreach ($allCats as $key => $info) {
         $cats[$info[global_mapping::ArticleTypeID]] = $info;
         unset($allCats[$key]);
     }
     $count = count($arrResult);
     for ($index = 0; $index < $count; $index++) {
         if ($manus[$arrResult[$index][global_mapping::ManufactoryID]]) {
             $arrResult[$index][global_mapping::ManufactoryName] = $manus[$arrResult[$index][global_mapping::ManufactoryID]][global_mapping::ManufactoryName];
         }
         if ($cats[$arrResult[$index][global_mapping::CatalogueID]]) {
             $arrResult[$index][global_mapping::ArticleTypeName] = $cats[$arrResult[$index][global_mapping::CatalogueID]][global_mapping::ArticleTypeName];
         }
     }
     $arrResult = global_common::mergeUserInfo($arrResult, $this->_objConnection);
     //print_r($arrResult);
     return $arrResult;
 }