Atualizando financial_categories_datagrid.php
This commit is contained in:
parent
b98c8113cc
commit
1b7d118956
1 changed files with 30 additions and 2 deletions
|
|
@ -2,12 +2,14 @@
|
|||
|
||||
/** Importação de classes */
|
||||
use vendor\model\FinancialCategories;
|
||||
use vendor\controller\FinancialCategoriesValidate;
|
||||
|
||||
/** Verifica se o token de acesso é válido */
|
||||
if($Main->verifyToken()){
|
||||
|
||||
/** Instânciamento de classes */
|
||||
$FinancialCategories = new FinancialCategories();
|
||||
$FinancialCategoriesValidate = new FinancialCategoriesValidate();
|
||||
|
||||
/** Carrega as configurações de paginação */
|
||||
$config = $Main->LoadConfigPublic();
|
||||
|
|
@ -17,8 +19,19 @@ if($Main->verifyToken()){
|
|||
$page = strtolower(isset($_POST['page']) ? (int)$Main->antiInjection( filter_input(INPUT_POST,'page', FILTER_SANITIZE_SPECIAL_CHARS) ) : 0);
|
||||
$max = isset($settings->{'app'}->{'datagrid'}->{'rows'}) ? $settings->{'app'}->{'datagrid'}->{'rows'} : 20;
|
||||
|
||||
/** Parametros de consulta */
|
||||
$description = isset($_POST['search']) ? (string)filter_input(INPUT_POST,'search', FILTER_SANITIZE_SPECIAL_CHARS) : '%';
|
||||
|
||||
/** Verifica se a consulta foi informada */
|
||||
if( !empty($description) ){
|
||||
|
||||
/** Validando os campos de entrada */
|
||||
$FinancialCategoriesValidate->setDescription($description);
|
||||
|
||||
}
|
||||
|
||||
/** Consulta a quantidade de registros */
|
||||
$NumberRecords = $FinancialCategories->Count()->qtde;
|
||||
$NumberRecords = $FinancialCategories->Count($FinancialCategoriesValidate->getDescription())->qtde;
|
||||
|
||||
/** Verifico a quantidade de registros localizados */
|
||||
if ($NumberRecords > 0){ //Caso tenha registros cadastrados, carrego o layout
|
||||
|
|
@ -54,6 +67,21 @@ if($Main->verifyToken()){
|
|||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<form class="row" id="frmSearchFinancialMovements">
|
||||
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<!--<label for="fantasy_name">Pesquisa: </label>-->
|
||||
<input type="text" class="form-control w-100" id="search" name="search" value="<?php echo $FinancialMovementsValidate->getDescription();?>" placeholder="Pesquisar..." data-toggle="tooltip" data-placement="top" title="Informe sua consulta" >
|
||||
<span class="glyphicon glyphicon-user form-control-feedback"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table table-bordered table-striped table-hover bg-white rounded shadow-sm table-sm" id="tableFinancialCategories" width="100%" cellspacing="0">
|
||||
|
|
@ -73,7 +101,7 @@ if($Main->verifyToken()){
|
|||
<?php
|
||||
|
||||
/** Consulta as categorias de documentos cadastradas*/
|
||||
$FinancialCategoriesResult = $FinancialCategories->All($start, $max);
|
||||
$FinancialCategoriesResult = $FinancialCategories->All($start, $max, $FinancialCategoriesValidate->getDescription());
|
||||
foreach($FinancialCategoriesResult as $FinancialCategoriesKey => $Result){
|
||||
?>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue