Esempio n. 1
0
$keyword = $_pgR['kw'];
$manu = $_pgR['manu'];
$properties = $_pgR['property'];
$filterProperty = '';
foreach ($properties as $key => $info) {
    //echo $key;
    if ($info) {
        $filterProperty .= '(GROUP_CONCAT(\'&&\',propertyid, propertyvalue,\'&&\') LIKE \'%&&' . $key . $info . '&&%\') And ';
    }
}
if ($filterProperty) {
    $filterProperty = global_common::cutLast($filterProperty, 4);
    $filterProperty = '1=1 GROUP BY productid HAVING ' . $filterProperty;
    //echo $filterProperty;
    $productProperties = $objProductProperty->getAllProductProperty(0, global_mapping::ProductID, $filterProperty);
    $productIDs = global_common::getArrayColumn($productProperties, global_mapping::ProductID);
    $productInIDs = global_common::convertToQueryIN($productIDs);
}
$search = '';
$_arrCategories = $objArticleType->getAllArticleType(0, null, '`ParentID`=0', 'Level');
//echo $catID;
$cat = $objArticleType->getArticleTypeByID($catID);
//print_r($cat);
$_currentParentCatID = $catID;
if ($cat) {
    $_currentParentCatID = $cat[global_mapping::ParentID];
    $search = '`' . global_mapping::CatalogueID . '` = ' . $catID . ' ';
}
if ($city) {
    if ($search) {
        $search = 'ProductID IN( select ProductID where CityID =`' . global_mapping::CityID . '` = ' . $city . ') ';
Esempio n. 2
0
    public function getTopPropertyValue($catID, $sizeProperty, $sizeValue)
    {
        $whereClause = 'WHERE ' . global_mapping::ArticleTypeID . ' =  \'' . $catID . '\' ';
        $strSQL = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', Model_PropertyGroup::TBL_SL_PROPERTY_GROUP, $whereClause));
        $propertyGroups = $this->_objConnection->selectCommand($strSQL);
        //print_r($propertyGroups);
        $arrPropertyGroupIDs = global_common::getArrayColumn($propertyGroups, global_mapping::PropertyGroupID);
        $strQueryIN = global_mapping::PropertyGroupID . ' IN(' . global_common::convertToQueryIN($arrPropertyGroupIDs) . ')';
        //echo $strQueryIN;
        $objProperty = new Model_Property($this->_objConnection);
        $allProperties = $objProperty->getAllProperty(0, '*', $strQueryIN, '`Order`');
        $arrPropertyIDs = global_common::getArrayColumn($allProperties, global_mapping::PropertyID);
        //print_r($allProperties);
        $strQueryIN = global_mapping::PropertyID . ' IN(' . global_common::convertToQueryIN($arrPropertyIDs) . ')';
        $temp = array();
        foreach ($allProperties as $key => $info) {
            $temp[$info[global_mapping::PropertyID]] = $info;
            unset($allProperties[$key]);
        }
        $allProperties = $temp;
        //print_r($allProperties);
        //get top properties used
        $strQueryIN = global_mapping::PropertyID . ' IN(' . global_common::convertToQueryIN($arrPropertyIDs) . ')';
        $strSQL = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array(PropertyID, self::TBL_SL_PRODUCT_PROPERTY, 'WHERE ' . $strQueryIN . ' 
						GROUP BY PropertyID ORDER BY COUNT(*) DESC LIMIT 0,' . $sizeProperty . ''));
        //echo '<br>SQL:'.$strSQL;
        $arrTopPropertyIDs = $this->_objConnection->selectCommand($strSQL);
        if (!$arrTopPropertyIDs || count($arrTopPropertyIDs) <= 0) {
            return;
        }
        //print_r($arrTopPropertyIDs);
        $arrTopPropertyIDs = global_common::getArrayColumn($arrTopPropertyIDs, global_mapping::PropertyID);
        $strQueryIN = 'WHERE ' . global_mapping::PropertyID . ' IN(' . global_common::convertToQueryIN($arrTopPropertyIDs) . ')';
        $strQueryIN .= ' Group By ' . global_mapping::PropertyID . ',' . global_mapping::PropertyValue;
        $strQueryIN .= ' Order By ' . global_mapping::PropertyID . ',COUNT(' . global_mapping::PropertyValue . ') DESC';
        $strSQL = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('distinct ' . global_mapping::PropertyID . ',' . global_mapping::PropertyValue, self::TBL_SL_PRODUCT_PROPERTY, $strQueryIN));
        //echo '<br>SQL:'.$strSQL;
        $arrTopProperties = $this->_objConnection->selectCommand($strSQL);
        //print_r($arrTopProperties);
        $arrResult = array();
        foreach ($arrTopPropertyIDs as $item) {
            //echo $item;
            $arrResult[$item] = $allProperties[$item];
            $arrValue = array();
            $limit = $sizeValue;
            //print_r($arrTopProperties);
            //echo ' PropID:'.$item;
            foreach ($arrTopProperties as $value) {
                if ($value[global_mapping::PropertyID] == $item && $limit > 0) {
                    //echo $value[global_mapping::PropertyValue];
                    //echo $value[global_mapping::PropertyValue];
                    $arrValue = array_merge($arrValue, array($value[global_mapping::PropertyValue]));
                    $limit--;
                }
            }
            //print_r($arrValue);
            $arrResult[$item][global_mapping::PropertyValue] = $arrValue;
        }
        //print_r($arrResult);
        return $arrResult;
    }
Esempio n. 3
0
     $companyPhone = html_entity_decode($_pgR[global_mapping::CompanyPhone], ENT_COMPAT, 'UTF-8');
     $adType = html_entity_decode($_pgR[global_mapping::AdType], ENT_COMPAT, 'UTF-8');
     $startDate = html_entity_decode($_pgR[global_mapping::StartDate], ENT_COMPAT, 'UTF-8');
     $endDate = html_entity_decode($_pgR[global_mapping::EndDate], ENT_COMPAT, 'UTF-8');
     $happyDays = html_entity_decode($_pgR[global_mapping::HappyDays], ENT_COMPAT, 'UTF-8');
     $startHappyHour = html_entity_decode($_pgR[global_mapping::StartHappyHour], ENT_COMPAT, 'UTF-8');
     $endHappyHour = html_entity_decode($_pgR[global_mapping::EndHappyHour], ENT_COMPAT, 'UTF-8');
     $addresses = html_entity_decode($_pgR[global_mapping::Addresses], ENT_COMPAT, 'UTF-8');
     $dictricts = html_entity_decode($_pgR[global_mapping::Dictricts], ENT_COMPAT, 'UTF-8');
     $cities = html_entity_decode($_pgR[global_mapping::Cities], ENT_COMPAT, 'UTF-8');
     $fileName = html_entity_decode($_pgR[global_mapping::FileName], ENT_COMPAT, 'UTF-8');
     $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);
     if ($resultID) {
         $arrHeader = global_common::getMessageHeaderArr($banCode);
         //$banCode
         echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, 'Đăng bài viế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;
     }
 }
 //else
 //{
 //	echo global_common::convertToXML($arrHeader, array("rs",'info'), array(0,global_common::STRING_REQUIRE_LOGIN), array(0,1));
 //}
 /**
  * Get Aticles By Type (Categories)
  *
  * @param mixed $articleTypeIDs This is a description
  * @return mixed This is the return value description
  *
  */
 public function getArticleTypesByID($articleID)
 {
     $whereClause = 'WHERE ' . global_mapping::ArticleID . ' = \'' . $articleID . '\'';
     $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', self::TBL_SL_ARTICLE_TYPE_ID, $whereClause));
     //return $strSQL;
     $articleTypes = $this->_objConnection->selectCommand($strSQL);
     return global_common::getArrayColumn($articleTypes, global_mapping::ArticleTypeID);
 }
