<?php require_once './participante.entidad.php'; require_once './participante.modelo.php'; $part = new Participante1(); $model = new ParticipanteModel(); if (isset($_GET['action'])) { $action = $_GET['action']; $id = $_REQUEST['id']; switch ($action) { case 'editar': $part = $model->obtener($_GET['id']); break; case 'actualizar': $part->__SET("IdParticipante", $id); $part->__SET("Nombre", $_POST['nombre']); $part->__SET("Apellidos", $_POST['apellidos']); $part->__SET("Poblacion", $_POST['poblacion']); $part->__SET("CLUB", $_POST['club']); $model->actualizar($part); 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. -->
<?php require_once './participante.entidad.php'; require_once './participante.modelo.php'; $tienda = new Participante1(); $model = new ParticipanteModel(); if (isset($_GET['action'])) { $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: