Exemplo n.º 1
0
<?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:
Exemplo n.º 2
0
<?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.
-->
Exemplo n.º 3
0
<?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("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;
    }