
 
 <?php

                $Month_Year='';
                $EmpID='';
                $LOP_Days=''; 
                $OT_Hrs_Worked=''; 
                $Loan_Recovered=''; 
                $Loan_Balance=''; 
                $Incentives=''; 
                $Other_Deductions=''; 
                $Created_By='';
                $Created_Time='';
                $Last_Mod_By='';
                $Last_Mod_Time='';        
                

if(!empty($monthly))
{
    foreach ($monthly as $mpi)
    {

                $Month_Year=$mpi->Month_Year;
                $EmpID= $mpi->EmpID;
                $LOP_Days=$mpi->LOP_Days; 
                $OT_Hrs_Worked=$mpi->OT_Hrs_Worked;
                $Loan_Recovered=$mpi->Loan_Recovered;
                $Loan_Balance=$mpi->Loan_Balance; 
                $Incentives=$mpi->Incentives;
                $Other_Deductions=$mpi->Other_Deductions; 
                $Created_By=$mpi->Created_By;
                $Created_Time=$mpi->Created_Time; 
                $Last_Mod_By=$mpi->Last_Mod_By;
                $Last_Mod_Time=$mpi->Last_Mod_Time;   
         
    }
}


?>
<script>




function validateLOP(){
	var x = $("#LOPDays").val();
    
	var ck_lopdays = /^[0-9 ]{1,2}$/;
	if(!(ck_lopdays.test(x) && x<=31)){
	 
	 $("#LOPDays").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
	 
	 $("#LOPDays").attr("title","0 to 31 Days Only");
	}
else{
	 $("#LOPDays").css({"border-style":"","border-color":"","border-width":"","background-color":""});	
	}
}

function validateOTHRS(){
var x = $("#OT_Hrs_Worked").val();
    
	var ck_lopdays = /^[0-9 ]{1,3}$/;
	if(!(ck_lopdays.test(x) && x<=150)){
	 
	 $("#OT_Hrs_Worked").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
	 $("#OT_Hrs_Worked").attr("title","Three Digits, not more then 150hrs");
	}
else{
	$("#OT_Hrs_Worked").css({"border-style":"","border-color":"","border-width":"","background-color":""});	
	}
}

function validateLR(){
var x = $("#Loan_Recovered").val();
    
	var ck_lopdays = /^[0-9 ]{1,6}$/;
	if(!(ck_lopdays.test(x) && x<=100000)){
	 
	$("#Loan_Recovered").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
	 $("#Loan_Recovered").attr("title","Positive Nos Only,Maximun Six Digits");
	}
else{
	$("#Loan_Recovered").css({"border-style":"","border-color":"","border-width":"","background-color":""});	
	}
}

function validateLB(){
var x = $("#Loan_Balance").val();
    
	var ck_lopdays = /^[0-9 ]{1,6}$/;
	if(!(ck_lopdays.test(x) && x<=100000)){
	 
	 $("#Loan_Balance").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
	 $("#Loan_Balance").attr("title","Positive Nos Only,Maximun Six Digitss");
	}
else{
	$("#Loan_Balance").css({"border-style":"","border-color":"","border-width":"","background-color":""});	
	}
}


function validateLB(){
var x = $("#Loan_Balance").val();
    
	var ck_lopdays = /^[0-9 ]{1,6}$/;
	if(!(ck_lopdays.test(x) && x<=100000)){
	 
	 $("#Loan_Balance").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
	 $("#Loan_Balance").attr("title","Positive Nos Only,Maximun Six Digits");
	}
else{
	$("#Loan_Balance").css({"border-style":"","border-color":"","border-width":"","background-color":""});	
	}
}


function validateINC(){
var x = $("#Incentives").val();
    
	var ck_lopdays = /^[0-9 ]{1,6}$/;
	if(!(ck_lopdays.test(x))){
	 
	 $("#Incentives").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
	 $("#Incentives").attr("title","Positive Nos Only,Maximun Six Digits");
	}
else{
	$("#Incentives").css({"border-style":"","border-color":"","border-width":"","background-color":""});	
	}
}

function validateODD(){
var x = $("#Other_Deductions").val();
    
	var ck_lopdays = /^[0-9 ]{1,6}$/;
	if(!(ck_lopdays.test(x))){
	 
	 $("#Other_Deductions").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
	 $("#Other_Deductions").attr("title","Positive Nos Only,Maximun Six Digits");
	}
else{
	$("#Other_Deductions").css({"border-style":"","border-color":"","border-width":"","background-color":""});	
	}
}

function validateAll(){
	
	

}

</script>

