This commit is contained in:
Kenio 2025-07-16 17:24:18 -03:00
parent cdc46dfdf6
commit 266a4506bf
2 changed files with 43 additions and 21 deletions

View file

@ -55,7 +55,8 @@ try{
$CompaniesValidate->setContractDate($contractDate);
$CompaniesValidate->setComputers($computers);
$CompaniesValidate->setServers($servers);
$CompaniesValidate->setcompanyId($companyId);
$CompaniesValidate->setCompanyId($companyId);
$CompaniesValidate->setUserId($userId);
/** Verifica se não existem erros a serem informados,
* caso não haja erro(s) salvo os dados do cliente ou

View file

@ -240,40 +240,53 @@ class Companies
}else{//Se o ID não foi informado, grava-se um novo registro
/** Consulta SQL */
$this->sql = 'insert into companies(company_id,
user_id,
name_business,
name_fantasy,
document,
cep,
$this->sql = 'insert into companies(name_business,
name_fantasy,
cnpj,
cep,
adress,
number,
complement,
district,
city_id,
number,
complement,
district,
city_id,
state_id,
active
) values (:company_id,
:user_id,
:name_business,
active,
type,
responsible,
email,
referene
responsible_document,
contract_date,
computers,
servers,
userId
) values (:name_business,
:name_fantasy,
:document,
:cnpj,
:cep,
:adress,
:adress,
:number,
:complement,
:district,
:city_id,
:state_id,
:active)';
:state_id,
:active,
:type,
:responsible,
:email,
:referene,
:responsible_document,
:contract_date,
:computers,
:servers,
:user_id)';
/** Preparo o sql para receber os valores */
$this->stmt = $this->connection->connect()->prepare($this->sql);
/** Preencho os parâmetros do SQL */
$this->stmt->bindParam('company_id', $this->companyId);
$this->stmt->bindParam('users_id', $this->userId);/** Informa o usuário responsável pelo nova empresa cadastrada */
$this->stmt->bindParam('user_id', $this->userId);/** Informa o usuário responsável pelo nova empresa cadastrada */
$this->stmt->bindParam('name_business', $this->nameBusiness);
$this->stmt->bindParam('name_fantasy', $this->nameFantasy);
$this->stmt->bindParam('cnpj', $this->cnpj);
@ -285,6 +298,14 @@ class Companies
$this->stmt->bindParam('city_id', $this->cityId);
$this->stmt->bindParam('state_id', $this->stateId);
$this->stmt->bindParam('active', $this->active);
$this->stmt->bindParam('type', $this->type);
$this->stmt->bindParam('responsible', $this->responsible);
$this->stmt->bindParam('email', $this->email);
$this->stmt->bindParam('referene', $this->referene);
$this->stmt->bindParam('responsible_document', $this->responsible_document);
$this->stmt->bindParam('contract_date', $this->contract_date);
$this->stmt->bindParam('computers', $this->computers);
$this->stmt->bindParam('servers', $this->servers);
}