Esempio n. 1
0
<?php

/* TODO: Add code here */
require 'config/globalconfig.php';
include_once 'class/model_store.php';
include_once 'class/model_articletype.php';
include_once 'class/model_storecategory.php';
include_once 'class/model_city.php';
include_once 'class/model_district.php';
$objArticleType = new Model_ArticleType($objConnection);
$objCity = new Model_City($objConnection);
$objDistrict = new Model_District($objConnection);
$objStore = new Model_Store($objConnection);
$objStoreCategory = new Model_Storecategory($objConnection);
$folder = global_common::FOLDER_FILES_OTHER . '/Foody/';
$fileCat = $folder . 'All_Foody_Categories.txt';
if ($_pgR["act"] == "import") {
    echo $fileCat;
    echo '<br>';
    $jsonCats = global_common::readFromFile($fileCat);
    $rootCats = json_decode($jsonCats, true);
    $cats = $rootCats['allCategories'];
    //print_r($cats);
    $createdBy = 11111;
    $updatedBy = 11111;
    foreach ($cats as $cat) {
        //print_r($cat);
        //return;
        $catName = $cat['Name'];
        $checkExisted = $objArticleType->getArticleTypeByName($catName);
        //print_r($checkExisted); ;
Esempio n. 2
0
 public function getStoresByCatID($objID, $selectField = '*')
 {
     $objCatStore = new Model_Storecategory($this->_objConnection);
     $arrCatStore = $objCatStore->getStorecategoryByCatID($objID);
     $arrStoreIDs = global_common::getArrayColumn($arrCatStore, global_mapping::StoreID);
     $strQueryStoreIN = global_common::convertToQueryIN($arrStoreIDs);
     $selectField = $selectField ? $selectField : '*';
     $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, self::TBL_SL_STORE, 'WHERE  StoreID IN (' . $strQueryStoreIN . ') '));
     //echo '<br>SQL:'.$strSQL;
     $arrResult = $this->_objConnection->selectCommand($strSQL);
     if (!$arrResult) {
         global_common::writeLog('get sl_store ByID:' . $strSQL, 1, $_mainFrame->pPage);
         return null;
     }
     return $arrResult;
 }