pictcode / app / View / Images / index.ctp @ dd7691f4
履歴 | 表示 | アノテート | ダウンロード (4.436 KB)
| 1 |
<script type="text/javascript"> |
|---|---|
| 2 |
// When the document is ready set up our sortable with it's inherant function(s) |
| 3 |
$(document).ready(function() {
|
| 4 |
$("#sortable tbody").sortable({
|
| 5 |
update : function () {
|
| 6 |
var order = $('#sortable tbody').sortable('toArray');
|
| 7 |
$.post("/images/ajax_sort_change/",{
|
| 8 |
id:order |
| 9 |
},function(data){
|
| 10 |
}); |
| 11 |
} |
| 12 |
}); |
| 13 |
}); |
| 14 |
</script> |
| 15 |
|
| 16 |
<div class="images index"> |
| 17 |
<h2><?php echo __('Images'); ?></h2>
|
| 18 |
|
| 19 |
<div class="section form_search"> |
| 20 |
<?php echo $this->Form->create('Image', array(
|
| 21 |
'novalidate' => true, |
| 22 |
'inputDefaults' => array( |
| 23 |
'div' => 'form-group', |
| 24 |
'wrapInput' => false, |
| 25 |
'class' => 'form-control' |
| 26 |
), |
| 27 |
'div' =>false, |
| 28 |
'class' => 'well well-sm', |
| 29 |
'url' => array_merge(array( |
| 30 |
'action' => 'index'), |
| 31 |
$this->params['pass']) )); ?> |
| 32 |
<fieldset> |
| 33 |
<legend>検索</legend> |
| 34 |
<?php echo $this->Form->input('name', array(
|
| 35 |
'legend' => false, |
| 36 |
'placeholder' => '例)kkk', |
| 37 |
'label' => '名前' |
| 38 |
) |
| 39 |
); ?> |
| 40 |
<?php echo $this->Form->input('type', array(
|
| 41 |
'label'=>'ステータス', |
| 42 |
'legend' => false, |
| 43 |
'type'=>'select', |
| 44 |
'options'=>array( |
| 45 |
'0' => 'expire', '1' => 'active' ,'2'=>'削除済み' |
| 46 |
), |
| 47 |
'empty'=>'選択してください')); ?> |
| 48 |
<?php echo $this->Form->submit('検索', array('div' => false,'class' => 'btn btn-danger')); ?>
|
| 49 |
<?php echo $this->Form->end(); ?> |
| 50 |
</fieldset> |
| 51 |
</div> |
| 52 |
|
| 53 |
<?php echo $this->Paginator->counter(array('format' => __('全{:count}件中 {:start}-{:end}件を表示'))); ?>
|
| 54 |
|
| 55 |
|
| 56 |
<table id="sortable" cellpadding="0" cellspacing="0" class="table table-striped"> |
| 57 |
<thead> |
| 58 |
<tr> |
| 59 |
<th><?php echo $this->Paginator->sort('id'); ?></th>
|
| 60 |
<th><?php echo $this->Paginator->sort('name'); ?></th>
|
| 61 |
<th><?php echo $this->Paginator->sort('image_file_name'); ?></th>
|
| 62 |
<th><?php echo $this->Paginator->sort('status'); ?></th>
|
| 63 |
<th><?php echo $this->Paginator->sort('created'); ?></th>
|
| 64 |
<th><?php echo $this->Paginator->sort('updated'); ?></th>
|
| 65 |
<th class="actions"><?php echo __('Actions'); ?></th>
|
| 66 |
</tr> |
| 67 |
</thead> |
| 68 |
<tbody> |
| 69 |
<?php foreach ($images as $image): ?> |
| 70 |
<tr id="<?php echo $image['Image']['id']?>"> |
| 71 |
<td><span class="glyphicon glyphicon-list"></span></td> |
| 72 |
<td><?php echo h($image['Image']['name']); ?> </td> |
| 73 |
<td><?php echo h($image['Image']['image_file_name']); ?> <?php echo $this->upload->uploadImage($image, 'Image.image', array('style' => 'thumb')); ?></td>
|
| 74 |
<td><?php echo h($image['Image']['status']); ?> </td> |
| 75 |
<td><?php echo h($image['Image']['created']); ?> </td> |
| 76 |
<td><?php echo h($image['Image']['updated']); ?> </td> |
| 77 |
<td class="actions"> |
| 78 |
<?php echo $this->Html->link(__('View'), array('action' => 'view', $image['Image']['id']),array('class'=>'btn btn-primary')); ?>
|
| 79 |
<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $image['Image']['id']),array('class'=>'btn btn-primary')); ?>
|
| 80 |
<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $image['Image']['id']),array('class'=>'btn btn-primary','confirm' => __('削除しますか?', $image['Image']['id']))); ?>
|
| 81 |
<?php echo $this->Form->postLink(__('抹消'), array('action' => 'compdelete', $image['Image']['id']),array('class'=>'btn btn-danger-outline','confirm' => __('完全に抹消されます。よろしいすか?', $image['Image']['id']))); ?>
|
| 82 |
</td> |
| 83 |
</tr> |
| 84 |
<?php endforeach; ?> |
| 85 |
</tbody> |
| 86 |
</table> |
| 87 |
<p> |
| 88 |
<?php |
| 89 |
echo $this->Paginator->counter(array( |
| 90 |
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
|
| 91 |
)); |
| 92 |
?> </p> |
| 93 |
<div class="paging"> |
| 94 |
<nav> |
| 95 |
<ul class="pager"> |
| 96 |
<?php |
| 97 |
echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
|
| 98 |
echo $this->Paginator->numbers(array('separator' => ''));
|
| 99 |
echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
|
| 100 |
?> |
| 101 |
</ul> |
| 102 |
</nav> |
| 103 |
</div> |
| 104 |
</div> |
| 105 |
<!-- <div class="actions"> |
| 106 |
<h3><?php echo __('Actions'); ?></h3>
|
| 107 |
<ul> |
| 108 |
<li><?php echo $this->Html->link(__('New Image'), array('action' => 'add'),array('class'=>'btn btn-warning')); ?></li>
|
| 109 |
</ul> |
| 110 |
</div>--> |