Advertisement
Guest User

Untitled

a guest
May 26th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1.  
  2. $path = dirname( __FILE__ );
  3.  
  4. require_once( $path . '/crud_class.php');
  5.  
  6. final class Historico extends Crud
  7. {
  8. protected $table = "historico_saude";
  9.  
  10. private $id_cliente;
  11. private $esporte;
  12. private $diabete;
  13. private $medicamentos;
  14. private $rh;
  15. private $p_arterial;
  16. //private $saude_m;
  17. private $fuma;
  18. private $bebe;
  19. private $drogas;
  20. private $cirurgia;
  21. private $queloide;
  22. private $hepatite;
  23. private $pdt;
  24. private $alergia;
  25.  
  26.  
  27. public function __set($propriedade, $valor)
  28. {
  29. $this->$propriedade = $valor;
  30. }
  31.  
  32. public function __get($valor)
  33. {
  34. return $valor = $valor;
  35. }
  36.  
  37.  
  38. public function insert()
  39. {
  40. $sql = "INSERT INTO $this->table
  41. (
  42. id_cliente, esporte, diabete, medicamentos, rh, p_arterial, fuma,
  43. bebe, drogas, cirurgia, queloide, hepatite, pdt, alergia
  44. )
  45. VALUES
  46. (
  47. :id_cliente, :esporte, :diabete, :medicamentos, :rh, :p_arterial, :fuma,
  48. :bebe, :drogas, :cirurgia, :queloide, :hepatite, :pdt, :alergia
  49. )";
  50.  
  51. $start = DB::prepare($sql);
  52. //$start->bindParam(":id_historico", $this->id_historico, PDO::PARAM_STR);
  53. $start->bindParam(":id_cliente", $this->id_cliente, PDO::PARAM_STR);
  54. $start->bindParam(":esporte", $this->esporte, PDO::PARAM_STR);
  55. $start->bindParam(':diabete', $this->diabete, PDO::PARAM_STR);
  56. $start->bindParam(':medicamentos', $this->medicamentos, PDO::PARAM_STR);
  57. $start->bindParam(':rh', $this->rh, PDO::PARAM_STR);
  58. $start->bindParam(':p_arterial', $this->p_arterial, PDO::PARAM_STR);
  59. //$start->bindParam(':saude_m', $this->saude_m, PDO::PARAM_STR);
  60. $start->bindParam(':fuma', $this->fuma, PDO::PARAM_STR);
  61. $start->bindParam(':bebe', $this->bebe, PDO::PARAM_STR);
  62. $start->bindParam(':drogas', $this->drogas, PDO::PARAM_STR);
  63. $start->bindParam(':cirurgia', $this->cirurgia, PDO::PARAM_STR);
  64. $start->bindParam(':queloide', $this->queloide, PDO::PARAM_STR);
  65. $start->bindParam(':hepatite', $this->hepatite, PDO::PARAM_STR);
  66. $start->bindParam(':pdt', $this->pdt, PDO::PARAM_STR);
  67. $start->bindParam(':alergia', $this->alergia, PDO::PARAM_STR);
  68.  
  69. return $start->execute();
  70. }
  71.  
  72.  
  73.  
  74. }
  75.  
  76. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement