$action = $_GET['action']; $store_id = $_REQUEST['id']; switch ($action) { case 'editar': $tienda = $model->obtener($_GET['id']); break; case 'actualizar': $tienda->__SET("Nombre", $_POST['nombre']); $tienda->__SET("Apellidos", $_POST['apellidos']); $tienda->__SET("Poblacion", $_POST['poblacion']); $tienda->__SET("CLUB", $_POST['club']); if ($store_id > 0) { $tienda->__SET("IdParticipante", $store_id); $model->actualizar($tienda); } else { $model->insertar($tienda); } header("Location: index.php"); break; case 'eliminar': $model->eliminar($store_id); header("Location: index.php"); break; default: break; } } ?> <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties.
$action = $_GET['action']; $id = $_REQUEST['id']; switch ($action) { case 'editar': $part = $model->obtener($_GET['id']); break; case 'actualizar': $part->__SET("Nombre", $_POST['nombre']); $part->__SET("Apellidos", $_POST['apellidos']); $part->__SET("Poblacion", $_POST['poblacion']); $part->__SET("CLUB", $_POST['club']); if ($id > 0) { $part->__SET("IdParticipante", $id); $model->actualizar($part); } else { $model->insertar($part); } header("Location: index.php"); break; case 'eliminar': $model->eliminar($id); header("Location: index.php"); break; } } ?> <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor.