diff --git a/vendor/model/Companies.class.php b/vendor/model/Companies.class.php index 5046f9a..3691f77 100644 --- a/vendor/model/Companies.class.php +++ b/vendor/model/Companies.class.php @@ -412,6 +412,28 @@ class Companies } + /** Lista os clientes para um combobox */ + public function Select() + { + + /** Consulta SQL */ + $this->sql = 'select c.* + from companies c + left join situations s on s.situation_id = c.situation_id + where s.situation_id = 1 + order by c.nickname'; + + /** Preparo o SQL para execução */ + $this->stmt = $this->connection->connect()->prepare($this->sql); + + /** Executo o SQL */ + $this->stmt->execute(); + + /** Retorno o resultado */ + return $this->stmt->fetchAll(\PDO::FETCH_OBJ); + + } + /** Fecha uma conexão aberta anteriormente com o banco de dados */ function __destruct() { diff --git a/vendor/view/documents/documents_form.php b/vendor/view/documents/documents_form.php index cd28a43..56fdf57 100644 --- a/vendor/view/documents/documents_form.php +++ b/vendor/view/documents/documents_form.php @@ -91,7 +91,7 @@ try{ All(null, null, null, null); + $CompaniesResult = $Companies->Select(); foreach($CompaniesResult as $CompaniesKey => $Result){ ?>