index.blade.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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_structure/add') }}" class="btn btn-sm btn-info pull-right"><i class="fa fa-plus"></i> Create Payroll</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 style="text-align: center;">Status</th>
  33. <th>Action</th>
  34. </tr>
  35. </thead>
  36. <tbody>
  37. @if($all)
  38. <?php $i=1;?>
  39. @foreach($all as $row)
  40. <tr>
  41. <td>{{ @$i++ }}</td>
  42. <td>{{ @$row->employee->name }}</td>
  43. <td>{{ @$row->designationName->designation['name'] }}</td>
  44. <td>
  45. {{ @$row->grade->name }}
  46. <?php $gmt=0; ?>
  47. @foreach($row->grade->gradeAmount as $gm)
  48. @php $gmt = $gmt + $gm->amount @endphp
  49. @endforeach
  50. ({{$gmt}} TK.)
  51. </td>
  52. <td class="text-right">
  53. <?php $salary=0; ?>
  54. @if(!empty($row->psHead))
  55. @foreach($row->psHead as $data)
  56. @php $salary = $salary + $data->amount @endphp
  57. @endforeach
  58. @if($salary==0)
  59. <span class="text-right">Salary Not Update </span>
  60. @else
  61. <span class="text-right">{{ number_format($salary,2) }} </span>
  62. @endif
  63. @else
  64. <span class="text-right">Salary Not Update </span>
  65. @endif
  66. </td>
  67. <td style="text-align: center;">
  68. @if($row->type == 4)
  69. <label class="label label-primary"> Rejoining </label>
  70. @else
  71. <label class="label label-success"> Continue </label>
  72. @endif
  73. </td>
  74. <td>
  75. @if(\Auth::user()->utype==1)
  76. <a href="{{ url('admin/payroll_structure/ps_update') }}/{{ $row->id }}" class='btn btn-primary btn-sm' data-toggle="tooltip" title="Update" data-placement="top">Update</a>
  77. {{-- <a href="{{ url('admin/payroll_structure/delete') }}/{{ $row->id }}" class='btn btn-default btn-sm' onclick="return confirm('Are you sure to delete this item ?')" data-toggle="tooltip" title="Delete" data-placement="top"><i class="fa fa-trash-o"></i></a> --}}
  78. @endif
  79. </td>
  80. </tr>
  81. @endforeach
  82. @endif
  83. </tbody>
  84. </table>
  85. </div>
  86. </div>
  87. <div class="modal fade" id="modalPreview">
  88. <div class="modal-dialog" style='width: 70%;'>
  89. </div>
  90. </div>
  91. <div id"statusmsg">
  92. </div>
  93. @stop
  94. @section('style')
  95. <style>
  96. .modal-dialog {
  97. width: 70% !important;
  98. height: 70% !important;
  99. }
  100. .modal-content {
  101. height: auto;
  102. min-height: 70% !important;
  103. border-radius: 0;
  104. }
  105. </style>
  106. @stop
  107. @section('script')
  108. <script src="{{ asset('/assets/') }}/js/jquery.dataTables.min.js"></script>
  109. <script src="{{ asset('/assets/') }}/js/dataTables.bootstrap.min.js"></script>
  110. <script src="{{ asset('/assets/') }}/switch/rcswitcher.js"></script>
  111. <script src="{{ asset('/assets/') }}/alert/sweetalert.min.js"></script>
  112. <script src="{{ asset('/assets/') }}/alert/pnotify.js"></script>
  113. <script src="{{ asset('/assets/') }}/alert/notify.js"></script>
  114. <script type="text/javascript">
  115. $(document).ready(function(){
  116. $('[data-toggle="tooltip"]').tooltip();
  117. $("input[type='checkbox']").rcSwitcher();
  118. });
  119. $(document).ready(function() {
  120. $('body').on('hidden.bs.modal', '.modal', function () {
  121. $(this).removeData('bs.modal');
  122. });
  123. var table=$("#example").DataTable({
  124. "searching": true,
  125. "lengthChange": true,
  126. "ordering": true,
  127. stateSave: true
  128. });
  129. $("input[type='checkbox']").rcSwitcher().on({'toggle.rcSwitcher': function( e, dataObj, changeType ){
  130. var id = $(this).data('id');
  131. var urll="{{ url('admin/payroll_structure/status') }}/"+id;
  132. var msg_success = 'Status Updated Successfully.';
  133. var msg_error = 'Something went wrong!';
  134. $.ajax({
  135. url:urll,
  136. success: function(data){
  137. notify('success',msg_success);
  138. },
  139. error: function (data) {
  140. notify('error',msg_error);
  141. }
  142. });
  143. }
  144. });
  145. });
  146. </script>
  147. @stop
  148. @if(Session::has('msg'))
  149. <div class="alert alert-success center-block msg_alt" >
  150. <a class="close" data-dismiss="alert" href="#">&times;</a>
  151. <strong><i class="fa fa-check"></i></strong>&nbsp;
  152. {{Session::get('msg')}}
  153. </div>
  154. @endif