home-old.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <!-- start: home -->
  2. <!--
  3. <ul class="nav nav-tabs" style="margin-bottom: 20px">
  4. <li class="nav-item">
  5. <a id="oip" class="nav-link active" href="#">OSOBY I PODMIOTY</a>
  6. </li>
  7. <li class="nav-item">
  8. <a id="obz" class="nav-link" href="#">OPER. BAZA ZGŁOSZEŃ</a>
  9. </li>
  10. </ul>
  11. -->
  12. <div id="smad-page-home" class="container-fluid">
  13. <div>
  14. <div>
  15. <div id="smad-menu-form-section">
  16. <div id="OIP">
  17. <div class="col-md-6 padding-lr-0 smad-border-col">
  18. <div class="menu-items text-center">
  19. <div class="menu-item">
  20. <a href="index.php?_route=UrlAction_Bocian#PRACOWNICY" title="Pracownicy">
  21. <div>Pracownicy</div>
  22. <img src="<?= $this->asset("assets/images/button-red.png"); ?>"
  23. alt="Pracownicy"
  24. onmouseover="this.src='<?= $this->asset("assets/images/button-red-border.png"); ?>'"
  25. onmouseout="this.src='<?= $this->asset("assets/images/button-red.png"); ?>'" />
  26. </a>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="col-md-6 padding-lr-0">
  31. <div class="menu-items text-center">
  32. <div class="menu-item">
  33. <a href="index.php?_route=UrlAction_Bocian#KONTRAHENCI" title="Kontrahenci">
  34. <div>Kontrahenci</div>
  35. <img src="<?= $this->asset("assets/images/button-red.png"); ?>"
  36. alt="Kontrahenci"
  37. onmouseover="this.src='<?= $this->asset("assets/images/button-red-border.png"); ?>'"
  38. onmouseout="this.src='<?= $this->asset("assets/images/button-red.png"); ?>'" />
  39. </a>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. <div id="OBZ" style="display:none">
  45. <div id="smad-menu-form-section">
  46. <div class="col-md-12 padding-lr-0 smad-border-col">
  47. <div class="menu-items text-center">
  48. <div class="container-fluid">
  49. <ul class="breadcrumb">
  50. <li>
  51. <a href="#" onclick="">Operacyjna baza zgłoszeń</a>
  52. </li>
  53. <li>
  54. <a href="index.php?_route=UrlAction_Bocian#KONTRAHENCI">
  55. <span class="glyphicon glyphicon-plus"></span>
  56. Dodaj nowy rekord
  57. </a>
  58. </li>
  59. </ul>
  60. <div class="padding-0 smad-employees-obz-head" style="background-color:lightgrey;">
  61. <div class "col-md-6">
  62. <h2 class="title" style="padding: 30px"> Operacyjna baza zgłoszeń</h2>
  63. </div>
  64. <div class="container-fluid">
  65. <div class="table-responsive padding-0" id="smad-table-obz">
  66. <table class="table table-responsive table-bordered table-hover table-striped" height="5">
  67. <thead>
  68. </thead>
  69. </table>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="col-md-12 border-top-grey border-bottom-grey">
  79. <div class="menu-form-input text-center">
  80. <div class="menu-item smad-heder-title">głębokość powiązań:</div>
  81. <div class="menu-item">
  82. <input type="text" class="form-control smad-depth" placeholder="1-16" value="6" />
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <div id="smad-generate-link" class="container-fluid">
  91. <div>
  92. <div class="text-center">
  93. <?php //todo: ukrycie przycisku generownia raportów powiazan ?>
  94. <!-- <a href="#" title="GENERUJ RAPORT POWIĄZAŃ" class="btn btn-primary font-weight-700">GENERUJ RAPORT POWIĄZAŃ</a> -->
  95. </div>
  96. </div>
  97. </div>
  98. <script type="text/javascript">
  99. if (localStorage.getItem("Bocian.biAuditForm.depth") === null) {
  100. localStorage.setItem('Bocian.biAuditForm.depth', 6);
  101. }
  102. $(document).ready(function() {
  103. clearBIAuditFormLocalStorage();
  104. loadCurrentDepthInInput('.smad-depth');
  105. updateLocalStorageBiAuditDepth('.smad-depth');
  106. setItemLocalStorage('Bocian.biAuditForm.smadReaportTitle', 'Nazwa raportu');
  107. $("#oip").click(function(){
  108. $("#OIP").show();
  109. $("#OBZ").hide();
  110. });
  111. $("#obz").click(function(){
  112. $("#OBZ").show();
  113. $("#OIP").hide();
  114. });
  115. });
  116. /**
  117. * Load data default title reaport in storage
  118. */
  119. function loadCurrentReaportTitleInInput(idInput) {
  120. var reaportTitleValue = getItemLocalStorage("Bocian.biAuditForm.smadReaportTitle");
  121. if ( getItemLocalStorage('Bocian.biAuditForm.smadReaportTitle') === null ) {
  122. reaportTitleValue = setItemLocalStorage('Bocian.biAuditForm.smadReaportTitle', 'Nazwa raportu');
  123. }
  124. $(idInput).val(function() {
  125. return reaportTitleValue;
  126. });
  127. }
  128. /**
  129. * Load data default depth in storage
  130. */
  131. function loadCurrentDepthInInput(idInput) {
  132. var depthValue = getItemLocalStorage("Bocian.biAuditForm.depth");
  133. if ( getItemLocalStorage('Bocian.biAuditForm.depth') === null ) {
  134. depthValue = setItemLocalStorage('Bocian.biAuditForm.depth', 6);
  135. }
  136. $(idInput).val(function() {
  137. return depthValue;
  138. });
  139. }
  140. /**
  141. * Update data default depth in storage
  142. */
  143. function updateLocalStorageBiAuditDepth(idInput) {
  144. $(idInput).keyup(function() {
  145. delayUpdate(function(){
  146. var newValue = $(idInput).val();
  147. var responseValue = validateValueDepth(parseInt(newValue));
  148. setItemLocalStorage('Bocian.biAuditForm.depth', responseValue);
  149. loadCurrentDepthInInput('.smad-depth');
  150. }, 1000 );
  151. });
  152. }
  153. function validateValueDepth(newValue) {
  154. var value = null;
  155. value = newValue;
  156. if (parseInt(newValue) < 0) {
  157. value = 1;
  158. }
  159. if (parseInt(newValue) > 16) {
  160. value = 16;
  161. }
  162. return value;
  163. }
  164. var delayUpdate = (function() {
  165. var timer = 0;
  166. return function(callback, ms) {
  167. clearTimeout (timer);
  168. timer = setTimeout(callback, ms);
  169. };
  170. })();
  171. // Local storage
  172. function setItemLocalStorage(key, array) {
  173. localStorage.setItem(key, JSON.stringify(array));
  174. }
  175. function getItemLocalStorage(key) {
  176. var retrievedData = localStorage.getItem(key);
  177. var response = JSON.parse(retrievedData);
  178. return response;
  179. }
  180. function clearBIAuditFormLocalStorage() {
  181. var arrayValue = [];
  182. setItemLocalStorage('Bocian.biAuditForm.pracownicyIds', arrayValue);
  183. setItemLocalStorage('Bocian.biAuditForm.kontrahenciIds', arrayValue);
  184. setItemLocalStorage('Bocian.biAuditForm.pracownicy.filterIdGroup', 0);
  185. setItemLocalStorage('Bocian.biAuditForm.kontrahenci.filterIdGroup', 0);
  186. setItemLocalStorage('Bocian.biAuditForm.analizaOnlyTargets', 'y');
  187. }
  188. window.delayUpdate = delayUpdate;
  189. </script>
  190. <!-- end:home -->