
 <?php echo form_open(base_url(''),array('class'=>"form-horizontal add_ad_ot", 'id'=>"add_ad_ot")); ?>
 <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">
                           
                            <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>
                    
                            <input type="hidden" value="<?php echo $get_emp_ad_ot[0]['id']; ?>" name="in_out_id" id="in_out_id" class="form-control required">
                       
                            <input type="hidden" value="<?php echo $get_emp_ad_ot[0]['emp_id']; ?>" name="emp_id" id="emp_id" class="form-control required">
                            <input type="hidden" value="<?php echo $get_emp_ad_ot[0]['date']; ?>" name="date" id="date" class="form-control required">


                    <div class="col-lg-6 col-md-6 col-sm-12">
                        <div class="form-group">
                            <label class="form-label">Advance</label>
                            <input type="number" name="advance" id="advance"  placeholder="Advance" class="form-control">
                        </div>
                    </div>
                    <div class="col-lg-6 col-md-6 col-sm-12">
                        <div class="form-group">
                            <label class="form-label">Over Time</label>
                            <input type="number" name="over_time" id="over_time" placeholder="Over Time" class="form-control">
                        </div>
                    </div>


                     <!-- <div class="col-lg-6 col-md-6 col-sm-12">
                        <div class="form-group">
                            <label class="form-label">Allowance </label>
                            <input type="number" name="allowance" id="allowance" placeholder="Empolyee Allowance" class="form-control">
                        </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" rows="3"></textarea>
                        </div>
                    </div>
                  

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

                </div>


                  <?php form_close();?>

                   <button type="submit" id="emp_add" class="btn btn-primary">Submit <i class="icon-arrow-right14 position-right"></i></button>
                <script type="text/javascript">
                    
                     var add_ad_ot = $('#add_ad_ot');   
                        
                        add_ad_ot.on('submit',function(e){
                                

                        e.preventDefault();
                        
                        var add_add_ad_ot = add_ad_ot.serialize();
                         $("#emp_add").attr('disabled', true); 
                            
                            $.ajax({
                                type:'POST',
                                url:'<?php echo base_url('Admin/daily_work_add_ad_ot'); ?>',
                                data:add_add_ad_ot,
                                dataType:'json',
                                success:function(data){
                                    console.log('first'+data.status);
                                    if(data.status === 'true'){
                                        console.log('second'+data.status);
                                        $('#party_success').show().html('added Successfully');
                                        setTimeout(function() {
                                                    window.location.reload(); } );
                                        //setTimeout(function(){location.href='<?php //echo base_url('Admin/daily_work_sheet/'); ?>'+emp_id} , 2000);
                                    }else{
                                        console.log('third'+data);          
                                    }
                                },
                                error:function(data){console.log(data.responseText);}
                            });
                       // }
                    });
                </script>