Dashboard sipadu mbip
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

template_notice_index.blade.php 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. @extends('layout.officer', ['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. </style>
  45. <div class="inner-page">
  46. <div class="row">
  47. <div class="col-md-12">
  48. <div class="fluid">
  49. @if(count($errors) > 0)
  50. <div class="alert alert-danger icons-alert">
  51. @foreach($errors->all() as $error)
  52. <p>{{$error}}</p>
  53. @endforeach
  54. </div>
  55. @endif
  56. @if(Session::get('error_msg'))
  57. <div class="alert alert-danger icons-alert">
  58. {!! Session::get('error_msg') !!}
  59. </div>
  60. @elseif(Session::get('success_msg'))
  61. <div class="alert alert-success icons-alert">
  62. {!! Session::get('success_msg') !!}
  63. </div>
  64. @endif
  65. </div>
  66. </div>
  67. </div>
  68. <div class="row">
  69. <div class="col-xl-2 col-md-12">
  70. <div class="panel panel-default">
  71. <div class="panel-heading">
  72. <h4 class="panel-title"> Navigasi </h4>
  73. </div>
  74. <div class="panel-body">
  75. <div>
  76. <a href="{{ url('/officer/setting/template/notice') }}" class="active">Senarai Templat Notis Amaran</a>
  77. </div>
  78. <div>
  79. <a href="{{ url('/officer/setting/template/notice/add') }}">Tambah Templat Notis Amaran</a>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="col-xl-10 col-md-12">
  85. <div class="card">
  86. <div class="card-header">
  87. <h5>Senarai Templat Notis Amaran</h5>
  88. <span><code>** <b>PERHATIAN!! </b></code> Template yang sedia ada boleh diguna bila status dia <code>'aktif' **</code></span>
  89. </div>
  90. <div class="card-block">
  91. <div class="dt-responsive table-responsive">
  92. <table id="template" class="table table-sm table-striped table-bordered nowrap" width="100%">
  93. <thead>
  94. <tr>
  95. <th>#/Jenis</th>
  96. <th>No.Rujukan</th>
  97. <th>Tempoh Surat</th>
  98. <th>Status</th>
  99. <th>Tindakan</th>
  100. </tr>
  101. </thead>
  102. <tfoot>
  103. <tr>
  104. <th>#/Jenis</th>
  105. <th>No.Rujukan</th>
  106. <th>Tempoh Surat</th>
  107. <th>Status</th>
  108. <th>Tindakan</th>
  109. </tr>
  110. </tfoot>
  111. </table>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. @endsection
  119. @section('external_js')
  120. <script type="text/javascript">
  121. $.ajaxSetup({
  122. headers: {
  123. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  124. }
  125. });
  126. var roles_access = '{{ $user->roles_access }}';
  127. var table = $('#template').DataTable({
  128. "ordering": false,
  129. "serverSide": true,
  130. "processing": true,
  131. "ajax": "{{ url('api/setting/template') }}/{{ $user->_id}}/-/list",
  132. "columns": [
  133. { "data": "index", "name": "index" },
  134. { "data": "no_rujukan", "name": "no_rujukan"},
  135. { "data": "tempoh", "name": "tempoh"},
  136. { "data": "status", "name": "status"},
  137. { "data": "tindakan","name": "tindakan"}
  138. ],
  139. "columnDefs": [
  140. {
  141. "render": function ( data, type, row ) {
  142. if (data.indexOf("Baru/") >= 0) {
  143. var split = data.split('/');
  144. return '<label class="label label-success">'+split[0]+'</label>&nbsp;'+split[1];
  145. }else {
  146. return data;
  147. }
  148. },
  149. "targets": 0,
  150. },
  151. {
  152. "render": function ( data, type, row ) {
  153. var currentLogin = '{{ $user->_id }}';
  154. if (data == 'tidak aktif') {
  155. return '<a onclick="confirmTemplate(\''+row.tindakan+'\',\'' + row.no_rujukan + '\',\'aktif \')" 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="Mengaktifkan">Aktifkan</a>';
  156. }else {
  157. return '<a onclick="confirmTemplate(\''+row.tindakan+'\',\'' + row.no_rujukan + '\',\'tidak aktif\')" class="tabledit-edit-button btn btn-sm btn-danger waves-effect waves-light" style="float: none;color:#fff" data-toggle="tooltip" data-placement="top" title="Tidak diaktifkan">Tidak Aktifkan</a>';
  158. }
  159. },
  160. "targets": 3,
  161. },
  162. {
  163. "render": function ( data, type, row ) {
  164. var kpd = 'null';
  165. var editLink = "{{ url('/officer/setting/template/notice') }}"+"/"+data+"/edit";
  166. var pdfLink = "{{ url('/officer/setting/template/notice') }}"+"/"+data+"/"+kpd+"/view/detail";
  167. 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 + '\')" 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>';
  168. },
  169. "targets": 4,
  170. },
  171. ],
  172. "language": {
  173. "paginate": {
  174. "previous": "Sebelum",
  175. "next": "Selepas"
  176. },
  177. "sLengthMenu": "Tunjukkan _MENU_ entri",
  178. "zeroRecords": "Tiada Data Ditemui",
  179. "infoEmpty": "Tiada Rekod Yang Wujud",
  180. "infoFiltered": "(Ditapis daripada _MAX_ jumlah rekod)",
  181. "info": "Tunjuk _START_ hingga _END_ daripada _TOTAL_ entri",
  182. "sSearch": "Cari:",
  183. }
  184. });
  185. function confirmTemplate(cid,rujukan,statusT) {
  186. var mid = cid;
  187. var rujukan = rujukan;
  188. swal({
  189. title: "",
  190. text: "Mengesahkan Template ( " + rujukan + " ) ?",
  191. html: true,
  192. type: "warning",
  193. showCancelButton: true,
  194. confirmButtonClass: "btn-danger",
  195. confirmButtonText: "Ya!",
  196. cancelButtonText: "Batal!",
  197. closeOnConfirm: false
  198. },
  199. function(isConfirm){
  200. if (!isConfirm) return;
  201. $.ajax({
  202. type: "POST",
  203. url: "{{ url('api/setting/template/confirm') }}",
  204. data: { "_token": "{{ csrf_token() }}", id: mid, status: statusT},
  205. success:function(data){
  206. if(data['status'] == "true"){
  207. swal({
  208. title: "Berjaya",
  209. text: data['desc'],
  210. type: "success",
  211. showCancelButton: false,
  212. confirmButtonText: "OK!",
  213. closeOnConfirm: true
  214. },
  215. function(){
  216. table.ajax.url("{{ url('api/setting/template') }}/{{ $user->_id}}/-/list").load();
  217. });
  218. }else if(data['status'] == "false"){
  219. swal({
  220. title: "Tidak Berjaya",
  221. text: data['desc'],
  222. type: "error",
  223. showCancelButton: false,
  224. confirmButtonText: "OK!",
  225. closeOnConfirm: true
  226. },
  227. function(){
  228. table.ajax.url("{{ url('api/setting/template') }}/{{ $user->_id}}/-/list").load();
  229. });
  230. }
  231. },
  232. error: function (xhr, ajaxOptions, thrownError) {
  233. swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
  234. }
  235. });
  236. });
  237. };
  238. function deleteA(cid,rujukan) {
  239. var cid = cid;
  240. var rujukan = rujukan;
  241. swal({
  242. title: "Adakah anda pasti?",
  243. text: "Anda tidak akan dapat memulihkan rekod memo ini ( " + rujukan + " )",
  244. html: true,
  245. type: "warning",
  246. showCancelButton: true,
  247. confirmButtonClass: "btn-danger",
  248. confirmButtonText: "Ya!",
  249. cancelButtonText: "Batal!",
  250. closeOnConfirm: false
  251. },
  252. function(isConfirm){
  253. if (!isConfirm) return;
  254. $.ajax({
  255. type: "POST",
  256. url: "{{ url('api/setting/template/delete') }}",
  257. data: { "_token": "{{ csrf_token() }}", id: cid },
  258. success:function(data){
  259. if(data['status'] == "true"){
  260. swal({
  261. title: "Berjaya",
  262. text: data['desc'],
  263. type: "success",
  264. showCancelButton: false,
  265. confirmButtonText: "OK!",
  266. closeOnConfirm: true
  267. },
  268. function(){
  269. table.ajax.url("{{ url('api/setting/template') }}/{{ $user->_id}}/-/list").load();
  270. });
  271. }else if(data['status'] == "false"){
  272. swal({
  273. title: "Tidak Berjaya",
  274. text: data['desc'],
  275. type: "error",
  276. showCancelButton: false,
  277. confirmButtonText: "OK!",
  278. closeOnConfirm: true
  279. },
  280. function(){
  281. table.ajax.url("{{ url('api/setting/template') }}/{{ $user->_id}}/-/list",).load();
  282. });
  283. }
  284. },
  285. error: function (xhr, ajaxOptions, thrownError) {
  286. swal("Error deleting!", "Rekod tidak berjaya di buang", "error");
  287. }
  288. });
  289. });
  290. };
  291. $(document).ready(function() {
  292. var origin = window.location.origin;
  293. $(".theme-loader").animate({
  294. opacity: "0"
  295. },1000);
  296. setTimeout(function() {
  297. $(".theme-loader").remove();
  298. }, 800);
  299. $('[data-toggle="tooltip"]').tooltip();
  300. });
  301. </script>
  302. @endsection