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_add.blade.php 16KB

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