<div class="row">
    <div class="col-sm-12">
        <div class="panel panel-bd">

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

            <div class="panel-body">

                <div class="panel-title bulk_add_emp_btn float-right">
                    <a style="color: #fff;" href="<?php base_url() ?>reports_list" class="btn btn-success" id="reportLists">Reports List</a>
                </div>

                <div class="row">
                    <div class="form-group row">
                        <?php echo form_open('reports/Employee_controller/employee_by_department',array('class' => '', 'id' => 'validate'));?>
                        <label class="select col-sm-2"><?php echo display('search') ?>:</label>
                        <div class="col-sm-4">
                            <button type="button" class="btn btn-primary" data-target="#filter" data-toggle="modal"><?php echo display('filter') ?></button>
                            <input type="button" class="btn btn-warning" name="btnPrint" id="btnPrint" value="Print" onclick="printDiv();"/>
                            <!--                            <a href="--><?php //base_url() ?><!--employee_by_department_export/--><?php //echo $dpt; ?><!--" class="btn btn-warning" id="exportReport">Export</a>-->
                        </div>
                        <?php echo form_close()?>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<div class="row">
    <!--  table area -->

    <div class="panel panel-bd">

        <div class="panel-heading">
            <div class="panel-title">
                <h4>
                    <?php echo "Employee Absent Summary" ?>
                </h4>
            </div>
        </div>

        <div class="panel-body" id="printArea">
            <div class="row" style="margin-bottom: 15px">
                <div class="col-sm-4 text-center"> <h3> Attendance Summary </h3> </div>
                <div class="col-sm-4 text-center"> <h3>  <?php echo "Period:".$start_date.' - '.$to_date ?> </h3> </div>
                <div class="col-sm-4 text-center"> <h3> <?php echo  "Work Location ".$work_location?> </h3> </div>
            </div>
            <div class="row" style="margin-bottom: 15px">
                <div class="col-sm-4 text-center"> <h3><?php
                        if($department == '0'){
                            echo "Department All";
                        }else{
                            echo "Department ".$department;
                        }
                        ?> </h3> </div>
                <div class="col-sm-4 text-center"> <h3> <?php
                        if($duty_types == '0'){
                            echo "Duty Type All";
                        }elseif($duty_types == '1'){
                            echo "Duty Type Intern";
                        }elseif($duty_types == '2'){
                            echo "Duty Type Full Time";
                        }elseif($duty_types == '3'){
                            echo "Duty Type Part Time";
                        }elseif($duty_types == '4'){
                            echo "Duty Type Contructual";
                        }elseif($duty_types == '5'){
                            echo "Duty Type Other";
                        }
                        ?> </h3> </div>
                <div class="col-sm-4 text-center"> <h3>
                        <?php
                        if ($employees_status == 0){
                            echo "Employee Status Inactive";
                        }elseif( $employees_status == 1 ){
                            echo "Employee Status Active";
                        }elseif ( $employees_status == 2){
                            echo "Employee Status On Leave";
                        }elseif ($employees_status == 3){
                            echo "Employee Status Not Started ";
                        }elseif ($employees_status == 4){
                            echo "Employee Status Cancelled ";
                        }else if($employees_status == 5){
                            echo "Employee Status All";
                        }
                        ?>
                    </h3> </div>
            </div>
            <div class="table-responsive">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th><?php echo display('cid') ?></th>
                        <th><?php echo "Employee Name" ?></th>
                        <th><?php echo "Department" ?></th>
                        <th><?php echo "Approved" ?></th>
                        <th><?php echo "Unapproved" ?></th>
                        <th><?php echo "Uninformed" ?></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php if (!empty($occurences)) { ?>
                        <?php $sl = 1; ?>
                        <?php foreach ($occurences as $row) {
                            $keys_arr = array_keys($row);
                            $emp_name = $keys_arr[0];
                            $dept_name = $keys_arr[1];
                            ?>
                            <tr class="<?php echo ($sl & 1)?"odd gradeX":"even gradeC" ?>">
                                <td><?php echo $sl; ?></td>
                                <td><?php echo$emp_name ?></td>
                                <td><?php echo $dept_name ?></td>
                                <td><?php if($row["Approved"] != "" ) echo $row["Approved"]; else echo "0"?></td>
                                <td><?php if($row["Unapproved"] != "" ) echo $row["Unapproved"]; else echo "0"?></td>
                                <td><?php if($row["Uninformed"] != "" ) echo $row["Uninformed"]; else echo "0"?></td>
                            </tr>
                            <?php $sl++; ?>
                        <?php } ?>
                    <?php } ?>
                    </tbody>
                </table>  <!-- /.table-responsive -->

            </div>
            <div class="biopagination">  <?php echo  $links ?></div>
        </div>
    </div>
