<div class="page-content" >


<div class="row">

    <div class="col-xs-12 col-sm-12">
        <div class="widget-box">
            <div class="widget-header" style="height:70px;">
                <h4  style="text-align:center; color:green;"><b> Edit Employee</b> </h4>
            </div>

            <div class="widget-body ">

                 <?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-main no-padding ">
                    <form action="<?php echo admin_url()?>/employeesetup/update_employee " method="post" enctype="multipart/form-data">
                        <!-- <legend>Form</legend> -->

                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2">  Employee Id </label>
                            <?php echo form_error('data[userId]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <input type="text" name="data[userId]" value="<?php if(!empty($employeeByid['userId'])) {echo $employeeByid['userId']; }?>" placeholder="e.id" class="col-xs-4 col-sm-4" />
                            <input type="hidden" name="userId" value="<?php if(!empty($employeeByid['userId'])) {echo $employeeByid['userId']; }?>"  class="col-xs-4 col-sm-4" />
                        </fieldset>

                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2">  Name </label>
                            <?php echo form_error('data[userName]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <input type="text" name="data[userName]" value="<?php if(!empty($employeeByid['userName'])) {echo $employeeByid['userName']; }?>" placeholder="Name" class="col-xs-4 col-sm-4" />
                            <input type="hidden" name="userId" value="<?php if(!empty($employeeByid['userId'])) {echo $employeeByid['userId']; }?>"  class="col-xs-4 col-sm-4" />
                        </fieldset>
                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> National Id </label>
                            <?php echo form_error('data[nationalId]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <input type="text" name="data[nationalId]" value="<?php if(!empty($employeeByid['nationalId'])) {echo $employeeByid['nationalId']; }?>" placeholder="nationalId" class="col-xs-4 col-sm-4" />

                        </fieldset>

                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> Mobile </label>
                            <?php echo form_error('data[mobile]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <input type="text" name="data[mobile]" value="<?php if(!empty($employeeByid['mobile'])) {echo $employeeByid['mobile']; }?>" placeholder="mobile" class="col-xs-4 col-sm-4" />

                        </fieldset>
                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> Email </label>
                            <?php echo form_error('data[email]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <input type="text" name="data[email]" value="<?php if(!empty($employeeByid['email'])) {echo $employeeByid['email']; }?>" placeholder="email" class="col-xs-4 col-sm-4" />

                        </fieldset>

                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2">Gender </label>
                            <?php echo form_error('data[gender]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <select name="data[gender]" class="col-xs-3 col-sm-3">

                                <?php foreach(getGender() as $key=>$value){?>
                                    <option value="<?php echo $key?>" <?php echo ($employeeByid['gender'] == $key) ? "Selected" : ""; ?>>
                                        <?php echo $value;?>
                                    </option>
                                <?php }?>
                            </select>

                        </fieldset>

                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> Religion </label>
                            <?php echo form_error('data[religion]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <select name="data[religion]" class="col-xs-3 col-sm-3">

                                <?php foreach(getReligion() as $key=>$value){?>
                                    <option value="<?php echo $key?>" <?php echo ($employeeByid['religion'] == $key) ? "Selected" : ""; ?>>
                                        <?php echo $value;?>
                                    </option>
                                <?php }?>
                            </select>

                        </fieldset>

                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> Father name </label>
                            <?php echo form_error('data[fatherName]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <input type="text" name="data[fatherName]" value="<?php if(!empty($employeeByid['fatherName'])) {echo $employeeByid['fatherName']; }?>" placeholder="fatherName" class="col-xs-4 col-sm-4" />

                        </fieldset>

                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> Mother name </label>
                            <?php echo form_error('data[motherName]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <input type="text" name="data[motherName]" value="<?php if(!empty($employeeByid['motherName'])) {echo $employeeByid['motherName']; }?>" placeholder="motherName" class="col-xs-4 col-sm-4" />

                        </fieldset>
                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> Present Address </label>
                            <?php echo form_error('data[presentAddress]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>

                           <textarea rows='5' cols="5" name="data[presentAddress]" class="col-xs-4 col-sm-4" ><?php if(!empty($employeeByid['presentAddress'])) {echo $employeeByid['presentAddress']; }?></textarea>
                        </fieldset>
                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> Parmanent Address </label>
                            <?php echo form_error('data[parmanentAddress]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>

                           <textarea rows='5' cols="5" name="data[parmanentAddress]" class="col-xs-4 col-sm-4" ><?php if(!empty($employeeByid['parmanentAddress'])) {echo $employeeByid['parmanentAddress']; }?></textarea>
                        </fieldset>
                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2"> Upload photo </label>
                            <?php echo form_error('data[photo]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>

                           <input type="file"  name="photo" value="<?php if(!empty($employeeByid['photo'])) {echo $employeeByid['photo']; }?>" class="widget-box col-xs-3 col-sm-3" />

                        </fieldset>
                        <fieldset class="col-xs-12 col-sm-12">
                            <label class="col-xs-2 col-sm-2">User Type </label>
                            <?php echo form_error('data[userType]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                            <select name="data[userType]" class="col-xs-3 col-sm-3">
                                    <option> Select User Type.....</option>>
                                <?php foreach(getUserType() as $key=>$value){?>
                                    <option value="<?php echo $key?>" <?php echo ($employeeByid['userType'] == $key) ? "Selected" : ""; ?>>
                                        <?php echo $value;?>
                                    </option>
                                <?php }?>
                            </select>

                        </fieldset>



                        <fieldset class="col-xs-12 col-sm-12">
                                <div class="col-xs-2 col-sm-2"><label>Joining Date</label></div>
                                <?php echo form_error('data[joiningdate]', '<div style="color: rgb(255, 0, 0);">', '</div>'); ?>
                                <div class="input-group col-xs-3 col-sm-3">
                                    <input class="form-control date-picker" id="id-date-picker-1" type="text" name="data[joiningdate]" value="<?php if(!empty($employeeByid['joiningdate'])) {echo $employeeByid['joiningdate']; }?>" data-date-format="yyyy-mm-dd"  />
                                    <span class="input-group-addon">
                                        <i class="fa fa-calendar bigger-110"></i>
                                    </span>
                                </div>
                        </fieldset>

                        <fieldset class="col-xs-12 col-sm-12">
                            <div class="col-xs-2 col-sm-2"><label>Reigning Date</label></div>
                            <div class="input-group col-xs-3 col-sm-3">
                                <input class="form-control date-picker" id="id-date-picker-1" type="text" name="data[reigning_date]" value="<?php if(!empty($employeeByid['reigning_date'])) {echo $employeeByid['reigning_date']; }?>" data-date-format="yyyy-mm-dd"  />
                                <span class="input-group-addon">
                                        <i class="fa fa-calendar bigger-110"></i>
                                    </span>
                            </div>
                        </fieldset>







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

                        <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>

