Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

template_notice_edit.blade.php 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  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') }}">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>Tambah Templat Notis Amaran</h5>
  88. <span><code>** <b>PERHATIAN!! </b></code>Sila <code>'aktifkan'</code> balik notis amaran ini setelah berjaya kemaskini<code>**</code></span>
  89. </div>
  90. <div class="card-block">
  91. <form method="POST" action="{{ url('/officer/setting/template/notice/request/edit') }}" enctype="multipart/form-data">
  92. <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
  93. <input type="hidden" name="_id" value="{{ $template->_id }}">
  94. <input type="hidden" id="department" name="department" value="{{ $department->jbkod }}">
  95. <div class="row">
  96. <div class="col-lg-6 col-md-12">
  97. <div class="form-group form-primary">
  98. <label class="float-label"><b>Jabatan <code>*</code></b></label>
  99. <input type="type" name="dd" class="form-control" value="[{{ $department->jbkod }}] {{ $department->jnama }}" disabled>
  100. <span class="form-bar"></span>
  101. </div>
  102. </div>
  103. <div class="col-lg-6 col-md-12">
  104. <div class="form-group form-primary">
  105. <label class="float-label"><b>Akta Kesalahan <code>*</code></b></label>
  106. <select id="acts" name="acts" class="form-control" required></select>
  107. <span class="form-bar"></span>
  108. </div>
  109. </div>
  110. </div>
  111. <div class="row" id="faulty">
  112. <div class="col-lg-12 col-md-12">
  113. <div class="form-group form-primary">
  114. <label class="float-label"><b>Seksyen Kesalahan <code>*</code></b></label>
  115. <select id="seksyen" name="seksyen" class="form-control" required>
  116. <option value="">Pilih Kategori Kesalahan</option>
  117. @foreach($seksyen as $d)
  118. @if($d->itkod == $template->seksyen_kesalahan)
  119. <option value="{{ $d->itkod }}" selected>[{{ $d->itkod }}] {{ $d->nama }}</option>
  120. @else
  121. <option value="{{ $d->itkod }}">[{{ $d->itkod }}] {{ $d->nama }}</option>
  122. @endif
  123. @endforeach
  124. </select>
  125. <span class="form-bar"></span>
  126. </div>
  127. </div>
  128. </div>
  129. <div class="row">
  130. <div class="col-lg-6 col-md-12">
  131. <div class="form-group form-primary">
  132. <label class="float-label"><b>Jenis Amaran <code>*</code></b></label>
  133. <select id="jenis_amaran" name="jenis_amaran" class="form-control" required>
  134. <option value="">Pilih Jenis Amaran</option>
  135. @if($template->jenis_amaran == "Amaran 1")
  136. <option selected value="Amaran 1">Amaran 1</option>
  137. <option value="Amaran 2">Amaran 2</option>
  138. <option value="Amaran 3">Amaran 3</option>
  139. @elseif($template->jenis_amaran == "Amaran 2")
  140. <option value="Amaran 1">Amaran 1</option>
  141. <option selected value="Amaran 2">Amaran 2</option>
  142. <option value="Amaran 3">Amaran 3</option>
  143. @else
  144. <option value="Amaran 1">Amaran 1</option>
  145. <option value="Amaran 2">Amaran 2</option>
  146. <option selected value="Amaran 3">Amaran 3</option>
  147. @endif
  148. </select>
  149. <span class="form-bar"></span>
  150. </div>
  151. </div>
  152. <div class="col-lg-6 col-md-12">
  153. <div class="form-group form-primary">
  154. <label class="float-label"><b>Tempoh Hari <code>*</code></b></label>
  155. <select id="tempoh" name="tempoh" class="form-control" required>
  156. <option value="">Pilih Tempoh Hari</option>
  157. @if($template->tempoh == "13")
  158. <option selected value="13">Sebelum 14</option>
  159. <option value="14">Selepas 14</option>
  160. <option value="28">Selepas 28</option>
  161. @elseif($template->tempoh == "14")
  162. <option value="13">Sebelum 14</option>
  163. <option selected value="14">Selepas 14</option>
  164. <option value="28">Selepas 28</option>
  165. @else
  166. <option value="13">Sebelum 14</option>
  167. <option value="14">Selepas 14</option>
  168. <option selected value="28">Selepas 28</option>
  169. @endif
  170. </select>
  171. <span class="form-bar"></span>
  172. <code>Notis amaran akan dihantar secara automatik selepas tempoh tarikh kompaun dikeluarkan, sekiranya jenis hantar adalah automatik</code>
  173. </div>
  174. </div>
  175. </div>
  176. <div class="row">
  177. <div class="col-lg-12 col-md-12">
  178. <div class="form-group form-primary">
  179. <label class="float-label"><b>No.Rujukan <code>*</code></b></label>
  180. <input type="text" name="no_rujukan" class="form-control" value="{{ $template->no_rujukan }}" required="">
  181. <span class="form-bar"></span>
  182. </div>
  183. </div>
  184. <div class="col-lg-12 col-md-12">
  185. <div class="form-group form-primary">
  186. <label class="float-label"><b>Subjek <code>*</code></b></label>
  187. <input type="text" name="subjek" class="form-control" value="{{ $template->subjek }}" required="">
  188. <span class="form-bar"></span>
  189. </div>
  190. </div>
  191. <div class="col-lg-12 col-md-12">
  192. <div class="form-group form-primary">
  193. <label class="float-label"><b>Isi Kandungan Surat <code>*</code></b></label>
  194. <textarea id="editor2" type="text" name="kandungan" id="kandungan" style="width: 100%; height: 200px" required=""> {{ $template->kandungan }}</textarea>
  195. <span class="form-bar"></span>
  196. </div>
  197. </div>
  198. </div>
  199. <!-- Drag Drop -->
  200. <!-- <div class="row" style="margin-bottom: 1.25em;">
  201. <div class="col-lg-12">
  202. <div class="dropzone" id="uploadF">
  203. <label class="float-label"><b>Pengakuan Pengirim <small style="color: red;">*</small></b></label>
  204. <div class="fallback">
  205. <input name="attachment" id="attachment" type="file" class="form-control form-control-sm" required="" />
  206. </div>
  207. </div>
  208. <code>Format <b>JPG / JPEG</b> sahaja yang diterima</code>
  209. </div>
  210. </div>
  211. <div class="row">
  212. <div class="col-lg-6 col-md-12">
  213. <div class="form-group form-primary">
  214. <label class="float-label"><b>Nama Pengirim <small style="color: red;">*</small></b></label>
  215. <input type="text" name="nama_pengirim" class="form-control" value="{{ $template->nama_pengirim }}" required="">
  216. <span class="form-bar"></span>
  217. </div>
  218. </div>
  219. <div class="col-lg-6 col-md-12">
  220. <div class="form-group form-primary">
  221. <label class="float-label"><b>Jawatan Pengirim <small style="color: red;">*</small></b></label>
  222. <input type="text" name="jawatan_pengirim" class="form-control" value="{{ $template->jawatan_pengirim }}" required="">
  223. <span class="form-bar"></span>
  224. </div>
  225. </div>
  226. </div> -->
  227. <hr>
  228. <div class="md-group-add-on"></div>
  229. <div>
  230. <button type="submit" class="btn btn-sm btn-outline-danger waves-effect f-right">Kemaskini Templat Surat</button>
  231. </div>
  232. </form>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. @endsection
  239. @section('external_js')
  240. <script type="text/javascript">
  241. var ellipsis = "...";
  242. function TrimLength(text, maxLength)
  243. {
  244. text = $.trim(text);
  245. if (text.length > maxLength)
  246. {
  247. text = text.substring(0, maxLength - ellipsis.length)
  248. return text.substring(0, text.lastIndexOf(" ")) + ellipsis;
  249. }
  250. else
  251. return text;
  252. }
  253. $.ajaxSetup({
  254. headers: {
  255. 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  256. }
  257. });
  258. $(document).ready(function() {
  259. var origin = window.location.origin;
  260. var akta = '{{ $template->akta_kesalahan }}';
  261. var seksyen = '{{ $template->seksyen_kesalahan }}';
  262. //Theme Loader
  263. $(".theme-loader").animate({
  264. opacity: "0"
  265. },1000);
  266. setTimeout(function() {
  267. $(".theme-loader").remove();
  268. }, 800);
  269. $('[data-toggle="tooltip"]').tooltip();
  270. $('#acts').empty();
  271. $('#acts').append('<option value="null">Pilih Kategori Akta/UUK</option>');
  272. $.ajax({
  273. type: "GET",
  274. url: "{{ url('api/deed-law') }}"+"/"+$('#department').val()+"/list",
  275. success: function(result){
  276. $.each(result.data, function(i, d) {
  277. if(akta == d.akkod){
  278. $('#acts').append('<option value="' + d.akkod + '" selected>' + d.nama + '</option>');
  279. }else{
  280. $('#acts').append('<option value="' + d.akkod + '">' + d.nama + '</option>');
  281. }
  282. $('#acts').prop('required',true);
  283. });
  284. }
  285. });
  286. $('#acts').empty();
  287. $('#acts').append('<option value="null">Pilih Kategori Akta/UUK</option>');
  288. $.ajax({
  289. type: "GET",
  290. url: "{{ url('api/deed-law') }}"+"/"+$('#department').val()+"/list",
  291. success: function(result){
  292. $.each(result.data, function(i, d) {
  293. $('#acts').append('<option value="' + d.akkod + '">' + d.nama + '</option>');
  294. $('#acts').prop('required',true);
  295. });
  296. }
  297. });
  298. $('#acts').change(function(){
  299. if( $(this).val()==""){
  300. $('#seksyen').empty();
  301. $('#seksyen').append('<option value="null">Pilih Kategori Kesalahan</option>');
  302. $('#seksyen').prop('required',false);
  303. }
  304. else {
  305. $('#seksyen').empty();
  306. $('#seksyen').append('<option value="null">Pilih Kategori Kesalahan</option>');
  307. $.ajax({
  308. type: "GET",
  309. url: "{{ url('api/faulty') }}"+"/"+ $('#department').val()+"/"+$(this).val()+"/list",
  310. success: function(result){
  311. if(result.data.length !== 0 ){
  312. $.each(result.data, function(i, d) {
  313. var full_sentences = '[' + d.itkod + '] '+ d.nama;
  314. $('#seksyen').append('<option value="' + d.itkod + '">' + TrimLength(full_sentences, 300) +'</option>');
  315. $('#seksyen').prop('required',true);
  316. });
  317. }
  318. }
  319. });
  320. }
  321. });
  322. });
  323. </script>
  324. <script type="text/javascript">
  325. CKEDITOR.replace('editor2', {
  326. // Define the toolbar: http://docs.ckeditor.com/#!/guide/dev_toolbar
  327. // The full preset from CDN which we used as a base provides more features than we need.
  328. // Also by default it comes with a 3-line toolbar. Here we put all buttons in a single row.
  329. toolbar: [{
  330. name: 'document',
  331. items: ['Print']
  332. }, {
  333. name: 'clipboard',
  334. items: ['Undo', 'Redo']
  335. }, {
  336. name: 'styles',
  337. items: ['Format', 'Font', 'FontSize']
  338. }, {
  339. name: 'basicstyles',
  340. items: ['Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat', 'CopyFormatting']
  341. }, {
  342. name: 'colors',
  343. items: ['TextColor', 'BGColor']
  344. }, {
  345. name: 'align',
  346. items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']
  347. }, {
  348. name: 'links',
  349. items: ['Link', 'Unlink']
  350. }, {
  351. name: 'paragraph',
  352. items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote']
  353. }, {
  354. name: 'editing',
  355. items: ['Scayt']
  356. }],
  357. // Since we define all configuration options here, let's instruct CKEditor to not load config.js which it does by default.
  358. // One HTTP request less will result in a faster startup time.
  359. // For more information check http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-customConfig
  360. customConfig: '',
  361. // Sometimes applications that convert HTML to PDF prefer setting image width through attributes instead of CSS styles.
  362. // For more information check:
  363. // - About Advanced Content Filter: http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter
  364. // - About Disallowed Content: http://docs.ckeditor.com/#!/guide/dev_disallowed_content
  365. // - About Allowed Content: http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules
  366. disallowedContent: 'img{width,height,float}',
  367. extraAllowedContent: 'img[width,height,align]',
  368. // Enabling extra plugins, available in the full-all preset: http://ckeditor.com/presets-all
  369. extraPlugins: 'tableresize,uploadimage,uploadfile',
  370. imageUploadUrl: '/uploader/upload.php?type=Images',
  371. uploadUrl: '/uploader/upload.php',
  372. /*********************** File management support ***********************/
  373. // In order to turn on support for file uploads, CKEditor has to be configured to use some server side
  374. // solution with file upload/management capabilities, like for example CKFinder.
  375. // For more information see http://docs.ckeditor.com/#!/guide/dev_ckfinder_integration
  376. // Uncomment and correct these lines after you setup your local CKFinder instance.
  377. // filebrowserBrowseUrl: 'http://example.com/ckfinder/ckfinder.html',
  378. // filebrowserUploadUrl: 'http://example.com/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
  379. /*********************** File management support ***********************/
  380. // Make the editing area bigger than default.
  381. height: 350,
  382. // An array of stylesheets to style the WYSIWYG area.
  383. // Note: it is recommended to keep your own styles in a separate file in order to make future updates painless.
  384. contentsCss: ['assets/pages/ckeditor/contents.css', 'assets/pages/ckeditor/document.css'],
  385. // This is optional, but will let us define multiple different styles for multiple editors using the same CSS file.
  386. bodyClass: 'document-editor',
  387. // Reduce the list of block elements listed in the Format dropdown to the most commonly used.
  388. format_tags: 'p;h1;h2;h3;pre',
  389. // Simplify the Image and Link dialog windows. The "Advanced" tab is not needed in most cases.
  390. removeDialogTabs: 'image:advanced;link:advanced',
  391. // Define the list of styles which should be available in the Styles dropdown list.
  392. // If the "class" attribute is used to style an element, make sure to define the style for the class in "mystyles.css"
  393. // (and on your website so that it rendered in the same way).
  394. // Note: by default CKEditor looks for styles.js file. Defining stylesSet inline (as below) stops CKEditor from loading
  395. // that file, which means one HTTP request less (and a faster startup).
  396. // For more information see http://docs.ckeditor.com/#!/guide/dev_styles
  397. stylesSet: [
  398. /* Inline Styles */
  399. {
  400. name: 'Marker',
  401. element: 'span',
  402. attributes: {
  403. 'class': 'marker'
  404. }
  405. }, {
  406. name: 'Cited Work',
  407. element: 'cite'
  408. }, {
  409. name: 'Inline Quotation',
  410. element: 'q'
  411. },
  412. /* Object Styles */
  413. {
  414. name: 'Special Container',
  415. element: 'div',
  416. styles: {
  417. padding: '5px 10px',
  418. background: '#eee',
  419. border: '1px solid #ccc'
  420. }
  421. }, {
  422. name: 'Compact table',
  423. element: 'table',
  424. attributes: {
  425. cellpadding: '5',
  426. cellspacing: '0',
  427. border: '1',
  428. bordercolor: '#ccc'
  429. },
  430. styles: {
  431. 'border-collapse': 'collapse'
  432. }
  433. }, {
  434. name: 'Borderless Table',
  435. element: 'table',
  436. styles: {
  437. 'border-style': 'hidden',
  438. 'background-color': '#E6E6FA'
  439. }
  440. }, {
  441. name: 'Square Bulleted List',
  442. element: 'ul',
  443. styles: {
  444. 'list-style-type': 'square'
  445. }
  446. }
  447. ]
  448. });
  449. </script>
  450. @endsection