</div>

<div id="filter" class="modal fade" role="dialog">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <center><strong><h4><i class='fa fa-book' aria-hidden='true'></i>Filter Reports</h4></strong></center>
            </div>

            <div class="modal-body">

                <div class="row">
                    <div class="col-sm-12 col-md-12">
                        <div class="panel">
                            <div class="panel-heading">
                                <div class="panel-title">

                                </div>
                            </div>
                            <div class="panel-body">

                                <?php echo  form_open_multipart('reports/Employee_controller/filter_absent_summary') ?>

                                <div class="row">
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="work_location" class="">
                                                <?php echo "Work Location:" ?></label>
                                            <?php
                                            echo form_dropdown('work_location', $country_list, (!empty($data->work_in_state) ? $data->work_in_state : "New York"), ' class="form-control"')
                                            ?>
                                        </div>
                                    </div>
                                    <div class="col-sm-3" id="start_date_div">
                                        <div class="form-group">
                                            <label for="from_date" class="">
                                                <?php echo "from Date" ?></label>
                                            <input type="text" name="start_date" id="start_date" placeholder="<?php echo "Enter Start Date" ?>" class="form-control datepicker">
                                        </div>
                                    </div>
                                    <div class="col-sm-3" id="end_date_div">
                                        <div class="to_date">
                                            <label for="courses_name" class="">
                                                <?php echo "To Date" ?></label>
                                            <input type="text" name="to_date" id="to_date" placeholder="<?php echo "Enter End date" ?>" class="form-control datepicker">
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="department" class="">
                                                <?php echo "Department:" ?></label>
                                            <select name="department" id="department" class="form-control select2-hidden-accessible" tabindex="-1" aria-hidden="true" autocomplete="off">
                                                <option value=""> All</option>
                                                <?php
                                                foreach ($dropdowndept as $dpts) {
                                                    echo '<option value="' . $dpts['dept_id'] . '">' . $dpts['department_name'] . '</option>';
                                                }
                                                ?>
                                            </select>
                                        </div>

                                    </div>
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="duty_types" class="">
                                                <?php echo "Duty Types:" ?></label>
                                            <select name="duty_types" id="duty_types" class="form-control select2-hidden-accessible" tabindex="-1" aria-hidden="true" autocomplete="off">
                                                <option value=""> All</option>
                                                <option value="1"> Intern</option>
                                                <option value="2"> Full Time</option>
                                                <option value="3"> Part Time</option>
                                                <option value="4"> Contructual</option>
                                                <option value="5"> Other</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                </div>
                                <div class="row">
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="employees_status" class="">
                                                <?php echo "Employees Status:" ?></label>
                                            <select name="employees_status" id="employees_status" class="form-control select2-hidden-accessible" tabindex="-1" aria-hidden="true" autocomplete="off">
                                                <option value=""> All </option>
                                                <option value="4">Cancelled </option>
                                                <option value="3">Not Started </option>
                                                <option value="2">On Leave </option>
                                                <option value="1">Active </option>
                                                <option value="0">Inactive</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label for="employees" class="">
                                                <?php echo "Employees:" ?></label>
                                            <select name="employees" id="employees" class="form-control select2-hidden-accessible" tabindex="-1" aria-hidden="true" autocomplete="off">
                                                <option value="">All</option>
                                                <?php foreach ($dropdownemp as $row) { ?>
                                                    <option value="<?php echo $row['employee_id'] ?>"><?php echo $row['first_name'].' '.$row['last_name']; ?></option>
                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group form-group-margin text-right">
                                    <button type="submit" class="btn btn-success w-md m-b-5"><?php echo 'View Reports' ?></button>
                                </div>
                                <?php echo form_close() ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">

        </div>

    </div>

</div>
