<?php
  include('common/header.php');

  // if ($this->uri->segment(4)!='') {
  //   $select_id=$this->uri->segment(4);
  // }
      
?>

<div id="messages" style="color: green;"><h5><?php echo $this->session->flashdata('message'); ?></h5></div>
  <div class="">
    <div class="col-xm-12">
      <div class="widget-box light-border">
        
        <div class="widget-body">
          <div class="widget-main">
            <div class="row">
              <div class="col-sm-12">
                  <form class="form-horizontal" method="post" action="<?php echo base_url();?>index.php/<?php echo DISPENSER_SALES_DATA;?>search_transfer_list" name="manage_client" id="manage_client" onsubmit="return validateForm()">
                    <input type="hidden" value="" name="hidden_from_id" id="hidden">
                    <!-- <input type="hidden" name="select_id" id="select_id" value="<?php echo $select_id; ?>"> -->
                  <section class="panel panel-default">
                  <header class="panel-heading bg-info lt font-bold"></header>
                  <!-- panel body start -->
                  <div class="panel-body bs-example form-horizontal">
                    <div class="">
                     <div class="hr hr12 dotted"></div>
                       <div class="">
                        <!-- main col-sm-12 -->
                      <div class="col-sm-12"> 

                        
                          <div class="col-sm-6">
                            <div class="form-group" id="client_code">
                              <label for="client_code" class="col-sm-5 control-label required"><?php echo $lable_branch_from; ?>:<font style="color:red">*</font></label>
                              <div class="col-sm-7">
                                    <select name="from_branch" id="from_branch" class="form-control">
                                      
                               
                                     
                                          
                                  </select>
                                  <span id="from_branch1" class="text-danger font-weight-bold"></span> 
                              </div>
                               
                            </div>
                          </div>

                          <div class="col-sm-6">
                            <div class="form-group" id="client_code">
                              <label for="client_code" class="col-sm-5 control-label required"><?php echo 'Tracking Number'; ?>:<font style="color:red"></font></label>
                              <div class="col-sm-7">
                                   <input type="text" name="tracking_number" id="tracking_number"  class="form-control" placeholder="Tracking Number">
                                  <span id="tracking_number1" class="text-danger font-weight-bold"></span> 
                              </div>
                               
                            </div>
                          </div>
                    
                       </div>



                    
                      
                        


                         <!-- </div> -->
                         <!-- main col-sm-12  close-->
                       </div> <!-- blank close -->
        </div><!-- blank close -->
      </div>   <!-- panel body close -->
    </section> <!-- section close -->

      

       <!-- customer contact start -->
   


    <!-- customer location start -->
    
              </div>
            </div>
          </div>  
        </div>
      </div>
    </div>
   
    <!-- /.col -->
  </div>
  <div class="clearfix form-actions">
    <div class="col-md-offset-5 col-md-5">
      
      <button class="btn btn-info" type="submit"  id="pc" >
         Submit
      </button>
    </div>
  </div>
   </form>
  <div class="space-4"></div>
    <!-- /.page-row -->
        <!-- /.page-content --> 
    </div>
    <!-- /.main-content --> 
  </div>
    <!-- /#ace-settings-container --> 
  </div>
<?php
  include('common/footer.php');
?>
<script type="text/javascript">
$(document).ready(function() {
    $.ajax({
    url:"<?php echo base_url();?>index.php/gc/dispenser_sale_data/branch",
    method:"POST",
    success:function(data)
    {
     $('#from_branch').html(data);
     //$("#from_branch").val($("#hidden-field").val());
    }
   });  

  
});
function get_branch(){
  var from_branch_id = $('#from_branch').val();
  if (from_branch_id>0) {
     $("#hidden").val(from_branch_id);
  }else{

  }

}
  function validateForm(){
     var error=false;  
  
  var from_branch=$("#from_branch").val();  
  if(from_branch=='default')
  {
    $("#from_branch1").html("Please Select Branch Name");
    error=true; 
  }
  else
  {
    $('#from_branch1').html("");
      
  }
  if(error==true)
  {
    return false;
  }
  else
  {
      return true;
    
  }

}
var check_id=$("#from_branch").val(); 
if (check_id=='default') {
    var select_id=$("#select_id").val(); 
  
$('#from_branch [value=119]').attr('selected', 'true'); 
}
</script> 
