<?php
	include('common/header.php');
?>
	<div class="">
		<div class="col-xm-12">
			<div class="widget-box light-border">
				<div class="widget-header header-color-grey">
					<h4 class="smaller">
						Refill History
					</h4>
				</div>
				<div class="widget-body">
					<div class="widget-main">
						<div class="row">
							<div class="col-sm-12">
								<form class="form-horizontal" role="form" method="post" name="module_form" id="module_form" action="<?php echo base_url()?>index.php/<?php echo REFILL_HISTORY?>refill_history_report">
								<div class="">
									<!-- PAGE CONTENT BEGINS -->

									<div class="form-group">  
										<label class="col-sm-5 control-label" for="form-field-2" ><?php echo 'Country';?><font style="color:red">*</font></label>
										<div class="col-sm-7">	
											 <?php
											 	$country_array_data=$country_array;
												$js1 = 'id="country_id"  class="form-control" style="width:262px" onchange="get_state(this.value);"';
												echo form_dropdown('country_id', $country_array_data, $country_id, $js1);
											?>
										</div>
									</div>

									<div class="form-group">  
										<label class="col-sm-5 control-label" for="form-field-2" ><?php echo 'State';?><font style="color:red">*</font></label>
										<div class="col-sm-7" id="state_id_div">	
											<select name="state_id" id="state_id" onchange="get_city(this.value);" style="width:262px">
												<option value="">Select State</option>
											</select>
										</div>
									</div>

									<div class="form-group">  
										<label class="col-sm-5 control-label" for="form-field-2" ><?php echo 'City';?><font style="color:red">*</font></label>
										<div class="col-sm-7">	
											<select name="city_id" id="city_id" style="width:262px">
												<option value="">Select City</option>
											</select>
										</div>
									</div>	
									
									<div class="form-group">  
										<label class="col-sm-5 control-label" for="form-field-2" ><?php echo 'Customer Name ';?><font style="color:red">*</font></label>
										<div class="col-sm-7">	
											<?php
												$customer_array_data=$customer_array;
												$js1 = 'class="select2 select2-multiple form-control" name="customer_id"  style="width:262px" id="customer_id" multiple="multiple" data-placeholder="Choose"';
												echo form_dropdown('customer_id', $customer_array_data, $customer_id, $js1);
												?>
										</div>
									</div>
									
									<div class="form-group">  
										<label class="col-sm-5 control-label" for="form-field-2" ><?php echo 'Dispenser Name';?><font style="color:red">*</font></label>
										<div class="col-sm-7">	
											 <?php
												$refill_array_data=$refill_array;
												$js1 = 'id="dispenser_id"  class="form-control"  style="width:262px"';
												echo form_dropdown('dispenser_id', $refill_array_data, $dispenser_id, $js1);
											?>
										</div>
									</div>
									
								</div>
								
							</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" >
				<!-- <?php echo $purpose;?> --> Submit
			</button>
		</div>
	</div>
	</form>	
	<div class="space-4"></div>
		<!-- /.page-row -->
        <!-- /.page-content --> 
    </div>
    <!-- /.main-content --> 
	</div>
    <!-- /#ace-settings-container --> 
	</div>
	<!-- /.main-container-inner --> 
<?php
	include('common/footer.php');
?>
<script>

$(document).ready(function(){
  
	$("#del").hide();
  $(".js-example-tags").select2({
	  tags: true
	});
  
	$(".select2").select2();  
	$(".select2").prop("multiple", "");
	
	/* var path='<?php echo base_url()?>index.php/<?php echo CUSTOMER_PATH;?>';
	auto_complete('<?php echo $company_id;?>',path,'company','company_list_id'); */

  });
function hide()
{
	document.getElementById("admin_type_code").style.display="none";
}
function show()
{
	document.getElementById("admin_type_code").style.display="";
}
function validate_dispenser()
{
	return true;
}
function get_state()
{
	var country_id = $('#country_id').val();
	$.ajax({
    url:"<?php echo base_url();?>index.php/gc/refill_history/get_state",
    method:"POST",
    data:{
      country_id:country_id
    },
    success:function(data)
    {
     $('#state_id').html(data);
    }
   });
}

function get_city()
{
	var state_id = $('#state_id').val();
	$.ajax({
    url:"<?php echo base_url();?>index.php/gc/refill_history/get_city",
    method:"POST",
    data:{
      state_id:state_id
    },
    success:function(data)
    {
     $('#city_id').html(data);
    }
   });
}
</script>
