File: export.php

package info (click to toggle)
webcalendar 0.9.45-4sarge7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,888 kB
  • ctags: 4,775
  • sloc: php: 16,990; sql: 1,272; perl: 777; sh: 120; makefile: 45
file content (126 lines) | stat: -rw-r--r-- 4,139 bytes parent folder | download
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
	<!-- EXPORT -->
	<a name="tabexport"></a>
	<div id="tabscontent_export">
<form action="export_handler.php" method="post" name="exportform">
<table style="border-width:0px;">
<tr><td>
	<label for="exformat"><?php etranslate("Export format")?>:</label></td><td>
	<select name="format" id="exformat">
		<option value="ical">iCalendar</option>
		<option value="vcal">vCalendar</option>
		<option value="pilot-csv">pilot-datebook CSV (<?php etranslate("Palm Pilot")?>)</option>
		<option value="pilot-text">install-datebook (<?php etranslate("Palm Pilot")?>)</option>
	</select>
</td></tr>
<?php  // Only include layers if they are enabled.
	if ( ! empty ( $LAYERS_STATUS ) && $LAYERS_STATUS == 'Y' ) {
?>
<tr><td>
	&nbsp;</td><td>
	<input type="checkbox" name="include_layers" id="include_layers" value="y" />
	<label for="include_layers" style="font-weight:bold;"><?php etranslate("Include all layers")?></label>
</td></tr>
<?php } ?>

<tr><td>
	&nbsp;</td><td>
	<input type="checkbox" name="use_all_dates" id="exportall" value="y" />
	<label for="exportall"><?php etranslate("Export all dates")?></label>
</td></tr>
<tr><td>
	<label><?php etranslate("Start date")?>:</label></td><td>
	<select name="fromday">
		<?php
			$day = date ( "d" );
			for ( $i = 1; $i <= 31; $i++ ) echo "<option" . ( $i == $day ? " selected=\"selected\"" : "" ) . ">$i</option>\n";
		?>
	</select>
	<select name="frommonth">
		<?php
			$month = date ( "m" );
			$year = date ( "Y" );
			for ( $i = 1; $i <= 12; $i++ ) {
				$m = month_short_name ( $i - 1 );
				print "<option value=\"$i\"" . ( $i == $month ? " selected=\"selected\"" : "" ) . ">$m</option>\n";
			}
		?>
	</select>
	<select name="fromyear">
		<?php
			$year = date ( "Y" ) - 1;
			for ( $i = -1; $i < 5; $i++ ) {
				$y = date ( "Y" ) + $i;
				print "<option value=\"$y\"" . ( $y == $year ? " selected=\"selected\"" : "" ) . ">$y</option>\n";
			}
		?>
	</select>
	<input type="button" onclick="selectDate('fromday','frommonth','fromyear')" value="<?php etranslate("Select")?>..." />
</td></tr>

<tr><td>
	<label><?php etranslate("End date")?>:</label></td><td>
	<select name="endday">
		<?php
			$day = date ( "d" );
			for ( $i = 1; $i <= 31; $i++ ) echo "<option" . ( $i == $day ? " selected=\"selected\"" : "" ) . ">$i</option>\n";
		?>
	</select>
	<select name="endmonth">
		<?php
			$month = date ( "m" );
			$year = date ( "Y" );
			for ( $i = 1; $i <= 12; $i++ ) {
				$m = month_short_name ( $i - 1 );
				print "<option value=\"$i\"" . ( $i == $month ? " selected=\"selected\"" : "" ) . ">$m</option>\n";
			}
		?>
	</select>
	<select name="endyear">
		<?php
			$year = date ( "Y" ) + 1;
			for ( $i = -1; $i < 5; $i++ ) {
				$y = date ( "Y" ) + $i;
				print "<option value=\"$y\"" . ( $y == $year ? " selected=\"selected\"" : "" ) . ">$y</option>\n";
			}
		?>
	</select>
	<input type="button" onclick="selectDate('endday','endmonth','endyear')" value="<?php etranslate("Select")?>..." />
</td></tr>

<tr><td>
	<label><?php etranslate("Modified since")?>:</label></td><td>
	<select name="modday">
		<?php
			$week_ago = mktime ( 0, 0, 0, date ( "m" ), date ( "d" ) - 7, date ( "Y" ) );
			$day = date ( "d", $week_ago );
			for ( $i = 1; $i <= 31; $i++ ) echo "<option" . ( $i == $day ? " selected=\"selected\"" : "" ) . ">$i</option>\n";
		?>
	</select>
	<select name="modmonth">
		<?php
			$month = date ( "m", $week_ago );
			$year = date ( "Y", $week_ago );
			for ( $i = 1; $i <= 12; $i++ ) {
				$m = month_short_name ( $i - 1 );
				print "<option value=\"$i\"" . ( $i == $month ? " selected=\"selected\"" : "" ) . ">$m</option>\n";
			}
		?>
	</select>
	<select name="modyear">
		<?php
			$year = date ( "Y", $week_ago );
			for ( $i = -1; $i < 5; $i++ ) {
				$y = date ( "Y" ) + $i;
				print "<option value=\"$y\"" . ( $y == $year ? " selected=\"selected\"" : "" ) . ">$y</option>\n";
			}
		?>
	</select>
	<input type="button" onclick="selectDate('modday','modmonth','modyear')" value="<?php etranslate("Select")?>..." />
</td></tr>

<tr><td colspan="2">
	<input type="submit" value="<?php etranslate("Export");?>" />
</td></tr>
</table>
</form>
</div> <!-- /EXPORT -->