                        
<div class="card">
<div class="card-body">
   <div class="row">
    <div class="form-group">
                                                        
<label class="form-label">DC Challans:</label>
<select class="form-control " data-live-search="true" name="dc_challan" required="required" id="dc_challan">
<option>Select DC</option>
<?php foreach ($so_dcs as $so_dcss) { ?>
<option value="<?php echo $so_dcss['dc_no']; ?>"><?php echo $so_dcss['dc_no']; ?> =  <?php $product_id = sale_order_pro($so_dcs[0]['so_id']); 
     echo product_name($product_id);?></option>
<?php } ?>
</select>
</div>

<div class="col-lg-3 col-md-6 col-sm-12">
<div class="form-group">
    <label class="form-label">Qty</label>
    <input type="text" name="qty"  readonly="readonly" id="qty" class="form-control qty">
</div>
</div>

<input type="hidden" value="<?php echo sale_order_pro($so_dcs[0]['so_id']);  ?>" name="product_id" id="product_id" class="form-control required">


 <div class="col-lg-3 col-md-6 col-sm-12">
<div class="form-group">
    <label class="form-label">Item</label>
    <input type="text" id="code" name="code" value="<?php
     $product_id = sale_order_pro($so_dcs[0]['so_id']); 
     echo product_name($product_id);
?>" readonly="readonly" class="form-control code">
</div>
</div>

<div class="col-lg-3 col-md-6 col-sm-12">
<div class="form-group">
    <label class="form-label">Vendor No.</label>
    <input type="text" id="vendor" name="vendor"   class="form-control vendor">
</div>
</div>

<div class="col-lg-3 col-md-6 col-sm-12">
<div class="form-group">
    <label class="form-label">Lot</label>
    <input type="text" id="lot" name="lot"   class="form-control code">
</div>
</div>

 <div class="col-lg-8 col-md-6 col-sm-12">
<div class="form-group">
    <label class="form-label">Remarks</label>
    <textarea name="remarks" class="form-control"><?php 
     $ref =  ref_code_fgrates_id($so_dcs[0]['ref_code']);
     echo @code_description($ref);
     ?></textarea>
</div>
</div>


 
</div>

</div>


 <input type="hidden" value="<?php echo date('Y-m-d'); ?>" name="insert_date" id="insert_date" class="form-control required">

  <input type="hidden" name="created" id="created" value="<?php echo date('Y-m-d H:i:s'); ?>" class="form-control required">
                                  
  <input type="hidden" value="<?php echo date('Y-m-d H:i:s'); ?>" name="modified" id="modified" class="form-control required">

<input type="hidden" name="user_id" id="user_id" value="<?php echo $this->session->userdata('id');?>"> 
 </div><button type="submit" id="save_data" class="btn btn-primary">Save <i class="icon-arrow-right14 position-right"></i></button>


 <script type='text/javascript'>

      $("#dc_challan").change(function() {

                var challan_id =  this.value;
               
                $.ajax({
                            type:'POST',
                            url:'<?php echo base_url('Sales_order/delivery_challan_qty'); ?>',
                            data:{challan_id:challan_id},
                            dataType:'json',
                            success:function(data){
                            
                                    $('#qty').val(data.total_qty);
                                   
                                      
                                  
                            },
                            error:function(data){console.log(data.responseText);}
                        });

    });





</script>