$properties = $_pgR['Properties']; //$properties = html_entity_decode($properties,ENT_COMPAT ,'UTF-8' ); $productName = $_pgR['ProductName']; $productName = html_entity_decode($productName, ENT_COMPAT, 'UTF-8'); $catalogueID = $_pgR['CatalogueID']; $catalogueID = html_entity_decode($catalogueID, ENT_COMPAT, 'UTF-8'); $imageLink = $_pgR['ImageLink']; $imageLink = html_entity_decode($imageLink, ENT_COMPAT, 'UTF-8'); $manufactoryID = $_pgR['ManufactoryID']; $manufactoryID = html_entity_decode($manufactoryID, ENT_COMPAT, 'UTF-8'); $description = $_pgR['Description']; $description = global_editor::rteSafe(html_entity_decode($description, ENT_COMPAT, 'UTF-8')); $status = 1; if ($_pgR["act"] == Model_Product::ACT_ADD) { $createdBy = $c_userInfo[global_mapping::UserID]; $resultID = $objProduct->insert($productName, $catalogueID, $imageLink, $manufactoryID, $description, $createdBy, $status); if ($resultID) { $orderProductProperty = 0; $orderGroup = global_common::getMaxValueofField($objConnection, global_mapping::PropertyGroupID, Model_PropertyGroup::TBL_SL_PROPERTY_GROUP) + 1; foreach ($properties as $item) { $group = $item[global_mapping::PropertyGroupID]; $groupID = global_common::convertToInt($group); //is new group if ($groupID <= 0) { $searchGroup = $objPropertyGroup->getPropertyGroupByNameAndCat($group, $catalogueID); if ($searchGroup) { $groupID = $searchGroup[global_mapping::PropertyGroupID]; } else { $groupID = $objPropertyGroup->insert($group, $group, $catalogueID, $orderGroup, $createdBy, null); $orderGroup++; }
$paymentModeID = global_editor::rteSafe(html_entity_decode($paymentModeID, ENT_COMPAT, 'UTF-8')); $numberaireID = $_pgR['NumberaireID']; $numberaireID = global_editor::rteSafe(html_entity_decode($numberaireID, ENT_COMPAT, 'UTF-8')); $storageDate = $_pgR['StorageDate']; $storageDate = global_editor::rteSafe(html_entity_decode($storageDate, ENT_COMPAT, 'UTF-8')); $price = $_pgR['Price']; $price = global_editor::rteSafe(html_entity_decode($price, ENT_COMPAT, 'UTF-8')); $amount = $_pgR['Amount']; $amount = global_editor::rteSafe(html_entity_decode($amount, ENT_COMPAT, 'UTF-8')); $description = $_pgR['Description']; $description = global_editor::rteSafe(html_entity_decode($description, ENT_COMPAT, 'UTF-8')); $status = $_pgR['Status']; $status = global_editor::rteSafe(html_entity_decode($status, ENT_COMPAT, 'UTF-8')); //$strName = $_pgR['name']; //$strName = global_editor::rteSafe(html_entity_decode($strName,ENT_COMPAT ,'UTF-8' )); $resultID = $objProduct->insert($productID, $productName, $catalogueID, $imageLink, $manufactoryID, $paymentModeID, $numberaireID, $storageDate, $price, $amount, $description, $status); if ($resultID) { $arrHeader = global_common::getMessageHeaderArr($banCode); //$banCode echo global_common::convertToXML($arrHeader, array("rs", "inf"), array(1, $result), array(0, 1)); return; } else { echo global_common::convertToXML($arrHeader, array("rs", "info"), 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)); } return; } elseif ($_pgR['act'] == model_Product::ACT_UPDATE) { if (global_common::isCLogin()) {