Last active
August 29, 2015 14:02
-
-
Save eddpascoal/c870367da4f6e40e0640 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- BackOffice --> | |
<?php | |
$this->Paginator->options( | |
array('update' => '#lista_clientes', | |
'url'=>array('controller'=>'Users', 'action'=>'myclients'), | |
'evalScripts' => true | |
) | |
); | |
?> | |
<div id="lista_clientes"> | |
<div class="row"> | |
<div class="page page_text"> | |
<h3>Os meus clientes</h3> | |
<div style="display:inline-block; width:100%" id="conta"> | |
<div class="three columns"> | |
<div class="medium default btn"> | |
<?php echo $this->Html->link("Adicionar Novo", '/Users/add_bk'); ?> | |
</div> | |
</div> | |
<div class="nine columns"> | |
<h5>Clientes</h5> | |
<div class="datagrid"> | |
<table> | |
<thead> | |
<tr> | |
<th>Id</th> | |
<th>Nome</th> | |
<th>Apelido</th> | |
<th>Editar</th> | |
<th>Remover</th> | |
</tr> | |
</thead> | |
<tbody> | |
<?php if ($this->Paginator->param('pageCount') == 0) { // Se for vazio coloco um warning a seguir à tabela. | |
echo "</tbody> | |
</table> | |
<div class='warning alert' >".__("Não foram encontrados conteúdos.")."</div>"; | |
}else{ ?> | |
<?php $a=0; | |
foreach ($Users as $u): | |
if($a==0){$a=1; | |
?> | |
<tr> | |
<?php }else{?> | |
<tr class="alt"> | |
<?php $a=0;}?> | |
<td><?php echo $this->Html->link($u['User']['id'], '/Users/view'); ?></td> | |
<td><?php echo $u['User']['nome']; ?></td> | |
<td><?php echo $u['User']['apelidos']; ?></td> | |
<td><?php echo $this->Html->link('Editar', '/Users/edit/'.$u['User']['id']); ?></td> | |
<td> | |
<?php echo $this->Js->link( | |
'Remover', | |
'/Users/remove/'.$u['User']['id'].'/page:'.$this->Paginator->counter(array('format' => '%page%')), | |
array('target' => '_self', 'update' => '#lista_clientes', 'escape' => false, 'confirm' => 'Tem a certeza que quer apagar o conteúdo?')); | |
?> | |
</td> | |
</tr> | |
<?php endforeach; | |
} | |
?> | |
</tbody> | |
</table> | |
</div> | |
<div class="pagination clearfix"> | |
<?php if ($this->Paginator->counter(array('format' => '%pages%')) > 1) { ?> | |
<!--<?php echo $this->Paginator->first("|<", array('escape' => false), null, array()); ?>--> | |
<?php echo $this->Paginator->prev("«", array('escape' => false), null, array()); ?> | |
<?php } ?> | |
<?php echo $this->Paginator->numbers(array('currentTag' =>'strong', 'separator' => '', 'class' => '')); ?> | |
<?php if ($this->Paginator->counter(array('format' => '%pages%')) > 1 && $this->Paginator->counter(array('format' => '%page%')) < $this->Paginator->counter(array('format' => '%pages%'))) { ?> | |
<?php echo $this->Paginator->next("»", array('escape' => false), null,array()); ?> | |
<!--<?php echo $this->Paginator->last(">|", array('escape' => false), null); ?>--> | |
<?php } ?> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<?php if($this->layout == 'ajax') | |
echo $this->Js->writeBuffer();?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment