<div class="widget-box ">

<div class="clearfix"></div>

<div>
<div class="alert alert-block alert-info">
 </div>
	<div id="user-profile-1" class="user-profile row">
	    <div class="col-xs-12 col-sm-4"></div>
	    <div class="col-xs-12 col-sm-4">

			<div class="space-12"></div>

			<div class="widget-box">
             <?php
                    $message = $this->session->userdata('message');
                    if (!empty($message)) {
                        ?>
                        <div class="alert alert-block alert-success">
                            <h6 class="lighter arial green" style="text-align:center;"><b>
                                    <?php echo $message;
                                    $this->session->unset_userdata('message');
                                    ?>
                                </b></h6>
                        </div>  
                        <?php
                    }
                    $errormessage = $this->session->userdata('errormessage');
                    if (!empty($errormessage)) {
                        ?>
                        <div class="alert alert-block alert-danger">
                            <h6 class="lighter arial red" style="text-align:center;"><b>
                                    <?php echo $errormessage;
                                    $this->session->unset_userdata('errormessage');
                                    ?>
                                </b></h6>
                        </div> 
                        <?php
                    }
                    ?>
<div class="widget-header">
    <h4 class="widget-title">Edit Leave</h4>
</div>

<div class="widget-body">
    <div class="widget-main no-padding">
        <form action="<?php echo admin_url()?>/employeesetup/update_leave" method="post">
            <!-- <legend>Form</legend> -->
            <fieldset>
                
                <label class="col-xs-4 col-sm-4">Type </label>
                <input type="hidden" name="lv_employee" value="<?php if(!empty($LeaveByid['lv_employee'])){ echo $LeaveByid['lv_employee'];}?>">
                <input type="hidden" name="lv_id" value="<?php if(!empty($LeaveByid['lv_id'])){ echo $LeaveByid['lv_id'];}?>">
                <select class="col-xs-8 col-sm-8" name="data[lv_type]">
                    <?php 
                            if($LeaveByid['lv_type'] ==1)
                                {  echo "<option value='1' selected>Casual Leave</option>"; }
                            elseif($LeaveByid['lv_type'] ==2)
                                {  echo "<option value='2' selected>Sick Leave</option>"; }
                            elseif($LeaveByid['lv_type'] ==3)
                                {  echo "<option value='3' selected>Maternity Leave</option>"; }
                            elseif($LeaveByid['lv_type'] ==4)
                                {  echo "<option value='4' selected>Earned Leave</option>"; }
                            elseif($LeaveByid['lv_type'] ==5)
                                {  echo "<option value='5' selected>Quarantine Leave</option>"; }
                            elseif($LeaveByid['lv_type'] ==6)
                                {  echo "<option value='6' selected>Half Pay Leave</option>"; }
                            elseif($LeaveByid['lv_type'] ==7)
                                {  echo "<option value='7' selected>Study Leave</option>"; }
                            elseif($LeaveByid['lv_type'] ==8)
                                {  echo "<option value='8' selected>Other Leave</option>"; }
                                else{
                                    echo "Select option";
                                }
                        ?>
                    <option value='1'>Casual Leave</option>
                    <option value='2'>Sick Leave</option>
                    <option value='3'>Maternity Leave</option>
                    <option value='4'>Earned Leave</option>
                    <option value='5'>Quarantine Leave</option>
                    <option value='6'>Half Pay Leave</option>
                    <option value='7'>Study Leave</option>
                    <option value='8'>Other Leave</option>
                </select>
            </fieldset>
            <fieldset>
                <label class="col-xs-4 col-sm-4">Start Date </label>
                <?php echo form_error('data[lv_start]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                <input type="date" name="data[lv_start]" autocomplete="off" value="<?php if(!empty($LeaveByid['lv_start'])) {echo $LeaveByid['lv_start']; }?>" placeholder="" class="col-xs-8 col-sm-8" />
               
            </fieldset>
            <fieldset>
                <label class="col-xs-4 col-sm-4">Days </label>
                <?php echo form_error('data[lv_days]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                <input type="text" name="data[lv_days]" autocomplete="off" value="<?php if(!empty($LeaveByid['lv_days'])) {echo $LeaveByid['lv_days']; }?>" placeholder="3,4,5 Jun, 2020" class="col-xs-8 col-sm-8" />
               
            </fieldset>
            
            <fieldset>
                <label class="col-xs-4 col-sm-4">Number </label>
                <?php echo form_error('data[lv_number]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                <input type="number" name="data[lv_number]" autocomplete="off" value="<?php if(!empty($LeaveByid['lv_number'])) {echo $LeaveByid['lv_number']; }?>" placeholder="3" class="col-xs-8 col-sm-8" />
               
            </fieldset>
            <fieldset>
                <label class="col-xs-4 col-sm-4">Note </label>
                <?php echo form_error('data[lv_note]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                <input type="text" name="data[lv_note]" autocomplete="off" value="<?php if(!empty($LeaveByid['lv_note'])) {echo $LeaveByid['lv_note']; }?>" placeholder="Eg. Urgent meeting " class="col-xs-8 col-sm-8" />
               
            </fieldset>
            <fieldset>
                    <label class="col-xs-4 col-sm-4">Year </label>
                    <!--<input type="hidden" name="data[lv_employee]" value="<?php if(!empty($employeeById['userId'])){ echo $employeeById['userId'];}?>">-->
                    <select class="col-xs-8 col-sm-8" name="data[lv_year]">
                        <option value="<?php if(!empty($LeaveByid['lv_year'])) {echo $LeaveByid['lv_year']; }?>"><?php if(!empty($LeaveByid['lv_year'])) {echo $LeaveByid['lv_year']; }?></option>
                        <?php 
                            $currentyear=date('Y'); echo $currentyear; $nextfiveyear=$currentyear +5; echo $nextfiveyear;
                            for($i=$currentyear; $currentyear <= $nextfiveyear; $currentyear++ ){
                                echo '<option value="'.$currentyear.'">'.$currentyear.'</option>';
                            }
                        ?>
                    </select>
                </fieldset>

            <div class="form-actions center">
                <button type="submit" name="btnUpdate" class="btn btn-sm btn-success">
                     <i class="ace-icon fa fa-check bigger-110"></i>Update</button>
            </div>
        </form>
    </div>
</div>
</div>
		</div>
	</div>
</div>
<br><br>
</div>
