Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $path = dirname( __FILE__ );
- require_once( $path . '/crud_class.php');
- final class Historico extends Crud
- {
- protected $table = "historico_saude";
- private $id_cliente;
- private $esporte;
- private $diabete;
- private $medicamentos;
- private $rh;
- private $p_arterial;
- //private $saude_m;
- private $fuma;
- private $bebe;
- private $drogas;
- private $cirurgia;
- private $queloide;
- private $hepatite;
- private $pdt;
- private $alergia;
- public function __set($propriedade, $valor)
- {
- $this->$propriedade = $valor;
- }
- public function __get($valor)
- {
- return $valor = $valor;
- }
- public function insert()
- {
- $sql = "INSERT INTO $this->table
- (
- id_cliente, esporte, diabete, medicamentos, rh, p_arterial, fuma,
- bebe, drogas, cirurgia, queloide, hepatite, pdt, alergia
- )
- VALUES
- (
- :id_cliente, :esporte, :diabete, :medicamentos, :rh, :p_arterial, :fuma,
- :bebe, :drogas, :cirurgia, :queloide, :hepatite, :pdt, :alergia
- )";
- $start = DB::prepare($sql);
- //$start->bindParam(":id_historico", $this->id_historico, PDO::PARAM_STR);
- $start->bindParam(":id_cliente", $this->id_cliente, PDO::PARAM_STR);
- $start->bindParam(":esporte", $this->esporte, PDO::PARAM_STR);
- $start->bindParam(':diabete', $this->diabete, PDO::PARAM_STR);
- $start->bindParam(':medicamentos', $this->medicamentos, PDO::PARAM_STR);
- $start->bindParam(':rh', $this->rh, PDO::PARAM_STR);
- $start->bindParam(':p_arterial', $this->p_arterial, PDO::PARAM_STR);
- //$start->bindParam(':saude_m', $this->saude_m, PDO::PARAM_STR);
- $start->bindParam(':fuma', $this->fuma, PDO::PARAM_STR);
- $start->bindParam(':bebe', $this->bebe, PDO::PARAM_STR);
- $start->bindParam(':drogas', $this->drogas, PDO::PARAM_STR);
- $start->bindParam(':cirurgia', $this->cirurgia, PDO::PARAM_STR);
- $start->bindParam(':queloide', $this->queloide, PDO::PARAM_STR);
- $start->bindParam(':hepatite', $this->hepatite, PDO::PARAM_STR);
- $start->bindParam(':pdt', $this->pdt, PDO::PARAM_STR);
- $start->bindParam(':alergia', $this->alergia, PDO::PARAM_STR);
- return $start->execute();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement