/
home
/
sjslayjy
/
public_html
/
mosaram
/
resources
/
views
/
Upload File
HOME
@extends('dashboard.layouts.app') @section('title', 'Attendance List') @section('style') {{ Html::style('assets/css/bootstrap-datepicker3.min.css') }} @endsection @section('content') <?php $currdatetime = date("Y-m-d H:i:s", strtotime("+330 minutes")); ?> <div class="main-content"> <div class="main-content-inner"> <div class="breadcrumbs ace-save-state" id="breadcrumbs"> <ul class="breadcrumb"> <li> <i class="ace-icon fa fa-home home-icon"></i> <a href="#">{{ __('messages.Home') }}</a> </li> <li class="active">Attendance Chart</li> </ul> </div> <div class="page-content"> <div class="row"> <form action="{{url('/attendance-chart')}}" method="POST"> {{ csrf_field() }} <div class="col-sm-4"> <label style="font-size:17px; font-weight: 500;">Month</label> <select name="month" id="month" style="width:100% !important;" control-id="ControlID-2"> <!--<option>Select Month</option>--> <!--<option value="01" <?php //echo (date('m')== '01') ? 'selected' : '' ?>>JAN</option>--> <!--<option value="02" <?php //echo (date('m')== '02') ? 'selected' : '' ?>>FEB</option>--> <!--<option value="03" <?php //echo (date('m')== '03') ? 'selected' : '' ?>>MAR</option>--> <!--<option value="04" <?php //echo (date('m')== '04') ? 'selected' : '' ?>>APR</option>--> <!--<option value="05" <?php //echo (date('m')== '05') ? 'selected' : '' ?>>MAY</option>--> <!--<option value="06" <?php //echo (date('m')== '06') ? 'selected' : '' ?>>JUN</option>--> <!--<option value="07" <?php //echo (date('m')== '07') ? 'selected' : '' ?>>JUL</option>--> <!--<option value="08" <?php //echo (date('m')== '08') ? 'selected' : '' ?>>AUG</option>--> <!--<option value="09" <?php //echo (date('m')== '09') ? 'selected' : '' ?>>SEP</option>--> <!--<option value="10" <?php //echo (date('m')== '10') ? 'selected' : '' ?>>OCT</option>--> <!--<option value="11" <?php //echo (date('m')== '11') ? 'selected' : '' ?>>NOV</option>--> <!--<option value="12" <?php //echo (date('m')== '12') ? 'selected' : '' ?>>DEC</option> --> <option>Select Month</option> @if($month) <option value="01" <?php echo ($month == '01') ? 'selected' : '' ?>>JAN</option> <option value="02" <?php echo ($month == '02') ? 'selected' : '' ?>>FEB</option> <option value="03" <?php echo ($month == '03') ? 'selected' : '' ?>>MAR</option> <option value="04" <?php echo ($month == '04') ? 'selected' : '' ?>>APR</option> <option value="05" <?php echo ($month == '05') ? 'selected' : '' ?>>MAY</option> <option value="06" <?php echo ($month == '06') ? 'selected' : '' ?>>JUN</option> <option value="07" <?php echo ($month == '07') ? 'selected' : '' ?>>JUL</option> <option value="08" <?php echo ($month == '08') ? 'selected' : '' ?>>AUG</option> <option value="09" <?php echo ($month == '09') ? 'selected' : '' ?>>SEP</option> <option value="10" <?php echo ($month == '10') ? 'selected' : '' ?>>OCT</option> <option value="11" <?php echo ($month == '11') ? 'selected' : '' ?>>NOV</option> <option value="12" <?php echo ($month == '12') ? 'selected' : '' ?>>DEC</option> @else <option value="01" <?php echo (date('m')== '01') ? 'selected' : '' ?>>JAN</option> <option value="02" <?php echo (date('m')== '02') ? 'selected' : '' ?>>FEB</option> <option value="03" <?php echo (date('m')== '03') ? 'selected' : '' ?>>MAR</option> <option value="04" <?php echo (date('m')== '04') ? 'selected' : '' ?>>APR</option> <option value="05" <?php echo (date('m')== '05') ? 'selected' : '' ?>>MAY</option> <option value="06" <?php echo (date('m')== '06') ? 'selected' : '' ?>>JUN</option> <option value="07" <?php echo (date('m')== '07') ? 'selected' : '' ?>>JUL</option> <option value="08" <?php echo (date('m')== '08') ? 'selected' : '' ?>>AUG</option> <option value="09" <?php echo (date('m')== '09') ? 'selected' : '' ?>>SEP</option> <option value="10" <?php echo (date('m')== '10') ? 'selected' : '' ?>>OCT</option> <option value="11" <?php echo (date('m')== '11') ? 'selected' : '' ?>>NOV</option> <option value="12" <?php echo (date('m')== '12') ? 'selected' : '' ?>>DEC</option> @endif </select> </div> <div class="col-sm-4"> <label style="font-size:17px;font-weight: 500;">Date</label> <select name="year" id="year" style="width:100% !important;" control-id="ControlID-3"> <option>Select Year</option> <?php for($i=1990; $i<=date('Y'); $i++){ ?> @if($year) <option value="<?php echo $i;?>" <?php echo ($i == $year) ? 'selected' : '' ?> ><?php echo $i;?> @else <option value="<?php echo $i;?>" <?php echo ($i == date('Y')) ? 'selected' : '' ?> ><?php echo $i;?> @endif </option> <?php } ?> </select> </div> <div class="col-sm-4" style="padding-top:33px;"> <input type="submit" value="Submit" id="btn" class="btn btn-primary" style="border-radius: 7px;padding: 8px 30px;font-weight: 500;"> <a href="{{url('attendance-report')}}" class="btn btn btn-outline-primary" style="border-radius: 7px;padding: 8px 30px;font-weight: 500;">Clear</a> </div> </form> </div> </div> <div class="page-content"> <div class="pull-right tableTools-container"></div> <h3 class="header smaller lighter blue">Attendance Chart</h3> <div class="table-header"><span class="badge badge-success"> </div> <div class="table-responsive"> <div class="dataTables_borderWrap"> <table id="dynamic-table" class="table table-striped table-bordered table-hover"> <thead> <tr> <th colspan="2"></th> <th colspan="31" style="background-color: gray; color: white; "><center>Days(<?php if(empty($month)){ echo $month = date('m'); }else{echo $month;}?>-<?php if(empty($year)){ echo $year = date('Y'); }else{echo $year;} ?>)</center></th> </tr> <th>#</th> <?php if(empty($month)){ $month = date('m'); }?> <?php if(empty($year)){ $year = date('Y'); }?> <th>Emp Name</th> <?php for($i=01;$i<=28;$i++){?> <th><?php echo $i ;?></th> <?php } ?> <?php if($month != '02'){ ?> <?php if($year % 4 == 0 && $month == '02') { ?> <th>29</th> <?php }elseif($year % 4 != 0 && $month != '02' || $year % 4 == 0 && $month != '02') { ?> <th>29</th> <th>30</th> <?php $month30days = array("04","11","06","09"); if(!in_array($month,$month30days)){ ?> <th>31</th> <?php $days=31; }else{ $days=30; } } }elseif($month == '02' && $year % 4 == 0){?> <th>29</th> <?php $days=29; }elseif($month == '02' && $year % 4 != 0){ $days=28; } ?> </thead> <tbody> <?php $i = 1; foreach($users as $val){ ?> <tr> <td><?php echo $i; ?></td> <td>{{ getUserById($val['user_id'])->name }}</td> <?php for($j=01; $j<=$days;$j++){ $date = $year.'-'.$month.'-'.$j; // dd($date); if(strtotime($date) > strtotime(date('Y-m-d'))){ echo "<td style='background-color:gray; color:black'></td>"; }else{ $getreport = getReport($val['user_id'],$date); if(!empty($getreport)){ // $status = $getreport['in_count']; echo"<td style='background-color:#4BB543; color:black'><b>P</b></br>(".date('H:i', strtotime($getreport['in_time'])).")</td>"; }else{ echo "<td style='background-color:#f46736; color:black'><b>A</b></td>"; } } }?> </tr> <?php $i++; }?> </tbody> </table> </div> </div> </div> </div><!-- /.page-content --> </div> </div> </div><!-- /.main-content --> <div class="modal fade" id="inOutTimeModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true" style="padding: 0% 17% 0% 17%;"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">In Out Time Details</h5> </div> <div class="modal-body" id="inOutTimeModalContent"> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" data-bs-dismiss="modal">Close</button> </div> </div> </div> </div> <!--status update--> <!-- <div class="modal fade" id="editItemModal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Update Status</h4> </div> <div class="modal-body" id="EditBodyItem"> </div> </div> </div> </div> --> @section('script') {{ Html::script('assets/js/jquery.dataTables.min.js') }} {{ Html::script('assets/js/jquery.dataTables.bootstrap.min.js') }} {{ Html::script('assets/js/dataTables.buttons.min.js') }} {{ Html::script('assets/js/buttons.flash.min.js') }} {{ Html::script('assets/js/buttons.html5.min.js') }} {{ Html::script('assets/js/buttons.print.min.js') }} {{ Html::script('assets/js/buttons.colVis.min.js') }} {{ Html::script('assets/js/dataTables.select.min.js') }} {{ Html::script('assets/js/ace-elements.min.js') }} {{ Html::script('assets/js/ace.min.js') }} {{ Html::script('assets/js/bootstrap-datepicker.min.js') }} <script type="text/javascript"> jQuery(function($) { //initiate dataTables plugin var myTable = $('#dynamic-table').DataTable({ bAutoWidth: false, "aaSorting": [], }); $.fn.dataTable.Buttons.defaults.dom.container.className = 'dt-buttons btn-overlap btn-group btn-overlap'; new $.fn.dataTable.Buttons(myTable, { buttons: [{ "extend": "colvis", "text": "<i class='fa fa-search bigger-110 blue'></i> <span class='hidden'>Show/hide columns</span>", "className": "btn btn-white btn-primary btn-bold", columns: ':not(:first):not(:last)' }, { "extend": "copy", "text": "<i class='fa fa-copy bigger-110 pink'></i> <span class='hidden'>Copy to clipboard</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "csv", "text": "<i class='fa fa-database bigger-110 orange'></i> <span class='hidden'>Export to CSV</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "excel", "text": "<i class='fa fa-file-excel-o bigger-110 green'></i> <span class='hidden'>Export to Excel</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "pdf", "text": "<i class='fa fa-file-pdf-o bigger-110 red'></i> <span class='hidden'>Export to PDF</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "print", "text": "<i class='fa fa-print bigger-110 grey'></i> <span class='hidden'>Print</span>", "className": "btn btn-white btn-primary btn-bold", autoPrint: false, message: 'This print was produced using the Print button for DataTables' } ] }); myTable.buttons().container().appendTo($('.tableTools-container')); //style the message box var defaultCopyAction = myTable.button(1).action(); myTable.button(1).action(function(e, dt, button, config) { defaultCopyAction(e, dt, button, config); $('.dt-button-info').addClass('gritter-item-wrapper gritter-info gritter-center white'); }); var defaultColvisAction = myTable.button(0).action(); myTable.button(0).action(function(e, dt, button, config) { defaultColvisAction(e, dt, button, config); if ($('.dt-button-collection > .dropdown-menu').length == 0) { $('.dt-button-collection') .wrapInner( '<ul class="dropdown-menu dropdown-light dropdown-caret dropdown-caret" />') .find('a').attr('href', '#').wrap("<li />") } $('.dt-button-collection').appendTo('.tableTools-container .dt-buttons') }); }); function getInOut(userId,createdDate){ var createdD = new Date(createdDate * 1000); var dateC = createdD.toUTCString(); $.ajax({ type:'get', url:'/in-out-time-by-date/'+userId+'/'+dateC, success: function(response){ console.log(response); $('#inOutTimeModalContent').html(response); $('#inOutTimeModal').modal('toggle'); } }); } function getUserDetail(id){ $.ajax({ url: "/user/get-user-detail/id/"+id, context: document.body, success: function(responseText) { $("#con-close-modal").html(responseText); $("#con-close-modal").find("script").each(function(i) { eval($(this).text()); }); } }); } </script> @endsection @endsection