<script type="text/javascript" src="<?php echo base_url();?>assets/js/employee.js"></script>
<aside class="right-side">
    <section class="content-header">
        <div class="title_bar">
            <h1 class="major_txt_color">Employee Edit</h1>
            <div class="breadcrumb_container"><?php echo breadcrumb_links();?></div>
        </div>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <form action="<?php echo $form_action;?>" method="post" name="employee_form" enctype="multipart/form-data" method="post">    
                    <input type="hidden" name="hidden_id" value="<?php echo $employee->id;?>" />    
                    <div class="box box-danger">
                        <div class="box-body">
                            <ul class="error_container"></ul>
                            <div class="col-xs-12">
                                <div class="col-md-6">
                                    <div class="form-group float-clear">
                                        <label>Name<span class="required">*</span></label>
                                        <input type="text" class="form-control" name="name" placeholder="Name" autofocus value="<?php echo $employee->name;?>" />
                                    </div>
                                    <div class="form-group float-clear">
                                        <label>Designation</label>
                                        <input type="text" class="form-control" name="designation" placeholder="Designation" value="<?php echo $employee->designation;?>" />
                                    </div>
                                    <div class="form-group float-clear">
                                        <label>Date of Birth</label>
                                        <div class="input-group">
                                            <input type="text" class="form-control datepicker" name="dob" placeholder="DD-MM-YYYY" value="<?php echo $employee->dob;?>" />
                                            <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                        </div>
                                    </div>
                                    
                                     <div class="form-group float-clear">
                                        <label>Address<span class="required">*</span></label>
                                        <textarea type="text" class="form-control" name="address"><?php echo $employee->address;?></textarea>
                                    </div>
                                    
                                    <div class="form-group float-clear">
                                        <label>Passport No<span class="required">*</span></label>
                                        <input type="text" class="form-control passport_no check_exist" name="passport_no" placeholder="Passport No" value="<?php echo $employee->passport_no;?>" />
                                    </div>
                                    <div class="form-group float-clear">
                                        <label>Passport Valid Upto</label>
                                        <div class="input-group">
                                            <input type="text" class="form-control datepicker" name="passport_valid_upto" placeholder="DD-MM-YYYY" value="<?php echo ($employee->passport_valid_to != '01-01-1970') ? $employee->passport_valid_to : '';?>" />
                                            <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group float-clear">
                                        <label>Work Permit No<span class="required">*</span></label>
                                        <input type="text" class="form-control work_permit_no check_exist" name="work_permit_no" placeholder="Work Permit No" value="<?php echo $employee->work_permit_no;?>" />
                                    </div>
                                    
                                    <div class="form-group float-clear">
                                        <label>Security Bond No<span class="required">*</span></label>
                                        <input type="text" class="form-control security_bond_no check_exist" name="security_bond_no" placeholder="Security Bond No" value="<?php echo $employee->security_bond_no;?>" />
                                    </div>
                                    
                                    <div class="form-group float-clear">
                                        <label>Photo</label>
                                        
                                        <?php
                                            if( !empty( $employee->image ) ) :
                                                ?>
                                                    <div class="img-preview">
                                                        <i class="fa fa-times rm-btn"></i>
                                                        <img src="<?php echo base_url() . EMP_DIR . $employee->image; ?>" >
                                                    </div>
                                                <?php
                                                
                                            endif;
                                        ?>
                                        <input type="file" class="form-control" name="image" data-value="<?php echo $employee->image; ?>"/>
                                    </div>
                                </div>
                                
                                <div class="col-md-6">
                                     <div class="form-group float-clear">
                                        <label>Date of Application</label>
                                        <div class="input-group">
                                            <input type="text" class="form-control datepicker" name="date_of_app" placeholder="DD-MM-YYYY" value="<?php echo ($employee->date_of_app != '01-01-1970') ? $employee->date_of_app : '';?>" />
                                            <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                        </div>
                                    </div>
                                    <div class="form-group float-clear">
                                        <label>Date of Joined</label>
                                        <div class="input-group">
                                            <input type="text" class="form-control datepicker" name="date_of_join" placeholder="DD-MM-YYYY" value="<?php echo ($employee->date_of_join != '01-01-1970') ? $employee->date_of_join : '';?>" />
                                            <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                        </div>
                                    </div>
                                    <div class="form-group float-clear">
                                        <label>Date of Expired</label>
                                        <div class="input-group">
                                            <input type="text" class="form-control datepicker" name="date_of_expire" placeholder="DD-MM-YYYY" value="<?php echo ($employee->date_of_expired != '01-01-1970') ? $employee->date_of_expired : '';?>" />
                                            <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group float-clear">
                                        <label>Date of Renewal</label>
                                        <div class="input-group">
                                            <input type="text" class="form-control datepicker" name="date_of_renewal" placeholder="DD-MM-YYYY" value="<?php echo ($employee->date_of_renewal != '01-01-1970') ? $employee->date_of_renewal : '';?>" />
                                            <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                        </div>
                                    </div>
                                    <div class="form-group float-clear">
                                        <label>Contact No:[S]</label>
                                        <input type="text" class="form-control" name="hps" placeholder="Contact No:[S]" value="<?php echo $employee->hps;?>" />
                                    </div>
                                    
                                    <div class="form-group float-clear">
                                        <label>Contact No:[I]</label>
                                        <input type="text" class="form-control" name="hpi" placeholder="Contact No:[I]" value="<?php echo $employee->hpi;?>" />
                                    </div>
                                    
                                    <div class="form-group float-clear">
                                        <label>WCI Insurance No</label>
                                        <input type="text" class="form-control" name="wci_no" placeholder="wci_no" value="<?php echo $employee->wci_insurance_no;?>" />
                                    </div>
                                    
                                    <div class="form-group float-clear">
                                        <label>Insurance Valid Upto</label>
                                        <div class="input-group">
                                            <input type="text" class="form-control datepicker" name="insurance_valid" placeholder="DD-MM-YYYY" value="<?php echo ($employee->insurance_valid_to != '01-01-1970') ? $employee->insurance_valid_to : '';?>" />
                                            <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label class="leftcol">Status</label>
                                        <div>
                                            <label for="status" style="width: 32%;"><input type="radio" name="status" value="1" <?php echo $employee->status == "1" ? 'checked' : ''; ?>/> &nbsp;&nbsp;Active</label> 
                                            <label for="status" style="width: 32%;"><input type="radio" name="status" value="0" <?php echo $employee->status == "0" ? 'checked' : ''; ?> /> &nbsp;&nbsp;Inactive</label> 
                                        </div>
                                    </div>
                                    
                                   
                                </div>
                            </div>
                        </div>
                        
                        <div class="box-footer form-actions float-clear">
                            <input class="btn reset" type="reset" value="Reset" />
                            <input type="submit" name="submit" value="Update" class="btn btn-success btn-primary" />
                        </div>
                    </div><!-- /.box -->
                </form>
            </div><!-- /.col-xs-12 -->
        </div><!-- /.row -->
    </section><!-- /.content -->
</aside>