$objArticleType = new model_ArticleType($objConnection);
$objArticle = new model_Article($objConnection);
$catID = $_pgR["cid"];
$page = $_pgR["p"] ? $_pgR["p"] : 1;
$inactive = $_pgR["inactive"];
$expired = $_pgR["expired"];
$allCats = $objArticleType->getAllArticleType(0, null, 'ParentID=0', null);
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);
    }
}
//print_r($allCatIDs);
if ($expired) {
    $condidtion = ' And ' . global_mapping::EndDate . ' < \'' . global_common::nowDateSQL() . '\'';
} else {
    $condidtion = ' And (' . global_mapping::EndDate . ' >= \'' . global_common::nowDateSQL() . '\' OR ' . global_mapping::EndDate . ' is null )';
}
if ($inactive == 'true') {
    $condidtion .= ' And `' . global_mapping::Status . '`=0';
} else {
    $condidtion .= ' And `' . global_mapping::Status . '`=1';
}
$articles = $objArticle->searchArticle($page, $allCatIDs, '', '', $condidtion, '', $total);
$_SESSION[global_common::SES_C_CUR_PAGE] = "admin/admin_article.php";
Esempio n. 6
0
    $lastPage .= 'cmArea=' . $cmArea . '&';
    $currentParentType = $cmArea;
}
if ($cmCategory) {
    //echo '$currentTypeID';
    if ($lastPage) {
        $lastPage .= 'cmCategory=' . $cmCategory . '&';
    } else {
        $lastPage .= 'cmCategory=' . $cmCategory;
    }
    $currentTypeID = $cmCategory;
    $condition .= $condition ? ' and ' : '';
    $condition .= global_mapping::CatalogueID . '=' . $cmCategory;
} else {
    $subTypes = $objArticleType->getAllArticleType(0, null, 'ParentID=' . $currentParentType, 'Level');
    $arrSubTypes = global_common::getArrayColumn($subTypes, global_mapping::ArticleTypeID);
    $strCatIN = global_common::convertToQueryIN($arrSubTypes);
    $condition .= $condition ? ' and ' : '';
    $condition .= global_mapping::CatalogueID . ' IN (' . $strCatIN . ')';
}
if ($cmManufactory) {
    if ($lastPage) {
        $lastPage .= 'cmManufactory=' . $cmManufactory . '&';
    } else {
        $lastPage .= 'cmManufactory=' . $cmManufactory;
    }
    //echo '$curentManuID';
    $curentManuID = $cmManufactory;
    $condition .= $condition ? ' and ' : '';
    $condition .= global_mapping::ManufactoryID . '=' . $cmManufactory;
}
 public function mergeReporterInfo($arrResult)
 {
     //TODO remove comment code
     $arrArticles = global_common::getArrayColumn($arrResult, global_mapping::ArticleID);
     $arrArticleInfo = global_common::getArticleInfo($arrArticles, $this->_objConnection);
     //echo 'before get comment bad';
     $arrCommentBad = global_common::getArrayColumn($arrResult, global_mapping::CommentID);
     $arrCommentBadInfo = global_common::getCommentBadInfo($arrCommentBad, $this->_objConnection);
     //echo 'after get comment bad';
     //print_r($arrUserInfo);
     $count = count($arrResult);
     for ($i = 0; $i < $count; $i++) {
         //print_r($arrResult[$i]);
         $arrResult[$i][global_mapping::ArticleID] = $arrArticleInfo[$arrResult[$i][global_mapping::ArticleID]];
         $arrResult[$i][global_mapping::CommentBad] = $arrCommentBadInfo[$arrResult[$i][global_mapping::CommentID]];
     }
     //print_r($arrResult);
     return $arrResult;
 }
