
<div class="page-content">
    <!-- Page Breadcrumb -->
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="#">Employee</a>
            </li>
            <li class="active">employee</li>
        </ul>
    </div>
    <!-- /Page Breadcrumb -->

    <!-- Page Header -->
    <div class="page-header position-relative">
        <div class="header-title">
            <h1>
                Employee employee
            </h1>
        </div>
        <!--Header Buttons-->
        <div class="header-buttons">
            <a class="sidebar-toggler" href="#">
                <i class="fa fa-arrows-h"></i>
            </a>
            <a class="refresh" id="refresh-toggler" href="">
                <i class="glyphicon glyphicon-refresh"></i>
            </a>
            <a class="fullscreen" id="fullscreen-toggler" href="#">
                <i class="glyphicon glyphicon-fullscreen"></i>
            </a>
        </div>
        <!--Header Buttons End-->
    </div>
    <!-- /Page Header -->
    <!-- Page Body -->
    



    
    <!-- End Page Body -->
                

    <div class="page-body">
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="row">
                    <div class="col-xs-12 col-md-12">
                        <div class="widget">
                            <div class="widget-header ">
                                <span class="widget-caption">Employee employee</span>
                                <div class="widget-buttons">
                                    <a href="#" data-toggle="maximize">
                                        <i class="fa fa-expand"></i>
                                    </a>
                                    <a href="#" data-toggle="collapse">
                                        <i class="fa fa-minus"></i>
                                    </a>
                                    <a href="#" data-toggle="dispose">
                                        <i class="fa fa-times"></i>
                                    </a>
                                </div>
                            </div>
                            <div class="widget-body">
                                <div class="table-toolbar">
                                    
                                    <a id="close" href="<?php echo site_url('employees')?>" class="btn btn-danger">
                                        <span class="fa fa-arrow-left"></span>
                                    </a>
                                    <div class="btn-group pull-right">
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-lg-12 col-sm-12 col-xs-12">
                                        <div class="well bordered-left bordered-themeprimary">
                                            <h3>Overview</h3>
                                            <p>You can add your employee details after which employee account is created from which employee can manage there task in vBizz.</p>
                                            <p>You Can mange several things related to employee like salary structure, employee details and recent activity</p>
                                        </div>
                                    </div>
                                </div>
                                <div class = "row center">
                                    <div class="col-lg-10 col-sm-6 col-xs-12">
                                        <div class="widget center">
                                            <div class="widget-header bordered-bottom bordered-lightred">
                                                <span class="widget-caption">Add New Record</span>
                                            </div>
                                            <div class="widget-body">
                                                <div id="horizontal-form">
                                                    <form class="form-horizontal" role="form" method="POST" action="<?php echo site_url('add_employee')?>" enctype="multipart/form-data">
                                                        <input type="hidden" name="userid" value="<?php echo !empty($employee)?$employee->userid:''?>">
                                                        <div class="tabbable">
                                                            <ul class="nav nav-tabs" id="myTab">
                                                                <li class="active">
                                                                    <a data-toggle="tab" href="#basic_details">
                                                                        Basic Details
                                                                    </a>
                                                                </li>

                                                                <li class="tab-red">
                                                                    <a data-toggle="tab" href="#sal_struc">
                                                                        Salary Structure For Current Month
                                                                    </a>
                                                                </li>

                                                                
                                                            </ul>
                                                            <div class="tab-content">
                                                                <div id="basic_details" class="tab-pane in active">
                                                                    <div class="form-group">
                                                                        <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Profile Pics</label>
                                                                        <div class="col-sm-10">
                                                                            <input type="file" class="form-control" name="profile_pic">
                                                                            <img id="profile_img" src="<?php echo !empty($employee->profile_pic)?$employee->profile_pic:site_url('uploads/noimage.png')?>" alt="" style="width:20%">
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Name</label>
                                                                        <div class="col-sm-10">
                                                                            <input type="text" class="form-control" name="name" placeholder="Employee Name" required
                                                                                value="<?php echo !empty($employee)?$employee->name:''?>"
                                                                            >
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Username</label>
                                                                        <div class="col-sm-10">
                                                                            <input type="text" class="form-control" name="username" placeholder="Username" required
                                                                                value="<?php echo !empty($employee)?$employee->username:''?>"
                                                                            >
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Password</label>
                                                                        <div class="col-sm-10">
                                                                            <input type="text" class="form-control" name="password" placeholder="Password" required
                                                                                value=""
                                                                            >
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">User Role</label>
                                                                        <div class="col-sm-10">
                                                                            <select id="user_role" name="user_role" style="width:100%" required>
                                                                                <?php 
                                                                                    foreach ($user_roles as $row){
                                                                                    ?>
                                                                                    <option value="<?php echo $row->id?>"><?php echo $row->title?></option>
                                                                                    <?php 
                                                                                    }
                                                                                ?>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Email</label>
                                                                        <div class="col-sm-10">
                                                                            <input type="text" class="form-control" name="email" placeholder="Email" required
                                                                                value="<?php echo !empty($employee)?$employee->email:''?>"
                                                                            >
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Employee Id</label>
                                                                        <div class="col-sm-10">
                                                                            <input type="text" class="form-control" name="empid" placeholder="Employee Id" required
                                                                                value="<?php echo !empty($employee)?$employee->empid:''?>"
                                                                            >
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Department</label>
                                                                        <div class="col-sm-10">
                                                                            <select id="emp_department" name="department" style="width:100%" required>
                                                                                <option value>Select Department</option>
                                                                                <?php 
                                                                                foreach ($departments as $row){
                                                                                ?>
                                                                                <option value="<?php echo $row->id?>"><?php echo $row->name?></option>
                                                                                <?php 
                                                                                }
                                                                                ?>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Designation</label>
                                                                        <div class="col-sm-10">
                                                                            <select id="emp_designation" name="designation" style="width:100%" required>
                                                                                <option value>Select Designation</option>
                                                                                <?php 
                                                                                foreach ($designations as $row){
                                                                                ?>
                                                                                <option value="<?php echo $row->id?>"><?php echo $row->title?></option>
                                                                                <?php 
                                                                                }
                                                                                ?>
                                                                            </select>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <div class="col-sm-10">
                                                                            <input id="show_more" onclick="show_more_options()" type="button" value="More Option" class="btn btn-info">
                                                                        </div>
                                                                    </div>
                                                                    <div id="more_options" class="hidden">
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Contact No.</label>
                                                                            <div class="col-sm-10">
                                                                                <input type="text" class="form-control" name="phone" placeholder="Contact No" 
                                                                                    value="<?php echo !empty($employee)?$employee->phone:''?>"
                                                                                >
                                                                            </div>
                                                                        </div>

                                                                        <div class="form-group">
                                                                            <label for="published" class="col-sm-2 control-label no-padding-right" >Gender</label>
                                                                            <div class="col-sm-10">
                                                                                <label>
                                                                                    <input id="gender" name="gender" class="checkbox-slider slider-icon colored-blue yesno" type="checkbox" 
                                                                                    <?php
                                                                                        if (!empty($employee)){
                                                                                            if ($employee->gender==1) {
                                                                                                echo 'checked';
                                                                                            } else {   
                                                                                                echo '';
                                                                                            }
                                                                                            
                                                                                        } 
                                                                                    ?>
                                                                                    >
                                                                                    <span class="text" style="margin-top:6px"></span>
                                                                                </label>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Blood Group</label>
                                                                            <div class="col-sm-10">
                                                                                <select id="blood_group" name="blood_group" style="width:100%">
                                                                                    <option value>Select Blood Group</option>
                                                                                    <option value="A+" <?php if(!empty($employee)&&$employee->blood_group=="A+") echo 'selected="selected"'; ?>>A+</option>
                                                                                    <option value="A-" <?php if(!empty($employee)&&$employee->blood_group=="A-") echo 'selected="selected"'; ?>>A-</option>
                                                                                    <option value="B+" <?php if(!empty($employee)&&$employee->blood_group=="B+") echo 'selected="selected"'; ?>>B+</option>
                                                                                    <option value="B-" <?php if(!empty($employee)&&$employee->blood_group=="B-") echo 'selected="selected"'; ?>>B-</option>
                                                                                    <option value="AB+" <?php if(!empty($employee)&&$employee->blood_group=="AB+") echo 'selected="selected"'; ?>>AB+</option>
                                                                                    <option value="AB-" <?php if(!empty($employee)&&$employee->blood_group=="AB-") echo 'selected="selected"'; ?>>AB-</option>
                                                                                    <option value="O+" <?php if(!empty($employee)&&$employee->blood_group=="O+") echo 'selected="selected"'; ?>>O+</option>
                                                                                    <option value="O-" <?php if(!empty($employee)&&$employee->blood_group=="O-") echo 'selected="selected"'; ?>>O-</option>
                                                                                </select>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Birth Date</label>
                                                                            <div class="col-sm-10">
                                                                                <input type="text" class="form-control date-picker" name="dob" data-date-format="yyyy-mm-dd" placeholder="Birth Date" 
                                                                                    value="<?php echo !empty($employee)?$employee->dob:''?>"
                                                                                >
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Present Address</label>
                                                                            <div class="col-sm-10">
                                                                                <textarea name="present_address" class="form-control" rows="3" placeholder="Present Address"><?php echo !empty($employee)?$employee->present_address:''?></textarea>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Permanent Address</label>
                                                                            <div class="col-sm-10">
                                                                                <textarea name="permanent_address" class="form-control" rows="3" placeholder="Permanent Address"><?php echo !empty($employee)?$employee->permanent_address:''?></textarea>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Joining Date</label>
                                                                            <div class="col-sm-10">
                                                                                <input type="text" class="form-control date-picker" name="joining_date" data-date-format="yyyy-mm-dd" placeholder="Joining Date" 
                                                                                    value="<?php echo !empty($employee)?$employee->joining_date:''?>"
                                                                                >
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Working Type</label>
                                                                            <div class="col-sm-10">
                                                                                <select id="work_type" name="work_type" style="width:100%" >
                                                                                    <option value>Select Working Type</option>
                                                                                    <option value="permanent" <?php if(!empty($employee)&&$employee->blood_group=="permanent") echo 'selected="selected"'; ?>>PERMANENT</option>
                                                                                    <option value="contract" <?php if(!empty($employee)&&$employee->blood_group=="contract") echo 'selected="selected"'; ?>>CONTRACT</option>
                                                                                    <option value="other" <?php if(!empty($employee)&&$employee->blood_group=="other") echo 'selected="selected"'; ?>>OTHER</option>
                                                                                </select>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Payment Type</label>
                                                                            <div class="col-sm-10">
                                                                                <select id="payment_type" name="payment_type" style="width:100%" >
                                                                                    <option value>Select Payment Type</option>
                                                                                    <option value="bank" <?php if(!empty($employee)&&$employee->payment_type=="bank") echo 'selected="selected"'; ?>>BANK TRANSFER</option>
                                                                                    <option value="checque" <?php if(!empty($employee)&&$employee->payment_type=="checque") echo 'selected="selected"'; ?>>CHECQUE</option>
                                                                                    <option value="cash" <?php if(!empty($employee)&&$employee->payment_type=="cash") echo 'selected="selected"'; ?>>CASH</option>
                                                                                </select>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Pan</label>
                                                                            <div class="col-sm-10">
                                                                                <input type="text" class="form-control" name="pan" placeholder="Pan" 
                                                                                    value="<?php echo !empty($employee)?$employee->pan:''?>"
                                                                                >
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">PF Acc No.</label>
                                                                            <div class="col-sm-10">
                                                                                <input type="number" class="form-control" name="pf_ac" placeholder="PF Acc No." 
                                                                                    value="<?php echo !empty($employee)?$employee->pf_ac:''?>"
                                                                                >
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Bank Acc No.</label>
                                                                            <div class="col-sm-10">
                                                                                <input type="number" class="form-control" name="bank_ac" placeholder="Bank Acc No" 
                                                                                    value="<?php echo !empty($employee)?$employee->bank_ac:''?>"
                                                                                >
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Bank Name</label>
                                                                            <div class="col-sm-10">
                                                                                <input type="text" class="form-control" name="bank_name" placeholder="Bank Name" 
                                                                                    value="<?php echo !empty($employee)?$employee->bank_name:''?>"
                                                                                >
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Bank Branch</label>
                                                                            <div class="col-sm-10">
                                                                                <input type="text" class="form-control" name="bank_branch" placeholder="Bank Branch" 
                                                                                    value="<?php echo !empty($employee)?$employee->bank_branch:''?>"
                                                                                >
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">IFSC Code</label>
                                                                            <div class="col-sm-10">
                                                                                <input type="text" class="form-control" name="ifsc" placeholder="IFSC Code" 
                                                                                    value="<?php echo !empty($employee)?$employee->ifsc:''?>"
                                                                                >
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-group">
                                                                            <label for="inputEmail3" class="col-sm-2 control-label no-padding-right">Leaving Date</label>
                                                                            <div class="col-sm-10">
                                                                                <input type="text" class="form-control date-picker" data-date-format="yyyy-mm-dd" name="leaving_date" placeholder="Leaving Date" 
                                                                                    value="<?php echo !empty($employee)?$employee->leaving_date:''?>"
                                                                                >
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <div class="col-sm-offset-2 col-sm-10">
                                                                            <button type="submit" class="btn btn-success">
                                                                            <span class="fa fa-check"></span>
                                                                            Save</button>
                                                                            <a id="close" href="<?php echo site_url('employees')?>" class="btn btn-danger">
                                                                                <span class="fa fa-close"></span>
                                                                                Close
                                                                            </a>
                                                                        </div>
                                                                    </div>

                                                                </div>
                                                                <div id="sal_struc" class="tab-pane">
                                                                    <table class="table table-striped">
                                                                        <thead>
                                                                            <tr>
                                                                                <th class="active" style="text-align:right">Effective From Date</th>
                                                                                <th>
                                                                                    <input type="" name="created" id="created" value="" class="date-picker" data-date-format="yyyy-mm-dd">
                                                                                </th>
                                                                            </tr>
                                                                        </thead>
                                                                    </table>
                                                                    <table class="table table-striped">
                                                                        <thead>
                                                                            <tr>
                                                                                <th class="active">
                                                                                    Payhead Name
                                                                                </th>
                                                                                <th class="active">
                                                                                    Payhead Type
                                                                                </th>
                                                                                <th class="active">
                                                                                    Amount
                                                                                </th>
                                                                            </tr>
                                                                        </thead>
                                                                        <tbody>
                                                                        </tbody>
                                                                    </table>

                                                                </div>


                                                            </div>
                                                        </div>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                    </div> 
                                    
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- End Page Content -->
<script>
    function show_more_options() {

        if($('#more_options').hasClass('hidden')){
            $('#show_more').val('Less Option');
            $('#more_options').removeClass('hidden');
        }else{
            $('#show_more').val('More Option');
            $('#more_options').addClass('hidden');
        }
        
    }
    $(document).ready(function(){

        $(".date-picker").datepicker();
        $("#emp_department").select2().val("<?php echo !empty($employee)?$employee->department:''?>").trigger("change");
        $("#emp_designation").select2().val("<?php echo !empty($employee)?$employee->designation:''?>").trigger("change");
    });
</script>