function Guardar() { $vicepresidencia = new Vicepresidencia(); if (isset($_POST['nombre']) && $_POST['nombre'] != "") { error_log("entro al guardar"); $nombre = $_POST['nombre']; $codigo = $_POST['descripcion']; $estatus = $_POST['estatus']; if ($estatus == "on") { $vicepresidencia->Insertar_Vicepresidencia($nombre, "1", $codigo); } else { $vicepresidencia->Insertar_Vicepresidencia($nombre, "0", $codigo); } header("Location: index.php?oksave"); } else { header("Location: index.php?error"); error_log("no hizo nada!!!"); } }