protected function save_new_hub() { $hubr = array(); $hubr['hubicao'] = DB::escape($this->post->hubicao); $hubr['hubname'] = DB::escape($this->post->hubname); $hubr['lat'] = DB::escape($this->post->lat); $hubr['lng'] = DB::escape($this->post->lng); $hubr['pilotid'] = DB::escape($this->post->pilotid); $hubr['manager'] = DB::escape($this->post->manager); $hubr['image'] = DB::escape($this->post->image); /* foreach($hubr as $test) { if(empty($test)) { $this->set('aircrafts', $ac); $this->show('aircraft/aircraft_new_form.tpl'); return; } }*/ HubData::save_new_hub($hubr['hubicao'], $hubr['hubname'], $hubr['lat'], $hubr['lng'], $hubr['pilotid'], $hubr['manager'], $hubr['image']); $this->set('hubs', HubData::get_hub()); $this->show('hub/hub_index.tpl'); }