aboutsummaryrefslogtreecommitdiffstats
path: root/includes/calendar_nav.php
blob: f4e72855f4a2c9cf72657449e17ecc81849fd79a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
	<?php
	
	if ($cal == $ALL_CALENDARS_COMBINED) {
		$cal_displayname2 = $all_cal_comb_lang;
	} else {
		$cal_displayname2 = $calendar_name . " $calendar_lang";
	}
	if (strlen($cal_displayname2) > 24) {
		$cal_displayname2 = substr("$cal_displayname2", 0, 21);
		$cal_displayname2 = $cal_displayname2 . "...";
	}
	
	$next_day = date("Ymd", strtotime("+1 day", $unix_time));
	$prev_day = date("Ymd", strtotime("-1 day", $unix_time));

	// Get the real date to display as "go to today", not the date displayed in the calendar
	$really_unix_time = strtotime(date('Ymd'));
	$really_today_today = date ('Ymd', $really_unix_time);
		
	$fake_getdate_time = strtotime($this_year.'-'.$this_month.'-15');
	?>
<br>
<?php
	$login_width = 737;
	include(BASE.'includes/login.php');
?>
<table border="0" width="737" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" class="calborder">
	<tr>
		<td align="left" valign="top" width="1%"  class="sideback"><?php echo "<a class=\"psf\" href=\"month.php?cal=$cal&amp;getdate=$prev_day\"><img src=\"styles/$style_sheet/left_arrows.gif\" alt=\"[$last_day_lang]\" border=\"0\" align=\"left\"></a>"; ?></td>
		<td align="center" class="sideback"><font class="G10B"><b><?php print (localizeDate ($dateFormat_day, strtotime($getdate))); ?></b></font></td>
		<td align="right" valign="top" width="1%"  class="sideback"><?php echo "<a class=\"psf\" href=\"month.php?cal=$cal&amp;getdate=$next_day\"><img src=\"styles/$style_sheet/right_arrows.gif\" alt=\"[$next_day_lang]\" border=\"0\" align=\"right\"></a>"; ?></td>
	</tr>
	<tr>
		<td colspan="3"><img src="images/spacer.gif" width="1" height="5" alt=" "></td>
	</tr>
	<tr>
		<td width="1%" valign="top" align="right">
			<table cellpadding="0" cellspacing="0" border="0" width="160">
				<tr>
					<td valign="middle" align="center">
						<table width="160" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td align="center"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, strtotime("-1 month", $fake_getdate_time))); ?></font></td>
							</tr>
							<tr>
								<td bgcolor="#FFFFFF" align="center">
									<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
										<?php
											$start_day = strtotime($week_start_day);
											echo '<tr>';
											for ($i=0; $i<7; $i++) {
												$day_num = date("w", $start_day);
												$day = $daysofweekreallyshort_lang[$day_num];
												echo '<td align="center" class="G10BOLD">'.$day.'</td>';
												$start_day = strtotime("+1 day", $start_day); 
											}
											echo '</tr>';
											$minical_time 		= strtotime("-1 month", $fake_getdate_time);
											$minical_month 		= date("m", $minical_time);
											$minical_year 		= date("Y", $minical_time);
											$first_of_month 	= $minical_year.$minical_month."01";
											$start_day 			= strtotime(dateOfWeek($first_of_month, $week_start_day));
											$i 					= 0;
											$whole_month 		= TRUE;
											$num_of_events 		= 0;
											do {
												$day 			= date ("j", $start_day);
												$daylink 		= date ("Ymd", $start_day);
												$check_month 	= date ("m", $start_day);
												if ($check_month != $minical_month) $day = '<font class="G10G">'.$day.'</font>';
												if ($i == 0) echo "<tr>\n";
												if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) {
													echo '<td width="22" align="center" class="G10B">';
													echo '<a class="ps2" href="'.$minical_view.'.php?cal='.$cal.'&amp;getdate='.$daylink.'">'.$day.'</a>';
													echo '</td>';
												} else {
													echo '<td width="22" align="center" class="G10B">';
													echo '<a class="psf" href="'.$minical_view.'.php?cal='.$cal.'&amp;getdate='.$daylink.'">'.$day.'</a>';
													echo '</td>';
												}
												$start_day = strtotime("+1 day", $start_day); 
												$i++;
												if ($i == 7) { 
													echo '</tr>';
													$i = 0;
													$checkagain = date ("m", $start_day);
													if ($checkagain != $minical_month) $whole_month = FALSE;	
												}
											} while ($whole_month == TRUE);
										?>
									</table>
									<img src="images/spacer.gif" width="1" height="3" alt=" "><br>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
		<td width="98%" valign="top" align="center">
			<table border="0" width="330" cellspacing="0" cellpadding="0">
				<tr>
					<td width="160" valign="top">
						<table cellpadding="0" cellspacing="0" border="0" width="160">
							<tr>
								<td bgcolor="#FFFFFF" align="left" class="G10BOLD">
									<?php 
									
									if (!isset($query)) $query = '';
									echo '<b>'.$jump_lang.'</b><br>';
									echo '<img src="images/spacer.gif" width="1" height="6" alt=" "><br>';
									echo "<form style=\"margin-bottom:0;\" action=\"month.php\" method=\"GET\">";
									include('./functions/list_icals.php');
									echo '<br>';
									include('./functions/list_years.php');
									echo '<br>';
									include('./functions/list_months.php');
									echo '<br>';
									include('./functions/list_weeks.php');
									echo '<br>';
									echo "</form>";
									echo '<img src="images/spacer.gif" width="1" height="6" alt=" "><br>';
									
									?>
								</td>
							</tr>
						</table>
					</td>
					<td><img src="images/spacer.gif" width="20" height="1" alt=" "></td>
					<td width="160" valign="top">
						<table cellpadding="0" cellspacing="0" border="0" width="160">
							<tr>
								<td valign="middle" align="left" valign="top">
									<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" width="100%">
										<tr>
											<td colspan="7"><img src="images/spacer.gif" width="21" height="2" alt=" "></td>
										</tr>
										<tr>
											<td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=" "></td>
											<td colspan="6"><font class="G10BOLD"><?php echo "$cal_displayname2"; ?></font></td>
										</tr>
										<tr>
											<td width="1%"><img src="images/spacer.gif" width="4" height="1" alt=" "></td>
											<td colspan="6" class="G10B">
											<?php 
												echo "<a class=\"psf\" href=\"day.php?cal=$cal&amp;getdate=$really_today_today\">$goday_lang</a><br>\n";
												echo "<a class=\"psf\" href=\"week.php?cal=$cal&amp;getdate=$really_today_today\">$goweek_lang</a><br>\n";
												echo "<a class=\"psf\" href=\"month.php?cal=$cal&amp;getdate=$really_today_today\">$gomonth_lang</a><br>\n";
												echo "<a class=\"psf\" href=\"year.php?cal=$cal&amp;getdate=$really_today_today\">$goyear_lang</a><br>\n";
												echo "<a class=\"psf\" href=\"print.php?cal=$cal&amp;getdate=$getdate&amp;printview=$current_view\">$goprint_lang</a><br>\n";
												if ($allow_preferences != 'no') echo "<a class=\"psf\" href=\"preferences.php?cal=$cal&amp;getdate=$getdate\">$preferences_lang</a><br>\n";
												if ($cal != $ALL_CALENDARS_COMBINED && $subscribe_path != '' && $download_filename != '') echo "<a class=\"psf\" href=\"$subscribe_path\">$subscribe_lang</a>&nbsp;|&nbsp;<a class=\"psf\" href=\"$download_filename\">$download_lang</a>\n";
												if ($username != '') {
													$querys = preg_replace("/action=[^&]+/", "action=logout", $QUERY_STRING);
													if ($querys == $QUERY_STRING) $querys .= "&action=logout";
													$querys = preg_replace("/(username|password)=[^&]+/", "", $querys);
													echo "<a class=\"psf\" href=\"$SCRIPT_NAME?$querys\">Logout $username</a><br>\n";
												}
											 ?>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>	
					</td>
				</tr>
			</table>
		</td>
		<td width="1%" valign="top" align="left">
	<table cellpadding="0" cellspacing="0" border="0" width="160">
		<tr>
			<td valign="middle" align="center">
				<table width="160" border="0" cellpadding="3" cellspacing="0">
					<tr>
						<td align="center"><font class="G10BOLD"><?php print (localizeDate ($dateFormat_month, strtotime("+1 month", $fake_getdate_time))); ?></font></td>
					</tr>
					<tr>
						<td bgcolor="#FFFFFF" align="center">
							<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
								<?php
									$start_day = strtotime($week_start_day);
									echo '<tr>';
									for ($i=0; $i<7; $i++) {
										$day_num = date("w", $start_day);
										$day = $daysofweekreallyshort_lang[$day_num];
										echo '<td align="center" class="G10BOLD">'.$day.'</td>';
										$start_day = strtotime("+1 day", $start_day); 
									}
									echo '</tr>';
									$minical_time 		= strtotime("+1 month", $fake_getdate_time);
									$minical_month 		= date("m", $minical_time);
									$minical_year 		= date("Y", $minical_time);
									$first_of_month 	= $minical_year.$minical_month."01";
									$start_day 			= strtotime(dateOfWeek($first_of_month, $week_start_day));
									$i 					= 0;
									$whole_month 		= TRUE;
									$num_of_events 		= 0;
									do {
										$day 			= date ("j", $start_day);
										$daylink 		= date ("Ymd", $start_day);
										$check_month 	= date ("m", $start_day);
										if ($check_month != $minical_month) $day = '<font class="G10G">'.$day.'</font>';
										if ($i == 0) echo "<tr>\n";
										if (isset($master_array[("$daylink")]) && ($check_month == $minical_month)) {
											echo '<td width="22" align="center" class="G10B">';
											echo '<a class="ps2" href="'.$minical_view.'.php?cal='.$cal.'&amp;getdate='.$daylink.'">'.$day.'</a>';
											echo '</td>';
										} else {
											echo '<td width="22" align="center" class="G10B">';
											echo '<a class="psf" href="'.$minical_view.'.php?cal='.$cal.'&amp;getdate='.$daylink.'">'.$day.'</a>';
											echo '</td>';
										}
										$start_day = strtotime("+1 day", $start_day); 
										$i++;
										if ($i == 7) { 
											echo '</tr>';
											$i = 0;
											$checkagain = date ("m", $start_day);
											if ($checkagain != $minical_month) $whole_month = FALSE;	
										}
									} while ($whole_month == TRUE);
								?>
							</table>
							<img src="images/spacer.gif" width="1" height="3" alt=" "><br>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>	
</td>
</tr>
</table>

© 2014-2024 Faster IT GmbH | imprint | privacy policy