/// /// </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; if ($_pgR["act"] == Model_Property::ACT_ADD) { $createdBy = $c_userInfo[global_mapping::UserID]; $resultID = $objProperty->insert($propertyGroupID, $propertyName, $propertyValue, $dataTypeID, $order, $createdBy, $status);
* 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 sldatatypes represent a Datatype /// /// </summary> chdir(".."); /* TODO: Add code here */ require 'config/globalconfig.php'; include_once 'class/model_datatype.php'; $objDatatype = new Model_Datatype($objConnection); if ($_pgR["act"] == model_Datatype::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; //} $dataTypeID = $_pgR['DataTypeID']; $dataTypeID = global_editor::rteSafe(html_entity_decode($dataTypeID, ENT_COMPAT, 'UTF-8')); $dataTypeName = $_pgR['DataTypeName']; $dataTypeName = global_editor::rteSafe(html_entity_decode($dataTypeName, ENT_COMPAT, 'UTF-8')); $status = $_pgR['Status']; $status = global_editor::rteSafe(html_entity_decode($status, ENT_COMPAT, 'UTF-8')); //$strName = $_pgR['name'];
public function getAllProperty($intPage = 0, $selectField = '*', $whereClause = '', $orderBy = '') { 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_Property::TBL_SL_PROPERTY, $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_Property::TBL_SL_PROPERTY, $whereClause . $orderBy)); } //echo '<br>SQL:'.$strSQL; $arrResult = $this->_objConnection->selectCommand($strSQL); if (!$arrResult) { global_common::writeLog('get All sl_property:' . $strSQL, 1, $_mainFrame->pPage); return null; } $objDataType = new Model_Datatype($this->_objConnection); $allDataType = $objDataType->getAllDatatype(); $dataTypes = array(); foreach ($allDataType as $key => $info) { $dataTypes[$info[global_mapping::DataTypeID]] = $info; unset($dataTypes[$key]); } $count = count($arrResult); for ($index = 0; $index < $count; $index++) { $arrResult[$index][global_mapping::DataTypeID] = $dataTypes[$arrResult[$index][global_mapping::DataTypeID]]; } //print_r($arrResult); return $arrResult; }