aboutsummaryrefslogtreecommitdiffstats
path: root/includes/calendar_nav.php
blob: d5fbf5634c230a6291454ddcfd3ce752b847129a (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
	<?php
	
	if ($cal == 'all_calenders_combined971') {
		$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>
<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); 
											}
											$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 
									
									echo '<b>'.$jump_lang.'</b><br>';
									echo '<img src="images/spacer.gif" width="1" height="6" alt=" "><br>';
									echo "<form action=\"day.php\" method=\"GET\"><select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value+'$query');\">";
									include('./functions/list_icals.php');
									include('./functions/list_years.php');
									include('./functions/list_months.php');
									include('./functions/list_weeks.php');
									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_calenders_combined971') echo "<a class=\"psf\" href=\"$subscribe_path\">$subscribe_lang</a>&nbsp;|&nbsp;<a class=\"psf\" href=\"$download_filename\">$download_lang</a>\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); 
									}
									$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