Dashboard sipadu mbip
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

officer.blade.php 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. @include('include.header')
  5. <style type="text/css">
  6. select.form-control, select.form-control:focus, select.form-control:hover{
  7. border-top: 1px solid #cccccc;
  8. border-right: 1px solid #cccccc;
  9. border-left: 1px solid #cccccc;
  10. }
  11. select.form-control:not([size]):not([multiple]) {
  12. height: auto;
  13. }
  14. .nav-tabs .slide { background: #D84315 !important; }
  15. .pcoded .pcoded-header[header-theme="theme6"] {
  16. background: #000 !important;
  17. }
  18. body.horizontal-icon .pcoded .pcoded-navbar .pcoded-item > li.pcoded-nomenu > a, body.horizontal-icon-fixed .pcoded .pcoded-navbar .pcoded-item > li.pcoded-nomenu > a {
  19. line-height: 30px;
  20. }
  21. body.horizontal-icon-fixed .pcoded[pcoded-device-type="desktop"] .pcoded-navbar .pcoded-item > li.pcoded-nomenu > a {
  22. height: 70px;
  23. }
  24. .pcoded-main-container {
  25. background: #343A40 !important;
  26. }
  27. .page-body .inner-page { margin: 0px 50px; }
  28. .card .card-header h5:after {
  29. background-color: #D84315 !important;
  30. }
  31. .page-item.active .page-link {
  32. background-color: #D84315 !important;
  33. border-color: #D84315 !important;
  34. }
  35. .icons-alert:before { top: 13px !important; }
  36. @media only screen and (max-width: 992px) {
  37. .page-body .inner-page { margin: 0px; }
  38. .header-navbar .navbar-wrapper .navbar-logo a img {
  39. width: 150px !important;
  40. }
  41. }
  42. body{
  43. font-family: sans-serif !important;
  44. }
  45. h5, b { font-weight: 600 !important }
  46. </style>
  47. <!-- The core Firebase JS SDK is always required and must be listed first -->
  48. <script src="https://www.gstatic.com/firebasejs/7.0.0/firebase-app.js"></script>
  49. <!-- Required Jquery -->
  50. <script type="text/javascript" src="{{ asset('bower_components/jquery/js/jquery.min.js') }}"></script>
  51. <script type="text/javascript" src="{{ asset('bower_components/jquery-ui/js/jquery-ui.min.js') }}"></script>
  52. <script type="text/javascript" src="{{ asset('bower_components/popper.js/js/popper.min.js') }}"></script>
  53. <script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
  54. <!-- Add Firebase products that you want to use -->
  55. <script src="https://www.gstatic.com/firebasejs/7.0.0/firebase-messaging.js"></script>
  56. <script>
  57. var existingToken = '{{ $token }}';
  58. // Your web app's Firebase configuration
  59. var firebaseConfig = {
  60. apiKey: "AIzaSyBJMDMk5s1Naxq5pW0cfcC4sSg_ExMyJYM",
  61. authDomain: "sipadu-johor.firebaseapp.com",
  62. databaseURL: "https://sipadu-johor.firebaseio.com",
  63. projectId: "sipadu-johor",
  64. storageBucket: "sipadu-johor.appspot.com",
  65. messagingSenderId: "790988903295",
  66. appId: "1:790988903295:web:89a8a3754829aa5649804a"
  67. };
  68. // Initialize Firebase
  69. firebase.initializeApp(firebaseConfig);
  70. // Retrieve Firebase Messaging object.
  71. const messaging = firebase.messaging();
  72. messaging.usePublicVapidKey("BKTcW6ZaTpbLNcP13Tzp0309y2J996jXU_FxBUeVLrwMN6W2tSJpyt6W5hsUtG12tSEeNCKaZL1oxNXkyxBhaKc");
  73. messaging.requestPermission().then(function() {
  74. console.log("Notification permission granted.");
  75. if(existingToken == ''){
  76. deleteToken();
  77. }
  78. return messaging.getToken();
  79. }).then(function(token) {
  80. updateToken();
  81. }).catch(function (err) {
  82. console.log('Unable to get permission to notify.');
  83. });
  84. messaging.onTokenRefresh(() => {
  85. messaging.getToken().then((refreshedToken) => {
  86. console.log('Token refreshed.');
  87. setTokenSentToServer(false);
  88. sendTokenToServer(refreshedToken);
  89. updateToken();
  90. }).catch((err) => {
  91. console.log('Unable to retrieve refreshed token ', err);
  92. });
  93. });
  94. messaging.onMessage(function (payload) {
  95. console.log('onMessage:', payload);
  96. notify(payload.notification.body, 'fa fa-comments', 'bottom', 'right', 'inverse', 'animated bounceIn', 'animated bounceOut');
  97. });
  98. function sendTokenToServer(currentToken) {
  99. if (!isTokenSentToServer()) {
  100. console.log('Sending token to server...');
  101. $.ajax({
  102. type: "POST",
  103. url: origin+"/api/update/firebase/token",
  104. data: { token: currentToken, _id: '{{ $uid }}' },
  105. success: function(result){
  106. if(result.success == true){
  107. console.log('Success sending token to server...');
  108. setTokenSentToServer(true);
  109. }else {
  110. setTokenSentToServer(false);
  111. console.log('Error sending token to server...');
  112. }
  113. }
  114. });
  115. } else {
  116. console.log('Token already sent to server so won\'t send it again ' +
  117. 'unless it changes');
  118. }
  119. }
  120. function isTokenSentToServer() {
  121. return window.localStorage.getItem('sentToServer') === '1';
  122. }
  123. function setTokenSentToServer(sent) {
  124. window.localStorage.setItem('sentToServer', sent ? '1' : '0');
  125. }
  126. function updateToken() {
  127. messaging.getToken().then((currentToken) => {
  128. if (currentToken) {
  129. sendTokenToServer(currentToken);
  130. } else {
  131. // Show permission request.
  132. console.log('No Instance ID token available. Request permission to generate one.');
  133. setTokenSentToServer(false);
  134. }
  135. }).catch((err) => {
  136. console.log('An error occurred while retrieving token. ', err);
  137. setTokenSentToServer(false);
  138. });
  139. }
  140. function deleteToken() {
  141. messaging.getToken().then((currentToken) => {
  142. messaging.deleteToken(currentToken).then(() => {
  143. console.log('Token deleted.');
  144. setTokenSentToServer(false);
  145. updateToken();
  146. }).catch((err) => {
  147. console.log('Unable to delete token. ', err);
  148. });
  149. }).catch((err) => {
  150. console.log('Error retrieving Instance ID token. ', err);
  151. });
  152. }
  153. </script>
  154. </head>
  155. <body class="horizontal-icon-fixed">
  156. <!-- Pre-loader start -->
  157. <div class="theme-loader">
  158. @include('include.loader')
  159. </div>
  160. <!-- Pre-loader end -->
  161. <div id="pcoded" class="pcoded">
  162. <div class="pcoded-overlay-box"></div>
  163. <div class="pcoded-container">
  164. @include('include.officer-top-menu')
  165. <!-- Sidebar chat start -->
  166. <!-- @include('include.sidebar-chat') -->
  167. <!-- Sidebar inner chat start-->
  168. <!-- @include('include.sidebar-chat-inner') -->
  169. <!-- Sidebar inner chat end-->
  170. <div class="pcoded-main-container">
  171. @include('include.officer-horizontal-menu')
  172. <div class="pcoded-wrapper">
  173. <div class="pcoded-content">
  174. <div class="pcoded-inner-content">
  175. <!-- Main-body start -->
  176. <div class="main-body">
  177. <div class="page-wrapper">
  178. <!-- Page body start -->
  179. <div class="page-body">
  180. @yield('content')
  181. </div>
  182. <!-- Page-body end -->
  183. </div>
  184. </div>
  185. <!-- Main-body end -->
  186. <!-- <div id="styleSelector">
  187. </div> -->
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. @include('include.footer')
  195. @yield('external_js')
  196. </body>
  197. </html>