index.blade.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. @extends('layouts.master')
  2. @section('content')
  3. <!-- DataTables -->
  4. <link rel="stylesheet" href="{{ asset('/assets/') }}/css/dataTables.bootstrap.min.css">
  5. <link rel="stylesheet" href="{{ asset('/assets/') }}/switch/rcswitcher.css">
  6. <link rel="stylesheet" href="{{ asset('/assets/') }}/alert/pnotify.css">
  7. <link rel="stylesheet" href="{{ asset('/assets/') }}/alert/sweetalert.css">
  8. <link rel="stylesheet" href="{{ asset('/assets/') }}/alert/sweet-alert-animations.css">
  9. <div class="panel panel-default" style="min-height: 500px">
  10. <!-- Default panel contents -->
  11. <div class="panel-heading"></div>
  12. <header class="panel-heading" style="height:50px;">
  13. <div class="pull-left">
  14. {{$title}}
  15. </div>
  16. <div>
  17. @if(\Auth::user()->utype==1)
  18. <a href="{{ url('admin/payroll/create') }}" class="btn btn-sm btn-info pull-right"><i class="fa fa-plus"></i> Employee Bill Create</a> <br><br>
  19. @endif
  20. </div>
  21. </header>
  22. <div class="panel-body">
  23. <div class="clearfix"></div>
  24. <table class="table table-bordered " id="example">
  25. <thead>
  26. <tr>
  27. <th>#</th>
  28. <th>Employee Name</th>
  29. <th>Designation</th>
  30. <th>Grade</th>
  31. <th class="text-right">Salary</th>
  32. <th class="text-right">Due</th>
  33. <th class="text-right">Payable</th>
  34. <th>Status</th>
  35. <th>Action</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. @if($all)
  40. <?php $i=1; $total=0;?>
  41. @foreach($all as $row)
  42. <tr>
  43. <td>{{ $i++ }}</td>
  44. <td>{{ @$row->employee->name }}</td>
  45. <td>{{ @$row->designationName->designation['name'] }}</td>
  46. <td>{{ @$row->grade->name }}</td>
  47. <td class="text-right">
  48. <?php $salary=0; ?>
  49. @foreach($row->psHead as $data)
  50. @php $salary = $salary + $data->amount @endphp
  51. @endforeach
  52. @if($salary >0)
  53. <span>{{ number_format($salary,2) }} </span>
  54. @else
  55. <span>Salary not update</span>
  56. @endif
  57. </td>
  58. <td class="text-right">
  59. <?php $gross=0; $paid=0; ?>
  60. @foreach($row->due as $due)
  61. @php
  62. $gross = $gross + $due->gross_amount;
  63. $paid = $paid + $due->paid_amount
  64. @endphp
  65. @endforeach
  66. @php
  67. $total_due = $gross - $paid
  68. @endphp
  69. {{ number_format($total_due,2) }}
  70. </td>
  71. <td class="text-right">{{ number_format($total_due,2) }}</td>
  72. <td>
  73. @if($total_due <= 0)
  74. <label class="label label-success">Paid</label>
  75. @else
  76. <label class="label label-info">Due</label>
  77. @endif
  78. </td>
  79. <td>
  80. @if(\Auth::user()->utype==1)
  81. <a href="{{ url('admin/payroll/pr_update') }}/{{ $row->id }}" class='btn btn-primary btn-sm' data-toggle="tooltip" title="Pay Now" data-placement="top" @if($total_due ==0) {{'disabled'}}@endif>Pay Now</a>
  82. <a href="{{ url('admin/payroll/details') }}/{{ $row->employee_id }}" class='btn btn-primary btn-sm' data-toggle="tooltip" title="Employee Payment History" data-placement="top">Details</a>
  83. @endif
  84. </td>
  85. </tr>
  86. @endforeach
  87. @endif
  88. </tbody>
  89. </table>
  90. </div>
  91. </div>
  92. <div class="modal fade" id="modalPreview">
  93. <div class="modal-dialog" style='width: 70%;'>
  94. </div>
  95. </div>
  96. <div id"statusmsg">
  97. </div>
  98. @stop
  99. @section('style')
  100. <style>
  101. .modal-dialog {
  102. width: 70% !important;
  103. height: 70% !important;
  104. }
  105. .modal-content {
  106. height: auto;
  107. min-height: 70% !important;
  108. border-radius: 0;
  109. }
  110. </style>
  111. @stop
  112. @section('script')
  113. <script src="{{ asset('/assets/') }}/js/jquery.dataTables.min.js"></script>
  114. <script src="{{ asset('/assets/') }}/js/dataTables.bootstrap.min.js"></script>
  115. <script src="{{ asset('/assets/') }}/switch/rcswitcher.js"></script>
  116. <script src="{{ asset('/assets/') }}/alert/sweetalert.min.js"></script>
  117. <script src="{{ asset('/assets/') }}/alert/pnotify.js"></script>
  118. <script src="{{ asset('/assets/') }}/alert/notify.js"></script>
  119. <script type="text/javascript">
  120. $(document).ready(function(){
  121. $('[data-toggle="tooltip"]').tooltip();
  122. $("input[type='checkbox']").rcSwitcher();
  123. });
  124. $(document).ready(function() {
  125. $('body').on('hidden.bs.modal', '.modal', function () {
  126. $(this).removeData('bs.modal');
  127. });
  128. var table=$("#example").DataTable({
  129. "searching": true,
  130. "lengthChange": true,
  131. "ordering": true,
  132. stateSave: true
  133. });
  134. $("input[type='checkbox']").rcSwitcher().on({'toggle.rcSwitcher': function( e, dataObj, changeType ){
  135. var id = $(this).data('id');
  136. var urll="{{ url('admin/payroll_structure/status') }}/"+id;
  137. var msg_success = 'Status Updated Successfully.';
  138. var msg_error = 'Something went wrong!';
  139. $.ajax({
  140. url:urll,
  141. success: function(data){
  142. notify('success',msg_success);
  143. },
  144. error: function (data) {
  145. notify('error',msg_error);
  146. }
  147. });
  148. }
  149. });
  150. });
  151. </script>
  152. @stop
  153. @if(Session::has('msg'))
  154. <div class="alert alert-success center-block msg_alt" >
  155. <a class="close" data-dismiss="alert" href="#">&times;</a>
  156. <strong><i class="fa fa-check"></i></strong>&nbsp;
  157. {{Session::get('msg')}}
  158. </div>
  159. @endif