diff --git a/vendor/action/companies/companies_save.php b/vendor/action/companies/companies_save.php index bf02c27..963d8c8 100644 --- a/vendor/action/companies/companies_save.php +++ b/vendor/action/companies/companies_save.php @@ -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 diff --git a/vendor/model/Companies.class.php b/vendor/model/Companies.class.php index 26a8e01..a89c29a 100644 --- a/vendor/model/Companies.class.php +++ b/vendor/model/Companies.class.php @@ -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); }