Esempio n. 8
0
 public function getPropertyByCat($catID, $groupID, &$total)
 {
     $sqlSearch = '1=1';
     if ($catID) {
         $sqlSearch .= ' And ' . global_mapping::ArticleTypeID . '=\'' . $catID . '\'';
     }
     if ($groupID) {
         $sqlSearch .= 'AND' . global_mapping::PropertyGroupID . '=\'' . $groupID . '\'';
     }
     $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', Model_PropertyGroup::TBL_SL_PROPERTY_GROUP, 'WHERE ' . $sqlSearch . '  Order by `' . global_mapping::Order . '`'));
     //	echo $strSQL;
     $arrResult = $this->_objConnection->selectCommand($strSQL);
     if (!$arrResult) {
         global_common::writeLog('get sl_product ByID:' . $strSQL, 1, $_mainFrame->pPage);
         return null;
     } else {
         //print_r($arrResult);
         $groupIDs = global_common::getArrayColumn($arrResult, global_mapping::PropertyGroupID);
         $groupIDs = array_unique($groupIDs);
         //print_r($groupIDs);
         $objPropertyGroup = new Model_PropertyGroup($this->_objConnection);
         $properties = $this->getPropertyGroupByIDs($groupIDs);
         $total = count($properties);
         //print_r($properties);
         $propertyGroups = $objPropertyGroup->getPropertyGroupByIDs($groupIDs);
         $temp = array();
         foreach ($arrResult as $key => $info) {
             $temp[$info[global_mapping::PropertyID]] = $info;
             unset($arrResult[$key]);
         }
         $arrResult = $temp;
         $temp = array();
         foreach ($groupIDs as $item) {
             foreach ($propertyGroups as $subitem) {
                 if ($item == $subitem[global_mapping::PropertyGroupID]) {
                     //echo $item.':';
                     $temp = array_merge($temp, array($subitem));
                 }
             }
         }
         $propertyGroups = $temp;
         //print_r($arrResult);
         //print_r($propertyGroups);
         $count = count($propertyGroups);
         //print_r($properties);
         for ($i = 0; $i < $count; $i++) {
             foreach ($properties as $item) {
                 if ($item[global_mapping::PropertyGroupID] == $propertyGroups[$i][global_mapping::PropertyGroupID]) {
                     //change defaut value  to product property value
                     //$item[global_mapping::Status] = $arrResult[$item[global_mapping::PropertyID]][global_mapping::Status];
                     //$item[global_mapping::TypeID] = $arrResult[$item[global_mapping::PropertyID]][global_mapping::TypeID];
                     //$item[global_mapping::StatusID] = $arrResult[$item[global_mapping::PropertyID]][global_mapping::StatusID];
                     //$item[global_mapping::Order] = $arrResult[$item[global_mapping::PropertyID]][global_mapping::Order];
                     if (count($propertyGroups[$i]['Properties']) > 0) {
                         array_push($propertyGroups[$i]['Properties'], $item);
                     } else {
                         $propertyGroups[$i]['Properties'] = array($item);
                     }
                     $propertyGroups[$i]['Properties'] = $propertyGroups[$i]['Properties'] ?: array($item);
                     //$propertyGroups[$i]['Properties'] = array_push($propertyGroups[$i]['Properties'], array($item));
                     //  print_r($propertyGroups[$i]);
                 }
             }
         }
     }
     //print_r($propertyGroups[0]);
     //	print_r($propertyGroups);
     return $propertyGroups;
 }
