Adicionando classe Cities.class.php ao projeto
This commit is contained in:
parent
7ff52c2db5
commit
f13f6211ad
2 changed files with 68 additions and 10 deletions
58
vendor/model/Cities.class.php
vendored
Normal file
58
vendor/model/Cities.class.php
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/** Defino o local da classe */
|
||||
namespace vendor\model;
|
||||
|
||||
class Cities
|
||||
{
|
||||
|
||||
/** Variaveis da classe */
|
||||
private $connection = null;
|
||||
private $sql = null;
|
||||
private $stmt = null;
|
||||
|
||||
private $state_id = null;
|
||||
|
||||
/** Construtor da classe */
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
/** Instanciamento da classe */
|
||||
$this->connection = new MySql();
|
||||
|
||||
}
|
||||
|
||||
/** Listagem de todos os registros */
|
||||
public function all($state_id)
|
||||
{
|
||||
|
||||
/** Parâmetros de entrad */
|
||||
$this->state_id = $state_id;
|
||||
|
||||
/** Montagem do SQL */
|
||||
$this->sql = 'SELECT * FROM cities WHERE state_id = :state_id ORDER BY name ASC';
|
||||
|
||||
/** Preparo o SQL para execução */
|
||||
$this->stmt = $this->connection->connect()->prepare($this->sql);
|
||||
|
||||
/** Preencho os valores */
|
||||
$this->stmt->bindParam(':state_id', $this->state_id);
|
||||
|
||||
/** Executo o SQL */
|
||||
$this->stmt->execute();
|
||||
|
||||
/** Retorno o resultado */
|
||||
return $this->stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
|
||||
}
|
||||
|
||||
/** Destrutor da classe */
|
||||
public function __destruct()
|
||||
{
|
||||
|
||||
/** Instanciamento da classe */
|
||||
$this->connection = null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
20
vendor/view/companies/companies_form.php
vendored
20
vendor/view/companies/companies_form.php
vendored
|
|
@ -111,20 +111,20 @@ try{
|
|||
|
||||
<div class="col-sm-6 mb-2">
|
||||
|
||||
<label for="client_name">Razão Social / Nome: <span class="text-danger">* Obrigatório</span></label>
|
||||
<input type="text" class="form-control form-control" maxlength="255" id="client_name" name="client_name" value="<?php echo $CompaniesResult->client_name;?>" placeholder="Informe a razão social da empresa">
|
||||
<label for="name_business">Razão Social / Nome: <span class="text-danger">* Obrigatório</span></label>
|
||||
<input type="text" class="form-control form-control" maxlength="255" id="name_business" name="name_business" value="<?php echo $CompaniesResult->name_business;?>" placeholder="Informe a razão social da empresa">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4 mb-2">
|
||||
|
||||
<label for="fantasy_name">Nome Fantasia:</label>
|
||||
<input type="text" class="form-control form-control" maxlength="120" id="fantasy_name" name="fantasy_name" value="<?php echo $CompaniesResult->fantasy_name;?>" placeholder="Informe o nome fantasia da empresa">
|
||||
<label for="name_fantasy">Nome Fantasia:</label>
|
||||
<input type="text" class="form-control form-control" maxlength="120" id="name_fantasy" name="name_fantasy" value="<?php echo $CompaniesResult->name_fantasy;?>" placeholder="Informe o nome fantasia da empresa">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 mb-2">
|
||||
|
||||
<label for="fantasy_name">Referência:</label>
|
||||
<input type="text" class="form-control form-control number" maxlength="20" id="reference" name="reference" value="<?php echo $CompaniesResult->reference;?>" placeholder="Informe o código referência da empresa">
|
||||
<label for="cns">CNS:</label>
|
||||
<input type="text" class="form-control form-control number" maxlength="20" id="reference" name="reference" value="<?php echo $CompaniesResult->cns;?>" placeholder="Informe o código referência da empresa">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -133,14 +133,14 @@ try{
|
|||
|
||||
<div class="col-sm-3 mb-2">
|
||||
|
||||
<label for="document">CPF / CNPJ: <span class="text-danger">* Obrigatório</span></label>
|
||||
<input type="text" class="form-control form-control number" maxlength="14" id="document" name="document" value="<?php echo $CompaniesResult->document;?>" placeholder="Informe CPF/CNPJ">
|
||||
<label for="cnpj">CPF / CNPJ: <span class="text-danger">* Obrigatório</span></label>
|
||||
<input type="text" class="form-control form-control number" maxlength="14" id="cnpj" name="cnpj" value="<?php echo $CompaniesResult->cnpj;?>" placeholder="Informe CPF/CNPJ">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3 mb-2">
|
||||
|
||||
<label for="zip_code">CEP:</label>
|
||||
<input type="text" class="form-control form-control postal_code" maxlength="9" id="zip_code" name="zip_code" value="<?php echo $CompaniesResult->zip_code;?>" placeholder="Informe o CEP">
|
||||
<label for="cep">CEP:</label>
|
||||
<input type="text" class="form-control form-control postal_code" maxlength="9" id="cep" name="cep" value="<?php echo $CompaniesResult->cep;?>" placeholder="Informe o CEP">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4 mb-2">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue