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

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