<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        <!--title-->
        <center>Edit Monthly Payment Details</center>
        
      </h1>
    </section>
    
    <section class="content">
    <div style="text-align:right;">
    <a href="<?php echo base_url() ?>monthlyListings" class="btn btn-info" value="Back">Back</a>
    </div>
    <br/>
        <div class="row">
            <!-- left column -->
            <div class="col-md-12">
              <!-- general form elements -->
                <div class="box box-primary">
                     
                    <!-- form start-->
                    
                    <form role="form" id="edit" action="<?php echo base_url() ?>monthlypay/editmonthly" method="post">
                        <div class="box-body">
                            <div class="row">  
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="form-group">
                                        <span for="month_year">Month Year:</span>

                                        <input type="text" class="form-control" readonly id="MonthYear" name="Month_Year" value="<?php echo $Month_Year;?>">
                                    </div>
                                    </div>
                                </div>
 

                      
                     
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="form-group">
                                        <span for="EmpID">Employee ID:</span>
                                        <input type="text" class="form-control" readonly id="EmployeeID" name="EmpID" value="<?php echo $EmpID; ?>">
                                    </div>
                                    </div>
                                </div>
                            </div>

                            <div class="row">  

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="form-group">
                                        <span for="LOP_Days">LOP Days:</span>
                                        <input type="text" class="form-control requried" id="LOPDays" onfocusout="validateLOP();" title="lopdays" name="LOP_Days" pattern="[0-9]{1,2}" value="<?php echo $LOP_Days; ?>">
                                    </div>
                                    </div>
                                </div>
                                
					
                             
                                                          
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="form-group">
                                            <span for="OT_Hrs_Worked">OverTime Hours Worked:</span>
                                           <input type="text" class="form-control required" id="OT_Hrs_Worked" name="OT_Hrs_Worked" onfocusout="validateOTHRS();" pattern="[0-9 ]{1,3}" value="<?php echo $OT_Hrs_Worked; ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>
                                




                                <div class="row">
                                  <div class="col-md-6">
                                    <div class="form-group">
                                         <div class="form-group">
                                           <span for="Loan_Recovered">Loan Recovered:</span>
                                           <input type="text" class="form-control required" id="Loan_Recovered" name="Loan_Recovered" onfocusout="validateLR();" pattern="[0-9 ]{1,6}" value="<?php echo $Loan_Recovered; ?>">
                                        </div>
                                    </div>
                                </div>
                                         
                                                                                          
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="form-group">
                                            <span for="Loan_Balance">Loan Balance:</span>
                                           <input type="text" class="form-control required" id="Loan_Balance" name="Loan_Balance" onfocusout="validateLB();"pattern="[0-9 ]{1,6}" value="<?php echo $Loan_Balance; ?>">
                                        </div>
                                    </div>
                                </div>
                            </div> 




                             <div class="row">
                                  <div class="col-md-6">
                                    <div class="form-group">
                                         <div class="form-group">
                                           <span for="Incentives">Incentives:</span>
                                           <input type="text" class="form-control required" id="Incentives" onfocusout="validateINC();" name="Incentives" pattern="[0-9 ]{1,6}" value="<?php echo $Incentives; ?>">
                                        </div>
                                    </div>
                                </div>
                        
                                                          
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="form-group">
                                            <span for="Other_Deductions">Other Deductions:</span>
                                           <input type="text" class="form-control required" id="Other_Deductions" onfocusout="validateODD();" name="Other_Deductions" pattern="[0-9 ]{1,6}" value="<?php echo $Other_Deductions; ?>">
                                        </div>
                                    </div>
                                </div>
                            </div> 



                            <div class="row">
                                  <div class="col-md-6">
                                    <div class="form-group">
                                         <div class="form-group">
                                    
                                           <input type="hidden" class="form-control required" id="CreatedBy" name="CreatedBy" value="<?php echo $Created_By; ?>">
                                        </div>
                                    </div>
                                </div>
                               
                                                          
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="form-group">
                            
                                           <input type="hidden" class="form-control required" id="Created_Time" name="Created_Time" value="<?php echo $Created_Time; ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>


                            <div class="row">
                                  <div class="col-md-6">
                                    <div class="form-group">
                                         <div class="form-group">
                                          
                                           <!--<input type="hidden" class="form-control required" id="LastModifiedBy" name="LastModifiedBy" value="<?php echo $name; ?>">-->
                                        </div>
                                    </div>
                                </div>
                               
                                                          
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="form-group">
                                            
                                           <input type="hidden" class="form-control required" id="Last Modified Time" name="Last Modified Time" value="<?php echo $Last_Mod_Time; ?>">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div id="content">
                             <div class="box-footer" style="text-align:right">
                            <input type="submit"  class="btn btn-info" value="Submit" onclick="validateAll();"/>
                            <input type="reset" class="btn btn-info" value="Reset" />
                        </div>
                
                        </div>
                </div>
				</form> 
            </div>
        </div>
       
          </div> 
           
   
<div class="col-md-4">
                <?php
                    $this->load->helper('form');
                    $error = $this->session->flashdata('error');
                    if($error)
                    {
                ?>
                <div class="alert alert-danger alert-dismissable">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                    <?php echo $this->session->flashdata('error'); ?>                    
                </div>
                <?php } ?>
                <?php  
                    $success = $this->session->flashdata('success');
                    if($success)
                    {
                ?>
                <div class="alert alert-success alert-dismissable">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                    <?php echo $this->session->flashdata('success'); ?>
                </div>
                <?php } ?>
                
                <div class="row">
                    <div class="col-md-12">
                        <?php echo validation_errors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>'); ?>
                    </div>
                </div>
            </div>
          
    </section>
</div>

<script src="<?php echo base_url(); ?>assets/js/editUser.js" type="text/javascript"></script>