public function renderForm()
 {
     if (Tools::getValue('addfeatures')) {
         $obj_hotel_features = new HotelFeatures();
         $features_list = $obj_hotel_features->HotelAllCommonFeaturesArray();
         $this->context->smarty->assign('features_list', $features_list);
         $this->context->smarty->assign('addfeatures', 1);
     }
     if ($this->display == 'add') {
         $obj_hotel_features = new HotelFeatures();
         $features_list = $obj_hotel_features->HotelAllCommonFeaturesArray();
         $hotel_info_obj = new HotelBranchInformation();
         $unassigned_ftrs_hotels = $hotel_info_obj->getUnassignedFeaturesHotelIds();
         $this->context->smarty->assign('hotels', $unassigned_ftrs_hotels);
         $this->context->smarty->assign('features_list', $features_list);
     } elseif ($this->display == 'edit') {
         $id = Tools::getValue('id');
         $this->context->smarty->assign('edit', 1);
         $obj_hotel_features = new HotelFeatures();
         $hotel_info_obj = new HotelBranchInformation();
         $features_hotel = $hotel_info_obj->getFeaturesOfHotelByHotelId(Tools::getValue('id'));
         $features_list = $obj_hotel_features->HotelBranchSelectedFeaturesArray($features_hotel);
         $hotels = $hotel_info_obj->hotelsNameAndId();
         $this->context->smarty->assign('hotel_id', $id);
         $this->context->smarty->assign('hotels', $hotels);
         $this->context->smarty->assign('features_list', $features_list);
     }
     $this->fields_form = array('submit' => array('title' => $this->l('Save')));
     return parent::renderForm();
 }