Esempio n. 9
0
 public function mergeUserInfo($arrResult)
 {
     $arrUsers = global_common::getArrayColumn($arrResult, 'CreatedBy');
     $arrUserInfo = global_common::getUserInfo($arrUsers, $this->_objConnection);
     //print_r($arrUserInfo);
     $count = count($arrResult);
     for ($i = 0; $i < $count; $i++) {
         //print_r($arrResult[$i]);
         $arrResult[$i]['CreatedBy'] = $arrUserInfo[$arrResult[$i]['CreatedBy']];
     }
     //print_r($arrResult);
     return $arrResult;
 }
Esempio n. 10
0
 public function getRetailerByProducts($intPage, $productIds, $type, $city, $status, &$total)
 {
     if (!$selectField) {
         $selectField = '*';
     }
     $arrIDs = global_common::splitString($productIds);
     $strQueryIN = global_common::convertToQueryIN($arrIDs);
     if ($strQueryIN) {
         $strQueryIN = global_mapping::ProductID . ' IN( ' . $strQueryIN . ') and';
     } else {
         $strQueryIN = '1 != and';
     }
     if ($city) {
         $city = ' and `' . global_mapping::CityID . '` = ' . $city . ' ';
     } else {
         $city = ' and 1=1 ';
     }
     if ($type) {
         $type = ' and `' . global_mapping::ProductStatusID . '` = ' . $type . ' ';
     } else {
         $type = ' and 1=1 ';
     }
     if ($status) {
         $status = '  (`' . global_mapping::StatusID . '` = ' . global_common::STATUS_ACTIVE . ' or `' . global_mapping::StatusID . '` is null)';
     } else {
         $status = '  `' . global_mapping::StatusID . '` = ' . global_common::STATUS_INACTIVE;
     }
     if ($intPage > 0) {
         $strSQLCount = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array("count(*)", self::TBL_SL_RETAILER, 'WHERE ' . $strQueryIN . $status . $type . $city));
         $strSQL = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, self::TBL_SL_RETAILER, 'WHERE ' . $strQueryIN . $status . $type . $city . $orderBy . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
     } else {
         $strSQL = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, self::TBL_SL_RETAILER, 'WHERE ' . $strQueryIN . $status . $type . $city));
     }
     //echo '<br>SQL:'.$strSQL;
     $arrResult = $this->_objConnection->selectCommand($strSQL);
     if (!$arrResult) {
         global_common::writeLog('get sl_retailer ByID:' . $strSQL, 1, $_mainFrame->pPage);
         return null;
     }
     if ($strSQLCount) {
         //echo $strSQLCount;
         $arrTotal = $this->_objConnection->selectCommand($strSQLCount);
         $total = $arrTotal[0][0];
     }
     //echo $total;
     $productIDs = global_common::getArrayColumn($arrResult, global_mapping::ProductID);
     //print_r($productIDs);
     $productIDs = array_unique($productIDs);
     $objProduct = new Model_Product($this->_objConnection);
     $products = $objProduct->getProductByIDs($productIDs);
     $temp = array();
     foreach ($products as $key => $info) {
         $temp[$info[global_mapping::ProductID]] = $info;
         unset($products[$key]);
     }
     $products = $temp;
     //print_r($products);
     $objStatus = new Model_Status($this->_objConnection);
     $allStatus = $objStatus->getAllStatus();
     $statuses = array();
     foreach ($allStatus as $key => $info) {
         $statuses[$info[global_mapping::StatusID]] = $info;
         unset($allStatus[$key]);
     }
     $count = count($arrResult);
     for ($i = 0; $i < $count; $i++) {
         $arrResult[$i][global_mapping::ProductStatus] = $statuses[$arrResult[$i][global_mapping::ProductStatusID]][global_mapping::StatusName];
         $arrResult[$i][global_mapping::ProductName] = $products[$arrResult[$i][global_mapping::ProductID]][global_mapping::ProductName];
     }
     $arrResult = global_common::mergeUserInfo($arrResult, $this->_objConnection);
     //print_r($arrResult);
     return $arrResult;
 }
