<div class="wrapper">
    <div class="container">
        <!-- Page-Title -->
        <div class="row">
            <div class="col-sm-12">
                <div class="btn-group pull-right m-t-10">
                    <!--<button onclick="openaddevent();" class="btn btn-primary waves-effect waves-light m-r-10"><i class="fa fa-plus"></i> Add Event</button>-->

                </div>
                <h4 class="page-title">HRM Setup:</h4>
                <div class="col-md-12">
                    <?php if ($this->session->flashdata('Success') && $this->session->flashdata('Success') != "") { ?>
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="alert alert-success">
                                    <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                                    <strong>Success!</strong> <?php echo $this->session->flashdata('Success'); ?>
                                </div>
                            </div>
                        </div>
                    <?php } ?>
                    <?php if ($this->session->flashdata('Error') && $this->session->flashdata('Error') != "") { ?>
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="alert alert-danger">
                                    <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
                                    <strong>Error!</strong> <?php echo $this->session->flashdata('Error'); ?>
                                </div>
                            </div>
                        </div>
                    <?php } ?>
                    <div class="card-box ">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="btn-group pull-right m-t-10">
                                    <form method="POST" action="<?php echo base_url();?>superuser_controller/add_deduction_policy">
                                    <button type="" class="btn btn-sm btn-primary waves-effect waves-light m-r-10"><i class="fa fa-plus"></i> Add Policy</button>
                                    </form>
                                </div>
                                <h3>Deduction Policies</h3>
                            </div>
                        </div>
                        <div class="row">     
                            <div class="col-md-12">
                                 
                                <table class="table table-resposive table-striped">                                
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>Name</th>
                                            <th>Allowed Absents</th>
                                            <th>Allowed Lates</th>
                                            <th>Deduction of x Day Salary on Absent</th>
                                            <th>Deduction of x Day Salary on Late</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php foreach ($deduction_policies as $deduction_policy){?>

                                        <tr>                                        
                                            <form method="POST" action="<?php echo base_url();?>superuser_controller/update_deduction_policy">
                                            <td><input name="id_deduction_policy" style="border: none; background: transparent; width:100%;" value="<?php echo $deduction_policy['id_deduction_policy'];?>"></td>
                                            <td><input name="deduction_policy" style="border: none; background: transparent; width:100%;" value="<?php echo $deduction_policy['deduction_policy'];?>"></td>
                                            <td><input name="total_absents_allowed" style="border: none; background: transparent; width:100%;" value="<?php echo $deduction_policy['total_absents_allowed'];?>"></td>
                                            <td><input name="total_late_allowed" style="border: none; background: transparent; width:100%;" value="<?php echo $deduction_policy['total_late_allowed'];?>"></td>
                                            <td><input name="deduction_days_absent" style="border: none; background: transparent; width:100%;" value="<?php echo $deduction_policy['deduction_days_absent'];?>"></td>
                                            <td><input name="deduction_days_late" style="border: none; background: transparent; width:100%;" value="<?php echo $deduction_policy['deduction_days_late'];?>"></td>
                                            <td >
                                                <button class="btn btn-sm btn-pink" type="submit">Update</button>
                                            </td>
                                            </form>
                                        </tr>

                                        <?php } ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    
                     <div class="card-box ">
                         
                       <div class="row">
                            <div class="col-sm-12">
                                <div class="btn-group pull-right m-t-10">
                                    <form method="POST" action="<?php echo base_url();?>superuser_controller/add_allowance">
                                    <button type="" class="btn btn-sm btn-primary waves-effect waves-light m-r-10"><i class="fa fa-plus"></i> Add Allowance</button>
                                    </form>
                                </div>
                                <h3>Allowances</h3>
                            </div>
                        </div>
                        <div class="row">                            
                            <div class="col-sm-12">
                                <table class="table table-resposive table-striped">                                
                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>Allowance</th>
                                            <th>Entity Name (from events)</th>                                           
                                        </tr>                                            
                                    </thead>
                                    <tbody>
                                        <?php foreach($allowances as $allowance){?>
                                        <form method="POST" action="<?php echo base_url();?>superuser_controller/update_allowance">
                                            <tr>
                                                <td><input name="id_allowances" style="border: none; background: transparent; width:100%;" value="<?php echo $allowance['id_allowances'];?>"></td>
                                                <td><input name="allowance_name" style="border: none; background: transparent; width:100%;" value="<?php echo $allowance['allowance_name'];?>"></td>
                                                <td><input name="entity_name" style="border: none; background: transparent; width:100%;" value="<?php echo $allowance['entity_name'];?>"></td>
                                                <td>
                                                <button class="btn btn-sm btn-pink" type="submit">Update</button>
                                                </td>
                                            </tr>
                                        </form>
                                        <?php } ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                     </div>
                    
                    
                </div>
            </div>
        </div>
    </div> <!--container end-->
