Ajustando documentos form

This commit is contained in:
Kenio 2025-09-09 10:00:06 -03:00
parent 356d6527b9
commit f341dc41be
2 changed files with 23 additions and 1 deletions

View file

@ -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()
{

View file

@ -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){
?>