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.

compound_list_result.blade.php 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <link rel="stylesheet" href="{{ asset('mobile/jquery.mobile-1.4.5.min.css') }}">
  7. <link rel="stylesheet" href="{{ asset('mobile/css/jqm-demos.css') }}">
  8. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700">
  9. <script src="{{ asset('mobile/jquery.js') }}"></script>
  10. <script src="{{ asset('mobile/js/index.js') }}"></script>
  11. <script src="{{ asset('mobile/jquery.mobile-1.4.5.min.js') }}"></script>
  12. <style type="text/css">
  13. /* A bit custom styling */
  14. .my-page .ui-listview li a {
  15. background-color: #fff !important;
  16. }
  17. .my-page .ui-listview li:active {
  18. border-color: #ccc !important;
  19. }
  20. .my-page .ui-listview li a:active {
  21. background-color: #fff !important;
  22. border-color: #ccc !important;
  23. color: #333 !important;
  24. }
  25. .ui-page-theme-a .ui-btn:focus,html .ui-bar-a .ui-btn:focus,html .ui-body-a .ui-btn:focus,html body .ui-group-theme-a .ui-btn:focus,html head+body .ui-btn.ui-btn-a:focus,.ui-page-theme-a .ui-focus,html .ui-bar-a .ui-focus,html .ui-body-a .ui-focus,html body .ui-group-theme-a .ui-focus,html head+body .ui-btn-a.ui-focus,html head+body .ui-body-a.ui-focus{
  26. -webkit-box-shadow:0 0 12px #ccc !important;
  27. -moz-box-shadow:0 0 12px #ccc !important;
  28. box-shadow:0 0 12px #ccc !important;
  29. }
  30. .ui-page-theme-a .ui-btn.ui-btn-active, html .ui-bar-a .ui-btn.ui-btn-active, html .ui-body-a .ui-btn.ui-btn-active, html body .ui-group-theme-a .ui-btn.ui-btn-active, html head+body .ui-btn.ui-btn-a.ui-btn-active, .ui-page-theme-a .ui-checkbox-on:after, html .ui-bar-a .ui-checkbox-on:after, html .ui-body-a .ui-checkbox-on:after, html body .ui-group-theme-a .ui-checkbox-on:after, .ui-btn.ui-checkbox-on.ui-btn-a:after, .ui-page-theme-a .ui-flipswitch-active, html .ui-bar-a .ui-flipswitch-active, html .ui-body-a .ui-flipswitch-active, html body .ui-group-theme-a .ui-flipswitch-active, html body .ui-flipswitch.ui-bar-a.ui-flipswitch-active, .ui-page-theme-a .ui-slider-track .ui-btn-active, html .ui-bar-a .ui-slider-track .ui-btn-active, html .ui-body-a .ui-slider-track .ui-btn-active, html body .ui-group-theme-a .ui-slider-track .ui-btn-active, html body div.ui-slider-track.ui-body-a .ui-btn-active{
  31. background-color: #fff !important;
  32. border-color: #ccc !important;
  33. color: #333 !important;
  34. text-shadow: none !important;
  35. }
  36. .my-page .ui-listview li .ui-btn p {
  37. color: #333 !important;
  38. }
  39. .my-page .ui-listview li .ui-btn .ui-li-aside {
  40. color: #eee;
  41. }
  42. .ui-input-search.ui-input-has-clear .ui-btn.ui-input-clear, .ui-input-text.ui-input-has-clear .ui-btn.ui-input-clear{
  43. display:none !important;
  44. }
  45. </style>
  46. </head>
  47. <body>
  48. <div data-role="page" id="demo-page" class="my-page">
  49. <!-- <div data-role="header"><h1>List Compounds</h1></div> -->
  50. <div role="main" class="ui-content">
  51. <input type="text" data-type="search" name="searchD" id="searchD" value="">
  52. <div id="result">
  53. @if(count($compound) > 0)
  54. @foreach($compound as $c)
  55. <ul data-role="listview" data-inset="true">
  56. <li>
  57. <a href="https://mpkb.sipadu.my/responsive/compound/{{ $c->kpd }}/view/details">
  58. <h2>{{ $c->kpd }}</h2>
  59. @if($c->jumlah_kemaskini_kompaun != '')
  60. <p>Rm {{ $c->jumlah_kemaskini_kompaun }}</p>
  61. <input type="hidden" name="amount" value="{{ $c->jumlah_kemaskini_kompaun }}">
  62. @else
  63. <p>Rm {{ $c->jumlah_asal_kompaun }}</p>
  64. <input type="hidden" name="amount" value="{{ $c->jumlah_asal_kompaun }}">
  65. @endif
  66. @if($c->ConfidentialFile->status == 'Belum Bayar')
  67. <p class="ui-li-aside"><input type="button" value="Pay"></p>
  68. @endif
  69. </a>
  70. </li>
  71. </ul>
  72. @endforeach
  73. @else
  74. <p style="text-align: center"><code><b>No Result Found</b></code></p>
  75. @endif
  76. </div>
  77. <div id="search_result">
  78. </div>
  79. </div>
  80. </body>
  81. <script type="text/javascript">
  82. function delay(callback, ms) {
  83. var timer = 0;
  84. return function() {
  85. var context = this, args = arguments;
  86. clearTimeout(timer);
  87. timer = setTimeout(function () {
  88. callback.apply(context, args);
  89. }, ms || 0);
  90. };
  91. }
  92. var typingTimer;
  93. var doneTypingInterval = 5000;
  94. $("#searchD").keyup(delay(function (e) {
  95. if(this.value == '' || this.value == null){
  96. $("#result").show(); $("#search_result").hide();
  97. $('#search_result').empty();
  98. }else {
  99. var params = 'data='+$("#searchD").val();
  100. var xhr = new XMLHttpRequest();
  101. xhr.open('POST', "{{ url('/api/search/compound') }}", true);
  102. xhr.withCredentials = true;
  103. xhr.onreadystatechange = function() {
  104. if(xhr.readyState == 4 && xhr.status == 200){
  105. $('#search_result').empty();
  106. $("#result").hide(); $("#search_result").show();
  107. var response = JSON.parse(xhr.responseText);
  108. if(response['success'] == true){
  109. var c = response['data'];
  110. if(c.length !== 0){
  111. $.each(c, function(i,item) {
  112. var tawaran = '';
  113. if(c[i].jumlah_kemaskini_kompaun != ''){
  114. tawaran = c[i].jumlah_kemaskini_kompaun;
  115. }else{
  116. tawaran = c[i].jumlah_asal_kompaun;
  117. }
  118. var html = '<ul data-role="listview" data-inset="true" class="ui-listview ui-listview-inset ui-corner-all ui-shadow">';
  119. html += '<li class="ui-first-child ui-last-child"><a href="https://mpkb.sipadu.my/responsive/compound/'+c[i].kpd+'/view/details" class="ui-btn ui-btn-icon-right ui-icon-carat-r">';
  120. html += '<h2>'+c[i].kpd+'</h2><p>Rm '+tawaran+'</p><input type="hidden" name="amount" value="'+tawaran+'">';
  121. $(c[i].ConfidentialFile).each(function(index, file) {
  122. if(file.status == 'Belum Bayar'){
  123. html += '<p class="ui-li-aside"><input type="button" value="Pay"></p>';
  124. }
  125. })
  126. $('#search_result').append(html);
  127. });
  128. }else{
  129. $('#search_result').append('<p style="text-align: center"><code><b>No Result Found</b></code></p>');
  130. }
  131. }e
  132. }
  133. else if(xhr.readyState == 4){
  134. location.reload();
  135. }
  136. }
  137. xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  138. xhr.send(params);
  139. }
  140. }, 700));
  141. </script>
  142. </html>