Esempio n. 11
0
 public function getLatestRetailer($intPage = 0, $whereClause = '', $type, &$total)
 {
     if ($whereClause) {
         $whereClause = ' WHERE ' . $whereClause;
     }
     $orderBy = ' ORDER BY ' . global_mapping::ModifiedDate . ' DESC';
     $strSQL = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array(global_mapping::ProductID, Model_Product::TBL_SL_PRODUCT, $whereClause));
     //echo '<br>SQL:'.$strSQL;
     $products = $this->_objConnection->selectCommand($strSQL);
     if (!$products) {
         global_common::writeLog('get All sl_product:' . $strSQL, 1, $_mainFrame->pPage);
         return null;
     }
     $productIDs = global_common::getArrayColumn($products, global_mapping::ProductID);
     $productIDs = array_unique($productIDs);
     //print_r($productIDs);
     $strQueryIN = global_common::convertToQueryIN($productIDs);
     $whereClause = 'Where ' . global_mapping::ProductID . ' IN (' . $strQueryIN . ')';
     if ($type) {
         $whereClause .= ' And ' . global_mapping::ProductStatusID . '=' . $type;
     }
     $strSQL = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('*', Model_Retailer::TBL_SL_RETAILER, $whereClause . $orderBy . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
     $arrResult = $this->_objConnection->selectCommand($strSQL);
     //echo $strSQL;
     if (!$arrResult) {
         global_common::writeLog('get All Retailers:' . $strSQL, 1, $_mainFrame->pPage);
         return null;
     }
     $strSQLCount = global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('count(*)', Model_Retailer::TBL_SL_RETAILER, $whereClause));
     //Get details of product to display
     $productIDs = global_common::getArrayColumn($arrResult, global_mapping::ProductID);
     $productIDs = array_unique($productIDs);
     //print_r($productIDs);
     $strQueryIN = global_common::convertToQueryIN($productIDs);
     $productDetails = $this->getProductByIDs($productIDs);
     $convertedProducts = array();
     foreach ($productDetails as $key => $info) {
         $convertedProducts[$info[global_mapping::ProductID]] = $info;
         unset($productDetails[$key]);
     }
     $objStatus = new Model_Status($this->_objConnection);
     $productStatus = $objStatus->getAllStatus();
     $convertedStatus = array();
     foreach ($productStatus as $key => $info) {
         $convertedStatus[$info[global_mapping::StatusID]] = $info;
         unset($productStatus[$key]);
     }
     //echo '<br>$strSQLCount:'.$strSQLCount;
     //Get total results
     if ($strSQLCount) {
         $arrTotal = $this->_objConnection->selectCommand($strSQLCount);
         $total = $arrTotal[0][0];
     }
     //Assign product details to retailers by ProductID
     $count = count($arrResult);
     for ($index = 0; $index < $count; $index++) {
         $arrResult[$index]["Product"] = $convertedProducts[$arrResult[$index][global_mapping::ProductID]];
         $arrResult[$index][global_mapping::StatusName] = $convertedStatus[$arrResult[$index][global_mapping::ProductStatusID]][global_mapping::StatusName];
     }
     //echo 'Before merge comment info';
     $arrResult = global_common::mergeUserInfo($arrResult, $this->_objConnection);
     return $arrResult;
 }
