
<script>


$(function(){
	$("#sub_categories").change(function(){
		$("#sub_categories_products").load('<?php echo site_url("Ajx_functions/sub_categories") ; ?>/'+$(this).val() );		
	});	 
});


$(function(){
	$("#sub_categories_products").change(function(){
		$("#pro_rate").load('<?php echo site_url("Ajx_functions/sub_categories_products") ; ?>/'+$(this).val() );		
	});	 
});



$(function(){
	$("#pro_qty").keydown(function(){
		
		$("#prot_total").load('<?php echo site_url("Ajx_functions/pro_qty") ; ?>/'+$(this).val() );	
		$("#prot_total").load('<?php echo site_url("Ajx_functions/pro_qty") ; ?>/'+$(this).val() );	
		
			
	});	 
});




</script>


<script type="text/javascript">
$(document).ready(function(){
		//group add limit
		var maxGroup = 10;
		
		//add more fields group
		$(".addMore").click(function(){
				if($('body').find('.fieldGroup').length <= maxGroup){
						var fieldHTML = '<div class="form-group fieldGroup">'+$(".fieldGroupCopy").html()+'</div>';
						$('body').find('.fieldGroup:last').after(fieldHTML);
				}else{
						alert('Maximum '+maxGroup+' groups are allowed.');
				}
		});
		
		//remove fields group
		$("body").on("click",".remove",function(){ 
				$(this).parents(".fieldGroup").remove();
		});
});
</script>




<script type="text/javascript">
var count = 0;
$(function(){
	$('a#add_field').click(function(){
		count += 1;
		$('#container').append(
'<div class="form-group fieldGroupCopy"><div class="input-group"><div class="col-md-3"><label><b>Subcategory *</b><select name="sub_categories[]" id="sub_categories"  class="form-control"  ><option value="">-SELECT-</option><?php foreach($subcategoryquick as $value){?><option value="<?php echo $value['id'];?>"><?php echo $value['title'];?></option><?php }?></select></label></div><div class="col-md-5"><label><b>Products *</b></label><select name="sub_categories_products[]" id="sub_categories_products" class="form-control"><option value="">-SELECT-</option></select></div><div class="col-md-2"><label><b><span id="pro_rate"></span> *</b></label><input type="text" value="" name="pro_qty[]" id="pro_qty" /></div><div class="col-md-3"><span id="prot_total"></span></div></div>' );
	
	});
});
</script>








<div class="container padd_not marg_top ">




<div class="col-md-12 registor" style="min-height:500px;">
<h3 class="sub_hd">Quick Order</h3>

<a href="#" id="add_field">+ Click to add Images +</a>
<div id="container"></div>


<div class="col-lg-12">
<div>
<form method="post" action="">
<div class="form-group fieldGroup">
<div class="input-group">
<!--<input type="text" name="name_fg[]" class="form-control" placeholder="Enter name">
<input type="text" name="email_fg[]" class="form-control" placeholder="Enter email">-->


<div class="col-md-3"> 
<label><b>Subcategory *</b></label>&nbsp;&nbsp;&nbsp;&nbsp;
<select name="sub_categories[]" id="sub_categories"  class="form-control"  >
<option value="">-SELECT-</option>
<?php foreach($subcategoryquick as $value){?>
<option value="<?php echo $value['id'];?>"   ><?php echo $value['title'];?></option>
<?php }?>
</select>
</div>
    
    
    
<div class="col-md-5"> 
<label><b>Products *</b></label>&nbsp;&nbsp;&nbsp;&nbsp;
<select name="sub_categories_products[]" id="sub_categories_products"  class="form-control"  >
<option value="">-SELECT-</option>	
</select>
</div>
 
 
<div class="col-md-2"> 
<label><b><span id="pro_rate"></span> *</b></label>
<input type="text" value="" name="pro_qty[]" id="pro_qty" />
</div>
 
 
<div class="col-md-2"> 
 <span id="prot_total"></span>
   </div>
    
    


<div class="input-group-addon"> 
<a href="javascript:void(0)" class="btn btn-success addMore"><span class="glyphicon glyphicon glyphicon-plus" aria-hidden="true"></span> Add</a>
</div>
</div>
</div>
<input type="submit" name="submit" class="btn btn-primary" value="SUBMIT">   
</form>
                    
                <!-- copy of input fields group -->

</div>
</div>






































<!--<form method="post">


    
<div class="col-md-3"> 
<label><b>Subcategory *</b></label>&nbsp;&nbsp;&nbsp;&nbsp;
<select name="sub_categories" id="sub_categories"  class="form-control"  >
<option value="">-SELECT-</option>
<?php foreach($subcategoryquick as $value){?>
<option value="<?php echo $value['id'];?>"   ><?php echo $value['title'];?></option>
<?php }?>
</select>
</div>
    
    
    
<div class="col-md-5"> 
<label><b>Products *</b></label>&nbsp;&nbsp;&nbsp;&nbsp;
<select name="sub_categories_products" id="sub_categories_products"  class="form-control"  >
<option value="">-SELECT-</option>	
</select>
</div>
 
 
<div class="col-md-2"> 
<label><b><span id="pro_rate"></span> *</b></label>
<input type="text" value="" name="pro_qty" id="pro_qty" />
</div>
 
 
 <div class="col-md-2"> 
 <span id="prot_total"></span>
   </div>
    
    






</form>-->






 
 
 
</div>








</div>





<script>

	
	
	
	

	
	
	
	
	
	
</script>

