ok
Direktori : /home2/selectio/public_html/obnovit-tracking/old/ |
Current File : /home2/selectio/public_html/obnovit-tracking/old/my-attendance.php |
<?php include "header.php";?> <div class="content-wrapper" style="background:white;"> <script type="text/javascript"> $(document).ready(function() { emp_data(); function emp_data(){ var filter_year =$('#filter_year').val(); var filter_month =$('#filter_month').val(); var table = $('#StData').DataTable({ 'ajax' : { url: 'data-tables/my-attendance-datatable.php', data:{filter_year:filter_year,filter_month:filter_month}, type: 'POST'}, bFilter: true, bDestroy: true, searching: true,pageLength: 10, "buttons": [ { extend: 'copyHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } }, { extend: 'excelHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } }, { extend: 'csvHtml5', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } }, { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A4', 'footer': false, exportOptions: { columns: [ 0, 1, 2, 3, 4, 5 ] } }, { extend: 'colvis', text: 'Columns'}, ] }); } $('#filter_month,#filter_year').change(function() { emp_data(); }); }); </script> <section class="content"> <div class="row"> <div class="col-xs-12"> <div > <div class="box-header"> <!-- <?php if($_SESSION['hrm']['id']==1 || $allPermissions['category']['create']=="1"){ ?> <a href="holidays-add.php" class="btn btn-success btn-sm pull-right"><i class="fa fa-plus-circle"></i> Create New Holidays</a> <?php } ?>--> <h3 class="box-title"><b><i class="fa fa-list"></i> Attendance </b></h3> </div> <div class="box-body"> <div class="row"> <div class="col-sm-2"> <div class="form-group"> <label class="control-label" for="user">Year</label> <select name="filter_year" class="form-control select2" style="width:100%" id="filter_year" required> <!--<option value="">All</option>--> <?php for($i=2020;$i<=2040;$i++){ if($i==date('Y')){ echo "<option value='".$i."' selected>".str_pad($i, 2, "0", STR_PAD_LEFT)."</option>"; }else{ echo "<option value='".$i."'>".str_pad($i, 2, "0", STR_PAD_LEFT)."</option>"; } } ?> </select> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label class="control-label" for="user">Month</label> <select name="filter_month" class="form-control select2" style="width:100%" id="filter_month" required> <!--<option value="">All</option>--> <?php for($i=1;$i<=12;$i++){ if($i==date('m')){ echo "<option value='".$i."' selected>".str_pad($i, 2, "0", STR_PAD_LEFT)."</option>"; }else{ echo "<option value='".$i."'>".str_pad($i, 2, "0", STR_PAD_LEFT)."</option>"; } } ?> </select> </div> </div> </div> <div class="clearfix"></div> Note: <span class="p">P</span>-Present <span class="a">A</span>-Absent <span class="h">H</span>-Holiday <span class="p2">P/2</span>-Half Day <br><br> <div class="table-responsive"> <table id="StData" class="table table-striped table-bordered table-condensed table-hover" style="margin-bottom:5px;font-size: 14px;"> <thead> <tr class="active"> <th data-orderable="false">S.no</th> <th data-orderable="false">Employee Name</th> <th data-orderable="false">PF Type</th> <th data-orderable="false" colspan="31">Date</th> </tr> <tr> <th colspan="3" data-orderable="false"></th> <?php for($d=1;$d<=31;$d++){ echo "<th data-orderable='false'>".$d."</th>"; } ?> </tr> </thead> <tbody> <tr> <td>1</td> <td>Hari Kirushnan</td> <td><span style="color:green;">Yes</span></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="a">A</b></td> <td><b class="h">H</b></td> <td><b class="p2">P/2</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="a">A</b></td> <td><b class="h">H</b></td> <td><b class="p2">P/2</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="a">A</b></td> <td><b class="h">H</b></td> <td><b class="p2">P/2</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> </tr> <tr> <td>1</td> <td>Vijay</td> <td><span style="color:green;">Yes</span></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="a">A</b></td> <td><b class="h">H</b></td> <td><b class="p2">P/2</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="a">A</b></td> <td><b class="h">H</b></td> <td><b class="p2">P/2</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="a">A</b></td> <td><b class="h">H</b></td> <td><b class="p2">P/2</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> </tr> <tr> <td>1</td> <td>Arun</td> <td><span style="color:green;">Yes</span></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="a">A</b></td> <td><b class="h">H</b></td> <td><b class="p2">P/2</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="a">A</b></td> <td><b class="h">H</b></td> <td><b class="p2">P/2</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="p">P</b></td> <td><b class="p">P</b></td> <td><b class="a">A</b></td> <td><b class="a">A</b></td> <td><b class="h">H</b></td> <td><b class="p2">P/2</b></td> <td><b class="a">A</b></td> </tr> </tbody> </table> </div> <div class="clearfix"></div> </div> </div> </div> </div> </section> <script> $(document).ready(function(){ $("#filter_department").change(function () { get_desgination(); }); $("#filter_designation").change(function () { get_employee_by_designation_id(); }); function get_desgination(){ $('#filter_designation').empty(); var departement_id=$('#filter_department').val(); $.ajax({ url: 'api/get-desgination-api.php', type: 'post', dataType: 'json', data: {type:'get_desgination',departement_id:departement_id}, success: function (response) { console.log(response); var m='<option value="all">All</option>'; if(response['error']==false){ for(var n=0;n<response['data'].length;n++){ m+='<option value='+response['data'][n]['id']+'>'+response['data'][n]['desgination']+'</option>'; } } $('#filter_designation').append(m); } }); } function get_employee_by_designation_id(){ $('#filter_employee').empty(); var designation_id=$('#filter_designation').val(); $.ajax({ url: 'api/get_employee_by_designation_id.php', type: 'post', dataType: 'json', data: {type:'get_employee_by_designation_id',designation_id:designation_id}, success: function (response) { console.log(response); var m='<option value="all">All</option>'; if(response['error']==false){ for(var n=0;n<response['data'].length;n++){ m+='<option value='+response['data'][n]['id']+'>'+response['data'][n]['emp_name']+'</option>'; } } $('#filter_employee').append(m); } }); } }); </script> <style> .p{ background: #417441;color: white;padding: 5px 10px 5px 10px;border-radius: 15px; } .p2{ background: #000000;color: white;padding: 5px 10px 5px 10px;border-radius: 15px; } .a{ background: #782626;color: white;padding: 5px 10px 5px 10px;border-radius: 15px; } .h{ background: #a36188;color: white;padding: 5px 10px 5px 10px;border-radius: 15px; } </style> <?php include "footer.php";?>