/
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') <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 Report</li> </ul> </div> <div class="page-content"> <div class="row"> <form action="{{url('attendanceDayReport')}}" method="POST"> {{ csrf_field() }} <div class="col-sm-2"> <label style="font-size:17px;font-weight: 200;">Date</label> <input type="date" class="form-control date-picker fromDates" id="dates" name="dates" value=""> </div> <div class="col-sm-1" style="padding-top:29px;"> <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</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>S.N.</th> <th>Name</th> <th>App.Version</th> <th>Date</th> <th>First Time In</th> <th>Last Time Out</th> <th>Total Stay Time</th> <th>Attendance</th> <th>Attendance Location</th> <th>Total In Out</th> </tr> </thead> <tbody> @php $i=1; @endphp @if(isset($userAndDateWiseReports)) @foreach($userAndDateWiseReports as $userAndDateWiseReport) <tr> <td>{{$i}}</td> <td>{{ getModelById('User',$userAndDateWiseReport->user_id)->name }}</td> <td>{{ getModelById('User',$userAndDateWiseReport->user_id)->version }}</td> <td>{{ date('d-M-Y',strtotime($userAndDateWiseReport->in_time))}}</td> <td>{{ date('d-M-Y h:i:s A',strtotime($userAndDateWiseReport->in_time))}}</td> <td>@if(!is_null($userAndDateWiseReports1)){{date('d-M-Y h:i:s A',strtotime($userAndDateWiseReports1->out_time))}} @endif</td> <td>@if(!is_null($total_time)) {{$total_time}} @else No out time available. @endif</td> <td>{{ $userAndDateWiseReport->attendance_status}}</td> <td><?php $attend = $attendanceReport->location_id; $location = \DB::table('addlocation')->where('id',$attend)->first(); echo $location->name ?></td> <td><button class="btn btn-info" onclick="getInOut({{$userAndDateWiseReport->user_id}}, {{strtotime($userAndDateWiseReport->created_at)}})">view</button></td> </tr> @php $i++; @endphp @endforeach @else @foreach($attendanceReports as $key=>$attendanceReport) <tr> <td>{{$i}}</td> <td>{{ getModelById('User',$attendanceReport->user_id)->name}}</td> <td>{{ getModelById('User',$attendanceReport->user_id)->version }}</td> <td>{{ date('d-M-Y',strtotime($attendanceReport->in_time))}}</td> <td>{{ date('d-M-Y h:i:s A',strtotime($attendanceReport->in_time))}}</td> <td>@if(!is_null($attendanceReports1[$key]->outTime)) {{ date('d-M-Y h:i:s A',strtotime($attendanceReports1[$key]->outTime)) }} @endif</td> <td>@if($totalTimes[$key]!='00:00:00') {{$totalTimes[$key]}} @endif</td> <td>{{ $attendanceReport->attendance_status }}</td> <td><?php $attend = $attendanceReport->location_id; $location = \DB::table('addlocation')->where('id',$attend)->first(); echo $location->name ?></td> <td><button class="btn btn-info" onclick="getInOut({{$attendanceReport->user_id}}, {{strtotime($attendanceReport->created_at)}})">view</button></td> </tr> @php $i++; @endphp @endforeach @endif </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-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'); } }); } </script> @endsection @endsection