footer.inc.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script>
  2. <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/js/bootstrap-switch.min.js"></script>
  3. <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/7.0.2/bootstrap-slider.min.js"></script>
  4. <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.9.4/js/bootstrap-select.js"></script>
  5. <script>
  6. // Select language and reopen active URL without POST
  7. function setLang(sel) {
  8. $.post( "<?=$_SERVER['REQUEST_URI'];?>", {lang: sel} );
  9. window.location.href = window.location.pathname + window.location.search;
  10. }
  11. $(document).ready(function() {
  12. // Hide alerts after n seconds
  13. $("#alert-fade").fadeTo(7000, 500).slideUp(500, function(){
  14. $("#alert-fade").alert('close');
  15. });
  16. // Remember last navigation pill
  17. (function () {
  18. 'use strict';
  19. $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
  20. var id = $(this).parents('[role="tablist"]').attr('id');
  21. var key = 'lastTag';
  22. if (id) {
  23. key += ':' + id;
  24. }
  25. localStorage.setItem(key, $(e.target).attr('href'));
  26. });
  27. $('[role="tablist"]').each(function (idx, elem) {
  28. var id = $(elem).attr('id');
  29. var key = 'lastTag';
  30. if (id) {
  31. key += ':' + id;
  32. }
  33. var lastTab = localStorage.getItem(key);
  34. if (lastTab) {
  35. $('[href="' + lastTab + '"]').tab('show');
  36. }
  37. });
  38. })();
  39. // Disable submit after submitting form
  40. $('form').submit(function() {
  41. if ($('form button[type="submit"]').data('submitted') == '1') {
  42. return false;
  43. } else {
  44. $(this).find('button[type="submit"]').first().text('<?=$lang['footer']['loading'];?>');
  45. $('form button[type="submit"]').attr('data-submitted', '1');
  46. function disableF5(e) { if ((e.which || e.keyCode) == 116 || (e.which || e.keyCode) == 82) e.preventDefault(); };
  47. $(document).on("keydown", disableF5);
  48. }
  49. });
  50. // IE fix to hide scrollbars when table body is empty
  51. $('tbody').filter(function (index) {
  52. return $(this).children().length < 1;
  53. }).remove();
  54. // Init Bootstrap Selectpicker
  55. $('select').selectpicker();
  56. });
  57. </script>
  58. <?php
  59. if (isset($_SESSION['return'])):
  60. ?>
  61. <div class="container">
  62. <div style="position:fixed;bottom:8px;right:25px;min-width:300px;max-width:350px;z-index:2000">
  63. <div <?=($_SESSION['return']['type'] == 'danger') ? null : 'id="alert-fade"'?> class="alert alert-<?=$_SESSION['return']['type'];?>" role="alert">
  64. <a href="#" class="close" data-dismiss="alert"> &times;</a>
  65. <?=htmlspecialchars($_SESSION['return']['msg']);?>
  66. </div>
  67. </div>
  68. </div>
  69. <?php
  70. unset($_SESSION['return']);
  71. endif;
  72. ?>
  73. </body>
  74. </html>
  75. <?php $stmt = null; $pdo = null; ?>