This commit is contained in:
Kenio 2025-07-16 16:26:33 -03:00
parent d8ee39e255
commit 2dd03d01f1
3 changed files with 16 additions and 23 deletions

View file

@ -60,8 +60,6 @@ try{
$CompaniesValidate->setContractDate($contractDate);
$CompaniesValidate->setComputers($computers);
$CompaniesValidate->setServers($servers);
echo $CompaniesValidate->getUserId();
/** Verifica se não existem erros a serem informados,
* caso não haja erro(s) salvo os dados do cliente ou

View file

@ -82,7 +82,7 @@ class CompaniesValidate
{
/** Trata a entrada da informação */
echo $this->userId = $userId > 0 ? (int)$this->Main->antiInjection($userId) : 0;
$this->userId = $userId > 0 ? (int)$this->Main->antiInjection($userId) : 0;
/** Verifica se a informação foi informada */
if($this->userId == 0)

View file

@ -167,7 +167,7 @@ class Companies
string $complement,
string $district,
string $cityId,
string $stateInitials,
string $stateId,
string $active,
int $userId)
{
@ -183,7 +183,7 @@ class Companies
$this->complement = $complement;
$this->district = $district;
$this->cityId = $cityId;
$this->stateInitials = $stateInitials;
$this->stateId = $stateId;
$this->active = $active;
$this->userId = $userId;
@ -199,9 +199,8 @@ class Companies
number = :number,
complement = :complement,
district = :district,
city = :city,
state = :state,
state_initials = :state_initials,
city_id = :city_id,
state_id = :state_id,
active = :active
where company_id = :company_id';
@ -218,9 +217,8 @@ class Companies
$this->stmt->bindParam('number', $this->number);
$this->stmt->bindParam('complement', $this->complement);
$this->stmt->bindParam('district', $this->district);
$this->stmt->bindParam('city', $this->city);
$this->stmt->bindParam('state', $this->state);
$this->stmt->bindParam('state_initials', $this->stateInitials);
$this->stmt->bindParam('city_id', $this->cityId);
$this->stmt->bindParam('state_id', $this->stateId);
$this->stmt->bindParam('active', $this->active);
}else{//Se o ID não foi informado, grava-se um novo registro
@ -236,9 +234,8 @@ class Companies
number,
complement,
district,
city,
state,
state_initials,
city_id,
state_id,
active
) values (:company_id,
:user_id,
@ -250,9 +247,8 @@ class Companies
:number,
:complement,
:district,
:city,
:state,
:state_initials,
:city_id,
:state_id,
:active)';
@ -261,18 +257,17 @@ class Companies
/** Preencho os parâmetros do SQL */
$this->stmt->bindParam('company_id', $this->companyId);
$this->stmt->bindParam('users_id', $_SESSION['USERSID']);/** Informa o usuário responsável pelo nova empresa cadastrada */
$this->stmt->bindParam('users_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('document', $this->document);
$this->stmt->bindParam('zip_code', $this->zipCode);
$this->stmt->bindParam('cnpj', $this->cnpj);
$this->stmt->bindParam('cep', $this->cep);
$this->stmt->bindParam('adress', $this->adress);
$this->stmt->bindParam('number', $this->number);
$this->stmt->bindParam('complement', $this->complement);
$this->stmt->bindParam('district', $this->district);
$this->stmt->bindParam('city', $this->city);
$this->stmt->bindParam('state', $this->state);
$this->stmt->bindParam('state_initials', $this->stateInitials);
$this->stmt->bindParam('city_id', $this->cityId);
$this->stmt->bindParam('state_id', $this->stateId);
$this->stmt->bindParam('active', $this->active);
}