<?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">Search</header>
        <div class="panel-body bs-example form-horizontal">
          <div class="row"> -->
            <!-- PAGE CONTENT BEGINS--> 
      <!-- <div class="col-md-12">
         <div class="col-sm-6">
         <div class="form-group">  
                    <label class="col-sm-5 control-label" for="form-field-2" ><?php echo 'Currency Name';?><font style="color:red">*</font></label>
                    <div class="col-sm-7">     
                      <input id="search" type="text" class="form-control" placeholder="Customer Name"> --> 

                      <!-- <input type="text" name="testid" id="testid" >
                          <div id="result"> -->
                      
                    <!-- </div> -->
          <!-- </div>

          

         </div> -->
<!-- 
         <div class="col-sm-6">
          <div class="form-group">
           <label class="col-sm-5 control-label" for="form-field-2">Branch Company Name</label>
           <div class="col-sm-6">
            <select name="linked_bname" id='linked_bname' class='form-control'>
			           <option value="" selected="selected">Select Branch Company Name</option>
			           <option value="1">BPW-Mumbai</option>
			           <option value="2">BPW-Nasik</option>
			           <option value="3">BPW-Pune</option>
		        </select>          
          </div>
          </div>
         </div> -->
    <!--   </div>      
          </div>
        </div>
      </section> -->

      <!-- <div class="clearfix form-actions">
        <div class="text-center">
          <button class="btn btn-info" type="button"> Search </button>
        </div>
      </div>
    </div> -->

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

      <section class="panel panel-default">
        <header class="panel-heading bg-info lt font-bold">List Branch Saleable Geography
     <!--  <ul class="nav nav-pills pull-right">
        <li class="bg-info lt"><a href="http://project.nityam.in/nityamhygiene/index.php/admin/client/manage_client"> + Add New Client</a></li>
        <li class="bg-info lt"><a href="http://project.nityam.in/nityamhygiene/index.php/admin/client/manage_client_n_location"> + Add New Client</a></li>
      </ul> -->
    </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>Country Name</th>
          <th>Saleable Geography Name</th> 
          <th>State Geography Name</th>
          <th>City Geography Name</th>
          <th>Action</th>
        </tr> 
      </thead>
         <tbody>  
       <?php 
       $srno=1;
       foreach ($geography as  $value) {
         $branch_salable_geograpahy_id=$value['branch_salable_geography_id'];
          $id=$this->encrypt->encode($branch_salable_geograpahy_id);
        $state_ids=$value['state_ids'];
        $city_ids=$value['city_ids'];
       ?>     
        <tr>
          <td><?php echo $srno; ?></td>
          <td><?php echo $value['country_name'];?></td>  
          <td><?php echo $value['saleble_geography_name'];?></td>
          <td>
            <?php 
                   $state= fetch_states($state_ids);
                   echo $state;
                   ?>
            
          </td> 
          <td>
            <?php 
                $city = fetch_cities($city_ids);
                 echo  $city;
            ?>
              
            </td>  
         <td>
            <b><a href="<?php echo base_url();?>index.php/gc/geography/view_branch_geography/<?php echo $id?>">View</a> | <a href="<?php echo base_url();?>index.php/gc/geography/manage_branch_geography/<?php echo $id ?>" onclick="return confirm('Are you sure you want to Edit?')"> Edit |
             <?php if($value['is_active']==0) {?>
                 <a href="<?php echo base_url();?>index.php/gc/geography/enable_geography/<?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/geography/disable_geography/<?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/geography/manage_branch_geography'">
					Add Branch Saleable Geography
				</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" charset="utf-8">
  $(document).ready(function() {
    $('#example').DataTable();
  } );
</script>
<script type="text/javascript">
$(document).ready(function() {
    $('#example').DataTable( {
    destroy: true,
    searching: true,
    "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> -->
