if ($search) { $search .= ' and (`' . global_mapping::ManufactoryID . '` = ' . global_common::escape_mysql_string($manu) . ')'; } else { $search .= '(`' . global_mapping::ManufactoryID . '` = ' . global_common::escape_mysql_string($manu) . ')'; } } if ($productInIDs) { if ($search) { $search .= ' and (`' . global_mapping::ProductID . '` IN (' . $productInIDs . '))'; } else { $search .= '(`' . global_mapping::ProductID . '` IN (' . $productInIDs . '))'; } } //echo 'search:'. $search; if ($search) { $products = $objProduct->getAllProduct($page, '*', $search, null, $total); } //echo $total; //print_r($topProperties); if ($_pgR["cid"]) { $catID = $_pgR["cid"]; $_SESSION[global_common::SES_C_CUR_PAGE] = "products.php?cid=" . $catID; } include_once 'include/_header.inc'; include_once 'include/_menu.inc'; ?> <script type="text/javascript" src="<?php echo $_objSystem->locateJs('user_product.js'); ?>
require 'config/globalconfig.php'; include_once 'include/_permission.inc'; include_once 'class/model_articletype.php'; include_once 'class/model_product.php'; include_once 'class/model_user.php'; include_once 'class/model_article.php'; include_once 'class/model_manufactory.php'; $objProduct = new Model_Product($objConnection); $objUser = new Model_User($objConnection); if (global_common::isCLogin()) { //get user info $userInfo = $_SESSION[global_common::SES_C_USERINFO]; $userID = $userInfo[global_mapping::UserID]; $condidtion = global_mapping::CreatedBy . '=' . $userID; //global_mapping::StartDate.' <= \''.global_common::nowSQL().'\''.' And '.global_mapping::EndDate.' >= \''.global_common::nowSQL().'\''; $products = $objProduct->getAllProduct($page, '*', $condidtion, '', $total); //$condidtion = global_mapping::EndDate.' <= \''.global_common::nowSQL().'\''; //$expireArticles = $objArticle->getArticleByUser($userID,1,global_common::DEFAULT_PAGE_SIZE,null,$condidtion,''); //print_r($articles); } $_SESSION[global_common::SES_C_CUR_PAGE] = "profile_product.php"; $_SESSION[global_common::SES_LAST_PAGE] = $_SESSION[global_common::SES_C_CUR_PAGE]; ?> <?php include_once 'include/_header.inc'; ?> <script type="text/javascript" src="<?php echo $_objSystem->locateJs('user_user.js'); ?> "></script>
} if ($keyword) { if ($search) { $search .= ' and (`' . global_mapping::ProductName . '` like \'%' . global_common::escape_mysql_string($keyword) . '%\' or `' . global_mapping::Description . '` like \'%' . global_common::escape_mysql_string($keyword) . '%\')'; } else { $search .= '(`' . global_mapping::ProductName . '` like \'%' . global_common::escape_mysql_string($keyword) . '%\' or `' . global_mapping::Description . '` like \'%' . global_common::escape_mysql_string($keyword) . '%\')'; } } if ($manu) { if ($search) { $search .= ' and (`' . global_mapping::ManufactoryID . '` = ' . global_common::escape_mysql_string($manu) . ')'; } else { $search .= '(`' . global_mapping::ManufactoryID . '` = ' . global_common::escape_mysql_string($manu) . ')'; } } $products = $objProduct->getAllProduct(0, '*', $search, null); $productIDs = global_common::getArrayColumn($products, global_mapping::ProductID); $allManuFactories = $objManufactory->getAllManufactory(0); //print_r($productIDs); //if($expired) //{ // $condidtion = ' And '.global_mapping::EndDate.' < \''.global_common::nowDateSQL().'\''; //} //else //{ // $condidtion = ' And '.global_mapping::StartDate.' <= \''.global_common::nowDateSQL().'\''.' And '.global_mapping::EndDate.' >= \''.global_common::nowDateSQL().'\''; //} $inactive = $_pgR["inactive"]; $status = $inactive ? 0 : 1; $type = $_pgR["type"]; $city = $_pgR['ct'];
$curentManuID = $cmManufactory; $condition .= $condition ? ' and ' : ''; $condition .= global_mapping::ManufactoryID . '=' . $cmManufactory; } if ($txtKeyword) { if ($lastPage) { $lastPage .= 'txtKeyword=' . $txtKeyword . '&'; } else { $lastPage .= 'txtKeyword=' . $txtKeyword; } $condition .= $condition ? ' and ' : ''; $condition .= global_mapping::ProductName . ' like \'%' . $txtKeyword . '%\''; } $_SESSION[global_common::SES_LAST_PAGE] = $_SESSION[global_common::SES_C_CUR_PAGE] . '?' . $lastPage; //echo $condition; $productResults = $objProduct->getAllProduct(0, "*", $condition, ''); ?> <script type="text/javascript" src="<?php echo $_objSystem->locateJPlugin('ckeditor/adapters/jquery.js'); ?> "></script> <script type="text/javascript" src="<?php echo $_objSystem->locateJs('user_product.js'); ?> "></script> <script type="text/javascript" src="<?php echo $_objSystem->locateJs('user_articletype.js'); ?> "></script>