<?php

$birthdayEmpName = array();
$birthdayEmpDate = array();

$uc_birthdayEmpName = array();

$WA_emp_name = array();

foreach ($allEmployeeData as $data) {
    $dob = $data['dob'];
    $time = strtotime($dob);
    if (date('m-d') == date('m-d', $time)) {
        $birthdayEmpName[] = $data['first_name'] . " " . $data['last_name'];
        $birthdayEmpDate[] = $data['dob'];
    }

    if (date('m') == date('m', $time) && date('m-d') != date('m-d', $time) && date('m-d') < date('m-d', $time)) {
        $uc_birthdayEmpName[] = $data['first_name'] . " " . $data['last_name'] . " - " . $data['department_name'] . "_" . $data['dob'];
    }

    $hire_date = $data['hire_date'];
    $hire_time = strtotime($hire_date);
    if (date('m-d') == date('m-d', $hire_time)) {
        $hire_date = $data['hire_date'];
        $current_date = date("Y-m-d");
        $diff = abs(strtotime($current_date) - strtotime($hire_date));
        $years = floor($diff / (365*60*60*24));

        $WA_emp_name[] = $data['first_name'] . " " . $data['last_name']." - ".$data['department_name']. "_" . "has completed " . $years . " years in the company.";
    }
    if (date('m') == date('m', $hire_time) && date('m-d') != date('m-d', $hire_time) && date('m-d') < date('m-d', $hire_time)) {
        $hire_date = $data['hire_date'];
        $current_date = date("Y-m-d");
        $diff = abs(strtotime($current_date) - strtotime($hire_date));
        $years = floor($diff / (365*60*60*24));
        $uc_WA_emp_name[] = $data['first_name'] . " " . $data['last_name']." - ".$data['department_name']. "_" . "Will be complete " . ($years+1) . " years in the company.";
    }
}
?>
<div class="se-pre-con"></div>
<div class="row box-panel">

    <div class="">
        <div class="panel-heading">
            <div class="panel-title">

            </div>
        </div>
        <div class="panel-body panel-body-new">
            <!-- Top Block Start -->

            <?php

            $employee_id = $this->session->userdata['employee_id'];
            $isAdmin = $this->session->userdata['isAdmin'];
            $isLogin = $this->session->userdata['isLogIn'];
            if ($isLogin && $isAdmin) {
                ?>

                <div class="row">

                    <!-- HRM Box for admin -->
                    <div class="col-xs-12 col-sm-6 col-md-3">
                        <div class="small-box bg-green whitecolor">
                            <div class="inner">
                                <h4>
                                    <span class="count-number"><?php echo(!empty($tae[0]->total_emp) ? $tae[0]->total_emp : 0); ?></span>
                                </h4>

                                <p><?php echo 'Active Employee' ?></p>

                                <div class="icon">
                                    <i class="fa fa-users"></i>
                                </div>
                            </div>
                            <?php if ($this->permission->method('employee', 'read')->access()) { ?>
                                <a href="<?php echo base_url('employee/employees/manageemployee') ?>"
                                   class="small-box-footer"><?php echo 'Active Employee' ?></a>
                            <?php } else { ?>
                                <a href="javascript:void(0)"
                                   class="small-box-footer"><?php echo 'Active Employee' ?></a>
                            <?php } ?>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-6 col-md-3">
                        <div class="small-box bg-pase whitecolor">
                            <div class="inner">
                                <h4>
                                    <span class="count-number"><?php echo(!empty($present_empl) ? $present_empl : 0); ?></span>
                                </h4>

                                <p><?php echo display('todays_present') ?></p>

                                <div class="icon">
                                    <i class="fa fa-user-plus"></i>
                                </div>
                            </div>
                            <a href="javascript:void(0)"
                               class="small-box-footer"><?php echo display('todays_present') ?></a>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-6 col-md-2">
                        <div class="small-box bg-bringal whitecolor">
                            <div class="inner">
                                <h4><span class="count-number"><?php

                                        $prandleave = (!empty($present_empl) ? $present_empl : 0) + (!empty($todys_leave) ? $todys_leave : 0);
                                        echo $tae[0]->total_emp - $prandleave;
                                        ?></span></h4>

                                <p><?php echo display('todays_absent') ?></p>

                                <div class="icon">
                                    <i class="fa fa-user-times"></i>
                                </div>
                            </div>
                            <a href="javascript:void(0)"
                               class="small-box-footer"><?php echo display('todays_absent') ?></a>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-6 col-md-2">
                        <div class="small-box bg-darkgreen whitecolor">
                            <div class="inner">
                                <h4>
                                    <span class="count-number"><?php echo(!empty($todys_leave) ? $todys_leave : 0); ?></span>
                                </h4>

                                <p><?php echo display('todays_leave') ?></p>

                                <div class="icon">
                                    <i class="fa fa-user-o"></i>
                                </div>
                            </div>
                            <a href="javascript:void(0)"
                               class="small-box-footer"><?php echo display('todays_leave') ?></a>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-6 col-md-2">
                        <div class="small-box bg-yellow whitecolor">
                            <div class="inner">
                                <h4>
                                    <span class="count-number"><?php echo(!empty($ttlc[0]->late_comer) ? $ttlc[0]->late_comer : 0); ?></span>
                                </h4>

                                <p><?php echo 'Late comers' ?></p>

                                <div class="icon">
                                    <i class="fa fa-user-times"></i>
                                </div>
                            </div>
                            <a href="javascript:void(0)"
                               class="small-box-footer"><?php echo 'Late comers' ?></a>
                        </div>
                    </div>

                    <!-- End of HRM Boxes for admin -->

                    <!-- Top Block End -->

                    <!-- Start of HRM Boxes for employee -->
                </div>
                <div class="row">
                    <div class="col-sm-3 col-md-3 latest-notice">
                        <div class="panel panel-bd lobidisable">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4><?php echo "Today Late Person" ?></h4>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="divContinuedAbsent">
                                    <?php
                                    foreach ($tlcwm_a as $row) { ?>
                                        <div class="leftdivcontent"><span data-empid="61"></span><a>
                                                <b><?php echo $row->first_name." ".$row->last_name. " ---- ".$row->late_minute?> </b></a>
                                        </div>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-3 col-md-3 latest-notice">
                        <div class="panel panel-bd lobidisable">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4><?php echo "Pending leaves" ?></h4>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="divContinuedAbsent">
                                    <?php
                                    foreach ($pl_a as $row) { ?>
                                        <div class="leftdivcontent"><span data-empid="61"></span><a>
                                                <b><?php echo $row->apply_strt_date." To ".$row->apply_end_date." --- ".$row->first_name." ".$row->last_name?> </b></a>
                                        </div>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-3 col-md-3 latest-notice">
                        <div class="panel panel-bd lobidisable">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4><?php echo "Over Time pending request" ?></h4>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="divContinuedAbsent">
                                    <?php
                                    foreach ($otpr_a as $row) { ?>
                                        <div class="leftdivcontent"><span data-empid="61"></span><a>
                                                <b><?php echo $row->first_name." ".$row->last_name." --- ".$row->ovt_start_date." ".$row->total_time?> </b></a>
                                        </div>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-3 new-recruited">
                        <div class="panel panel-bd lobidisable">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4><?php echo display('new_recruited_employee') ?></h4>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="divContinuedAbsent">
                                    <?php foreach ($latestrecruitedemple as $recruitempl) { ?>
                                        <div class="leftdivcontent"><span
                                                    data-empid="61"></span><b><?php echo $recruitempl['first_name'] . ' ' . $recruitempl['last_name'].'<br>'.$recruitempl['department_name'] ?> </b><br><span><?php echo display('hire_date') ?>: </span><b><?php echo $recruitempl['hire_date']; ?></b>
                                        </div>
                                    <?php } ?>

                                </div>
                            </div>
                        </div>
                    </div>

                </div>
                <div class="row">
                    <div class="col-sm-3 col-md-3 latest-notice">
                        <div class="panel panel-bd lobidisable">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4><?php echo "Upcoming Employee Confirmations" ?></h4>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="divContinuedAbsent">
                                    <?php
                                    foreach ($ucec_a as $row) { ?>
                                        <div class="leftdivcontent"><span data-empid="61"></span>
                                            <a><b><?php echo $row->first_name." ".$row->last_name." --- ".$row->probation_end_date?> </b></a>
                                        </div>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-3 col-md-3 latest-notice">
                        <div class="panel panel-bd lobidisable">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4><?php echo "Employee Confirmations Due" ?></h4>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="divContinuedAbsent">
                                    <?php
                                    foreach ($ecd_a as $row) { ?>
                                        <div class="leftdivcontent"><span data-empid="61"></span>
                                            <a><b><?php echo $row->first_name." ".$row->last_name." --- ".$row->probation_end_date?> </b></a>
                                        </div>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-3 col-md-3 latest-notice">
                        <div class="panel panel-bd lobidisable">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4><?php echo "Resigned/ Terminated Employee, add (current Month)" ?></h4>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="divContinuedAbsent">
                                    <?php
                                    foreach ($letm_a as $row) { ?>
                                        <div class="leftdivcontent"><span data-empid="61"></span><a>
                                                <b><?php
                                                    if($row->voluntary_termination == 1){
                                                        $leaving = "<span>[ Resigned ]</span>";
                                                    }elseif ($row->voluntary_termination == 2){
                                                        $leaving = "<span style='color: red'>[ Terminated ]</span>";
                                                    }
                                                    echo $row->first_name." ".$row->last_name." --- ".$row->department_name."<br>".$leaving
                                                    ?> </b></a>
                                        </div>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-3 latest-notice">
                        <div class="panel panel-bd lobidisable">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4><?php echo display('latest_notice') ?></h4>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="divContinuedAbsent">
                                    <?php foreach ($notice as $notices) { ?>
                                        <div class="leftdivcontent"><span data-empid="61"></span><a
                                                    href="<?php echo base_url("noticeboard/Notice_controller/view_details/" . $notices['notice_id']) ?>"><b><?php echo $notices['notice_date'] . ' - ' . $notices['notice_type']; ?> </b></a>
                                        </div>
                                    <?php } ?>


                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12 col-md-12 absent-chart">
                        <div class="panel panel-bd lobidisable">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4>Employees in the Company By Department</h4>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div id="employee_department_percentage" height="260"></div>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-12 col-md-12 absent-chart">
                        <div class="panel panel-bd">
                            <div class="panel-heading">
                                <div class="panel-body">
                                    <canvas id="bar-chart-recruitment" class="chartcontent" height="220"></canvas>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            <?php } else if ($isLogin && $employee_id) {
            ?>
            <div class="row">

                <!-- HRM Box -->
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <div class="small-box bg-green whitecolor">
                        <div class="inner">
                            <h4>
                                <span class="count-number"><?php echo(!empty($this_month_employee_present[0]->present) ? $this_month_employee_present[0]->present : 0); ?></span>
                            </h4>

                            <p>Total Days Worked</p>

                            <div class="icon">
                                <i class="fa fa-users"></i>
                            </div>
                        </div>
                        <a href="javascript:void(0)" class="small-box-footer">Days Worked</a>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <div class="small-box bg-pase whitecolor">
                        <div class="inner">
                            <h4>
                                <span class="count-number"><?php echo(!empty($this_month_employee_absent) ? $this_month_employee_absent : 0); ?></span>
                            </h4>

                            <p>Number Of Absents</p>

                            <div class="icon">
                                <i class="fa fa-user-plus"></i>
                            </div>
                        </div>
                        <a href="javascript:void(0)" class="small-box-footer">Attendance Points</a>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <div class="small-box bg-bringal whitecolor">
                        <div class="inner">
                            <h4>
                                <span class="count-number"><?php echo(!empty($this_month_late_comings[0]->time_dif) ? $this_month_late_comings[0]->time_dif : 0); ?></span>
                            </h4>

                            <p>Number Of Late Comings</p>

                            <div class="icon">
                                <i class="fa fa-user-times"></i>
                            </div>
                        </div>
                        <a href="javascript:void(0)" class="small-box-footer">Late Comings</a>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-6 col-md-3">
                    <?php if(!empty($today_attendance_status)){ ?>
                    <div class="small-box bg-green whitecolor">
                        <?php }else{?>
                        <div class="small-box bg-red whitecolor">
                            <?php } ?>

                            <div class="inner">
                                <h4>
                                    <?php if(!empty($today_attendance_status)){ ?>
                                        <span class="count-number"> Yes </span>
                                    <?php }else{?>
                                        <span class="count-number"> No </span>
                                    <?php } ?>
                                </h4>

                                <p>Today Attendance Status</p>

                                <div class="icon">
                                    <i class="fa fa-user-o"></i>
                                </div>
                            </div>
                            <a href="javascript:void(0)" class="small-box-footer">Attendance Status</a>
                        </div>
                    </div>

                    <!-- End of HRM Boxes for employee -->

                    <!-- Top Block End -->

                    <!-- Second block start -->
                </div>

                <?php } ?>

                <hr>

                <!-- New Design for chart report from 22nd November 2020 -->

                <?php

                if ($isLogin && $isAdmin) {
//                if (false) {
                    ?>

                    <div class="row" style="display: none">

                        <div class="col-sm-12 col-md-5 attendance-chart">
                            <div class="panel panel-bd">
                                <div class="panel-heading">
                                    <div class="panel-body">
                                        <canvas id="bar-chart-attendance" class="chartcontent" height="220"></canvas>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-12 col-md-5 recruited-chart" >
                            <div class="panel panel-bd">
                                <div class="panel-heading">
                                    <div class="panel-body">
                                        <canvas id="bar-chart-recruitment-null" class="chartcontent" height="220"></canvas>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!--                        <div class="col-sm-12 col-md-2 latest-notice">-->
                        <!--                            <div class="panel panel-bd lobidisable">-->
                        <!--                                <div class="panel-heading">-->
                        <!--                                    <div class="panel-title">-->
                        <!--                                        <h4>--><?php //echo display('latest_notice') ?><!--</h4>-->
                        <!--                                    </div>-->
                        <!--                                </div>-->
                        <!--                                <div class="panel-body">-->
                        <!--                                    <div class="divContinuedAbsent">-->
                        <!--                                        --><?php //foreach ($notice as $notices) { ?>
                        <!--                                            <div class="leftdivcontent"><span data-empid="61"></span><a-->
                        <!--                                                        href="--><?php //echo base_url("noticeboard/Notice_controller/view_details/" . $notices['notice_id']) ?><!--"><b>--><?php //echo $notices['notice_date'] . ' - ' . $notices['notice_type']; ?><!-- </b></a>-->
                        <!--                                            </div>-->
                        <!--                                        --><?php //} ?>
                        <!---->
                        <!---->
                        <!--                                    </div>-->
                        <!--                                </div>-->
                        <!--                            </div>-->
                        <!--                        </div>-->
                    </div>

                    <!--                    <div class="row">-->
                    <!---->
                    <!--                        <div class="col-sm-12 col-md-5 absent-chart">-->
                    <!--                            <div class="panel panel-bd">-->
                    <!--                                <div class="panel-heading">-->
                    <!--                                    <div class="panel-body">-->
                    <!--                                        <canvas id="bar-chart-absent" class="chartcontent" height="220"></canvas>-->
                    <!--                                    </div>-->
                    <!--                                </div>-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!---->
                    <!--                        <div class="col-sm-12 col-md-5 locan-payment-chart">-->
                    <!--                            <div class="panel panel-bd">-->
                    <!--                                <div class="panel-heading">-->
                    <!--                                    <div class="panel-body">-->
                    <!--                                        <canvas id="piechart" height="175"></canvas>-->
                    <!--                                    </div>-->
                    <!--                                </div>-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!---->
                    <!--                        <div class="col-sm-12 col-md-2 new-recruited">-->
                    <!--                            <div class="panel panel-bd lobidisable">-->
                    <!--                                <div class="panel-heading">-->
                    <!--                                    <div class="panel-title">-->
                    <!--                                        <h4>--><?php //echo display('new_recruited_employee') ?><!--</h4>-->
                    <!--                                    </div>-->
                    <!--                                </div>-->
                    <!--                                <div class="panel-body">-->
                    <!--                                    <div class="divContinuedAbsent">-->
                    <!--                                        --><?php //foreach ($latestrecruitedemple as $recruitempl) { ?>
                    <!--                                            <div class="leftdivcontent"><span-->
                    <!--                                                        data-empid="61"></span><b>--><?php //echo $recruitempl['first_name'] . ' ' . $recruitempl['last_name'] ?><!-- </b><br><span>--><?php //echo display('hire_date') ?><!--: </span><b>--><?php //echo $recruitempl['hire_date']; ?><!--</b>-->
                    <!--                                            </div>-->
                    <!--                                        --><?php //} ?>
                    <!---->
                    <!--                                    </div>-->
                    <!--                                </div>-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!---->
                    <!--                    </div>-->

                    <!--                    <div class="row">-->
                    <!---->
                    <!--                        <div class="col-sm-12 col-md-6 absent-chart">-->
                    <!--                            <div class="panel panel-bd">-->
                    <!--                                <div class="panel-heading">-->
                    <!--                                    <div class="panel-body">-->
                    <!--                                        <canvas id="bar-chart-loanyear" class="chartcontent" height="220"></canvas>-->
                    <!--                                    </div>-->
                    <!--                                </div>-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!---->
                    <!--                        <div class="col-sm-12 col-md-6 locan-payment-chart">-->
                    <!--                            <div class="panel panel-bd">-->
                    <!--                                <div class="panel-heading">-->
                    <!--                                    <div class="panel-body">-->
                    <!--                                        <canvas id="scatter" class="chartcontent" height="220"></canvas>-->
                    <!--                                    </div>-->
                    <!--                                </div>-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!---->
                    <!--                    </div>-->

                    <!--                    <div class="row">-->
                    <!-- Table to show used license/customer -->
                    <!--                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 absent-chart">-->
                    <!--                            <div class="panel panel-bd lobidrag">-->
                    <!--                                <div class="panel-heading">-->
                    <!--                                    <div class="panel-title">-->
                    <!--                                        <h4>--><?php //echo display('employee_point') ?><!--</h4>-->
                    <!--                                    </div>-->
                    <!--                                </div>-->
                    <!---->
                    <!--                                <div class="panel-body scroller">-->
                    <!--                                    <div class="table-responsive">-->
                    <!--                                        <table class="table table-striped">-->
                    <!--                                            <thead>-->
                    <!--                                            <tr>-->
                    <!--                                                <th>--><?php //echo display('cid') ?><!--</th>-->
                    <!--                                                <th>--><?php //echo display('employee_name') ?><!--</th>-->
                    <!--                                                <th>--><?php //echo display('attendence_point') ?><!--</th>-->
                    <!--                                                <th>--><?php //echo display('collaborative_point') ?><!--</th>-->
                    <!--                                                <th>--><?php //echo display('management_point') ?><!--</th>-->
                    <!--                                                <th>--><?php //echo display('total') . " " . display('point') ?><!--</th>-->
                    <!--                                                <th>--><?php //echo display('date') ?><!--</th>-->
                    <!--                                            </tr>-->
                    <!--                                            </thead>-->
                    <!--                                            <tbody>-->
                    <!---->
                    <!---->
                    <!--                                            --><?php //if (!empty($employee_points)) { ?>
                    <!--                                                --><?php //$sl = 1; ?>
                    <!--                                                --><?php //foreach ($employee_points as $que) {
//                                                    ?>
                    <!--                                                    <tr class="--><?php //echo ($sl & 1) ? "odd gradeX" : "even gradeC" ?><!--">-->
                    <!--                                                        <td>--><?php //echo $sl; ?><!--</td>-->
                    <!--                                                        <td>--><?php //echo $que->firstname . ' ' . $que->lastname; ?><!--</td>-->
                    <!--                                                        <td>--><?php //echo $que->attendence != null ? $que->attendence : 0; ?><!--</td>-->
                    <!--                                                        <td>--><?php //echo $que->collaborative != null ? $que->collaborative : 0; ?><!--</td>-->
                    <!--                                                        <td>--><?php //echo $que->management != null ? $que->management : 0; ?><!--</td>-->
                    <!--                                                        <td>--><?php //echo $que->total; ?><!--</td>-->
                    <!--                                                        <td>--><?php //echo date('F, Y', strtotime($que->date)); ?><!--</td>-->
                    <!--                                                    </tr>-->
                    <!--                                                    --><?php //$sl++; ?>
                    <!--                                                --><?php //} ?>
                    <!--                                            --><?php //} ?>
                    <!--                                            </tbody>-->
                    <!--                                        </table>-->
                    <!--                                    </div>-->
                    <!--                                </div>-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!--                    </div>-->

                <?php } else if ($isLogin && $employee_id) {
                    ?>

                    <div class="row">
                        <!-- Single Bar Chart -->
                        <div class="col-sm-6 col-md-6 absent-chart">
                            <div class="panel panel-bd lobidisable">
                                <div class="panel-heading">
                                    <div class="panel-title">
                                        <h4>Yearly Attendance</h4>
                                    </div>
                                </div>
                                <div class="panel-body">
                                    <canvas id="year_attendance_barchart" height="160"></canvas>
                                </div>
                                <!--                            <div class="panel-body">-->
                                <!--                                <canvas id="singelBarChart" height="160"></canvas>-->
                                <!--                            </div>-->

                            </div>
                        </div>
                        <div class="col-sm-3 col-md-3 latest-notice">
                            <div class="panel panel-bd lobidisable">
                                <div class="panel-heading">
                                    <div class="panel-title">
                                        <h4><?php echo "This Month Absents" ?></h4>
                                    </div>
                                </div>
                                <div class="panel-body">
                                    <div class="divContinuedAbsent">
                                        <?php
                                        foreach ($this_month_absent_dates as $row) { ?>
                                            <div class="leftdivcontent"><span data-empid="61"></span><a>
                                                    <b><?php echo $row ?> </b></a>
                                            </div>
                                        <?php } ?>


                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-3 col-md-3 latest-notice">
                            <div class="panel panel-bd lobidisable">
                                <div class="panel-heading">
                                    <div class="panel-title">
                                        <h4><?php echo display('latest_notice') ?></h4>
                                    </div>
                                </div>
                                <div class="panel-body">
                                    <div class="divContinuedAbsent">
                                        <?php foreach ($notice as $notices) { ?>
                                            <div class="leftdivcontent"><span data-empid="61"></span><a
                                                        href="<?php echo base_url("noticeboard/Notice_controller/view_details/" . $notices['notice_id']) ?>"><b><?php echo $notices['notice_date'] . ' - ' . $notices['notice_type']; ?> </b></a>
                                            </div>
                                        <?php } ?>


                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php if($is_manager){ ?>
                        <div class="row">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4>Team Stats</h4>
                                </div>
                            </div>
                            <div class="col-xs-12 col-sm-6 col-md-4">
                                <div class="small-box bg-green whitecolor">
                                    <div class="inner">
                                        <h4>
                                            <span class="count-number"><?php echo(!empty($teit[0]->total_emp) ? $teit[0]->total_emp : 0); ?></span>
                                        </h4>

                                        <p>Employees in department</p>

                                        <div class="icon">
                                            <i class="fa fa-users"></i>
                                        </div>
                                    </div>
                                    <a href="javascript:void(0)" class="small-box-footer">Employees in department</a>
                                </div>
                            </div>
                            <div class="col-xs-12 col-sm-6 col-md-4">
                                <div class="small-box bg-pase whitecolor">
                                    <div class="inner">
                                        <h4>
                                            <span class="count-number"><?php echo(!empty($tepit[0]->present) ? $tepit[0]->present : 0); ?></span>
                                        </h4>

                                        <p>Employee Present Today</p>

                                        <div class="icon">
                                            <i class="fa fa-user-plus"></i>
                                        </div>
                                    </div>
                                    <a href="javascript:void(0)" class="small-box-footer">Present Today</a>
                                </div>
                            </div>
                            <div class="col-xs-12 col-sm-6 col-md-4">
                                <div class="small-box bg-red whitecolor">
                                    <div class="inner">
                                        <h4>
                                            <span class="count-number"><?php echo(!empty($teait) ? $teait : 0); ?></span>
                                        </h4>

                                        <p>Employee Absent Today</p>

                                        <div class="icon">
                                            <i class="fa fa-user-times"></i>
                                        </div>
                                    </div>
                                    <a href="javascript:void(0)" class="small-box-footer">Absent Today</a>
                                </div>
                            </div>

                        </div>
                        <div class="row">
                            <div class="col-sm-3 col-md-3 latest-notice">
                                <div class="panel panel-bd lobidisable">
                                    <div class="panel-heading">
                                        <div class="panel-title">
                                            <h4><?php echo "Today Late Person" ?></h4>
                                        </div>
                                    </div>
                                    <div class="panel-body">
                                        <div class="divContinuedAbsent">
                                            <?php
                                            foreach ($lcwm as $row) { ?>
                                                <div class="leftdivcontent"><span data-empid="61"></span><a>
                                                        <b><?php echo $row->first_name." ".$row->last_name. " ---- ".$row->late_minute?> </b></a>
                                                </div>
                                            <?php } ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-3 col-md-3 latest-notice">
                                <div class="panel panel-bd lobidisable">
                                    <div class="panel-heading">
                                        <div class="panel-title">
                                            <h4><?php echo "Pending leaves" ?></h4>
                                        </div>
                                    </div>
                                    <div class="panel-body">
                                        <div class="divContinuedAbsent">
                                            <?php
                                            foreach ($tpl as $row) { ?>
                                                <div class="leftdivcontent"><span data-empid="61"></span><a>
                                                        <b><?php echo $row->apply_strt_date." To ".$row->apply_end_date." --- ".$row->first_name." ".$row->last_name?> </b></a>
                                                </div>
                                            <?php } ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-3 col-md-3 latest-notice">
                                <div class="panel panel-bd lobidisable">
                                    <div class="panel-heading">
                                        <div class="panel-title">
                                            <h4><?php echo "Pending Resignation" ?></h4>
                                        </div>
                                    </div>
                                    <div class="panel-body">
                                        <div class="divContinuedAbsent">
                                            <?php
                                            foreach ($tpr as $row) { ?>
                                                <div class="leftdivcontent"><span data-empid="61"></span><a>
                                                        <b><?php echo $row->res_initiate_date." --- ".$row->first_name." ".$row->last_name?> </b></a>
                                                </div>
                                            <?php } ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-3 col-md-3 latest-notice">
                                <div class="panel panel-bd lobidisable">
                                    <div class="panel-heading">
                                        <div class="panel-title">
                                            <h4><?php echo "Over Time pending request" ?></h4>
                                        </div>
                                    </div>
                                    <div class="panel-body">
                                        <div class="divContinuedAbsent">
                                            <?php
                                            foreach ($otpr as $row) { ?>
                                                <div class="leftdivcontent"><span data-empid="61"></span><a>
                                                        <b><?php echo $row->first_name." ".$row->last_name." --- ".$row->ovt_start_date." ".$row->total_time?> </b></a>
                                                </div>
                                            <?php } ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php }?>
                    <?php
                }
                ?>

                <!-- End of New Design for chart report-->

                <!-- Forth part end -->
            </div>

            <!-- Birthday and Anniversary  -->

            <?php
            if ($isLogin && $isAdmin){ ?>
                <div class="row">
                    <!-- Table to show used license/customer -->
                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 absent-chart">
                        <div class="panel panel-bd lobidrag">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4>Employee Birthdays</h4>
                                </div>
                            </div>

                            <div class="panel-body scroller">
                                <div class="">
                                    <div class="row">

                                        <div class="col-lg-6">
                                            <h5>Birthdays</h5>
                                            <?php
                                            foreach ($birthdayEmpName as $name) {
                                                ?>
                                                <ul>
                                                    <li>
                                                        <strong><?php echo $name ?></strong> has birthday today
                                                    </li>
                                                </ul>
                                                <?php
                                            }
                                            ?>


                                        </div>
                                        <div class="col-lg-6">
                                            <h5>Upcoming Birthdays</h5>
                                            <?php
                                            foreach ($uc_birthdayEmpName as $name) {
                                                $upcoming_birthdays = explode("_", $name);
                                                ?>
                                                <ul>
                                                    <li>
                                                        <strong><?php echo $upcoming_birthdays[0] ?></strong>
                                                        <em><?php echo $upcoming_birthdays[1] ?></em>
                                                    </li>
                                                </ul>
                                            <?php }
                                            ?>
                                        </div>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <!-- Table to show used license/customer -->
                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 absent-chart">
                        <div class="panel panel-bd lobidrag">
                            <div class="panel-heading">
                                <div class="panel-title">
                                    <h4>Employee Work Anniversary </h4>
                                </div>
                            </div>

                            <div class="panel-body scroller">
                                <div class="">
                                    <div class="row">

                                        <div class="col-lg-6">
                                            <h5>Anniversaries</h5>
                                            <?php
                                            foreach ($WA_emp_name as $name) {
                                                $ann = explode("_", $name);
                                                ?>
                                                <ul>
                                                    <li>
                                                        <strong><?php echo $ann[0] ?></strong>
                                                        <em><?php echo $ann[1] ?></em>
                                                    </li>
                                                </ul>
                                                <?php
                                            }
                                            ?>

                                        </div>
                                        <div class="col-lg-6">
                                            <h5>Upcoming Anniversaries</h5>
                                            <?php
                                            foreach ($uc_WA_emp_name as $name) {
                                                $upcoming_anniversaries = explode("_", $name);
                                                ?>
                                                <ul>
                                                    <li>
                                                        <strong><?php echo $upcoming_anniversaries[0] ?></strong>
                                                        <em><?php echo $upcoming_anniversaries[1] ?></em>
                                                    </li>
                                                </ul>
                                            <?php }
                                            ?>
                                        </div>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            <?php }?>


        </div>

        <input type="hidden" name="" id="attendancelabel" value="<?php echo $attendanclabel; ?>">
        <input type="hidden" name="" id="attendancedata" value="<?php echo $attendancdata; ?>">
        <input type="hidden" name="" id="month" value='<?php echo $month; ?>'>
        <input type="hidden" name="" id="recruitedemp" value="<?php echo $recruitedemp; ?>">
        <input type="hidden" name="" id="abdfftdaylabel" value="<?php echo $abdfftdaylabel; ?>">
        <input type="hidden" name="" id="abdfftdayval" value="<?php echo $abdfftdayval ?>">
        <input type="hidden" name="" id="loanpayemntamnt"
               value="<?php echo(!empty($lnamountpaid->amount) ? $lnamountpaid->amount : 1); ?>">
        <input type="hidden" name="" id="loanreceivedamnt"
               value="<?php echo(!empty($lnamountpaid->amount) ? $lnamountpaid->amount : 1); ?>">
        <input type="hidden" name="" id="loanstatisticpayment" value="<?php echo $loanstatisticpayment; ?>">
        <input type="hidden" name="" id="loanstatisticreceived" value="<?php echo $loanstatisticreceived; ?>">
        <input type="hidden" name="" id="awardedempl" value="<?php echo $awardedempl; ?>">
        <input type="hidden" name="" id="presentitle" value="<?php echo display('attendance_last_30days') ?>">
        <input type="hidden" name="" id="attendancetitle" value="<?php echo display('attendance') ?>">
        <input type="hidden" name="" id="employeetitle" value="<?php echo display('employee') ?>">
        <input type="hidden" name="" id="absenttitle" value="<?php echo display('absent_15days') ?>">
        <input type="hidden" name="" id="absent" value="<?php echo display('absent') ?>">
        <input type="hidden" name="" id="recruitedtitle" value="<?php echo display('recruited') ?>">
        <input type="hidden" name="" id="recruitedyeartitle" value="<?php echo display('recruited_current_year') ?>">
        <input type="hidden" name="" id="loanpaymenttitle" value="<?php echo display('loanpayment') ?>">
        <input type="hidden" name="" id="loanreceivettitle" value="<?php echo display('loanreceive') ?>">
        <input type="hidden" name="" id="paymentrecvtitle"
               value="<?php echo display('loanpayment') . ' ' . display('loanreceive') ?>">
        <input type="hidden" name="" id="awardedtitle" value="<?php echo display('awarded') ?>">
        <input type="hidden" name="" id="awardedcurrnttitle"
               value="<?php echo display('awarded') . ' ' . display('current_year') ?>">

    </div>


    <script src="<?php echo base_url('assets/plugins/counterup/chart.min.js') ?>" type="text/javascript"></script>

    <?php if ($isLogin && $isAdmin) { ?>
        <script src="<?php echo base_url('assets/js/dashboardchart.js') ?>" type="text/javascript"></script>
    <?php } ?>

    <?php if ($isLogin && $employee_id) { ?>
        <script src="<?php echo base_url('assets/js/employee-dashboardchart.js') ?>" type="text/javascript"></script>
    <?php } ?>

    <!--- Pei Chart Code Script --->
    <script>
        Highcharts.chart('employee_department_percentage', {
            chart: {
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false,
                type: 'pie'
            },
            title: {
                text: 'Employees in the Company By Department'
            },
            tooltip: {
                pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
            },
            accessibility: {
                point: {
                    valueSuffix: '%'
                }
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: false
                    },
                    showInLegend: true
                }
            },
            legend: {
                x: 0,
                y: 0
            },
            series: [{
                name: 'Persons in Departments',
                colorByPoint: true,
                data: [<?php echo $per_dep_pie; ?>]
            }]
        });
    </script>