home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2005 July / PCpro_2005_07.ISO / files / internet / JanaServer / JanaSetup.exe / admin / pruefen_js / weekscheduler.js < prev   
Encoding:
Text File  |  2005-02-19  |  5.1 KB  |  186 lines

  1. function konvert()
  2. {
  3.     var fehler = 0;
  4.  
  5.     for (i = 1; i < 15; i++)
  6.     {
  7.         var df = 'document.formular.';
  8.         var f1 = eval(df + 'T' + i);
  9.  
  10.         if (f1.value == '24:00')
  11.         {
  12.             f1.value = '23:59';
  13.             fehler = 1;
  14.         }
  15.     }
  16.  
  17.     if (fehler == 1)
  18.         send();
  19. }
  20.  
  21. /**/
  22.  
  23. function feld_disabled()
  24. {
  25.     with (document.formular)
  26.     {
  27.         var c8 = C8.checked;
  28.         var c1 = C1.checked;
  29.         var c2 = C2.checked;
  30.         var c3 = C3.checked;
  31.         var c4 = C4.checked;
  32.         var c5 = C5.checked;
  33.         var c6 = C6.checked;
  34.         var c7 = C7.checked;
  35.  
  36.         if (c8 == true)
  37.         {
  38.             C1.disabled = false;
  39.             T1.disabled = (c1 == true) ? false : true;
  40.             T2.disabled = (c1 == true) ? false : true;
  41.             C2.disabled = false;
  42.             T3.disabled = (c2 == true) ? false : true;
  43.             T4.disabled = (c2 == true) ? false : true;
  44.             C3.disabled = false;
  45.             T5.disabled = (c3 == true) ? false : true;
  46.             T6.disabled = (c3 == true) ? false : true;
  47.             C4.disabled = false;
  48.             T7.disabled = (c4 == true) ? false : true;
  49.             T8.disabled = (c4 == true) ? false : true;
  50.             C5.disabled  = false;
  51.             T9.disabled  = (c5 == true) ? false : true;
  52.             T10.disabled = (c5 == true) ? false : true;
  53.             C6.disabled  = false;
  54.             T11.disabled = (c6 == true) ? false : true;
  55.             T12.disabled = (c6 == true) ? false : true;
  56.             C7.disabled  = false;
  57.             T13.disabled = (c7 == true) ? false : true;
  58.             T14.disabled = (c7 == true) ? false : true;
  59.         }
  60.         else
  61.         {
  62.             C1.disabled = true;
  63.             T1.disabled = true;
  64.             T2.disabled = true;
  65.             C2.disabled = true;
  66.             T3.disabled = true;
  67.             T4.disabled = true;
  68.             C3.disabled = true;
  69.             T5.disabled = true;
  70.             T6.disabled = true;
  71.             C4.disabled = true;
  72.             T7.disabled = true;
  73.             T8.disabled = true;
  74.             C5.disabled  = true;
  75.             T9.disabled  = true;
  76.             T10.disabled = true;
  77.             C6.disabled  = true;
  78.             T11.disabled = true;
  79.             T12.disabled = true;
  80.             C7.disabled  = true;
  81.             T13.disabled = true;
  82.             T14.disabled = true;
  83.         }
  84.     }
  85. }
  86.  
  87. /**/
  88.  
  89. function send()
  90. {
  91.     if (pruefen() == true)
  92.     {
  93.         with (document.formular)
  94.         {
  95.             var c8 = C8.checked;
  96.             var c1 = C1.checked;
  97.             var c2 = C2.checked;
  98.             var c3 = C3.checked;
  99.             var c4 = C4.checked;
  100.             var c5 = C5.checked;
  101.             var c6 = C6.checked;
  102.             var c7 = C7.checked;
  103.  
  104.             C1.disabled = false;
  105.             T1.disabled = (((c8 == true) && (c1 == true)) || (T1.value == '')) ? false : true;
  106.             T2.disabled = (((c8 == true) && (c1 == true)) || (T2.value == '')) ? false : true;
  107.             C2.disabled = false;
  108.             T3.disabled = (((c8 == true) && (c2 == true)) || (T3.value == '')) ? false : true;
  109.             T4.disabled = (((c8 == true) && (c2 == true)) || (T4.value == '')) ? false : true;
  110.             C3.disabled = false;
  111.             T5.disabled = (((c8 == true) && (c3 == true)) || (T5.value == '')) ? false : true;
  112.             T6.disabled = (((c8 == true) && (c3 == true)) || (T6.value == '')) ? false : true;
  113.             C4.disabled = false;
  114.             T7.disabled = (((c8 == true) && (c4 == true)) || (T7.value == '')) ? false : true;
  115.             T8.disabled = (((c8 == true) && (c4 == true)) || (T8.value == '')) ? false : true;
  116.             C5.disabled  = false;
  117.             T9.disabled  = (((c8 == true) && (c5 == true)) || (T9.value == '')) ? false : true;
  118.             T10.disabled = (((c8 == true) && (c5 == true)) || (T10.value == '')) ? false : true;
  119.             C6.disabled  = false;
  120.             T11.disabled = (((c8 == true) && (c6 == true)) || (T11.value == '')) ? false : true;
  121.             T12.disabled = (((c8 == true) && (c6 == true)) || (T12.value == '')) ? false : true;
  122.             C7.disabled  = false;
  123.             T13.disabled = (((c8 == true) && (c7 == true)) || (T13.value == '')) ? false : true;
  124.             T14.disabled = (((c8 == true) && (c7 == true)) || (T14.value == '')) ? false : true;
  125.  
  126.             submit();
  127.         }
  128.     }
  129. }
  130.  
  131. /**/
  132.  
  133. function pruefen()
  134. {
  135.     var c1 = document.formular.C1.checked;
  136.     var c2 = document.formular.C2.checked;
  137.     var c3 = document.formular.C3.checked;
  138.     var c4 = document.formular.C4.checked;
  139.     var c5 = document.formular.C5.checked;
  140.     var c6 = document.formular.C6.checked;
  141.     var c7 = document.formular.C7.checked;
  142.     var c8 = document.formular.C8.checked;
  143.  
  144.     if ((c8 == true) && ((c1 == false) && (c2 == false) && (c3 == false) && (c4 == false) && (c5 == false) && (c6 == false) && (c7 == false)))
  145.     {
  146.             alert(txt[42][5]);
  147.             return false;
  148.     }
  149.  
  150.     for (i = 1; i <= 7; i++)
  151.     {
  152.         var df = 'document.formular.';
  153.         var cb = eval(df + 'C' + i + '.checked');
  154.         var f1 = eval(df + 'T' + (( i * 2 ) - 1) + '.value');
  155.         var f2 = eval(df + 'T' + ( i * 2 ) + '.value');
  156.         var s1 = eval(df + 'T' + (( i * 2 ) - 1));
  157.         var s2 = eval(df + 'T' + ( i * 2 ));
  158.         var z1 = Number(Date.parse('Wed, 23 Oct 2002 ' + f1 + ':00 GMT'));
  159.         var z2 = Number(Date.parse('Wed, 23 Oct 2002 ' + f2 + ':00 GMT'));
  160.         var ce = new Array(f1, f2);
  161.         var pr = new Array('' + z1 + '', '' + z2 + '');
  162.         var se = new Array(s1, s2);
  163.  
  164.         if ((c8 == true) && (cb == true))
  165.         {
  166.             for (j = 0; j < ce.length; j++)
  167.             {
  168.                 if ((ce[j].length != 5) || (pr[j].match(/\D/) != null))
  169.                 {
  170.                     alert(txt[42][6] + ' ( ' + txt[20][6 + i] + '. ),   " ' + txt[42][7] + '\t');
  171.                     se[j].select();
  172.                     return false;
  173.                 }
  174.             }
  175.  
  176.             if ((z2 - z1) < 1800000)
  177.             {
  178.                 alert(txt[42][3] + '" ' + txt[20][6 + i] + '. "' + txt[42][4]);
  179.                 s2.select();
  180.                 return false;
  181.             }
  182.         }
  183.     }
  184.  
  185.     return true;
  186. }