public function getIecDetailsByIecId($iec_id) { $iec_info = Model_EntityIecinfo::getEntityInfobyId($iec_id)->toArray(); $category = Model_EntityCategories::getCategoryById($iec_info['category'])->toArray(); $iec_info['category_name'] = $category['name']; $iec_info['bank_details'] = Model_EntityBankDetails::getBankDetailsByIecId($iec_id)->toArray(); $iec_details = Model_EntityDetails::getIecDetailsByIecId($iec_id)->toArray(); $iec_info['ports'] = Model_Ports::getAllPorts()->toArray(); $iec_info['capital_goods'] = Model_EpcgGoodsSector::getAllGoodsSector()->toArray(); //$primary_branch_flag = false; foreach ($iec_details as $detail) { $detail['state'] = Model_States::getById($detail['state'])->toArray()['name']; $detail['district'] = Model_Districts::getById($detail['district'])->toArray()['name']; $detail['city'] = Model_Cities::getById($detail['city'])->toArray()['name']; if ($detail['entity_category_id'] == 0) { if ($detail['state'] == 'Karnataka') { //TO DO: Pick state Karnataka from database $iec_info['branch_details_primary'][] = $detail; //$primary_branch_flag = true; } $iec_info['branch_details'][] = $detail; } else { $iec_info['partner_details'][] = $detail; } } print_r($iec_info); return $iec_info; }
public function getIecDetailsByIecId($iec_id) { $iec_info = Model_EntityIecinfo::getEntityInfobyId($iec_id)->toArray(); $iec_info['state'] = Model_States::getById($iec_info['state'])->toArray()['name']; $iec_info['district'] = Model_States::getById($iec_info['district'])->toArray()['name']; $iec_info['city'] = Model_States::getById($iec_info['city'])->toArray()['name']; $category = Model_EntityCategories::getCategoryById($iec_info['category'])->toArray(); $iec_info['category_name'] = $category['name']; $iec_info['bank_details'] = Model_EntityBankDetails::getBankDetailsByIecId($iec_id)->toArray(); $iec_details = Model_EntityDetails::getIecDetailsByIecId($iec_id)->toArray(); $iec_info['finance_details'] = Model_FinancialDetails::getFinancialDetailsByIecId($iec_id)->toArray(); foreach ($iec_details as $detail) { $detail['state'] = Model_States::getById($detail['state'])->toArray()['name']; $detail['district'] = Model_Districts::getById($detail['district'])->toArray()['name']; $detail['city'] = Model_Cities::getById($detail['city'])->toArray()['name']; if ($detail['entity_category_id'] == 0) { $iec_info['branch_details'][] = $detail; } else { $iec_info['partner_details'][] = $detail; } } print_r($iec_info); return $iec_info; }