Skip to content

Commit

Permalink
Implementação da funcionalidade de inserir na tabela contribuicao_log…
Browse files Browse the repository at this point in the history
… [Issue #728]
  • Loading branch information
GabrielPintoSouza committed Sep 25, 2024
1 parent 799efbc commit 78f5bd9
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 22 deletions.
45 changes: 45 additions & 0 deletions html/apoio/dao/ContribuicaoLogDAO.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
//requisitar arquivo de conexão
require_once '../dao/ConexaoDAO.php';

//requisitar model
require_once '../model/ContribuicaoLog.php';

class ContribuicaoLogDAO{
private $pdo;

public function __construct()
{
$this->pdo = ConexaoDAO::conectar();
}

public function criar(ContribuicaoLog $contribuicaoLog){
$sqlInserirContribuicaoLog = "INSERT INTO contribuicao_log (
id_socio,
codigo,
valor,
data_geracao,
data_vencimento,
status_pagamento
)
VALUES (
:idSocio,
:codigo,
:valor,
:dataGeracao,
:dataVencimento,
:statusPagamento
)
";

$stmt = $this->pdo->prepare($sqlInserirContribuicaoLog);
$stmt->bindParam(':idSocio', $contribuicaoLog->getIdSocio());
$stmt->bindParam(':codigo', $contribuicaoLog->getCodigo());
$stmt->bindParam(':valor', $contribuicaoLog->getValor());
$stmt->bindParam(':dataGeracao', $contribuicaoLog->getDataGeracao());
$stmt->bindParam(':dataVencimento', $contribuicaoLog->getDataVencimento());
$stmt->bindParam(':statusPagamento', $contribuicaoLog->getStatusPagamento());

$stmt->execute();
}
}
44 changes: 22 additions & 22 deletions html/apoio/model/ContribuicaoLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ class ContribuicaoLog{
private $id;
private $valor;
private $codigo;
private $data_geracao;
private $data_vencimento;
private $id_socio;
private $statusPagamento;
private $dataGeracao;
private $dataVencimento;
private $idSocio;
private $statusPagamento = 0;

/**
* Get the value of id
Expand Down Expand Up @@ -69,61 +69,61 @@ public function setCodigo($codigo)
}

/**
* Get the value of data_geracao
* Get the value of dataGeracao
*/
public function getData_geracao()
public function getDataGeracao()
{
return $this->data_geracao;
return $this->dataGeracao;
}

/**
* Set the value of data_geracao
* Set the value of dataGeracao
*
* @return self
*/
public function setData_geracao($data_geracao)
public function setDataGeracao($dataGeracao)
{
$this->data_geracao = $data_geracao;
$this->dataGeracao = $dataGeracao;

return $this;
}

/**
* Get the value of data_vencimento
* Get the value of dataVencimento
*/
public function getData_vencimento()
public function getDataVencimento()
{
return $this->data_vencimento;
return $this->dataVencimento;
}

/**
* Set the value of data_vencimento
* Set the value of dataVencimento
*
* @return self
*/
public function setData_vencimento($data_vencimento)
public function setDataVencimento($dataVencimento)
{
$this->data_vencimento = $data_vencimento;
$this->dataVencimento = $dataVencimento;

return $this;
}

/**
* Get the value of id_socio
* Get the value of idSocio
*/
public function getId_socio()
public function getIdSocio()
{
return $this->id_socio;
return $this->idSocio;
}

/**
* Set the value of id_socio
* Set the value of idSocio
*
* @return self
*/
public function setId_socio($id_socio)
public function setIdSocio($idSocio)
{
$this->id_socio = $id_socio;
$this->idSocio = $idSocio;

return $this;
}
Expand Down

0 comments on commit 78f5bd9

Please sign in to comment.