commit dd7691f49b6ed913c60ca963661fc0f21a9f5165
Author: root <root@localhost.localdomain>
Date:   Thu Feb 4 23:29:26 2016 -0500

    ImageのModelとViewを追加

diff --git a/app/Model/Image.php b/app/Model/Image.php
new file mode 100644
index 0000000..592bd19
--- /dev/null
+++ b/app/Model/Image.php
@@ -0,0 +1,56 @@
+<?php
+App::uses('AppModel', 'Model');
+/**
+ * Image Model
+ *
+ */
+class Image extends AppModel {
+
+/**
+ * Validation rules
+ *
+ * @var array
+ */
+	public $validate = array(
+		'name' => array(
+			'notBlank' => array(
+				'rule' => array('notBlank'),
+				//'message' => 'Your custom message here',
+				//'allowEmpty' => false,
+				//'required' => false,
+				//'last' => false, // Stop validation after this rule
+				//'on' => 'create', // Limit validation to 'create' or 'update' operations
+			),
+		),
+	);
+
+    public $actsAs = array(
+	'UploadPack.Upload' => array(
+		'image' => array(     //☆ここでは、"_file_name"を除いたカラム名を書く
+			'quality' => 95,   //☆画質指定、デフォルトでは75
+			'path' => ':webroot/upload/:model/:id/:hash.:extension',
+			'styles' => array(
+				'thumb' => '85x85'  //☆リサイズしたいサイズを書く
+			)
+		)
+	),
+	'Search.Searchable'
+	);
+
+	public $filterArgs = array(
+		'name' => array('type' => 'query', 'method' => 'orConditions'),
+		'status' => array('type' => 'value'),
+	);
+
+	public function orConditions( $data = array() ) {
+		$filter = $data['name'];
+		$cond = array(
+			'OR' => array(
+				$this->alias . '.name LIKE' => '%' . $filter . '%',
+			),
+		);
+		return $cond;
+	}
+
+
+}
diff --git a/app/View/Images/add.ctp b/app/View/Images/add.ctp
new file mode 100644
index 0000000..e300060
--- /dev/null
+++ b/app/View/Images/add.ctp
@@ -0,0 +1,17 @@
+<div class="form">
+<?php  echo $this->Form->create('Image',array('type'=>'file')); ?> 
+	<fieldset>
+		<legend><?php  echo __('Add Image'); ?></legend>
+		<?php echo $this->Form->input('name'); ?>
+		<?php echo $this->Form->input('image',array('type'=>'file','label'=>'画像')); ?>
+	</fieldset>
+<?php  echo $this->Form->end(__('Submit')); ?>
+</div>
+<?php  echo $this->element('admin_action');?>
+<div class="actions">
+	<h3><?php  echo __('Actions'); ?></h3>
+	<ul>
+
+		<li><?php  echo $this->Html->link(__('List Images'), array('action' => 'index')); ?></li>
+	</ul>
+</div>
diff --git a/app/View/Images/edit.ctp b/app/View/Images/edit.ctp
new file mode 100644
index 0000000..88c2bde
--- /dev/null
+++ b/app/View/Images/edit.ctp
@@ -0,0 +1,27 @@
+<div class="images form">
+<?php //echo $this->Form->create('Image'); ?>
+<?php echo $this->Form->create('Image',array('type'=>'file')); ?>
+	<fieldset>
+		<legend><?php echo __('Edit Image'); ?></legend>
+	<?php
+		echo $this->Form->input('id');
+		echo $this->Form->input('name');
+		echo $this->Form->input('image_file_name');
+		echo $this->Form->input('image',array('type'=>'file','label'=>'画像')); 	
+		echo $this->Form->input('status', array(
+			'type' => 'select', 
+		    'options' => array('1' => 'Active', '0' => 'Expire')
+		));
+	?>
+	</fieldset>
+<?php echo $this->Form->end(__('Submit')); ?>
+</div>
+<?php  echo $this->element('admin_action'); ?>
+<div class="actions">
+	<h3><?php echo __('Actions'); ?></h3>
+	<ul>
+
+		<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Image.id')), array('confirm' => __('Are you sure you want to delete # %s?', $this->Form->value('Image.id')))); ?></li>
+		<li><?php echo $this->Html->link(__('List Images'), array('action' => 'index')); ?></li>
+	</ul>
+</div>
diff --git a/app/View/Images/index.ctp b/app/View/Images/index.ctp
new file mode 100644
index 0000000..36723ae
--- /dev/null
+++ b/app/View/Images/index.ctp
@@ -0,0 +1,110 @@
+<script type="text/javascript">
+// When the document is ready set up our sortable with it's inherant function(s) 
+	$(document).ready(function() {  
+			  $("#sortable tbody").sortable({      
+					update : function () {          
+						  var order = $('#sortable tbody').sortable('toArray');          
+							$.post("/images/ajax_sort_change/",{            
+						   		id:order
+						},function(data){
+					});
+	   			}
+		  });
+	});
+</script>
+
+<div class="images index">
+	<h2><?php echo __('Images'); ?></h2>
+   
+		<div class="section form_search">
+						<?php echo $this->Form->create('Image', array( 
+							'novalidate' => true,
+							'inputDefaults' => array(
+								'div' => 'form-group',
+								'wrapInput' => false,
+								'class' => 'form-control'
+								),				
+							'div' =>false,
+							'class' => 'well well-sm',
+							'url' => array_merge(array(
+							'action' => 'index'),
+									$this->params['pass']) )); ?>
+					<fieldset>
+						<legend>検索</legend>			
+						<?php echo $this->Form->input('name', array(
+										'legend' => false,
+										'placeholder' => '例）kkk',
+										'label' => '名前'
+										)
+									); ?>
+						<?php echo $this->Form->input('type', array(
+										'label'=>'ステータス',
+										'legend' => false,
+										'type'=>'select',
+										'options'=>array(
+								 					'0' => 'expire', '1' => 'active' ,'2'=>'削除済み'
+													),
+										'empty'=>'選択してください')); ?>
+							<?php echo $this->Form->submit('検索', array('div' => false,'class' => 'btn btn-danger')); ?>	
+							<?php echo $this->Form->end(); ?>
+					</fieldset>
+					</div>
+
+<?php echo $this->Paginator->counter(array('format' => __('全{:count}件中 {:start}-{:end}件を表示'))); ?>
+
+
+				<table id="sortable" cellpadding="0" cellspacing="0" class="table table-striped">
+				<thead>
+				<tr>
+						<th><?php echo $this->Paginator->sort('id'); ?></th>
+						<th><?php echo $this->Paginator->sort('name'); ?></th>
+						<th><?php echo $this->Paginator->sort('image_file_name'); ?></th>
+						<th><?php echo $this->Paginator->sort('status'); ?></th>
+						<th><?php echo $this->Paginator->sort('created'); ?></th>
+						<th><?php echo $this->Paginator->sort('updated'); ?></th>
+						<th class="actions"><?php echo __('Actions'); ?></th>
+				</tr>
+				</thead>
+				<tbody>
+				<?php foreach ($images as $image): ?>
+				<tr id="<?php echo $image['Image']['id']?>">
+					<td><span class="glyphicon glyphicon-list"></span></td>
+					<td><?php echo h($image['Image']['name']); ?>&nbsp;</td>
+					<td><?php echo h($image['Image']['image_file_name']); ?>&nbsp;<?php echo $this->upload->uploadImage($image, 'Image.image', array('style' => 'thumb')); ?></td>
+					<td><?php echo h($image['Image']['status']); ?>&nbsp;</td>
+					<td><?php echo h($image['Image']['created']); ?>&nbsp;</td>
+					<td><?php echo h($image['Image']['updated']); ?>&nbsp;</td>
+				<td class="actions">
+					<?php echo $this->Html->link(__('View'), array('action' => 'view', $image['Image']['id']),array('class'=>'btn btn-primary')); ?>
+					<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $image['Image']['id']),array('class'=>'btn btn-primary')); ?>
+					<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $image['Image']['id']),array('class'=>'btn btn-primary','confirm' => __('削除しますか?', $image['Image']['id']))); ?>
+					<?php echo $this->Form->postLink(__('抹消'), array('action' => 'compdelete', $image['Image']['id']),array('class'=>'btn btn-danger-outline','confirm' => __('完全に抹消されます。よろしいすか?', $image['Image']['id']))); ?>
+				</td>
+			</tr>
+		<?php endforeach; ?>
+			</tbody>
+			</table>
+			<p>
+			<?php
+			echo $this->Paginator->counter(array(
+				'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
+			));
+			?>	</p>
+			<div class="paging">
+			<nav>
+			<ul class="pager">
+			<?php
+				echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
+				echo $this->Paginator->numbers(array('separator' => ''));
+				echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
+			?>
+			</ul>
+			</nav>
+			</div>
+		</div>
+<!--		<div class="actions">
+			<h3><?php echo __('Actions'); ?></h3>
+			<ul>
+				<li><?php echo $this->Html->link(__('New Image'), array('action' => 'add'),array('class'=>'btn btn-warning')); ?></li>
+			</ul>
+		</div>-->
diff --git a/app/View/Images/view.ctp b/app/View/Images/view.ctp
new file mode 100644
index 0000000..893bb22
--- /dev/null
+++ b/app/View/Images/view.ctp
@@ -0,0 +1,44 @@
+<div class="images view">
+<h2><?php echo __('Image'); ?></h2>
+	<dl>
+		<dt><?php echo __('Id'); ?></dt>
+		<dd>
+			<?php echo h($image['Image']['id']); ?>
+			&nbsp;
+		</dd>
+		<dt><?php echo __('Name'); ?></dt>
+		<dd>
+			<?php echo h($image['Image']['name']); ?>
+			&nbsp;
+		</dd>
+		<dt><?php echo __('Image File Name'); ?></dt>
+		<dd>
+			<?php echo h($image['Image']['image_file_name']); ?>
+			&nbsp;
+		</dd>
+		<dt><?php echo __('Status'); ?></dt>
+		<dd>
+			<?php echo h($image['Image']['status']); ?>
+			&nbsp;
+		</dd>
+		<dt><?php echo __('Created'); ?></dt>
+		<dd>
+			<?php echo h($image['Image']['created']); ?>
+			&nbsp;
+		</dd>
+		<dt><?php echo __('Updated'); ?></dt>
+		<dd>
+			<?php echo h($image['Image']['updated']); ?>
+			&nbsp;
+		</dd>
+	</dl>
+</div>
+<div class="actions">
+	<h3><?php echo __('Actions'); ?></h3>
+	<ul>
+		<li><?php echo $this->Html->link(__('Edit Image'), array('action' => 'edit', $image['Image']['id'])); ?> </li>
+		<li><?php echo $this->Form->postLink(__('Delete Image'), array('action' => 'delete', $image['Image']['id']), array('confirm' => __('Are you sure you want to delete # %s?', $image['Image']['id']))); ?> </li>
+		<li><?php echo $this->Html->link(__('List Images'), array('action' => 'index')); ?> </li>
+		<li><?php echo $this->Html->link(__('New Image'), array('action' => 'add')); ?> </li>
+	</ul>
+</div>
