public function editAction() { $id = (int) isset($_GET['id']) ? $_GET['id'] : 0; $this->conf_caja = conf_caja::get($id); $this->page->extra_url = '&action=edit&id=' . (int) $this->conf_caja->getId(); $this->action = 'edit'; $this->template = 'admin_cajas/form'; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $this->conf_caja->setValues($_POST); $this->conf_caja->setEdit(true); if ($this->conf_caja->save()) { $this->new_message("Configuracion de caja actualizada correctamente!"); $this->indexAction(); } else { $this->new_error_msg("¡Imposible actualizar configuracion de caja!"); } } }