47e4f9d351ed423d1519e36c9eeef026b80e0112
[kivitendo-erp.git] / bin / mozilla / kopf.pl
1 #!/usr/bin/perl
2 #
3
4 #$| = 1;
5
6 #use CGI::Carp qw(fatalsToBrowser);
7
8 use strict;
9
10 sub run {
11   my $session_result = shift;
12
13 my $form     = $main::form;
14 my $locale   = $main::locale;
15
16 $form->header;
17 my $paramstring = $ENV{"QUERY_STRING"};
18 my @felder = split "&", $paramstring;
19 my ($name, $wert);
20 foreach (@felder) {
21   ($name, $wert) = split "=", $_;
22   $wert =~ tr/+/ /;
23   $name = $wert;
24 }
25 my $login =
26     "[" . $form->{login}
27   . " - <a href=\"login.pl?action=logout\" target=\"_top\">"
28   . $locale->text('Logout')
29   . "</a>] ";
30 my ($Sekunden, $Minuten,   $Stunden,   $Monatstag, $Monat,
31     $Jahr,     $Wochentag, $Jahrestag, $Sommerzeit)
32   = localtime(time);
33 my $CTIME_String = localtime(time);
34 $Monat     += 1;
35 $Jahrestag += 1;
36 $Monat     = $Monat < 10     ? $Monat     = "0" . $Monat     : $Monat;
37 $Monatstag = $Monatstag < 10 ? $Monatstag = "0" . $Monatstag : $Monatstag;
38 $Jahr += 1900;
39 my @Wochentage = ("Sonntag",    "Montag",  "Dienstag", "Mittwoch",
40                   "Donnerstag", "Freitag", "Samstag");
41 my @Monatsnamen = ("",       "Januar",    "Februar", "M&auml;rz",
42                    "April",  "Mai",       "Juni",    "Juli",
43                    "August", "September", "Oktober", "November",
44                    "Dezember");
45 my $datum =
46     $Wochentage[$Wochentag] . ", der "
47   . $Monatstag . "."
48   . $Monat . "."
49   . $Jahr . " - ";
50
51 #$zeit="<div id='Uhr'>".$Stunden.":".$Minuten.":".$Sekunden."</div>";
52 my $zeit = "<div id='Uhr'>" . $Stunden . ":" . $Minuten . "</div>";
53
54 print qq|
55 <script type="text/javascript">
56 <!--
57 var clockid=new Array()
58 var clockidoutside=new Array()
59 var i_clock=-1
60 var thistime= new Date()
61 var hours= | . $Stunden . qq|;
62 var minutes= | . $Minuten . qq|;
63 var seconds= | . $Sekunden . qq|;
64 if (eval(hours) <10) {hours="0"+hours}
65 if (eval(minutes) < 10) {minutes="0"+minutes}
66 if (seconds < 10) {seconds="0"+seconds}
67 //var thistime = hours+":"+minutes+":"+seconds
68 var thistime = hours+":"+minutes
69
70 function writeclock() {
71   i_clock++
72   if (document.all \|\| document.getElementById \|\| document.layers) {
73     clockid[i_clock]="clock"+i_clock
74     document.write("<font family=arial size=2><span id='"+clockid[i_clock]+"' style='position:relative'>"+thistime+"</span></font>")
75   }
76 }
77
78 function clockon() {
79   thistime= new Date()
80   hours=thistime.getHours()
81   minutes=thistime.getMinutes()
82   seconds=thistime.getSeconds()
83   if (eval(hours) <10) {hours="0"+hours}
84   if (eval(minutes) < 10) {minutes="0"+minutes}
85   if (seconds < 10) {seconds="0"+seconds}
86   //thistime = hours+":"+minutes+":"+seconds
87   thistime = hours+":"+minutes
88
89   if (document.all) {
90     for (i=0;i<=clockid.length-1;i++) {
91       var thisclock=eval(clockid[i])
92       thisclock.innerHTML=thistime
93     }
94   }
95
96   if (document.getElementById) {
97     for (i=0;i<=clockid.length-1;i++) {
98       document.getElementById(clockid[i]).innerHTML=thistime
99     }
100   }
101   var timer=setTimeout("clockon()",60000)
102 }
103 window.onload=clockon
104 //-->
105 </script>
106 |;
107
108 #
109 print qq|
110 <body bgcolor="#ffffff" text="#ffffff" link="#ffffff" vlink="#ffffff" alink="#ffffff" topmargin="0" leftmargin="0"  marginwidth="0" marginheight="0" style="background-image: url('image/fade.png'); background-repeat:repeat-x;">
111
112 <table border="0" width="100%" background="image/bg_titel.gif" cellpadding="0" cellspacing="0">
113   <tr>
114     <td  style="color:white; font-family:verdana,arial,sans-serif; font-size: 12px;">
115       &nbsp;[<a href="JavaScript:top.main_window.print();" title="| . $locale->text('Hardcopy') . qq|">| . $locale->text('Print') . qq|</a>]
116       &nbsp;[<a HREF="login.pl" target="_blank" "title="| . $locale->text('Open a further Lx-Office Window or Tab') . qq|">| . $locale->text('New Win/Tab') . qq|</a>]
117       &nbsp;[<a href="Javascript:top.main_window.history.back();" title="| . $locale->text('Go one step back') . qq|">| . $locale->text('Back') . qq|</a>]
118       <!-- is there a better solution for Back? Possibly with the callback variable? -->
119     </td>
120     <td align="right" style="vertical-align:middle; color:white; font-family:verdana,arial,sans-serif; font-size: 12px;" nowrap>|
121   . $login . $datum . qq| <script>writeclock()</script>&nbsp;
122     </td>
123   </tr>
124 </table>
125 </body>
126 </html>
127 |;
128
129 }
130
131 1;
132
133 #