Esempio n. 12
0
 public function getTrackerUserType($userID, $type, $intPage)
 {
     $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array('`Value` as StoreID' . ',count(*) as Count', self::TBL_SL_TRACKER, 'WHERE  UserID = ' . $userID . ' And  TrackType = \'' . $type . '\' GROUP BY `Value`' . ' ORDER BY MAX(' . global_mapping::TrackDate . ') DESC ' . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
     //echo $strSQL;
     //return;
     $arrTrackStores = $this->_objConnection->selectCommand($strSQL);
     $arrStoreIDs = global_common::getArrayColumn($arrTrackStores, 'StoreID');
     return $arrStoreIDs;
 }
Esempio n. 13
0
 public function getCheckedInStores($userID, $intPage)
 {
     $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array(global_mapping::StoreID . ',count(*) as Count', self::TBL_SL_CHECKIN, 'WHERE  UserID = ' . $userID . ' GROUP BY ' . global_mapping::StoreID . ' ORDER BY MAX(' . global_mapping::CreatedDate . ') DESC ' . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE));
     //echo $strSQL;
     $arrCheckedStores = $this->_objConnection->selectCommand($strSQL);
     $arrStoreIDs = global_common::getArrayColumn($arrCheckedStores, global_mapping::StoreID);
     return $arrStoreIDs;
 }
Esempio n. 14
0
$objProperty = new Model_Property($objConnection);
$objProduct = new Model_Product($objConnection);
$objProductProperty = new Model_ProductProperty($objConnection);
$objManufactory = new Model_Manufactory($objConnection);
//$propertyInfo = $objProduct->getPropertyInfoByID(30);
//print_r($propertyInfo);
$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];
$allGroups = $objPropertyGroup->getAllPropertyGroup(0, '*', '', '');
$allManuFactories = $objManufactory->getAllManufactory(0, '*', '', global_mapping::ManufactoryName);
//print_r($allGroups);
$allGroupIDs = global_common::getArrayColumn($allGroups, global_mapping::PropertyGroupID);
$strQueryIN = global_mapping::PropertyGroupID . ' IN(' . global_common::convertToQueryIN($allGroupIDs) . ')';
//echo($allCities);
$allProperties = $objProperty->getAllProperty(0, '*', $strQueryIN, '`Order`');
//print_r($allProperties);
if ($_pgR["pid"]) {
    $productID = $_pgR["pid"];
    $product = $objProduct->getProductByID($productID);
    $intMode = 1;
    //edit mode
    $createBy = $product[global_mapping::CreatedBy];
    $currentUserID = $_SESSION[global_common::SES_C_USERINFO][global_mapping::UserID];
    if ($createBy != $currentUserID) {
        global_common::redirectByScript("index.php");
        return;
    }