include_once 'class/model_property.php'; include_once 'class/model_productproperty.php'; include_once 'class/model_retailer.php'; 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) {
<?php /* TODO: Add code here */ 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'; $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); if ($_pgR["act"] == model_Article::ACT_ADD || $_pgR["act"] == model_Article::ACT_UPDATE) { if (global_common::isCLogin()) { //get user info $c_userInfo = $_SESSION[global_common::SES_C_USERINFO]; $articleid = $_pgR[global_mapping::ArticleID]; $content = html_entity_decode($_pgR[global_mapping::Content], ENT_COMPAT, 'UTF-8'); $createdby = $c_userInfo[global_mapping::UserID]; $status = 1; if ($_pgR["act"] == Model_Comment::ACT_ADD) { $createdBy = $c_userInfo[global_mapping::UserID]; $resultID = $objComment->insert($articleid, $content, $createdby, $status); //echo global_common::convertToXML($arrHeader, array("rs","info"), array(0,$resultID), array(0,1)); //return; if ($resultID) { $commentHTML = $objComment->getCommentHTMLByArticle($articleid); $arrHeader = global_common::getMessageHeaderArr($banCode); //$banCode
/* TODO: Add code here */ require 'config/globalconfig.php'; $_SESSION[global_common::SES_C_CUR_PAGE] = "post_article.php"; include_once 'include/_permission.inc'; include_once 'include/_header.inc'; include_once 'class/model_articletype.php'; include_once 'class/model_article.php'; include_once 'class/model_comment.php'; include_once 'class/model_user.php'; include_once 'class/model_city.php'; include_once 'class/model_district.php'; include_once 'class/model_partner.php'; $objPartner = new Model_Partner($objConnection); $objArticle = new Model_Article($objConnection); $objArticleType = new Model_ArticleType($objConnection); $objCity = new Model_City($objConnection); $objDistrict = new Model_District($objConnection); $intMode = 0; //add mode $parentTypes = $objArticleType->getAllArticleType(0, null, 'ParentID=0', 'Level'); $allTypes = $objArticleType->getAllArticleType(0, null, 'ParentID=' . $parentTypes[0][global_mapping::ArticleTypeID], 'Level'); $allCities = $objCity->getAllCity(); //echo 'get city:'; //echo($allCities); $allDistricts = $objDistrict->getAllDistrict(); $currentPartner = $objPartner->getPartnerByUserID($_SESSION[global_common::SES_C_USERINFO][global_mapping::UserID]); if ($_pgR["aid"]) { //reset partner info $currentPartner = null; $articleID = $_pgR["aid"];
include_once 'class/model_articletype.php'; include_once 'class/model_article.php'; include_once 'class/model_comment.php'; include_once 'class/model_user.php'; include_once 'class/model_product.php'; include_once 'class/model_retailer.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); $_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]; }
<?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); ;
<?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];
public function getAllPropertyGroup($intPage = 0, $selectField = '*', $whereClause = '', $orderBy = '', &$total) { if (!$selectField) { $selectField = '*'; } if ($whereClause) { $whereClause = ' WHERE ' . $whereClause; } if ($orderBy) { $orderBy = ' ORDER BY ' . $orderBy . ' ,`Order`'; } else { $orderBy = ' ORDER BY `Order`'; } if ($intPage > 0) { $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, Model_PropertyGroup::TBL_SL_PROPERTY_GROUP, $whereClause . $orderBy . ' limit ' . ($intPage - 1) * self::NUM_PER_PAGE . ',' . self::NUM_PER_PAGE)); } else { $strSQL .= global_common::prepareQuery(global_common::SQL_SELECT_FREE, array($selectField, Model_PropertyGroup::TBL_SL_PROPERTY_GROUP, $whereClause . $orderBy)); } //echo '<br>SQL:'.$strSQL; $arrResult = $this->_objConnection->selectCommand($strSQL); if (!$arrResult) { global_common::writeLog('get All sl_property_group:' . $strSQL, 1, $_mainFrame->pPage); return null; } $total = count($arrResult); $objCat = new Model_ArticleType($this->_objConnection); $allCats = $objCat->getAllArticleType(0); $convertedCats = array(); foreach ($allCats as $key => $info) { $convertedCats[$info[global_mapping::ArticleTypeID]] = $info; unset($allCats[$key]); } $count = count($arrResult); for ($index = 0; $index < $count; $index++) { $arrResult[$index][global_mapping::ArticleTypeName] = $convertedCats[$arrResult[$index][global_mapping::ArticleTypeID]][global_mapping::ArticleTypeName]; } //print_r($arrResult); return $arrResult; }
* This file was automatically generated By Code Smith * Modifications will be overwritten when code smith is run * * PLEASE DO NOT MAKE MODIFICATIONS TO THIS FILE * Date Created 5/6/2012 * */ /// <summary> /// Implementations of slarticletypes represent a ArticleType /// /// </summary> chdir(".."); /* TODO: Add code here */ require 'config/globalconfig.php'; include_once 'class/model_articletype.php'; $objArticleType = new Model_ArticleType($objConnection); if ($_pgR["act"] == model_ArticleType::ACT_ADD) { if (global_common::isCLogin()) { //get user info //$c_userInfo = $_SESSION[consts::SES_C_USERINFO]; //if ($objMenu->getMenuByName($_pgR['name'])) { // echo global_common::convertToXML($arrHeader, array("rs",'info'), array(0,global_common::STRING_NAME_EXIST), array(0,1)); // return; //} $articleTypeID = $_pgR['ArticleTypeID']; $articleTypeID = global_editor::rteSafe(html_entity_decode($articleTypeID, ENT_COMPAT, 'UTF-8')); $articleTypeName = $_pgR['ArticleTypeName']; $articleTypeName = global_editor::rteSafe(html_entity_decode($articleTypeName, ENT_COMPAT, 'UTF-8')); $status = $_pgR['Status']; $status = global_editor::rteSafe(html_entity_decode($status, ENT_COMPAT, 'UTF-8')); //$strName = $_pgR['name'];
*/ /// <summary> /// Implementations of Property represent a Property /// /// </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_property.php'; include_once 'class/model_propertygroup.php'; include_once 'class/model_adtype.php'; include_once 'class/model_articletype.php'; include_once 'class/model_datatype.php'; $objArticleType = new Model_ArticleType($objConnection); $objProperty = new Model_Property($objConnection); $objAdType = new Model_AdType($objConnection); $objDataType = new Model_Datatype($objConnection); $objGroup = new Model_PropertyGroup($objConnection); $allCats = $objArticleType->getAllArticleType(0, null, '', null); if ($_pgR["act"] == Model_Property::ACT_ADD || $_pgR["act"] == Model_Property::ACT_UPDATE) { //get user info $c_userInfo = $_SESSION[global_common::SES_C_USERINFO]; $propertyName = $_pgR[global_mapping::PropertyName]; $propertyName = html_entity_decode($propertyName, ENT_COMPAT, 'UTF-8'); $dataTypeID = html_entity_decode($_pgR[global_mapping::DataTypeID], ENT_COMPAT, 'UTF-8'); $propertyGroupID = html_entity_decode($_pgR[global_mapping::PropertyGroupID], ENT_COMPAT, 'UTF-8'); $propertyValue = html_entity_decode($_pgR[global_mapping::PropertyValue], ENT_COMPAT, 'UTF-8'); $order = html_entity_decode($_pgR[global_mapping::Order], ENT_COMPAT, 'UTF-8'); $status = 1;
<?php /* TODO: Add code here */ require 'config/globalconfig.php'; include_once 'class/model_articletype.php'; include_once 'class/model_article.php'; include_once 'class/model_user.php'; $objArticleType = new Model_ArticleType($objConnection); $objArticle = new Model_Article($objConnection); $objUser = new Model_User($objConnection); $htmlCategory = $objArticleType->DisplayAllCategory(); ?> <script type="text/javascript" src="<?php echo $_objSystem->locateJs('sela_article.js'); ?> "></script> <?php include_once 'include/_header.inc'; include_once 'include/_menu.inc'; if ($_pgR["catid"]) { $catID = $_pgR["catid"]; $intPage = $_pgR['p']; $condition = global_mapping::ArticleType . '=\'' . $catID . '\''; $orderBy = global_mapping::CreatedDate . ' DESC '; //$arrArticle = $objArticle->getAllArticle('*',$condition,$orderBy); $arrArticle = $objArticle->getArticleByType($intPage, $total, $catID); $outPutHTML = $objArticle->getHTMLArticles($arrArticle, $intPage, $total); } ?> <div id='list-content'> <?php
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; }
require 'config/globalconfig.php'; $_SESSION[global_common::SES_C_CUR_PAGE] = "post_product.php"; include_once 'include/_permission.inc'; include_once 'include/_header.inc'; include_once 'class/model_articletype.php'; include_once 'class/model_article.php'; include_once 'class/model_comment.php'; include_once 'class/model_user.php'; include_once 'class/model_propertygroup.php'; include_once 'class/model_property.php'; include_once 'class/model_product.php'; include_once 'class/model_manufactory.php'; include_once 'class/model_productproperty.php'; include_once 'class/model_datatype.php'; $objArticle = new Model_Article($objConnection); $objArticleType = new Model_ArticleType($objConnection); $objPropertyGroup = new Model_PropertyGroup($objConnection); $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);
<?php /* TODO: Add code here */ require 'config/globalconfig.php'; include_once 'class/model_store.php'; include_once 'class/model_user.php'; include_once 'class/model_articletype.php'; include_once 'class/model_storecategory.php'; include_once 'class/model_city.php'; include_once 'class/model_article.php'; include_once 'class/model_user.php'; include_once 'class/model_district.php'; include_once 'class/model_tracker.php'; $objArticleType = new Model_ArticleType($objConnection); $objCity = new Model_City($objConnection); $objUser = new Model_User($objConnection); $objDistrict = new Model_District($objConnection); $objStore = new Model_Store($objConnection); $objStoreCategory = new Model_Storecategory($objConnection); $objTracker = new Model_Tracker($objConnection); global_common::cors(); //print_r($allStores); //return; //header('Access-Control-Allow-Origin: *'); //header('Access-Control-Allow-Methods: GET, POST'); //header('Content-Type: application/json'); $request_body = file_get_contents("php://input"); //echo $request_body; if ($request_body && global_common::isJson($request_body)) { $_pgR = json_decode($request_body, true); }