Ajustando documentos form
This commit is contained in:
parent
356d6527b9
commit
f341dc41be
2 changed files with 23 additions and 1 deletions
22
vendor/model/Companies.class.php
vendored
22
vendor/model/Companies.class.php
vendored
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
2
vendor/view/documents/documents_form.php
vendored
2
vendor/view/documents/documents_form.php
vendored
|
|
@ -91,7 +91,7 @@ try{
|
|||
<option value="" selected>Selecione</option>
|
||||
<?php
|
||||
|
||||
$CompaniesResult = $Companies->All(null, null, null, null);
|
||||
$CompaniesResult = $Companies->Select();
|
||||
foreach($CompaniesResult as $CompaniesKey => $Result){
|
||||
?>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue