<div class="modal-body">
   <h4><?php echo mold_code($get_details_mould[0]['mold']); ?></h4>                                           

<?php echo form_open(base_url(''),array('class'=>"form-horizontal edit_party", 'id'=>"edit_party")); ?>
        <fieldset class="content-group">
           
            <?php if($this->session->flashdata('party_success')){ ?>
    <div class="alert alert-success solid" style='text-align:center;'><?php echo $this->session->flashdata('party_success'); ?></div>
<?php } ?>  

        <div class="col-xl-12 col-xxl-12 col-sm-12">
            <div class="card">
            
                <div class="card-body">
                     <div id='party_success' class='alert alert-success solid' style='display:none;'></div>
                    
                        <div class="row">
                       

                            <div class="col-lg-6 col-md-6 col-sm-12">
                            <div class="form-group">
                                <label class="form-label">Status:</label>
                                <select class="form-control required" required="required" name="status" id="status" tabindex="-98">
                                   <option>Select Option</option>
                                   <option value="1">Active</option>
                                    </select>
                            </div>
                        </div>


                        

                               <div class="col-lg-6 col-md-6 col-sm-12">
                                <div class="form-group">
                                    <label class="form-label">Remarks:</label>
                                    <textarea name="remarks" id="remarks" required="required" class="form-control required" rows="5"></textarea>
                                </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="created" id="created" class="form-control required">
                                </div>
                            </div>
                           
                       <input type="hidden" name="user_id" id="user_id" value="<?php echo $this->session->userdata('id');?>">

                       
                        <input type="hidden" name="so_id" id="so_id" value="<?php echo $get_details_mould[0]['so_id']; ?>">

                        
                         <input type="hidden" name="product_id" id="product_id" value="<?php $item = product_id($get_details_mould[0]['product_name']);  echo $item; ?>">       
                       
                
                  </div>
                   <button type="submit" class="btn btn-primary">Submit <i class="icon-arrow-right14 position-right"></i></button>
                </div>
            </div>
        </div>
   </div>
   <?php form_close(); ?>

 <script type="text/javascript">


  var edit_party = $('#edit_party');   
    
    edit_party.on('submit',function(e){

        e.preventDefault();
        
        var partydata = edit_party.serialize();
        
        /*var id = $('#production_id').val();
*/
if (confirm('Are you sure you want to Add Production Mould.?')) {


            $.ajax({
                type:'POST',
                url:'<?php echo base_url('Requisition/add_production_mould_status/');?>',
                data:partydata,
                dataType:'json',
                success:function(data){
                    console.log('first'+data.status);
                    if(data.status === 'true'){
                        console.log('second'+data.status);
                        $('#party_success').show().html('Update Successfully').hide(3000);
                       setTimeout(function(){location.href="<?php echo base_url('Requisition/mould_department'); ?>"} , 3000);
                    }else{
                        console.log('third'+data);          
                    }
                },
                error:function(data){console.log(data.responseText);}
            });
     }
    });
                                                    
                  
                        </script>