public function getNeededCategoriesIdsAndOrFormulaArray() { $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); if (isset($_REQUEST['mb'])) { $mb = $this->secure($_REQUEST['mb']); } if (isset($_REQUEST['mb'])) { $mb = $this->secure($_REQUEST['mb']); $motherboard_sata_ide_support = $pccm->getMbSataIdeSupport($mb); } $neededCategoriesIdsAndOrFormulaArray = array(); if ($motherboard_sata_ide_support) { if (in_array(CategoriesConstants::MB_SATA_SUPPORTED, $motherboard_sata_ide_support) && in_array(CategoriesConstants::MB_IDE_SUPPORTED, $motherboard_sata_ide_support)) { $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::OPTICAL_DRIVE_SATA; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::OPTICAL_DRIVE_IDE; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_STORAGE_INTERFACE_COMPATIBLE_DB; } elseif (in_array(CategoriesConstants::MB_IDE_SUPPORTED, $motherboard_sata_ide_support)) { $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::OPTICAL_DRIVE_IDE; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_STORAGE_INTERFACE_COMPATIBLE_DB; } elseif (in_array(CategoriesConstants::MB_SATA_SUPPORTED, $motherboard_sata_ide_support)) { $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::OPTICAL_DRIVE_SATA; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_STORAGE_INTERFACE_COMPATIBLE_DB; } } }
function getNeededCategoriesIdsAndOrFormulaArray() { $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); $motherboard_form_factor = null; if (isset($_REQUEST['mb'])) { $mb = $this->secure($_REQUEST['mb']); $motherboard_form_factor = $pccm->getMbFormFactor($mb); } $neededCategoriesIdsAndOrFormulaArray = array(); if (isset($motherboard_form_factor)) { //Motherboard is ATX if ($motherboard_form_factor == CategoriesConstants::MB_FORM_FACTOR_ATX) { //CASE size should be ATX $neededCategoriesIdsAndOrFormulaArray = array(CategoriesConstants::CASE_SIZE_ATX, ":", PcConfiguratorManager::PCC_CASE_SIZE_COMPATIBLE_DB); //Motherboard is mini ATX } else { if ($motherboard_form_factor == CategoriesConstants::MB_FORM_FACTOR_MINI_ATX) { //CASE size should be ATX or mini ATX $neededCategoriesIdsAndOrFormulaArray = array(CategoriesConstants::CASE_SIZE_ATX, 'or', CategoriesConstants::CASE_SIZE_MINI_ATX, ":", PcConfiguratorManager::PCC_CASE_SIZE_COMPATIBLE_DB); //Motherboard is micro ATX } else { if ($motherboard_form_factor == CategoriesConstants::MB_FORM_FACTOR_MICRO_ATX) { //CASE size should be ATX or mini ATX or Micro Atx $neededCategoriesIdsAndOrFormulaArray = array(CategoriesConstants::CASE_SIZE_ATX, 'or', CategoriesConstants::CASE_SIZE_MINI_ATX, 'or', CategoriesConstants::CASE_SIZE_MICRO_ATX, ":", PcConfiguratorManager::PCC_CASE_SIZE_COMPATIBLE_DB); } } } } return $neededCategoriesIdsAndOrFormulaArray; }
public function load() { $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); $pccm->manageComponentLoadRequestBeforeLoad(); $allSelectedComponentsIdsArray = $pccm->getSelectedItemsIdsFromRequest(); $this->addParam("allSelectedComponentsIdsArray", $allSelectedComponentsIdsArray); $itemManager = ItemManager::getInstance($this->config, $this->args); $userLevel = $this->getUserLevel(); $requiredCategoriesFormulasArray = $this->getRequiredCategoriesFormulasArray(); $neededCategoriesIdsAndOrFormulaArray = $this->getNeededCategoriesIdsAndOrFormulaArray(); $selected_component_item_id = $this->getSelectedComponentItemId(); $search_text = null; if (isset($_REQUEST['search_component'])) { $search_text = $this->secure($_REQUEST['search_component']); } list($offset, $limit) = $this->getItemsOffsetAndLimit($search_text); $itemsDtos = $itemManager->getPccItemsByCategoryFormula($this->getUserId(), $userLevel, $requiredCategoriesFormulasArray, $neededCategoriesIdsAndOrFormulaArray, $offset, $limit, $selected_component_item_id, $search_text); $this->addParam("itemsDtos", $itemsDtos); $this->addParam("itemManager", $itemManager); $this->addParam('componentLoad', $this); $ci = $this->getComponentTypeIndex(); $this->addParam('componentName', $pccm->getComponentKeywordByIndex($ci)); $this->addParam('componentIndex', $ci); $this->addParam('pcmm', PccMessagesManager::getInstance($this->config, $this->args)); $this->addParam('tab_header_info_text', $this->getTabHeaderInfoText()); }
public function load() { $this->setDescriptionTagValue('Build you computer (PC) using this tool and order it. We\'ll configure your PC and proceed your order!'); $this->setKeywordsTagValue('Build PC, Build Computer, Build Desktop Computer'); $this->setTitleTagValue('PC Configurator, build your computer!'); $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); $this->addParam('pccm', $pccm); if (isset($this->args[0])) { $edited_pc_cart_item_id = $this->args[0]; //if (!isset($this->customerEmail)) $this->initVars(); if (!isset($this->customerEmail)) { exit; } $pcToBeEdit = $this->getPcToBeEdited($edited_pc_cart_item_id); if ($pcToBeEdit != null) { $this->setPcConfiguratorRequestParamsCorrespondingToEditedPcComponents($pcToBeEdit); $this->addParam("configurator_mode_edit_cart_row_id", $edited_pc_cart_item_id); } } $right_side_panel_width = $this->getCmsVar('pc_configurator_right_side_panel_width'); $width = intval($this->getCmsVar('whole_page_width')) - $right_side_panel_width; $this->addParam('left_side_panel_width', $width); $this->addParam('pcc_components_count', count(PcConfiguratorManager::$PCC_COMPONENTS)); $lm = LanguageManager::getInstance($this->config, $this->args); $componentDisplayNames = array(); foreach (PcConfiguratorManager::$PCC_COMPONENTS_DISPLAY_NAMES_IDS as $pid) { $componentDisplayNames[] = $pid; } $this->addParam("component_display_names", $componentDisplayNames); }
public function service() { $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); $retFieldsArray = array(); $retFieldsArray['selected_components_ids'] = $pccm->getRequestComponentSelectedComponents(); $retFieldsArray['required_components_ids'] = $pccm->getRequestComponentRequiredComponents($this->sessionManager->getUser()); echo json_encode($retFieldsArray); return true; }
public function getComponentMaxPossibleCount($item) { if (isset($_REQUEST['mb'])) { $mb = $this->secure($_REQUEST['mb']); } $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); $selected_ssd_count = (int) $this->getSelectedItemCount($item); $mb_free_sata_storage_count = (int) $pccm->getMbSataStorageFreePortCount($mb); return $selected_ssd_count + $mb_free_sata_storage_count; }
public function load() { $user = $this->getUser(); $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); $selectedComponents = $pccm->getSelectedComponentsDtosOrderedInArray($user); $itemManager = ItemManager::getInstance($this->config, $this->args); $this->addParam("selected_components", $selectedComponents); $priceGroup = null; if ($this->getUserLevel() === UserGroups::$ADMIN) { $customer = $this->getCustomer(); $priceGroup = $customer->getPriceGroup(); } list($totalUsd, $totalAmd) = $pccm->getSelectedComponentSubTotalsAndTotals($selectedComponents, $user->getLevel(), $priceGroup); $required_components_ids = $pccm->getRequestComponentRequiredComponents($this->sessionManager->getUser()); if (count($required_components_ids) === 0) { $this->addParam("ready_to_order", "true"); } else { $this->addParam("ready_to_order", "false"); } if (isset($_REQUEST['configurator_mode_edit_cart_row_id']) && intval($_REQUEST['configurator_mode_edit_cart_row_id']) > 0) { $this->addParam("configurator_mode_edit_cart_row_id", intval($_REQUEST['configurator_mode_edit_cart_row_id'])); } $this->addParam("pccm", $pccm); $this->addParam("total_usd", $totalUsd); $this->addParam("total_amd", $totalAmd); $vipCustomer = 0; if ($this->getUserLevel() === UserGroups::$USER) { $customer = $this->getCustomer(); $userManager = UserManager::getInstance($this->config, $this->args); $vipCustomer = $userManager->isVipAndVipEnabled($customer); } if ($this->getUserLevel() === UserGroups::$ADMIN) { $customer = $this->getCustomer(); $vipCustomer = $customer->getPriceGroup() === 'vip'; } if ($vipCustomer) { $pc_configurator_discount = floatval($this->getCmsVar('vip_pc_configurator_discount')); } else { $pc_configurator_discount = floatval($this->getCmsVar('pc_configurator_discount')); } $this->addParam("pc_configurator_discount", $pc_configurator_discount); $selectedComponentProfitWithDiscount = $pccm->calcSelectedComponentProfitWithDiscount($selectedComponents, $user->getLevel(), $pc_configurator_discount, $priceGroup); $pcBuildFeeAMD = $pccm->calcPcBuildFee($selectedComponentProfitWithDiscount); $this->addParam("pc_build_fee_amd", $pcBuildFeeAMD); $this->pcGrandTotalAmd = $totalAmd * (1 - $pc_configurator_discount / 100) + $pcBuildFeeAMD; $this->pcGrandTotalUsd = $totalUsd; $this->addParam("grand_total_amd", $this->pcGrandTotalAmd); $this->addParam("itemManager", $itemManager); }
public function getComponentMaxPossibleCount($item) { if (isset($_REQUEST['mb'])) { $mb = $this->secure($_REQUEST['mb']); } $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); $interface = $pccm->getGraphicsInterface($item); $selected_graphics_count = (int) $this->getSelectedItemCount($item); if ($interface == CategoriesConstants::VIDEO_INTERFACE_PCI_EXPRESS) { $mb_free_pci_express_graphics_count = (int) $pccm->getMbPciExpressFreePortCount($mb); return $selected_graphics_count + $mb_free_pci_express_graphics_count; } else { if ($interface == CategoriesConstants::VIDEO_INTERFACE_AGP) { $mb_free_agp_graphics_count = (int) $pccm->getMbAgpFreePortCount($mb); return $selected_graphics_count + $mb_free_agp_graphics_count; } } }
/** * Initializes DB mappers * * @param object $config * @param object $args * @return */ function __construct($config, $args, $user) { $this->config = $config; $this->args = $args; $this->user = $user; $this->pccm = PcConfiguratorManager::getInstance($this->config, $this->args); $this->itemManager = ItemManager::getInstance($this->config, $this->args); $this->office_pc_components_ratio = explode(',', $this->getCmsVar('office_pc_components_ratio')); $this->gaming_pc_components_ratio = explode(',', $this->getCmsVar('gaming_pc_components_ratio')); $this->office_pc_components_ratio_only_case = explode(',', $this->getCmsVar('office_pc_components_ratio_only_case')); $this->gaming_pc_components_ratio_only_case = explode(',', $this->getCmsVar('gaming_pc_components_ratio_only_case')); $userManager = UserManager::getInstance($config, $args); $vipCustomer = false; if ($this->user->getLevel() == UserGroups::$USER) { $userDto = $userManager->selectByPK($this->user->getId()); $vipCustomer = $userManager->isVipAndVipEnabled($userDto); } if ($vipCustomer) { $pc_configurator_discount = $this->getCmsVar('vip_pc_configurator_discount'); } else { $pc_configurator_discount = $this->getCmsVar('pc_configurator_discount'); } }
public function service() { $customer = $this->getCustomer(); $customerEmail = strtolower($customer->getEmail()); $customerCartManager = CustomerCartManager::getInstance($this->config, $this->args); $bundleItemsManager = BundleItemsManager::getInstance($this->config, $this->args); $itemManager = ItemManager::getInstance($this->config, $this->args); $userLevel = $this->sessionManager->getUser()->getLevel(); $user_id = $this->getUserId(); $add_count = 1; if (isset($_REQUEST['add_count'])) { $add_count = $this->secure($_REQUEST['add_count']); } if (isset($_REQUEST['bundle_items_ids'])) { $bundle_items_ids = $this->secure($_REQUEST['bundle_items_ids']); } else { $jsonArr = array('status' => "err", "errText" => "System error: Try to add empty bundle to cart!"); echo json_encode($jsonArr); return false; } $userManager = UserManager::getInstance($this->config, $this->args); $vipCustomer = $userManager->isVipAndVipEnabled($customer); if ($vipCustomer) { $discount = floatval($this->getCmsVar('vip_pc_configurator_discount')); } else { $discount = floatval($this->getCmsVar('pc_configurator_discount')); } $bundle_display_name_id = 287; //means "computer" $bundle_items_ids_array = explode(',', $bundle_items_ids); $itemsDto = $itemManager->getItemsForOrder($bundle_items_ids_array, $user_id, $userLevel); if (count($itemsDto) !== count($bundle_items_ids_array)) { $jsonArr = array('status' => "err", "errText" => "Some items are not available!"); echo json_encode($jsonArr); return false; } $last_dealer_price = 0; foreach ($itemsDto as $key => $itemDto) { $last_dealer_price += $itemDto->getDealerPrice(); } if (isset($_REQUEST['replace_cart_row_id']) && $_REQUEST['replace_cart_row_id'] > 0) { $replace_cart_row_id = $_REQUEST['replace_cart_row_id']; $dto = $customerCartManager->selectByPK($replace_cart_row_id); if ($dto) { $replaceing_bundle_id = $dto->getBundleId(); $addedItemId = $customerCartManager->updateById($replace_cart_row_id, $customerEmail, 0, $replaceing_bundle_id, $last_dealer_price, $discount, $dto->getCount()); $bundleItemsManager->deleteBundle($replaceing_bundle_id); } else { $jsonArr = array('status' => "err", "errText" => "System Error: Bundle is not available in your cart!"); echo json_encode($jsonArr); return false; } } $bundle_id = $bundleItemsManager->createBundle($bundle_display_name_id, $bundle_items_ids, "", $replaceing_bundle_id); if (!isset($addedItemId)) { $addedItemId = $customerCartManager->addToCart($customerEmail, 0, $bundle_id, $last_dealer_price, $add_count); } ///////////start add build fee if it should be add/////////////////// $bundleItems = $customerCartManager->getCustomerCart($customerEmail, $user_id, $userLevel, $addedItemId); //list($bpAMD, $bpUSD, $specialFeesTotalAMD) = $bundleItemsManager->calcBundlePriceForCustomerWithoutDiscount($bundleItems, $userLevel); $specialFeesManager = SpecialFeesManager::getInstance($this->config, $this->args); /* var_dump($bpAMD , intval($this->getCmsVar('pc_buid_fee_free_amd_over'))); var_dump($bpAMD < intval($this->getCmsVar('pc_buid_fee_free_amd_over'))); exit; */ $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); $bundleProfitWithoutDiscountUSD = 0; if ($userLevel != UserGroups::$ADMIN && $userLevel != UserGroups::$COMPANY) { $bundleProfitWithoutDiscountUSD = $bundleItemsManager->calcBundleProfitWithDiscount($bundleItems, $discount); } $pcBuildFee = $pccm->calcPcBuildFee($bundleProfitWithoutDiscountUSD); $pcBuildFeeId = $specialFeesManager->getPcBuildFee()->getId(); $special_fees = array($pcBuildFeeId => $pcBuildFee); if ($pcBuildFee > 0) { $bundleItemsManager->addSpecialFeesToBundle($bundle_id, $bundle_display_name_id, $special_fees); } ///////////end add build fee if it should be add/////////////////// $totalCount = $customerCartManager->getCustomerCartTotalCount($customerEmail); $jsonArr = array('status' => "ok", "cart_items_count" => $totalCount); echo json_encode($jsonArr); return true; }
public function getNeededCategoriesIdsAndOrFormulaArray() { $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); if (isset($_REQUEST['mb'])) { $mb = $this->secure($_REQUEST['mb']); $motherboard_socket = $pccm->getMbSocket($mb); } if (isset($_REQUEST['cooler'])) { $cooler = $this->secure($_REQUEST['cooler']); $cooler_sockets = $pccm->getCoolerSockets($cooler); } $neededCategoriesIdsAndOrFormulaArray = array(); //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking MB compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($motherboard_socket) { //if Mb soxket is 478 if ($motherboard_socket == CategoriesConstants::MB_SOCKET_478) { //CPU socket should be 478 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_478; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_MB_SOCKET_COMPATIBLE_DB; } else { //if MB soxket is 775 if ($motherboard_socket == CategoriesConstants::MB_SOCKET_775) { //CPU socket should be 775 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_775; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_MB_SOCKET_COMPATIBLE_DB; } else { //if MB soxket is 1150 if ($motherboard_socket == CategoriesConstants::MB_SOCKET_1150) { //CPU socket should be 1150 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_1150; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_MB_SOCKET_COMPATIBLE_DB; } else { //if MB soxket is 1155 if ($motherboard_socket == CategoriesConstants::MB_SOCKET_1155) { //CPU socket should be 1155 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_1155; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_MB_SOCKET_COMPATIBLE_DB; } else { //if MB soxket is 1156 if ($motherboard_socket == CategoriesConstants::MB_SOCKET_1156) { //CPU socket should be 1156 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_1156; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_MB_SOCKET_COMPATIBLE_DB; } else { //if MB soxket is 1366 if ($motherboard_socket == CategoriesConstants::MB_SOCKET_1366) { //CPU socket should be 1366 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_1366; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_MB_SOCKET_COMPATIBLE_DB; } else { //if MB soxket is 2011 if ($motherboard_socket == CategoriesConstants::MB_SOCKET_2011) { //CPU socket should be 2011 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_2011; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_MB_SOCKET_COMPATIBLE_DB; } } } } } } } } //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking COOLER compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($cooler_sockets) { $neededCategoriesIdsAndOrFormulaArray[] = '('; if (in_array(CategoriesConstants::COOLER_SOCKET_478, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_478; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_775, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_775; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_1150, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_1150; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_1155, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_1155; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_1156, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_1156; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_1366, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_1366; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_2011, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::CPU_SOCKET_2011; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } array_pop($neededCategoriesIdsAndOrFormulaArray); $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_COOLER_SOCKET_COMPATIBLE_DB; } return $neededCategoriesIdsAndOrFormulaArray; }
public function getNeededCategoriesIdsAndOrFormulaArray() { $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); if (isset($_REQUEST['mb'])) { $mb = $this->secure($_REQUEST['mb']); $motherboard_ram_type = $pccm->getMbRamType($mb); $motherboard_ram_slot_count = $pccm->getMbRamSlotCount($mb); //$motherboard_ram_slot_count_integer = $pccm->getMbRamSlotCountRepresentedInInteger($selected_mb); } $neededCategoriesIdsAndOrFormulaArray = array(); if ($motherboard_ram_type) { if ($motherboard_ram_type == CategoriesConstants::MB_RAM_TYPE_DDR) { $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_TYPE_DDR; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_TYPE_COMPATIBLE_DB; } elseif ($motherboard_ram_type == CategoriesConstants::MB_RAM_TYPE_DDR2) { $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_TYPE_DDR2; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_TYPE_COMPATIBLE_DB; } elseif ($motherboard_ram_type == CategoriesConstants::MB_RAM_TYPE_DDR3) { $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_TYPE_DDR3; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_TYPE_COMPATIBLE_DB; } } if ($motherboard_ram_slot_count) { //Motherboard RAM SLOT COUNT is 1 if ($motherboard_ram_slot_count == CategoriesConstants::MB_RAM_SLOT_COUNT_1) { //then RAM kit count should be 1 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_1; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } else { //Motherboard RAM SLOT COUNT is 2 if ($motherboard_ram_slot_count == CategoriesConstants::MB_RAM_SLOT_COUNT_2) { //then RAM kit count can be 1 or 2 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_1; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_2; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } else { //Motherboard RAM SLOT COUNT is 3 if ($motherboard_ram_slot_count == CategoriesConstants::MB_RAM_SLOT_COUNT_3) { //then RAM kit count can be 1 , 2 or 3 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_1; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_2; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_3; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } else { //Motherboard RAM SLOT COUNT is 4 if ($motherboard_ram_slot_count == CategoriesConstants::MB_RAM_SLOT_COUNT_4) { //then RAM kit count can be 1,2,3 or 4 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_1; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_2; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_3; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_4; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } else { //Motherboard RAM SLOT COUNT is 6 if ($motherboard_ram_slot_count == CategoriesConstants::MB_RAM_SLOT_COUNT_6) { //then RAM kit count can be 1,2,3,4 or 6 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_1; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_2; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_3; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_4; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } else { //Motherboard RAM SLOT COUNT is 8 if ($motherboard_ram_slot_count == CategoriesConstants::MB_RAM_SLOT_COUNT_8) { //then RAM kit count can be 1,2,3,4,6 or 8 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_1; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_2; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_3; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_4; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::RAM_KIT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } } } } } } } return $neededCategoriesIdsAndOrFormulaArray; }
public function getComponentMaxPossibleCount($item) { if (isset($_REQUEST['mb'])) { $mb = $this->secure($_REQUEST['mb']); } $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); $interface = $pccm->getHddInterface($item); $selected_hdd_count = (int) $this->getSelectedItemCount($item); if ($interface == CategoriesConstants::HDD_SATA) { $mb_free_sata_storage_count = (int) $pccm->getMbSataStorageFreePortCount($mb); return $selected_hdd_count + $mb_free_sata_storage_count; } else { if ($interface == CategoriesConstants::HDD_ATA) { $mb_free_ata_storage_count = (int) $pccm->getMbAtaStorageFreePortCount($mb); return $selected_hdd_count + $mb_free_ata_storage_count; } } }
public function getNeededCategoriesIdsAndOrFormulaArray() { $pccm = PcConfiguratorManager::getInstance($this->config, $this->args); if (isset($_REQUEST['case'])) { $case = $this->secure($_REQUEST['case']); $case_size = $pccm->getCaseSize($case); } if (isset($_REQUEST['cpu'])) { $cpu = $this->secure($_REQUEST['cpu']); $cpu_socket = $pccm->getCpuSocket($cpu); } if (isset($_REQUEST['rams'])) { $rams = $this->secure($_REQUEST['rams']); $rams = explode(',', $rams); $ram_type = $pccm->getRamType($rams[0]); $total_rams_count = $pccm->getTotalRamsCount($rams); } if (isset($_REQUEST['cooler'])) { $cooler = $this->secure($_REQUEST['cooler']); $cooler_sockets = $pccm->getCoolerSockets($cooler); } if (isset($_REQUEST['graphics'])) { $graphics = $this->secure($_REQUEST['graphics']); $graphics_interface = $pccm->getGraphicsInterface($graphics); } if (isset($_REQUEST['hdds'])) { $hdds = $this->secure($_REQUEST['hdds']); $hdds = explode(',', $hdds); $hdd_interface = $pccm->getHddsInterfaces($hdds); } if (isset($_REQUEST['opts'])) { $opts = $this->secure($_REQUEST['opts']); $opts = explode(',', $opts); $opt_interface = $pccm->getOptsInterfaces($opts); } $ssc = $pccm->getSelectedStorageComponentCount(); $totalSelectedSataStorageCount = $ssc[0]; $totalSelectedAtaStorageCount = $ssc[1]; $neededCategoriesIdsAndOrFormulaArray = array(); //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking CASE compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($case_size) { //if CASE is ATX if ($case_size == CategoriesConstants::CASE_SIZE_ATX) { //MB can be AXT, MiniATX, MicroATX $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_FORM_FACTOR_ATX; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_FORM_FACTOR_MINI_ATX; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_FORM_FACTOR_MICRO_ATX; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_CASE_SIZE_COMPATIBLE_DB; } else { //if CASE is miniATX if ($case_size == CategoriesConstants::CASE_SIZE_MINI_ATX) { //MB can be MiniATX, MicroATX $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_FORM_FACTOR_MINI_ATX; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_FORM_FACTOR_MICRO_ATX; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_CASE_SIZE_COMPATIBLE_DB; } else { //if CASE is microATX if ($case_size == CategoriesConstants::CASE_SIZE_MICRO_ATX) { //MB can be only MicroATX $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_FORM_FACTOR_MICRO_ATX; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_CASE_SIZE_COMPATIBLE_DB; } } } } //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking CPU compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($cpu_socket) { //if CPU soxket is 478 if ($cpu_socket == CategoriesConstants::CPU_SOCKET_478) { //MB socket should be 478 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_478; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_CPU_SOCKET_COMPATIBLE_DB; } else { //if CPU soxket is 775 if ($cpu_socket == CategoriesConstants::CPU_SOCKET_775) { //MB socket should be 775 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_775; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_CPU_SOCKET_COMPATIBLE_DB; } else { //if CPU soxket is 1150 if ($cpu_socket == CategoriesConstants::CPU_SOCKET_1150) { //MB socket should be 1150 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_1150; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_CPU_SOCKET_COMPATIBLE_DB; } else { //if CPU soxket is 1155 if ($cpu_socket == CategoriesConstants::CPU_SOCKET_1155) { //MB socket should be 1155 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_1155; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_CPU_SOCKET_COMPATIBLE_DB; } else { //if CPU soxket is 1156 if ($cpu_socket == CategoriesConstants::CPU_SOCKET_1156) { //MB socket should be 1156 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_1156; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_CPU_SOCKET_COMPATIBLE_DB; } else { //if CPU soxket is 1366 if ($cpu_socket == CategoriesConstants::CPU_SOCKET_1366) { //MB socket should be 1366 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_1366; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_CPU_SOCKET_COMPATIBLE_DB; } else { //if CPU soxket is 2011 if ($cpu_socket == CategoriesConstants::CPU_SOCKET_2011) { //MB socket should be 2011 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_2011; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_CPU_SOCKET_COMPATIBLE_DB; } } } } } } } } //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking RAM TYPE compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($ram_type) { //if RAM TYPE is DDR if ($ram_type == CategoriesConstants::RAM_TYPE_DDR) { //MB RAM TYPE should be DDR $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_TYPE_DDR; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_TYPE_COMPATIBLE_DB; } else { //if RAM TYPE is DDR2 if ($ram_type == CategoriesConstants::RAM_TYPE_DDR2) { //MB RAM TYPE should be DDR2 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_TYPE_DDR2; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_TYPE_COMPATIBLE_DB; } else { //if RAM TYPE is DDR3 if ($ram_type == CategoriesConstants::RAM_TYPE_DDR3) { //MB RAM TYPE should be DDR3 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_TYPE_DDR3; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_TYPE_COMPATIBLE_DB; } } } } //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking RAM COUNT compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($total_rams_count) { //if RAM COUNT is 1 if ($total_rams_count == 1) { //MB RAM SLOT COUNT can be 1 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_1; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_2; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_3; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_4; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } else { //if RAM COUNT is 2 if ($total_rams_count == 2) { //MB RAM SLOT COUNT can be 2 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_2; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_3; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_4; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } else { //if RAM COUNT is 3 if ($total_rams_count == 3) { //MB RAM SLOT COUNT can be 3 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_3; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_4; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } else { //if RAM COUNT is 4 if ($total_rams_count == 4) { //MB RAM SLOT COUNT can be 4 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_4; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } else { //if RAM COUNT is 6 if ($total_rams_count == 5 || $total_rams_count == 6) { //MB RAM SLOT COUNT can be 6 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } else { //if RAM COUNT is 8 if ($total_rams_count == 7 || $total_rams_count == 8) { //MB RAM SLOT COUNT can be 8 $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_RAM_SLOT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_RAM_COUNT_COMPATIBLE_DB; } else { assert(false); // system max mb ram slot count support is 8 } } } } } } } //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking Sata port count compatibility compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($totalSelectedAtaStorageCount > 0) { //if Stat Storage COUNT is 1 if ($totalSelectedAtaStorageCount == 1) { //MB Sata port count should be 1 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_ATA_PORT_COUNT_1; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_ATA_PORT_COUNT_2; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_ATA_STORAGE_COUNT_COMPATIBLE_DB; } else { if ($totalSelectedAtaStorageCount == 2) { //MB Ata port count should be 2 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_ATA_PORT_COUNT_2; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_ATA_STORAGE_COUNT_COMPATIBLE_DB; } } } //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking Sata port count compatibility compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($totalSelectedSataStorageCount > 0) { //if Stat Storage COUNT is 1 if ($totalSelectedSataStorageCount == 1) { //MB Sata port count should be 1 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_1; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_2; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_3; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_4; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_5; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_7; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_10; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_12; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_14; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_COUNT_COMPATIBLE_DB; } else { if ($totalSelectedSataStorageCount == 2) { //MB Sata port count should be 2 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_2; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_3; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_4; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_5; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_7; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_10; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_12; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_14; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_COUNT_COMPATIBLE_DB; } elseif ($totalSelectedSataStorageCount == 3) { //MB Sata port count should be 3 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_3; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_4; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_5; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_7; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_10; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_12; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_14; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_COUNT_COMPATIBLE_DB; } elseif ($totalSelectedSataStorageCount == 4) { //MB Sata port count should be 4 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_4; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_5; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_7; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_10; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_12; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_14; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_COUNT_COMPATIBLE_DB; } elseif ($totalSelectedSataStorageCount == 5) { //MB Sata port count should be 5 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_5; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_7; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_10; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_12; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_14; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_COUNT_COMPATIBLE_DB; } elseif ($totalSelectedSataStorageCount == 6) { //MB Sata port count should be 6 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_6; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_7; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_10; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_12; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_14; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_COUNT_COMPATIBLE_DB; } elseif ($totalSelectedSataStorageCount == 7) { //MB Sata port count should be 8 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_7; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_10; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_12; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_14; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_COUNT_COMPATIBLE_DB; } elseif ($totalSelectedSataStorageCount == 8) { //MB Sata port count should be 18 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_8; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_10; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_12; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_14; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_COUNT_COMPATIBLE_DB; } elseif ($totalSelectedSataStorageCount == 9 || $totalSelectedSataStorageCount == 10) { //MB Sata port count should be 10 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_10; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_12; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_14; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_COUNT_COMPATIBLE_DB; } elseif ($totalSelectedSataStorageCount == 11 || $totalSelectedSataStorageCount == 12) { //MB Sata port count should be 12 or more or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_12; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_14; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_COUNT_COMPATIBLE_DB; } elseif ($totalSelectedSataStorageCount == 13 || $totalSelectedSataStorageCount == 14) { //MB Sata port count should be 14 or more $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_PORT_COUNT_14; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_COUNT_COMPATIBLE_DB; } else { assert(false); // system max mb sata port count support is 14 } } } //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking COOLER compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($cooler_sockets) { $neededCategoriesIdsAndOrFormulaArray[] = '('; //if COOLER is 478 if (in_array(CategoriesConstants::COOLER_SOCKET_478, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_478; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_775, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_775; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_1150, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_1150; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_1155, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_1155; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_1156, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_1156; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_1366, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_1366; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } if (in_array(CategoriesConstants::COOLER_SOCKET_2011, $cooler_sockets)) { $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SOCKET_2011; $neededCategoriesIdsAndOrFormulaArray[] = 'or'; } array_pop($neededCategoriesIdsAndOrFormulaArray); $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_COOLER_SOCKET_COMPATIBLE_DB; } //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking VIDEO compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($graphics_interface) { //if VIDEO INTERFACE is AGP if ($graphics_interface == CategoriesConstants::VIDEO_INTERFACE_AGP) { //MB Video Interface should be AGP $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_GRAPHICS_AGP; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_GRAPHICS_INTERFACE_COMPATIBLE_DB; } else { //if VIDEO INTERFACE is PCI-PEXPRESS if ($graphics_interface == CategoriesConstants::VIDEO_INTERFACE_PCI_EXPRESS) { //MB Video Interface should be PCI-EXPRESS $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_GRAPHICS_PCI_EXPRESS; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_GRAPHICS_INTERFACE_COMPATIBLE_DB; } } } //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking HDD compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($hdd_interface) { if (in_array(CategoriesConstants::HDD_ATA, $hdd_interface)) { $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_IDE_SUPPORTED; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_ATA_STORAGE_INTERFACE_COMPATIBLE_DB; } if (in_array(CategoriesConstants::HDD_SATA, $hdd_interface)) { $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_SUPPORTED; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_INTERFACE_COMPATIBLE_DB; } } //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking SSD compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if (isset($_REQUEST['ssds']) && !empty($_REQUEST['ssds'])) { $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_SUPPORTED; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_INTERFACE_COMPATIBLE_DB; } //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< checking HDD compatibility >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ($opt_interface) { if (in_array(CategoriesConstants::OPTICAL_DRIVE_IDE, $opt_interface)) { $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_IDE_SUPPORTED; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_ATA_STORAGE_INTERFACE_COMPATIBLE_DB; } if (in_array(CategoriesConstants::OPTICAL_DRIVE_SATA, $opt_interface)) { $neededCategoriesIdsAndOrFormulaArray[] = '('; $neededCategoriesIdsAndOrFormulaArray[] = CategoriesConstants::MB_SATA_SUPPORTED; $neededCategoriesIdsAndOrFormulaArray[] = ')'; $neededCategoriesIdsAndOrFormulaArray[] = ':'; $neededCategoriesIdsAndOrFormulaArray[] = PcConfiguratorManager::PCC_SATA_STORAGE_INTERFACE_COMPATIBLE_DB; } } return $neededCategoriesIdsAndOrFormulaArray; }