<?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-md-12">

      <section class="panel panel-default">
        <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>Country Name</th>
          <th>Country Code</th>
          <th>Std Code</th>
          <th>Action</th>
        </tr> 
      </thead>
      <tbody>
          <?php 
            $srno=1;
            foreach ($country as  $value) {
            $country_id = $value['country_id'];
            $std_code = $value['std_code'];
           // $id=$this->encrypt->encode($country_id);
			 $id=encrypt_decrypt_parameters($country_id,'encrypt');
          ?> 
         <tr>
          <td><?php echo $srno; ?></td>
          <td><?php echo $value['country_name'];?></td>
          <td><?php echo $value['country_code'];?></td>       
          <td><?php echo $value['std_code'];?></td>       
          <td>
            <b><a href="<?php echo base_url();?>index.php/gc/country/view_country/<?php echo $id?>">View</a> | <a href="<?php echo base_url();?>index.php/gc/country/manage_country/<?php echo $id ?>"> Edit |
             <?php if($value['is_active']==0) {?>
                 <a href="<?php echo base_url();?>index.php/gc/country/enable_country/<?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/country/disable_country/<?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/country/manage_country'">
					Add Country
				</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":  [] }
      ]
  } );
});
</script> 