public function editPuesto() { session_start(); if (isset($_SESSION['user_id'])) { } else { header('Location: index.php?ctl=login'); } if ($_SESSION['user_id'] == 2 || $_SESSION['user_id'] == 3 || $_SESSION['user_id'] == 5) { $m = new EmpleadosModel(Config::$mvc_bd_nombre, Config::$mvc_bd_usuario, Config::$mvc_bd_clave, Config::$mvc_bd_hostname); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $m->editarPuesto($_POST['id'], $_POST['puesto'], $_POST['proyecto_tipo'], $_POST['area_id'], $_POST['departamento_id'], $_POST['razon_social_id']); header('Location: index.php?ctl=ver&id=' . $_POST['id']); } else { $id = $_GET['id']; $empleado = $m->dameEmpleado($id); $params = $empleado; } require __DIR__ . '/templates/Empleado/EditEmpleadoPuesto.php'; } else { header('Location: index.php?ctl=listar'); } }