index.blade.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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/grade_structure/add') }}" class="btn btn-sm btn-info pull-right"><i class="fa fa-plus"></i> Add Grade Structure</a> <br><br>
  19. @endif --}}
  20. </div>
  21. </header>
  22. <div class="panel-body">
  23. @foreach($grade as $data)
  24. <div class="col-md-4">
  25. <div class="box" style="border: 1px solid #d4d4d4;background: #f0f0f0;">
  26. <div class="box-header with-border" style="text-align: center !important">
  27. <h4 class="tex-center">{{$data->name}}</h4>
  28. </div>
  29. <!-- /.box-header -->
  30. <div class="box-body">
  31. <table class="table table-bordered">
  32. <tbody>
  33. <?php $newhead=array();$newgrade=array(); $total=0; ?>
  34. @foreach($data->gradehead as $row)
  35. <tr>
  36. <td>{{$row->head->name}}</td>
  37. <td class="text-right">{{ number_format($row->amount,2) }}</td>
  38. <?php $total = $total + $row->amount; ?>
  39. </tr>
  40. <?php
  41. $newhead[] = $row->head_id;
  42. $newgrade[] = $row->grade_id;
  43. ?>
  44. @endforeach
  45. @if(in_array($data->id,$newgrade))
  46. @foreach($heads as $head)
  47. @if(!in_array($head->id,$newhead))
  48. <tr>
  49. <td>{{$head->name}}</td>
  50. <td class="text-right">0</td>
  51. </tr>
  52. @endif
  53. @endforeach
  54. @else
  55. @foreach($heads as $head)
  56. <tr>
  57. <td>{{$head->name}}</td>
  58. <td class="text-right">0</td>
  59. </tr>
  60. @endforeach
  61. @endif
  62. <tr>
  63. <td colspan="2" class="text-right">Total : &nbsp; {{ number_format($total,2) }}</td>
  64. </tr>
  65. </tbody>
  66. </table><br/>
  67. <a href="{{ url('admin/grade_structure/edit/'.$data->id) }}" class="btn btn-sm btn-info pull-right"><i class="fa fa-edit"></i> Update</a> <br><br>
  68. </div>
  69. </div>
  70. </div>
  71. @endforeach
  72. <div class="clearfix"></div>
  73. </div>
  74. </div>
  75. <div class="modal fade" id="modalPreview">
  76. <div class="modal-dialog" style='width: 70%;'>
  77. </div>
  78. </div>
  79. <div id"statusmsg">
  80. </div>
  81. @stop
  82. @section('style')
  83. <style>
  84. .modal-dialog {
  85. width: 70% !important;
  86. height: 70% !important;
  87. }
  88. .modal-content {
  89. height: auto;
  90. min-height: 70% !important;
  91. border-radius: 0;
  92. }
  93. </style>
  94. @stop
  95. @section('script')
  96. <script src="{{ asset('/assets/') }}/js/jquery.dataTables.min.js"></script>
  97. <script src="{{ asset('/assets/') }}/js/dataTables.bootstrap.min.js"></script>
  98. <script src="{{ asset('/assets/') }}/switch/rcswitcher.js"></script>
  99. <script src="{{ asset('/assets/') }}/alert/sweetalert.min.js"></script>
  100. <script src="{{ asset('/assets/') }}/alert/pnotify.js"></script>
  101. <script src="{{ asset('/assets/') }}/alert/notify.js"></script>
  102. <script type="text/javascript">
  103. $(document).ready(function(){
  104. $('[data-toggle="tooltip"]').tooltip();
  105. $("input[type='checkbox']").rcSwitcher();
  106. });
  107. $(document).ready(function() {
  108. $('body').on('hidden.bs.modal', '.modal', function () {
  109. $(this).removeData('bs.modal');
  110. });
  111. var table=$("#example").DataTable({
  112. "searching": true,
  113. "lengthChange": true,
  114. "ordering": true,
  115. stateSave: true
  116. });
  117. $("input[type='checkbox']").rcSwitcher().on({'toggle.rcSwitcher': function( e, dataObj, changeType ){
  118. var id = $(this).data('id');
  119. var urll="{{ url('admin/grade_structure/status') }}/"+id;
  120. var msg_success = 'Status Updated Successfully.';
  121. var msg_error = 'Something went wrong!';
  122. $.ajax({
  123. url:urll,
  124. success: function(data){
  125. notify('success',msg_success);
  126. },
  127. error: function (data) {
  128. notify('error',msg_error);
  129. }
  130. });
  131. }
  132. });
  133. });
  134. </script>
  135. @stop
  136. @if(Session::has('msg'))
  137. <div class="alert alert-success center-block msg_alt" >
  138. <a class="close" data-dismiss="alert" href="#">&times;</a>
  139. <strong><i class="fa fa-check"></i></strong>&nbsp;
  140. {{Session::get('msg')}}
  141. </div>
  142. @endif