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

template_notice_add.blade.php 17KB

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