33 lines
821 B
PHP
33 lines
821 B
PHP
<?php
|
|
require_once('../db.php');
|
|
|
|
class Reserva
|
|
{
|
|
private $id;
|
|
private $fecha;
|
|
private $cliente_id;
|
|
|
|
public function __construct()
|
|
{
|
|
}
|
|
|
|
public function get_id() { return $this->id; }
|
|
public function set_id($id) { $this->id = $id; }
|
|
public function get_fecha() { return $this->fecha; }
|
|
public function set_fecha($fecha) { $this->fecha = $fecha; }
|
|
public function get_cliente_id() { return $this->cliente_id; }
|
|
public function set_cliente_id($cliente_id) { $this->cliente_id = $cliente_id; }
|
|
|
|
public function save()
|
|
{
|
|
$db = new DB();
|
|
$result = $db->dml
|
|
(
|
|
"insert into reserva (id, fecha, cliente) values (?, ?, ?)",
|
|
$this->id, $this->fecha, $this->cliente_id
|
|
);
|
|
return $result > 0;
|
|
}
|
|
}
|
|
?>
|