Dashboard sipadu mbip
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

memo_index.blade.php 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. @extends('layout.master', ['uid' => $user->_id, 'token' => $user->token_firebase])
  2. @section('page_title', 'Kompaun')
  3. @section('sub_page_title', '')
  4. @section('name', $user->StaffDetail->full_name)
  5. @section('img_profile', $user->StaffDetail->profile_img)
  6. @section('content')
  7. <style type="text/css">
  8. select.form-control, select.form-control:focus, select.form-control:hover {
  9. border: 1px solid #ccc !important;
  10. height: auto !important;
  11. }
  12. .panel-group .panel {
  13. margin-bottom: 0;
  14. overflow: hidden;
  15. border-radius: 4px;
  16. }
  17. .panel-default {
  18. border-color: #ddd;
  19. }
  20. .panel-default>.panel-heading {
  21. color: #333;
  22. background-color: #f5f5f5;
  23. border-color: #ddd;
  24. }
  25. .panel-title {
  26. margin-top: 0;
  27. margin-bottom: 0;
  28. font-size: 16px;
  29. color: inherit;
  30. }
  31. .panel-body .table>thead>tr>th, .panel-body .table>tbody>tr>th, .panel-body .table>tfoot>tr>th, .panel-body .table>thead>tr>td, .panel-body .table>tbody>tr>td, .panel-body .table>tfoot>tr>td , .panel-body div{
  32. padding: 8px 15px;
  33. line-height: 1.428571429;
  34. vertical-align: top;
  35. border-top: 1px solid #ddd;
  36. }
  37. .glyphicon { margin-right:10px; }
  38. .panel-body { padding:0px; }
  39. .panel-body table tr td { padding-left: 15px }
  40. .panel-body table tr td a:hover , .panel-body div a:hover{ color: #d84315 !important; }
  41. .panel-body .table, .panel-body div {margin-bottom: 0px; }
  42. .active { color: #d84315; }
  43. .active:hover { color: #d84315; }
  44. .r-padd { padding-right: 5%; }
  45. </style>
  46. <div class="inner-page">
  47. <div class="row">
  48. <div class="col-md-12">
  49. <div class="fluid">
  50. @if(count($errors) > 0)
  51. <div class="alert alert-danger icons-alert">
  52. @foreach($errors->all() as $error)
  53. <p>{{$error}}</p>
  54. @endforeach
  55. </div>
  56. @endif
  57. @if(Session::get('error_msg'))
  58. <div class="alert alert-danger icons-alert">
  59. {!! Session::get('error_msg') !!}
  60. </div>
  61. @elseif(Session::get('success_msg'))
  62. <div class="alert alert-success icons-alert">
  63. {!! Session::get('success_msg') !!}
  64. </div>
  65. @endif
  66. </div>
  67. </div>
  68. </div>
  69. <div class="row">
  70. <div class="col-xl-2 col-md-12">
  71. <div class="panel panel-default">
  72. <div class="panel-heading">
  73. <h4 class="panel-title"> Navigasi </h4>
  74. </div>
  75. <div class="panel-body">
  76. <div>
  77. <a href="{{ url('/main/setting/memo/index') }}" class="active">Senarai Memo/Nota</a>
  78. </div>
  79. <div>
  80. <a href="{{ url('/main/setting/memo/add') }}">Tambah Memo/Nota</a>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="col-xl-10 col-md-12">
  86. <div class="row">
  87. <div class="col-md-12">
  88. <div class="card">
  89. <div class="card-header">
  90. <h5>Senarai Memo/Nota</h5>
  91. </div>
  92. <div class="card-block">
  93. <div class="dt-responsive table-responsive">
  94. <table id="nota" class="table table-sm table-striped table-bordered nowrap" style="width:100%">
  95. <thead>
  96. <tr>
  97. <th>#</th>
  98. <th>ItKod</th>
  99. <th>Jenis Memo</th>
  100. <th>No.Rujukan</th>
  101. <th>Tarikh Mula</th>
  102. <th>Tarikh Akhir</th>
  103. <th>DiKeluarkan</th>
  104. <th>Disahkan</th>
  105. <th>Tindakan</th>
  106. </tr>
  107. </thead>
  108. <tfoot>
  109. <tr>
  110. <th>#</th>
  111. <th>ItKod</th>
  112. <th>Jenis Memo</th>
  113. <th>No.Rujukan</th>
  114. <th>Tarikh Mula</th>
  115. <th>Tarikh Akhir</th>
  116. <th>DiKeluarkan</th>
  117. <th>Disahkan</th>
  118. <th>Tindakan</th>
  119. </tr>
  120. </tfoot>
  121. </table>
  122. </div>
  123. <!-- End <div class="animation-modal"> -->
  124. </div>
  125. </div>
  126. </div>
  127. <div class="md-overlay"></div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. @endsection
  133. @section('external_js')
  134. <script type="text/javascript">
  135. $.ajaxSetup({
  136. headers: {
  137. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  138. }
  139. });
  140. var roles_access = '{{ $user->roles_access }}';
  141. var table = $('#nota').DataTable({
  142. "ordering": false,
  143. "serverSide": true,
  144. "processing": true,
  145. "ajax": "{{ url('api/setting/memo/list') }}",
  146. "columns": [
  147. { "data": "index","name": "index"},
  148. { "data": "itkod","name": "itkod"},
  149. { "data": "jenis","name": "jenis"},
  150. { "data": "no_rujukan", "name": "no_rujukan" },
  151. { "data": "mula", "name": "mula"},
  152. { "data": "akhir", "name": "akhir"},
  153. { "data": "dikeluakan", "name": "dikeluakan"},
  154. { "data": "disahkan", "name": "disahkan"},
  155. { "data": "tindakan","name": "tindakan"}
  156. ],
  157. "columnDefs": [
  158. {
  159. "render": function ( data, type, row ) {
  160. if (data.indexOf("Baru/") >= 0) {
  161. var split = data.split('/');
  162. return '<label class="label label-success">'+split[0]+'</label>&nbsp;'+split[1];
  163. }else {
  164. return data;
  165. }
  166. },
  167. "targets": 0,
  168. },
  169. {
  170. "render": function ( data, type, row ) {
  171. var currentLogin = '{{ $user->_id }}';
  172. if(data != ''){
  173. return data;
  174. }else{
  175. return '<a onclick="confirmMemo(\''+row.tindakan+'\',\'' + row.no_rujukan + '\',\'' + currentLogin + '\')" class="tabledit-edit-button btn btn-sm btn-warning waves-effect waves-light" style="float: none;color:#333" data-toggle="tooltip" data-placement="top" title="Mengesahkan">Minta Pengesahan</a>';
  176. }
  177. },
  178. "targets": 7,
  179. },
  180. {
  181. "render": function ( data, type, row ) {
  182. var editLink = "{{ url('/main/setting/memo') }}"+"/"+data+"/edit/detail";
  183. var pdfLink = "{{ url('/main/setting/memo') }}"+"/"+data+"/view/detail";
  184. var staff = "{{ $user->_id }}";
  185. return '<div class="btn-group btn-group-sm" style="float: none;"><a target="_blank" href="'+pdfLink+'" class="tabledit-edit-button btn btn-success waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Maklumat Memo"><span class="icofont icofont-eye-alt" style="color:white"></span></a> <a href="'+editLink+'" class="tabledit-edit-button btn btn-primary waves-effect waves-light" style="float: none;" data-toggle="tooltip" data-placement="top" title="Kemaskini Memo"><span class="icofont icofont-ui-edit" style="color:white"></span></a> <a onclick="deleteA(\''+data+'\',\'' + row.no_rujukan + '\',\'' + staff + '\')" data-toggle="tooltip" data-placement="top" title="Buang Memo" class="tabledit-delete-button btn btn-danger waves-effect waves-light" style="float: none;"><span class="icofont icofont-ui-delete" style="color:white"></span></a></div>';
  186. },
  187. "targets": 8,
  188. },
  189. ],
  190. "language": {
  191. "paginate": {
  192. "previous": "Sebelum",
  193. "next": "Selepas"
  194. },
  195. "sLengthMenu": "Tunjukkan _MENU_ entri",
  196. "zeroRecords": "Tiada Data Ditemui",
  197. "infoEmpty": "Tiada Rekod Yang Wujud",
  198. "infoFiltered": "(Ditapis daripada _MAX_ jumlah rekod)",
  199. "info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
  200. "sSearch": "Cari:",
  201. }
  202. });
  203. function confirmMemo(cid,rujukan,currentLogin) {
  204. var mid = cid;
  205. var rujukan = rujukan;
  206. swal({
  207. title: "",
  208. text: "Mengesahkan Memo ( " + rujukan + " ) ?",
  209. html: true,
  210. type: "warning",
  211. showCancelButton: true,
  212. confirmButtonClass: "btn-danger",
  213. confirmButtonText: "Ya!",
  214. cancelButtonText: "Batal!",
  215. closeOnConfirm: false
  216. },
  217. function(isConfirm){
  218. if (!isConfirm) return;
  219. $.ajax({
  220. type: "POST",
  221. url: "{{ url('api/setting/memo/confirm') }}",
  222. data: { "_token": "{{ csrf_token() }}", id: mid, confirm_id: currentLogin, kpd: "null"},
  223. success:function(data){
  224. if(data['status'] == "true"){
  225. swal({
  226. title: "Berjaya",
  227. text: data['desc'],
  228. type: "success",
  229. showCancelButton: false,
  230. confirmButtonText: "OK!",
  231. closeOnConfirm: true
  232. },
  233. function(){
  234. table.ajax.url("{{ url('api/setting/memo/list') }}").load();
  235. });
  236. }else if(data['status'] == "false"){
  237. swal({
  238. title: "Tidak Berjaya",
  239. text: data['desc'],
  240. type: "error",
  241. showCancelButton: false,
  242. confirmButtonText: "OK!",
  243. closeOnConfirm: true
  244. },
  245. function(){
  246. table.ajax.url("{{ url('api/setting/memo/list') }}").load();
  247. });
  248. }
  249. },
  250. error: function (xhr, ajaxOptions, thrownError) {
  251. swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
  252. }
  253. });
  254. });
  255. };
  256. function deleteA(cid,rujukan,staff) {
  257. var cid = cid;
  258. var rujukan = rujukan;
  259. swal({
  260. title: "Adakah anda pasti?",
  261. text: "Anda tidak akan dapat memulihkan rekod memo ini ( " + rujukan + " )",
  262. html: true,
  263. type: "warning",
  264. showCancelButton: true,
  265. confirmButtonClass: "btn-danger",
  266. confirmButtonText: "Ya!",
  267. cancelButtonText: "Batal!",
  268. closeOnConfirm: false
  269. },
  270. function(isConfirm){
  271. if (!isConfirm) return;
  272. $.ajax({
  273. type: "POST",
  274. url: "{{ url('api/setting/delete/memo') }}",
  275. data: { "_token": "{{ csrf_token() }}", id: cid, staff:staff },
  276. success:function(data){
  277. if(data['status'] == "true"){
  278. swal({
  279. title: "Berjaya",
  280. text: data['desc'],
  281. type: "success",
  282. showCancelButton: false,
  283. confirmButtonText: "OK!",
  284. closeOnConfirm: true
  285. },
  286. function(){
  287. table.ajax.url("{{ url('api/setting/memo/list') }}").load();
  288. });
  289. }else if(data['status'] == "false"){
  290. swal({
  291. title: "Tidak Berjaya",
  292. text: data['desc'],
  293. type: "error",
  294. showCancelButton: false,
  295. confirmButtonText: "OK!",
  296. closeOnConfirm: true
  297. },
  298. function(){
  299. table.ajax.url("{{ url('api/setting/memo/list') }}").load();
  300. });
  301. }
  302. },
  303. error: function (xhr, ajaxOptions, thrownError) {
  304. swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
  305. }
  306. });
  307. });
  308. };
  309. $(document).ready(function() {
  310. var origin = window.location.origin;
  311. // <!-- Theme Loader -->
  312. $(".theme-loader").animate({
  313. opacity: "0"
  314. },1000);
  315. setTimeout(function() {
  316. $(".theme-loader").remove();
  317. }, 800);
  318. /*** Tooltip ***/
  319. $('#nota').on('draw.dt', function () {
  320. $('[data-toggle="tooltip"]').tooltip();
  321. });
  322. });
  323. </script>
  324. @endsection