<?php
	include('common/header.php');
?>
<div id="messages" style="color: green;"><h5><?php echo $this->session->flashdata('message'); ?></h5></div>
<div class="row">
  <section class="panel panel-default">
     <header class="panel-heading bg-info lt font-bold"><?php echo 'Search results'; ?></header>
    <form method="post" action="<?php echo base_url()?>index.php/<?php echo COMPANY_BRANCH;?>search_company_branch">

    <div class="panel-body bs-example form-horizontal">
     <div class="col-sm-12" >                                             
                          <div class="col-sm-6">
                            <div class="form-group" id="client_code">
                              <label for="client_code" class="col-sm-3 control-label required"><?php echo 'Branch Company Name'; ?>:</label>
                              <div class="col-sm-7">
                                <input type="text" name="branch_company_name" onkeypress="return RestrictSpace()" value="<?php echo $branch_company_name; ?>" id="branch_company_name" placeholder="Branch Company Name" class="form-control" maxlength="150" /> 
                                
                              </div>
                            </div>
                          </div>

                        <div class="col-sm-6">
                           <div class="form-group">
                              <label for="client_code" class="col-sm-3 control-label required"><?php echo 'Branch Mobile Number'; ?>:</label>
                                <div class="col-sm-7">
                                 
                                <input type="text" name="branch_mobile_no" onkeypress="return RestrictSpace()" value="<?php echo $branch_mobile_no; ?>" id="branch_mobile_no" placeholder="Branch Mobile Number" class="form-control" maxlength="20" /> 
                                  
                                 </div>
                              
                            </div>
                          </div> 
        </div>
        <div class="col-sm-12">
                      <div class="col-sm-6">    
                           <div class="form-group" id="client_code">
                            <label for="client_code" class="col-sm-3 control-label required"><?php echo 'Contact Person Name'; ?>:</label>
                              <div class="col-sm-7">   
                                <input type="text" name="contact_person_name" onkeypress="return RestrictSpace()" value="<?php echo $contact_person_name; ?>" id="contact_person_name" placeholder="Contact Person Name" class="form-control" maxlength="150">
                                                                        
                              </div>   
                            </div>                         
                      </div>
                      
        </div>

    </div>
    <div class="clearfix form-actions">
      <div class="col-md-offset-5 col-md-5">
        <button class="btn btn-info" type="submit" value="search" name="search">
         Search
        </button>
      </div>
    </div>
</form>
  </section>
</div>
<div class="row">

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

      <section class="panel panel-default">
        <!-- <header class="panel-heading bg-info lt font-bold">List Company
    
    </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>
           <?php foreach($fields as $field_name => $field_display): ?>
            <th <?php if ($sort_by == $field_name) echo "class=\"sorting_$sort_order\"" ?>>
            <?php echo anchor("gc/company_branch/list_company_branch/$query_id/$field_name/" .
            (($sort_order == 'asc' && $sort_by == $field_name) ? 'desc' : 'asc') ,
            $field_display); ?>     </th>
          <?php endforeach; ?>
          <!-- <th>Branch Company Name</th>        
          <th>Branch Mobile Number</th>
          <th>Contact Person Name</th> -->
          <th>Action</th>
        </tr> 
      </thead>
     <tbody>
         <?php 
       $icnt=0;
     $count=count($branch);
     if ($count>0) {
       foreach ($branch as  $value) {
          $company_branch_id = $value->company_branch_id;
         // $id=$this->encrypt->encode($company_branch_id);
		  $id=encrypt_decrypt_parameters($company_branch_id,'encrypt');
          $company_branch_name=$value->company_branch_name;
          $branch_mobile_no=$value->std_code.$value->branch_mobile_no;
          $contact_person_name=$value->contact_person_name;
          $is_active=$value->is_active;
          $icnt++;
      $sr=$offset+$icnt;
       ?> 
        
        <tr>
          <td><?php echo $sr; ?></td>
          <td><?php echo $company_branch_name;?></td>
          <td><?php echo $branch_mobile_no;?></td>
          <td><?php echo $contact_person_name;?></td>    
          <td>
            
            <b><a href="<?php echo base_url();?>index.php/gc/company_branch/view_company_branch/<?php echo $id?>">View </a>|<a href="<?php echo base_url();?>index.php/gc/company_branch/manage_company_branch/<?php echo $id ?>"> Edit </a>| 
                <?php if($is_active==0) {?>
                 <a href="<?php echo base_url();?>index.php/gc/company_branch/enable_company_branch/<?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/company_branch/disable_company_branch/<?php echo $id ?> " onclick="return confirm('Are you sure you want to Disable?')">Disable</a></b><?php } ?>
          </td>
        </tr> 
        <?php 
         //$srno=$srno+1;
       }
        }else{?>
              <td colspan="8" class="text-center">no data found</td>
         <?php } ?>
        </tbody>
            </table>
          </div>
          <?php
     if($num_results > 0) { ?>
      <div class="block"> </div>
        <div class="clearfix">
        <div class="row">
          <?php 
            if (strlen($pagination)): 
              $label_disp="Company branch";
              $data['label_disp']=$label_disp;
              $data['count']=$count;
              $this->load->view('pagination_view.php',$data);
            endif; ?>
        </div>
        </div>
        <div class="block"> </div>
      <?php } ?>
        </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/company_branch/manage_company_branch'">
					Add Company Branch
				</button>
			</div>
		</div>
	</div>
</div>

<!-- /.main-content --> 
</div>
<!-- /#ace-settings-container --> 
</div>
<!-- /.main-container-inner -->
<?php
	include('common/footer.php');
?>


