public function create() { $template = 'create.php'; $args['ciudad'] = modelClass::getcity(); $args['rh'] = modelClass::getRh(); $args['tipo_id'] = modelClass::getTypeId(); if ($_SERVER['REQUEST_METHOD'] === 'POST') { $rsp = modelClass::NewApre($_POST['txtId'], $_POST['txtName'], $_POST['txtLastName'], $_POST['txtPhone'], $_POST['txtCity'], $_POST['txtRh'], $_POST['txtTypeId'], $_POST['txtgender'], $_POST['txtAge']); if ($rsp === true) { $args['success'] = 'El registro fue realizado exitosamente'; $this->index($args); } else { $args['error'] = $rsp->getMessage(); $args['formAction'] = 'index.php?action=create'; $args = array_merge($args, $_POST); viewClass::renderHTML($template, $args); } } else { $args['formAction'] = 'index.php?action=create'; viewClass::renderHTML($template, $args); } }