<?php
	include('common/header.php');
?>
<div id="messages" style="color: green;"><h5><?php echo $this->session->flashdata('message'); ?></h5></div>


<div class="row">

 <div class="col-xs-12">

      <section class="panel panel-default">
        <!-- <header class="panel-heading bg-info lt font-bold">List Currency
        
    </header> -->
        <div class="panel-body bs-example form-horizontal">
          <div class="table-responsive">
            <table id="example" class="table table-bordered" cellspacing="0" width="100%">
              <thead>
        <tr>
          <th>Sr No</th>
          <th>Currency Name</th>
          <th>Currency Code</th>
          <th>Country Name</th>
          <th>Action</th>
        </tr> 
      </thead>
      <tbody>
         <?php 
       $srno=1;
       foreach ($currency as  $value) {
          $currency_id = $value['currency_id'];
          $id=$this->encrypt->encode($currency_id);
		   $id=encrypt_decrypt_parameters($currency_id,'encrypt');
       ?> 
        
        <tr>
          <td><?php echo $srno; ?></td>
          <td><?php echo $value['currency_name'];?></td>
          <td><?php echo $value['currency_code'];?></td>
           <td><?php echo $value['country_name'];?></td>   
          <td>
            
            <b><a href="<?php echo base_url();?>index.php/gc/currency/view_currency/<?php echo $id?>">View </a>|<a href="<?php echo base_url();?>index.php/gc/currency/manage_currency/<?php echo $id ?>"> Edit </a>| 
                <?php if($value['is_active']==0) {?>
                 <a href="<?php echo base_url();?>index.php/gc/currency/enable_currency/<?php echo $id ?>" onclick="return confirm('Are you sure you want to Enable?')">Enable</a></b><?php }else{?>
                 <a href="<?php echo base_url();?>index.php/gc/currency/disable_currency/<?php echo $id ?> " onclick="return confirm('Are you sure you want to Disable?')">Disable</a></b><?php } ?>
          </td>
        </tr> 
        <?php 
         $srno=$srno+1;
       }
         ?>
        </tbody>
            </table>
          </div>
        </div>
      </section>

		<div class="clearfix form-actions">
			<div class="col-md-offset-5 col-md-5">
				<button class="btn btn-info" type="button" onclick="javascript:window.location='<?php echo base_url();?>index.php/gc/currency/manage_currency'">
					Add Currency
				</button>
			</div>
		</div>
	</div>
</div>
<div>
	<!-- /.page-row -->
    <!-- /.page-content --> 
</div>
<!-- /.main-content --> 
</div>
<!-- /#ace-settings-container --> 
</div>
<!-- /.main-container-inner -->
<?php
	include('common/footer.php');
?>

<script type="text/javascript">
$(document).ready(function() {
    $('#example').DataTable( {
    destroy: true,
    searching: true,
    "lengthMenu": [20, 40, 60, 80, 100],
    "pageLength": 20,
    "order": [],
    "columnDefs": [
      { "orderable": false, "targets":  [3] }
      ]
  } );
});
</script>

<!-- <script>
$.widget( "custom.catcomplete", $.ui.autocomplete, {
          _create: function() {
            this._super();
            this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" );
          },
          _renderMenu: function( ul, items ) {
            var that = this,
            currentCategory = "";
            $.each( items, function( index, item ) {
              var li;
              if ( item.category != currentCategory ) {
                ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
                currentCategory = item.category;
              }
              li = that._renderItemData( ul, item );
                if ( item.category ) {
                li.attr( "aria-label", item.category + " : " + item.label );
              }
            });
          }
        });
        
         var data = [
          { label: "indian rupee" },
          { label: "singapore dollar"}
        ];
        $( "#search" ).catcomplete({
          delay: 0,
          source: data
        }); 

       

</script> -->
<!-- <script>
  setTimeout(function() {
    $('#message').fadeOut('fast');
}, 1000);
</script> -->