<?php if($current_user['role']==array_search('Admin',$arrRole)):?>
	<div class="mws-panel grid_8">
		
		<div class="mws-panel-header">
	    	<span class="mws-i-24 i-table-1"><?php echo __('Categories');?></span>
	     </div>
	     <div class="mws-panel-body">
			<table  cellpadding="0" cellspacing="0" class="mws-datatable-fn mws-table">
				<thead>
					<tr>
						<th><?php echo $this->Paginator->sort('name');?></th>
						<th><?php echo $this->Paginator->sort('parent_id');?></th>
						<th><?php echo 'Image';?></th>
						<th><?php echo $this->Paginator->sort('seq');?></th>
						<th><?php echo $this->Paginator->sort('status');?></th>
					
						<th class="actions"><?php echo __('Actions');?></th>
					</tr>
				</thead>
			<?php
			
			foreach ($categories as $category): ?>
			
		<tr>
			<td><?php echo h($category['Category']['name']); ?>&nbsp;</td>
			<td><?php echo $category['ParentCategory']['name']; ?>&nbsp;</td>
			<td><?php echo $this->Html->image('upload/category/'.$category['Category']['id'].'.png'); ?>&nbsp;</td>
			<td><?php echo h($category['Category']['seq']); ?>&nbsp;</td>
			<td><?php echo h($category['Category']['status']); ?>&nbsp;</td>
			<td class="actions">
				<?php echo $this->Html->link(__($this->Html->image('zoom.png',array('alt' =>'View','title' =>'View'))), array('action' => 'view', $category['Category']['id']),array('escape' =>false)); ?>
				<?php echo $this->Html->link($this->Html->image('edit.png',array('title' =>'Edit')), array('action' => 'edit', $category['Category']['id']),array('escape' =>false)); ?>
				<?php echo $this->Form->postLink(__($this->Html->image('delete.gif',array('title' =>'Delete'))), array('action' => 'delete', $category['Category']['id']),array('escape' =>false), __('Are you sure you want to delete # %s?', $category['Category']['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
			</table>
		</div>
		
		
		
	
		
		<div style ="text-align: center;"> 
			<!-- pagination of cakephp -->
			 <?php 
				$page_count = $this->Paginator->counter(array('format' => __('{:pages}')));
				if($page_count > 1){
					echo "<p>";
					echo $this->Paginator->counter(array(
						'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total')
					));
					
					echo "</p><div class='paging'>";
					
					echo $this->Paginator->prev($this->Html->image('backword.png'),array('escape' =>false), null, array('class' => 'prev disabled', 'escape' =>false));
					echo $this->Paginator->numbers(array('separator' => ''));
					echo $this->Paginator->next($this->Html->image('forward.png'),array('escape' =>false), null, array('class' => 'next disabled', 'escape' =>false));
					echo "</div>";
				}
			?>	
		<!-- end pagination of cakephp -->
		
		</div>
		
	
		<div style="padding-top: 15px;">
			<?php echo $this->Html->link("<span>".$this->Html->image('add_more_btn.png')." New Category</span>", array('action' => 'add'),array('escape'=>false)); ?>	</div>
	</div>
<?php endif;?>
