Mini Shell
<fieldset class="box">
<legend>Parceiros</legend>
<nav class="pannel">
<?PHP echo $this->Html->link('Adicionar novo',array('action'=>'add')); ?>
</nav>
<table class="tables">
<thead>
<tr>
<td class="thumb"><a>Imagem</a></td>
<td><?PHP echo $this->Paginator->sort('title','TÃtulo')?></td>
<td class="edit"> </td>
<td class="delete"> </td>
</tr>
</thead>
<tbody class="sortable">
<?PHP foreach($posts as $post){ ?>
<tr data-id="<?PHP echo $post['Parceiro']['id']; ?>">
<!--<td><?PHP // if($post['Parceiro']['imagem']) echo $this->Fill->image($post['Parceiro']['imagem'],66,44,'ffffff'); ?></td>-->
<td><?PHP if($post['Parceiro']['imagem']) echo $this->Html->image('/'.$post['Parceiro']['imagem'],array('width'=>'55')); ?></td>
<td><?PHP echo $post['Parceiro']['title']?></td>
<td><?PHP echo $this->Html->link('Editar',array('action'=>'edit',$post['Parceiro']['id']))?></td>
<td><?PHP echo $this->Html->link('Excluir',array('action'=>'delete',$post['Parceiro']['id']),false,'Tem certeza?')?></td>
</tr>
<?PHP } ?>
</tbody>
</table>
<?PHP echo $this->element('Painel.paginator');?>
</fieldset>
<script>
var base='<?= $this->base ?>';
jQuery(function($){
$(".sortable").sortable({
stop:function(evt,ui){
$(".sortable>tr").each(function(i,e){
var id=$(e).attr('data-id');
var index=$(e).index();
$.getJSON(base+'/admin/parceiros/parceiros/order/'+id+'/'+index,function(data){
});
});
}
});
});
</script>
Zerion Mini Shell 1.0