            <div class="row">
               <div class="col-12">
                        <?php echo form_open(base_url(''),array('class'=>"form-horizontal add_material_mix", 'id'=>"add_material_mix")); ?>       <div id='material_success' class='alert alert-success solid material_success' style='display:none;'></div>                  
                 <div class="modal-body">
                                
                                        
                                               
                                     
                                          <div class="col-xl-12 col-xxl-12 col-sm-12">
                                             <div class="card">
                                                <div class="card-header">
                                                    <h5 class="card-title">Add Mix Color Material</h5>
                                                </div>


                                                <div class="card-body">
                                                 
                                                       <div class="row">

                                                        <div class="col-lg-6 col-md-6 col-sm-12">
                                                                    <div class="form-group">
                                                                       
                                                                        <input type="hidden" name="created" id="created" value="<?php echo date('Y-m-d H:i:s'); ?>" class="form-control required">
                                                                    </div>
                                                                </div>

                                                                <div class="col-lg-6 col-md-6 col-sm-12">
                                                                    <div class="form-group">
                                                                       
                                                                        <input type="hidden" value="<?php echo date('Y-m-d H:i:s'); ?>" name="modified" id="modified" class="form-control required">
                                                                    </div>
                                                                </div>
                                                            
                                                          
                                                            <div class="col-lg-6 col-md-6 col-sm-12">
                                                                <div class="form-group">
                                                                    <label class="form-label">Material Color Mix:</label>
                                                                    <select name="color_id" data-live-search="true" id="color_id" class="form-control" tabindex="-98">
                                                                        <option value="">Select Material</option>
                                                                        <?php foreach ($get_materials_all as $get_materials_alls) { ?>
                                                                            
                                                                             <option value="<?php echo $get_materials_alls['id']; ?>"><?php echo $get_materials_alls['name']; ?></option>

                                                                        <?php } ?>
                                                                       
                                                                        
                                                                        </select>
                                                                </div>
                                                            </div>

                                                         <input type="hidden" id="material_id" name="material_id" value="<?php echo $material_id; ?>">


                                                            <input type="hidden" name="user_id" id="user_id" value="<?php echo $this->session->userdata('id');?>">
                                                        </div>
                                                    
                                                </div>
                                            </div>
                                        </div>



                                                </div>

                                                <div class="modal-footer">
                                                  
                                                    <button type="submit" id="dis_submit" class="btn btn-primary">Submit <i class="icon-arrow-right14 position-right"></i></button>
                                                </div>
                                         
                                   <?php form_close(); ?>
                    </div>





					
				</div>

 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

  <script type="text/javascript">
                    
    var add_material = $('#add_material_mix');   
    
    add_material.on('submit',function(e){

 $("#dis_submit").attr('disabled', true);
        e.preventDefault();
        
        var add_material_mix = add_material.serialize();
        
        if (confirm('Are you sure you want to Add .?')) {
            $.ajax({
                type:'POST',
                url:'<?php echo base_url('Masterlist/mix_color'); ?>',
                data:add_material_mix,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);
                    if(data.status == 'true'){
                        console.log('second'+data.status);
                        $('.material_success').show().html('Material Color Added Successfully');
                       setTimeout(function(){location.href="<?php echo base_url('Masterlist/material'); ?>"} );
                    }else{
                        console.log('third'+data);          
                    }
                },
                error:function(data){console.log(data.responseText);}
            });
        }
    });
                </script>