javascrip_1t.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. function filterHelper(control) {
  2. if ( document.filter_form.Modell_1.options[document.filter_form.Modell_1.selectedIndex].text != '' && isNaN(control) ) {
  3. document.filter_form.Modell_3.value = document.filter_form.Modell_1.options[document.filter_form.Modell_1.selectedIndex].text;
  4. document.filter_form.Fgst_3.value = '';
  5. document.filter_form.Optcode_3.value = '';
  6. } else if ( document.filter_form.Modell_1.options[document.filter_form.Modell_1.selectedIndex].text != '' && document.getElementsByName("Modell_2")[0].value != '' ) {
  7. //Wert wird durch searchHelper() schon eingetragen
  8. } else if ( document.filter_form.Modell_1.options[document.filter_form.Modell_1.selectedIndex].text == '' && isNaN(document.getElementsByName("Modell_2")[0]) && isNaN(control) ) {
  9. document.filter_form.Modell_3.value = '';
  10. }
  11. if ( isNaN(document.getElementsByName("Fgst_1")[0]) && isNaN(control) ) {
  12. document.filter_form.Fgst_3.value = '';
  13. } else if ( document.getElementsByName("Fgst_1")[0].value == '' ) {
  14. document.filter_form.Fgst_3.value = '';
  15. }
  16. if ( isNaN(document.getElementsByName("Optcode_1")[0]) && isNaN(control) ) {
  17. document.filter_form.Optcode_3.value = '';
  18. } else if ( document.getElementsByName("Optcode_1")[0].value == '' ) {
  19. document.filter_form.Optcode_3.value = '';
  20. }
  21. }
  22. function searchHelper() {
  23. var reg = /\*/;
  24. document.filter_form.Modell_3.value = '*' + document.getElementsByName("Modell_2")[0].value + '*';
  25. document.filter_form.Fgst_3.value = '*' + document.getElementsByName("Fgst_1")[0].value;
  26. document.filter_form.Optcode_3.value = '*' + document.getElementsByName("Optcode_1")[0].value + '*';
  27. while ( reg.test(document.filter_form.Modell_3.value) == true ) {
  28. document.filter_form.Modell_3.value = document.filter_form.Modell_3.value.replace(/\*/, '%');
  29. }
  30. while ( reg.test(document.filter_form.Fgst_3.value) == true ) {
  31. document.filter_form.Fgst_3.value = document.filter_form.Fgst_3.value.replace(/\*/, '%');
  32. }
  33. while ( reg.test(document.filter_form.Optcode_3.value) == true ) {
  34. document.filter_form.Optcode_3.value = document.filter_form.Optcode_3.value.replace(/\*/, '%');
  35. }
  36. }
  37. function Semaphor(i) {
  38. sem = window.open("semaphor.php", "Semaphor");
  39. sem.focus;
  40. }
  41. function table_resize(){
  42. if(document.getElementsByName('datefrom')[0]){
  43. if(document.getElementsByName('datefrom')[0].value != '' && document.getElementsByName('dateuntil')[0].value != ''){
  44. var field1_exp = document.getElementsByName('datefrom')[0].value.split("-");
  45. var field2_exp = document.getElementsByName('dateuntil')[0].value.split("-");
  46. if(field1_exp.length == 3)
  47. document.getElementsByName('datefrom')[0].value = field1_exp[2]+"."+field1_exp[1]+"."+field1_exp[0];
  48. if(field2_exp.length == 3)
  49. document.getElementsByName('dateuntil')[0].value = field2_exp[2]+"."+field2_exp[1]+"."+field2_exp[0];
  50. }
  51. }
  52. if(document.all['report_content_header_table'] && document.all['report_content_table_table']){
  53. window.status = "Die Darstellung der Tabelle ist von der Auflösung Ihres Desktops abhängig.";
  54. /* document.all['report_content'].style.height = document.all['report_content'].offsetHeight;
  55. document.all['report_content_table'].style.width = document.all['report_content'].offsetWidth;
  56. document.all['report_content_header'].style.width = document.all['report_content'].offsetWidth;
  57. document.all['report_content_header_table'].style.width = "100%";
  58. document.all['report_content_table_table'].style.width = "100%";
  59. alert(document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td").length + ' - ' + document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td").length);
  60. if(document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td").length == document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td").length){
  61. */
  62. /* for(i=0; i < document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td").length; i++){
  63. if(document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth < document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth){
  64. document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].style.width = document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth
  65. document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].style.width = document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth;
  66. }else{
  67. document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].style.width = document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth;
  68. document.all['report_content_table_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].style.width = document.all['report_content_header_table'].getElementsByTagName("tr")[0].getElementsByTagName("td")[i].offsetWidth;
  69. }alert("stop");
  70. }
  71. */
  72. document.all['report_content_table'].style.height = (document.all['report_content'].offsetHeight - document.all['report_content_header'].offsetHeight) - 10;
  73. document.all['report_content_table'].style.top = document.all['report_content_header'].offsetHeight + 5;
  74. /* }else{
  75. alert("Auf dieser Seite wurde ein Fehler in der grafischen Darstellung festgestellt der nicht behoben werden konnte. Bitte wenden Sie sich an den Systemadministrator.");
  76. }
  77. */
  78. }
  79. }
  80. //Alte Funktion für die Bearbeiten Seite NICHT LÖSCHEN (wird noch benötigt für WV Feld)
  81. function dateFormatEdit()
  82. {
  83. var elementValue = new Array;
  84. var ret = true;
  85. for(var i = 0; i < document.phpMyEdit_form.elements.length; i++)
  86. {
  87. if(document.phpMyEdit_form.elements[i].getAttribute("date"))
  88. {
  89. if(document.phpMyEdit_form.elements[i].value != '')
  90. {
  91. elementValue = document.phpMyEdit_form.elements[i].value.split(".");
  92. if(elementValue.length != 3)
  93. {
  94. alert("Der Vorgang kann nicht durchgeführt werden!\nEin von Ihnen eingegebenes Datum kann nicht verabeitet werden.");
  95. document.phpMyEdit_form.elements[i].style.borderColor = "#FF0000";
  96. ret = false;
  97. }
  98. else
  99. {
  100. document.phpMyEdit_form.elements[i].style.borderColor = "#E8EEFF";
  101. }
  102. }
  103. }
  104. if(document.phpMyEdit_form.elements[i].getAttribute("amount"))
  105. {
  106. if(document.phpMyEdit_form.elements[i].value != '')
  107. {
  108. if(document.phpMyEdit_form.elements[i].value.search(/\w/) == -1)
  109. {
  110. alert("Der Vorgang kann nicht durchgeführt werden!\nEin von Ihnen eingegebener Betrag kann nicht verabeitet werden.");
  111. document.phpMyEdit_form.elements[i].style.borderColor = "#FF0000";
  112. ret = false;
  113. }
  114. else
  115. {
  116. document.phpMyEdit_form.elements[i].style.borderColor = "#E8EEFF";
  117. }
  118. }
  119. }
  120. }
  121. if(ret === true)
  122. {
  123. for(var i = 0; i < document.phpMyEdit_form.elements.length; i++)
  124. {
  125. if(document.phpMyEdit_form.elements[i].getAttribute("date"))
  126. {
  127. if(document.phpMyEdit_form.elements[i].value != '')
  128. {
  129. document.phpMyEdit_form.elements[i].style.color = '#FFFFFF';
  130. elementValue = document.phpMyEdit_form.elements[i].value.split(".");
  131. document.phpMyEdit_form.elements[i].value = elementValue[2]+"-"+elementValue[1]+"-"+elementValue[0];
  132. }
  133. }
  134. if(document.phpMyEdit_form.elements[i].getAttribute("amount"))
  135. {
  136. if(document.phpMyEdit_form.elements[i].value != '')
  137. {
  138. document.phpMyEdit_form.elements[i].style.color = '#FFFFFF';
  139. document.phpMyEdit_form.elements[i].value = document.phpMyEdit_form.elements[i].value.replace(/\./, "");
  140. document.phpMyEdit_form.elements[i].value = document.phpMyEdit_form.elements[i].value.replace(/,/, ".");
  141. }
  142. }
  143. }
  144. }
  145. return ret;
  146. }
  147. //Neue Funktion für die Anzeigeseite
  148. function dateFormat(field_name_array)
  149. {
  150. var field_name_array = field_name_array.split(':');
  151. var field_value_array = new Array;
  152. var field_bgcolor_array = new Array;
  153. var ret = true;
  154. for(var i in field_name_array)
  155. {
  156. if(document.getElementsByName(field_name_array[i])[0]){
  157. if(document.getElementsByName(field_name_array[i])[0].value != '')
  158. {
  159. field_value_array[i] = document.getElementsByName(field_name_array[i])[0].value.split(".");
  160. if(field_value_array[i].length != 3)
  161. {
  162. alert('Der Vorgang kann nicht durchgeführt werden! \nEin von Ihnen eingegebenes Datum kann nicht verarbeitet werden. \n\nBestätigen Sie bitte diese Nachricht und ändern Sie das rot makierte Feld.');
  163. document.getElementsByName(field_name_array[i])[0].style.borderColor = '#FF0000';
  164. ret = false;
  165. }else
  166. document.getElementsByName(field_name_array[i])[0].style.borderColor = "#E8EEFF";
  167. }
  168. }
  169. }
  170. if(ret === true)
  171. {
  172. for(var i in field_name_array)
  173. {
  174. if(document.getElementsByName(field_name_array[i])[0]){
  175. if(document.getElementsByName(field_name_array[i])[0].value != '')
  176. {
  177. document.getElementsByName(field_name_array[i])[0].style.color = '#FFFFFF';
  178. //document.getElementsByName(field_name_array[i])[0].value = field_value_array[i][2]+"-"+field_value_array[i][1]+"-"+field_value_array[i][0];
  179. }
  180. }
  181. }
  182. }
  183. return ret;
  184. }