5 $lang = $_REQUEST['lang'];
10 setcookie('lang', $lang);
13 <!DOCTYPE HTML
PUBLIC "-//IETF//DTD HTML//EN">
22 // put here the correct path to "calendar.php"; don't move the file
23 // "calendar.php" -- I think it's best if you leave it inside the
24 // "/jscalendar/" directory. Just put here the correct path to it, such as
25 // "../jscalendar/calendar.php" or something.
26 require_once ('calendar.php');
28 // parameters to constructor:
29 // 1. the absolute URL path to the calendar files
30 // 2. the languate used for the calendar (see the lang/ dir)
31 // 3. the theme file used for the clanedar, without the ".css" extension
32 // 4. boolean that specifies if the "_stripped" files are to be loaded
33 // The stripped files are smaller as they have no whitespace and comments
34 $calendar = new DHTML_Calendar('/jscalendar/', $lang, 'calendar-win2k-2', false);
36 // call this in the <head> section; it will "echo" code that loads the calendar
37 // scripts and theme file.
38 $calendar->load_files();
46 <?php
if ($_REQUEST['submitted']) { ?
>
48 <h1
>Form submitted
</h1
>
50 <?php
foreach ($_REQUEST as $key => $val) {
51 echo htmlspecialchars($key) . ' = ' . htmlspecialchars($val) . '<br />';
56 <h1
>Calendar
.php test
</h1
>
58 <form action
="test.php" method
="get">
59 Select language
: <select name
="lang" onchange
="this.form.submit()">
63 foreach (glob('*.js') as $filename) {
64 $l = preg_replace('/(^calendar-|.js$)/', '', $filename);
67 $selected = 'selected="selected" ';
71 echo '<option ' . $selected . 'value="' . $l . '">' . $display . '</option>';
75 <blockquote style
="font-size: 90%">
76 <b
>NOTE
</b
>: as of this release
, 0.9.6, only
"EN" and "RO", which I
77 maintain
, function correctly
. Other language files
do not work
78 because they need to be updated
. If you update some language file
,
79 please consider sending it back to me so that I can
include it in the
80 calendar distribution
.
84 <form action
="test.php" method
="get">
85 <input type
="hidden" name
="submitted" value
="1" />
93 <?php
$calendar->make_input_field(
94 // calendar options go here; see the documentation and/or calendar-setup.js
95 array('firstDay' => 1, // show Monday first
98 'ifFormat' => '%Y-%m-%d %I:%M %P',
99 'timeFormat' => '12'),
100 // field attributes go here
101 array('style' => 'width: 15em; color: #840; background-color: #ff8; border: 1px solid #000; text-align: center',
103 'value' => strftime('%Y-%m-%d %I:%M %P', strtotime('now')))); ?
>
109 <button
>Submit
</button
>