File: datesel.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 (28 lines) | stat: -rw-r--r-- 951 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
<?php
global $form, $fmonth, $fday, $fyear;
if (preg_match("/\/includes\//", $PHP_SELF)) {
  die ("You can't access this file directly!");
}
$form = clean_word($form);
$fmonth = clean_word($fmonth);
$fday = clean_word($fday);
$fyear = clean_word($fyear);
?>

<script type="text/javascript">
<!-- <![CDATA[
function sendDate ( date ) {
  year = date.substring ( 0, 4 );
  month = date.substring ( 4, 6 );
  day = date.substring ( 6, 8 );
  window.opener.document.<?php echo $form?>.<?php echo $fday?>.selectedIndex = day - 1;
  window.opener.document.<?php echo $form?>.<?php echo $fmonth?>.selectedIndex = month - 1;
  for ( i = 0; i < window.opener.document.<?php echo $form?>.<?php echo $fyear?>.length; i++ ) {
    if ( window.opener.document.<?php echo $form?>.<?php echo $fyear?>.options[i].value == year ) {
      window.opener.document.<?php echo $form?>.<?php echo $fyear?>.selectedIndex = i;
    }
  }
  window.close ();
}
//]]> -->
</script>