<?php 
//check if current user role is allowed access to the pages
$can_add = ACL::is_allowed("employee_details/add");
$can_edit = ACL::is_allowed("employee_details/edit");
$can_view = ACL::is_allowed("employee_details/view");
$can_delete = ACL::is_allowed("employee_details/delete");
?>
<?php
$comp_model = new SharedController;
$page_element_id = "list-page-" . random_str();
$current_page = $this->set_current_page_link();
$csrf_token = Csrf::$token;
//Page Data From Controller
$view_data = $this->view_data;
$records = $view_data->records;
$record_count = $view_data->record_count;
$total_records = $view_data->total_records;
$field_name = $this->route->field_name;
$field_value = $this->route->field_value;
$view_title = $this->view_title;
$show_header = $this->show_header;
$show_footer = $this->show_footer;
$show_pagination = $this->show_pagination;
?>
<section class="page" id="<?php echo $page_element_id; ?>" data-page-type="list"  data-display-type="table" data-page-url="<?php print_link($current_page); ?>">
    <?php
    if( $show_header == true ){
    ?>
    <div  class="bg-light p-3 mb-3">
        <div class="container-fluid">
            <div class="row ">
                <div class="col ">
                    <h4 class="record-title">Employee Details</h4>
                </div>
                <div class="col-sm-3 ">
                    <?php if($can_add){ ?>
                    <a  class="btn btn btn-primary my-1" href="<?php print_link("employee_details/add") ?>">
                        <i class="fa fa-plus"></i>                              
                        Add New Employee Details 
                    </a>
                    <?php } ?>
                </div>
                <div class="col-sm-4 ">
                    <form  class="search" action="<?php print_link('employee_details/'); ?>" method="get">
                        <div class="input-group">
                            <input value="<?php echo get_value('search'); ?>" class="form-control" type="text" name="search"  placeholder="Search" />
                                <div class="input-group-append">
                                    <button class="btn btn-primary"><i class="fa fa-search"></i></button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="col-md-12 comp-grid">
                        <div class="">
                            <!-- Page bread crumbs components-->
                            <?php
                            if(!empty($field_name) || !empty($_GET['search'])){
                            ?>
                            <hr class="sm d-block d-sm-none" />
                            <nav class="page-header-breadcrumbs mt-2" aria-label="breadcrumb">
                                <ul class="breadcrumb m-0 p-1">
                                    <?php
                                    if(!empty($field_name)){
                                    ?>
                                    <li class="breadcrumb-item">
                                        <a class="text-decoration-none" href="<?php print_link('employee_details'); ?>">
                                            <i class="fa fa-angle-left"></i>
                                        </a>
                                    </li>
                                    <li class="breadcrumb-item">
                                        <?php echo (get_value("tag") ? get_value("tag")  :  make_readable($field_name)); ?>
                                    </li>
                                    <li  class="breadcrumb-item active text-capitalize font-weight-bold">
                                        <?php echo (get_value("label") ? get_value("label")  :  make_readable(urldecode($field_value))); ?>
                                    </li>
                                    <?php 
                                    }   
                                    ?>
                                    <?php
                                    if(get_value("search")){
                                    ?>
                                    <li class="breadcrumb-item">
                                        <a class="text-decoration-none" href="<?php print_link('employee_details'); ?>">
                                            <i class="fa fa-angle-left"></i>
                                        </a>
                                    </li>
                                    <li class="breadcrumb-item text-capitalize">
                                        Search
                                    </li>
                                    <li  class="breadcrumb-item active text-capitalize font-weight-bold"><?php echo get_value("search"); ?></li>
                                    <?php
                                    }
                                    ?>
                                </ul>
                            </nav>
                            <!--End of Page bread crumbs components-->
                            <?php
                            }
                            ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <?php
        }
        ?>
        <div  class="">
            <div class="container-fluid">
                <div class="row ">
                    <div class="col-md-12 comp-grid">
                        <?php $this :: display_page_errors(); ?>
                        <div  class=" animated fadeIn page-content">
                            <div id="employee_details-emppresent-records">
                                <div id="page-report-body" class="table-responsive">
                                    <table class="table  table-striped table-sm text-left">
                                        <thead class="table-header bg-light">
                                            <tr>
                                                <?php if($can_delete){ ?>
                                                <th class="td-checkbox">
                                                    <label class="custom-control custom-checkbox custom-control-inline">
                                                        <input class="toggle-check-all custom-control-input" type="checkbox" />
                                                        <span class="custom-control-label"></span>
                                                    </label>
                                                </th>
                                                <?php } ?>
                                                <th class="td-sno">#</th>
                                                <th  class="td-id"> Id</th>
                                                <th  class="td-employee_name"> Employee Name</th>
                                                <th  class="td-portfolio_id"> Portfolio Id</th>
                                                <th  class="td-basic_pay"> Basic Pay</th>
                                                <th  class="td-bank_acc_no"> Bank Acc No</th>
                                                <th  class="td-bank_name"> Bank Name</th>
                                                <th  class="td-email"> Email</th>
                                                <th  class="td-dob"> Dob</th>
                                                <th  class="td-date_of_join"> Date Of Join</th>
                                                <th  class="td-date_of_retirement"> Date Of Retirement</th>
                                                <th  class="td-department"> Department</th>
                                                <th  class="td-IFSC"> Ifsc</th>
                                                <th  class="td-designation"> Designation</th>
                                                <th  class="td-caste"> Caste</th>
                                                <th  class="td-relegion"> Relegion</th>
                                                <th  class="td-nominee"> Nominee</th>
                                                <th  class="td-payscale"> Payscale</th>
                                                <th  class="td-gender"> Gender</th>
                                                <th  class="td-identification_mark"> Identification Mark</th>
                                                <th  class="td-place_of_birth"> Place Of Birth</th>
                                                <th  class="td-balanceleave"> Balanceleave</th>
                                                <th  class="td-mobile"> Mobile</th>
                                                <th  class="td-photo"> Photo</th>
                                                <th  class="td-user_info2_id"> User Info2 Id</th>
                                                <th  class="td-user_info2_username"> User Info2 Username</th>
                                                <th  class="td-user_info2_password"> User Info2 Password</th>
                                                <th  class="td-user_info2_email"> User Info2 Email</th>
                                                <th  class="td-user_info2_user_full_name"> User Info2 User Full Name</th>
                                                <th  class="td-user_info2_user_role_id"> User Info2 User Role Id</th>
                                                <th  class="td-user_info2_portfolio_id"> User Info2 Portfolio Id</th>
                                                <th  class="td-absent_in_out_id"> Absent In Out Id</th>
                                                <th  class="td-absent_in_out_empid"> Absent In Out Empid</th>
                                                <th  class="td-absent_in_out_userid"> Absent In Out Userid</th>
                                                <th  class="td-absent_in_out_attendance_type"> Absent In Out Attendance Type</th>
                                                <th  class="td-absent_in_out_in_out"> Absent In Out In Out</th>
                                                <th  class="td-absent_in_out_for_date"> Absent In Out For Date</th>
                                                <th  class="td-absent_in_out_entrytime"> Absent In Out Entrytime</th>
                                                <th  class="td-absent_in_out_time"> Absent In Out Time</th>
                                                <th  class="td-user_info_id"> User Info Id</th>
                                                <th  class="td-user_info_username"> User Info Username</th>
                                                <th  class="td-user_info_password"> User Info Password</th>
                                                <th  class="td-user_info_email"> User Info Email</th>
                                                <th  class="td-user_info_user_full_name"> User Info User Full Name</th>
                                                <th  class="td-user_info_user_role_id"> User Info User Role Id</th>
                                                <th  class="td-user_info_portfolio_id"> User Info Portfolio Id</th>
                                                <th class="td-btn"></th>
                                            </tr>
                                        </thead>
                                        <?php
                                        if(!empty($records)){
                                        ?>
                                        <tbody class="page-data" id="page-data-<?php echo $page_element_id; ?>">
                                            <!--record-->
                                            <?php
                                            $counter = 0;
                                            foreach($records as $data){
                                            $rec_id = (!empty($data['id']) ? urlencode($data['id']) : null);
                                            $counter++;
                                            ?>
                                            <tr>
                                                <?php if($can_delete){ ?>
                                                <th class=" td-checkbox">
                                                    <label class="custom-control custom-checkbox custom-control-inline">
                                                        <input class="optioncheck custom-control-input" name="optioncheck[]" value="<?php echo $data['id'] ?>" type="checkbox" />
                                                            <span class="custom-control-label"></span>
                                                        </label>
                                                    </th>
                                                    <?php } ?>
                                                    <th class="td-sno"><?php echo $counter; ?></th>
                                                    <td class="td-id"><a href="<?php print_link("employee_details/view/$data[id]") ?>"><?php echo $data['id']; ?></a></td>
                                                    <td class="td-employee_name">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['employee_name']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="employee_name" 
                                                            data-title="Enter Employee Name" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['employee_name']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-portfolio_id">
                                                        <span <?php if($can_edit){ ?> data-source='<?php print_link('api/json/employee_details_portfolio_id_option_list'); ?>' 
                                                            data-value="<?php echo $data['portfolio_id']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="portfolio_id" 
                                                            data-title="Select a value ..." 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="select" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['portfolio_id']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-basic_pay">
                                                        <span <?php if($can_edit){ ?> data-step="0.01" 
                                                            data-value="<?php echo $data['basic_pay']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="basic_pay" 
                                                            data-title="Enter Basic Pay" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="number" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['basic_pay']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-bank_acc_no">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['bank_acc_no']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="bank_acc_no" 
                                                            data-title="Enter Bank Acc No" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['bank_acc_no']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-bank_name">
                                                        <span <?php if($can_edit){ ?> data-source='<?php print_link('api/json/employee_details_bank_name_option_list'); ?>' 
                                                            data-value="<?php echo $data['bank_name']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="bank_name" 
                                                            data-title="Select a value ..." 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="select" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['bank_name']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-email"><a href="<?php print_link("mailto:$data[email]") ?>"><?php echo $data['email']; ?></a></td>
                                                    <td class="td-dob">
                                                        <span <?php if($can_edit){ ?> data-flatpickr="{ enableTime: false, minDate: '', maxDate: ''}" 
                                                            data-value="<?php echo $data['dob']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="dob" 
                                                            data-title="Enter Dob" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="flatdatetimepicker" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['dob']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-date_of_join">
                                                        <span <?php if($can_edit){ ?> data-flatpickr="{ enableTime: false, minDate: '', maxDate: ''}" 
                                                            data-value="<?php echo $data['date_of_join']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="date_of_join" 
                                                            data-title="Enter Date Of Join" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="flatdatetimepicker" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['date_of_join']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-date_of_retirement">
                                                        <span <?php if($can_edit){ ?> data-flatpickr="{ enableTime: false, minDate: '', maxDate: ''}" 
                                                            data-value="<?php echo $data['date_of_retirement']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="date_of_retirement" 
                                                            data-title="Enter Date Of Retirement" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="flatdatetimepicker" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['date_of_retirement']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-department">
                                                        <span <?php if($can_edit){ ?> data-source='<?php print_link('api/json/employee_details_department_option_list'); ?>' 
                                                            data-value="<?php echo $data['department']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="department" 
                                                            data-title="Select a value ..." 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="select" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['department']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-IFSC">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['IFSC']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="IFSC" 
                                                            data-title="Enter Ifsc" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['IFSC']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-designation">
                                                        <span <?php if($can_edit){ ?> data-source='<?php print_link('api/json/employee_details_designation_option_list'); ?>' 
                                                            data-value="<?php echo $data['designation']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="designation" 
                                                            data-title="Select a value ..." 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="select" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['designation']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-caste">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['caste']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="caste" 
                                                            data-title="Enter Caste" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['caste']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-relegion">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['relegion']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="relegion" 
                                                            data-title="Enter Relegion" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['relegion']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-nominee">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['nominee']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="nominee" 
                                                            data-title="Enter Nominee" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['nominee']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-payscale">
                                                        <span <?php if($can_edit){ ?> data-source='<?php print_link('api/json/employee_details_payscale_option_list'); ?>' 
                                                            data-value="<?php echo $data['payscale']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="payscale" 
                                                            data-title="Select a value ..." 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="select" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['payscale']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-gender">
                                                        <span <?php if($can_edit){ ?> data-source='<?php echo json_encode_quote(Menu :: $gender); ?>' 
                                                            data-value="<?php echo $data['gender']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="gender" 
                                                            data-title="Select a value ..." 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="select" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['gender']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-identification_mark">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['identification_mark']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="identification_mark" 
                                                            data-title="Enter Identification Mark" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['identification_mark']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-place_of_birth">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['place_of_birth']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="place_of_birth" 
                                                            data-title="Enter Place Of Birth" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['place_of_birth']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-balanceleave">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['balanceleave']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="balanceleave" 
                                                            data-title="Enter Balanceleave" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="number" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['balanceleave']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-mobile">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['mobile']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="mobile" 
                                                            data-title="Enter Mobile" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['mobile']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-photo">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['photo']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("employee_details/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="photo" 
                                                            data-title="Browse..." 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['photo']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-user_info2_id"> <?php echo $data['user_info2_id']; ?></td>
                                                    <td class="td-user_info2_username">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['user_info2_username']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("user_info/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="username" 
                                                            data-title="Enter Username" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['user_info2_username']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-user_info2_password"> <?php echo $data['user_info2_password']; ?></td>
                                                    <td class="td-user_info2_email"><a href="<?php print_link("mailto:$data[user_info2_email]") ?>"><?php echo $data['user_info2_email']; ?></a></td>
                                                    <td class="td-user_info2_user_full_name">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['user_info2_user_full_name']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("user_info/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="user_full_name" 
                                                            data-title="Enter User Full Name" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['user_info2_user_full_name']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-user_info2_user_role_id">
                                                        <span <?php if($can_edit){ ?> data-source='<?php print_link('api/json/employee_details_user_info2_user_role_id_option_list'); ?>' 
                                                            data-value="<?php echo $data['user_info2_user_role_id']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("user_info/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="user_role_id" 
                                                            data-title="Select a value ..." 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="select" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['user_info2_user_role_id']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-user_info2_portfolio_id">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['user_info2_portfolio_id']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("user_info/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="portfolio_id" 
                                                            data-title="Enter Portfolio Id" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['user_info2_portfolio_id']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-absent_in_out_id"> <?php echo $data['absent_in_out_id']; ?></td>
                                                    <td class="td-absent_in_out_empid">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['absent_in_out_empid']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("absent_in_out/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="empid" 
                                                            data-title="Enter Empid" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['absent_in_out_empid']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-absent_in_out_userid">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['absent_in_out_userid']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("absent_in_out/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="userid" 
                                                            data-title="Enter Userid" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['absent_in_out_userid']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-absent_in_out_attendance_type">
                                                        <span <?php if($can_edit){ ?> data-source='<?php echo json_encode_quote(Menu :: $attendance_type); ?>' 
                                                            data-value="<?php echo $data['absent_in_out_attendance_type']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("absent_in_out/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="attendance_type" 
                                                            data-title="Select a value ..." 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="select" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['absent_in_out_attendance_type']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-absent_in_out_in_out">
                                                        <span <?php if($can_edit){ ?> data-source='<?php echo json_encode_quote(Menu :: $in_out); ?>' 
                                                            data-value="<?php echo $data['absent_in_out_in_out']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("absent_in_out/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="in_out" 
                                                            data-title="Select a value ..." 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="select" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['absent_in_out_in_out']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-absent_in_out_for_date">
                                                        <span <?php if($can_edit){ ?> data-flatpickr="{ enableTime: false, minDate: '', maxDate: '<?php echo date_now(); ?>'}" 
                                                            data-value="<?php echo $data['absent_in_out_for_date']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("absent_in_out/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="for_date" 
                                                            data-title="Enter For Date" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="flatdatetimepicker" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['absent_in_out_for_date']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-absent_in_out_entrytime"> <?php echo $data['absent_in_out_entrytime']; ?></td>
                                                    <td class="td-absent_in_out_time">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['absent_in_out_time']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("absent_in_out/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="time" 
                                                            data-title="Enter Time" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="time" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['absent_in_out_time']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-user_info_id"> <?php echo $data['user_info_id']; ?></td>
                                                    <td class="td-user_info_username">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['user_info_username']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("user_info/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="username" 
                                                            data-title="Enter Username" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['user_info_username']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-user_info_password"> <?php echo $data['user_info_password']; ?></td>
                                                    <td class="td-user_info_email"><a href="<?php print_link("mailto:$data[user_info_email]") ?>"><?php echo $data['user_info_email']; ?></a></td>
                                                    <td class="td-user_info_user_full_name">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['user_info_user_full_name']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("user_info/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="user_full_name" 
                                                            data-title="Enter User Full Name" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['user_info_user_full_name']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-user_info_user_role_id">
                                                        <span <?php if($can_edit){ ?> data-source='<?php print_link('api/json/employee_details_user_info_user_role_id_option_list'); ?>' 
                                                            data-value="<?php echo $data['user_info_user_role_id']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("user_info/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="user_role_id" 
                                                            data-title="Select a value ..." 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="select" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['user_info_user_role_id']; ?> 
                                                        </span>
                                                    </td>
                                                    <td class="td-user_info_portfolio_id">
                                                        <span <?php if($can_edit){ ?> data-value="<?php echo $data['user_info_portfolio_id']; ?>" 
                                                            data-pk="<?php echo $data['id'] ?>" 
                                                            data-url="<?php print_link("user_info/editfield/" . urlencode($data['id'])); ?>" 
                                                            data-name="portfolio_id" 
                                                            data-title="Enter Portfolio Id" 
                                                            data-placement="left" 
                                                            data-toggle="click" 
                                                            data-type="text" 
                                                            data-mode="popover" 
                                                            data-showbuttons="left" 
                                                            class="is-editable" <?php } ?>>
                                                            <?php echo $data['user_info_portfolio_id']; ?> 
                                                        </span>
                                                    </td>
                                                    <th class="td-btn">
                                                        <?php if($can_view){ ?>
                                                        <a class="btn btn-sm btn-success has-tooltip" title="View Record" href="<?php print_link("employee_details/view/$rec_id"); ?>">
                                                            <i class="fa fa-eye"></i> View
                                                        </a>
                                                        <?php } ?>
                                                        <?php if($can_edit){ ?>
                                                        <a class="btn btn-sm btn-info has-tooltip" title="Edit This Record" href="<?php print_link("employee_details/edit/$rec_id"); ?>">
                                                            <i class="fa fa-edit"></i> Edit
                                                        </a>
                                                        <?php } ?>
                                                        <?php if($can_delete){ ?>
                                                        <a class="btn btn-sm btn-danger has-tooltip record-delete-btn" title="Delete this record" href="<?php print_link("employee_details/delete/$rec_id/?csrf_token=$csrf_token&redirect=$current_page"); ?>" data-prompt-msg="Are you sure you want to delete this record?" data-display-style="modal">
                                                            <i class="fa fa-times"></i>
                                                            Delete
                                                        </a>
                                                        <?php } ?>
                                                    </th>
                                                </tr>
                                                <?php 
                                                }
                                                ?>
                                                <!--endrecord-->
                                            </tbody>
                                            <tbody class="search-data" id="search-data-<?php echo $page_element_id; ?>"></tbody>
                                            <?php
                                            }
                                            ?>
                                        </table>
                                        <?php 
                                        if(empty($records)){
                                        ?>
                                        <h4 class="bg-light text-center border-top text-muted animated bounce  p-3">
                                            <i class="fa fa-ban"></i> No record found
                                        </h4>
                                        <?php
                                        }
                                        ?>
                                    </div>
                                    <?php
                                    if( $show_footer && !empty($records)){
                                    ?>
                                    <div class=" border-top mt-2">
                                        <div class="row justify-content-center">    
                                            <div class="col-md-auto justify-content-center">    
                                                <div class="p-3 d-flex justify-content-between">    
                                                    <?php if($can_delete){ ?>
                                                    <button data-prompt-msg="Are you sure you want to delete these records?" data-display-style="modal" data-url="<?php print_link("employee_details/delete/{sel_ids}/?csrf_token=$csrf_token&redirect=$current_page"); ?>" class="btn btn-sm btn-danger btn-delete-selected d-none">
                                                        <i class="fa fa-times"></i> Delete Selected
                                                    </button>
                                                    <?php } ?>
                                                    <div class="dropup export-btn-holder mx-1">
                                                        <button class="btn btn-sm btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                            <i class="fa fa-save"></i> Export
                                                        </button>
                                                        <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                                                            <?php $export_print_link = $this->set_current_page_link(array('format' => 'print')); ?>
                                                            <a class="dropdown-item export-link-btn" data-format="print" href="<?php print_link($export_print_link); ?>" target="_blank">
                                                                <img src="<?php print_link('assets/images/print.png') ?>" class="mr-2" /> PRINT
                                                                </a>
                                                                <?php $export_pdf_link = $this->set_current_page_link(array('format' => 'pdf')); ?>
                                                                <a class="dropdown-item export-link-btn" data-format="pdf" href="<?php print_link($export_pdf_link); ?>" target="_blank">
                                                                    <img src="<?php print_link('assets/images/pdf.png') ?>" class="mr-2" /> PDF
                                                                    </a>
                                                                    <?php $export_word_link = $this->set_current_page_link(array('format' => 'word')); ?>
                                                                    <a class="dropdown-item export-link-btn" data-format="word" href="<?php print_link($export_word_link); ?>" target="_blank">
                                                                        <img src="<?php print_link('assets/images/doc.png') ?>" class="mr-2" /> WORD
                                                                        </a>
                                                                        <?php $export_csv_link = $this->set_current_page_link(array('format' => 'csv')); ?>
                                                                        <a class="dropdown-item export-link-btn" data-format="csv" href="<?php print_link($export_csv_link); ?>" target="_blank">
                                                                            <img src="<?php print_link('assets/images/csv.png') ?>" class="mr-2" /> CSV
                                                                            </a>
                                                                            <?php $export_excel_link = $this->set_current_page_link(array('format' => 'excel')); ?>
                                                                            <a class="dropdown-item export-link-btn" data-format="excel" href="<?php print_link($export_excel_link); ?>" target="_blank">
                                                                                <img src="<?php print_link('assets/images/xsl.png') ?>" class="mr-2" /> EXCEL
                                                                                </a>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col">   
                                                                    <?php
                                                                    if($show_pagination == true){
                                                                    $pager = new Pagination($total_records, $record_count);
                                                                    $pager->route = $this->route;
                                                                    $pager->show_page_count = true;
                                                                    $pager->show_record_count = true;
                                                                    $pager->show_page_limit =true;
                                                                    $pager->limit_count = $this->limit_count;
                                                                    $pager->show_page_number_list = true;
                                                                    $pager->pager_link_range=5;
                                                                    $pager->render();
                                                                    }
                                                                    ?>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <?php
                                                        }
                                                        ?>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </section>
