<div class="table-responsive animated fadeInRight">
	<table class="table m-0 table-striped">
		<tr>
			<th><?php echo get_msg('no'); ?></th>
			<th><?php echo get_msg('currency_short_form'); ?></th>
			<th><?php echo get_msg('currency_symbol'); ?></th>
			
			<?php if ( $this->ps_auth->has_access( EDIT )): ?>
				
				<th><span class="th-title"><?php echo get_msg('btn_edit')?></span></th>
			
			<?php endif; ?>
			
			<?php if ( $this->ps_auth->has_access( DEL )): ?>
				
				<th><span class="th-title"><?php echo get_msg('btn_delete')?></span></th>
			
			<?php endif; ?>
			
			<?php if ( $this->ps_auth->has_access( PUBLISH )): ?>
				
				<th><span class="th-title"><?php echo get_msg('btn_publish')?></span></th>
			
			<?php endif; ?>

			<th><?php echo get_msg('is_default'); ?></th>

		</tr>
		
	
	<?php $count = $this->uri->segment(4) or $count = 0; ?>

	<?php if ( !empty( $currencies ) && count( $currencies->result()) > 0 ): ?>

		<?php foreach($currencies->result() as $currency): ?>
			
			<tr>
				<td><?php echo ++$count;?></td>
				<td ><?php echo $currency->currency_short_form;?></td>
				<td ><?php echo $currency->currency_symbol;?></td>

				<?php if ( $this->ps_auth->has_access( EDIT )): ?>
			
					<td>
						<a href='<?php echo $module_site_url .'/edit/'. $currency->id; ?>'>
							<i style='font-size: 18px;' class='fa fa-pencil-square-o'></i>
						</a>
					</td>
				
				<?php endif; ?>
				
				<?php if ( $this->ps_auth->has_access( DEL )): ?>
					<?php if(@$currency->is_default == 1) { ?>
					<td>
						<a herf='#' class='btn-delete' data-toggle="modal" data-target="#currencyModal" id="<?php echo $currency->id;?>">
							<i style='font-size: 18px;' class='fa fa-trash-o'></i>
						</a>
					</td>
					<?php } else { ?>
					<td>
						<a herf='#' class='btn-delete' data-toggle="modal" data-target="#myModal" id="<?php echo $currency->id;?>">
							<i style='font-size: 18px;' class='fa fa-trash-o'></i>
						</a>
					</td>
					<?php } ?>
				<?php endif; ?>
				
				<?php if ( $this->ps_auth->has_access( PUBLISH )): ?>
					
					<td>
						<?php if ( @$currency->status == 1): ?>
							<button class="btn btn-sm btn-success unpublish" id='<?php echo $currency->id;?>'>
							<?php echo get_msg( 'btn_yes' ); ?></button>
						<?php else:?>
							<button class="btn btn-sm btn-danger publish" id='<?php echo $currency->id;?>'>
							<?php echo get_msg( 'btn_no' ); ?></button><?php endif;?>
					</td>
				
				<?php endif; ?>

				<?php if ( $this->ps_auth->has_access( PUBLISH )): ?>
					
					<td>
						<?php if ( @$currency->is_default == 1): ?>
							<button class="btn btn-sm btn-success undefault" id='<?php echo $currency->id;?>'>
							<?php echo get_msg( 'btn_yes' ); ?></button>
						<?php else:?>
							<button class="btn btn-sm btn-danger default" id='<?php echo $currency->id;?>'>
							<?php echo get_msg( 'btn_no' ); ?></button><?php endif;?>
					</td>
				
				<?php endif; ?>

			</tr>

		<?php endforeach; ?>

	<?php else: ?>
			
		<?php $this->load->view( $template_path .'/partials/no_data' ); ?>

	<?php endif; ?>

</table>
</div>

