@@ -19,12 +19,24 @@ |
||
| 19 | 19 | define('CALENDAR_ROOT','../../'); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | -if (!isset($_GET['y'])) $_GET['y'] = 2003; |
|
| 23 | -if (!isset($_GET['m'])) $_GET['m'] = 8; |
|
| 24 | -if (!isset($_GET['d'])) $_GET['d'] = 9; |
|
| 25 | -if (!isset($_GET['h'])) $_GET['h'] = 12; |
|
| 26 | -if (!isset($_GET['i'])) $_GET['i'] = 34; |
|
| 27 | -if (!isset($_GET['s'])) $_GET['s'] = 46; |
|
| 22 | +if (!isset($_GET['y'])) { |
|
| 23 | + $_GET['y'] = 2003; |
|
| 24 | +} |
|
| 25 | +if (!isset($_GET['m'])) { |
|
| 26 | + $_GET['m'] = 8; |
|
| 27 | +} |
|
| 28 | +if (!isset($_GET['d'])) { |
|
| 29 | + $_GET['d'] = 9; |
|
| 30 | +} |
|
| 31 | +if (!isset($_GET['h'])) { |
|
| 32 | + $_GET['h'] = 12; |
|
| 33 | +} |
|
| 34 | +if (!isset($_GET['i'])) { |
|
| 35 | + $_GET['i'] = 34; |
|
| 36 | +} |
|
| 37 | +if (!isset($_GET['s'])) { |
|
| 38 | + $_GET['s'] = 46; |
|
| 39 | +} |
|
| 28 | 40 | |
| 29 | 41 | switch (@$_GET['view']) { |
| 30 | 42 | default: |
@@ -15,12 +15,24 @@ |
||
| 15 | 15 | } |
| 16 | 16 | require_once CALENDAR_ROOT.'Second.php'; |
| 17 | 17 | |
| 18 | -if (!isset($_GET['y'])) $_GET['y'] = date('Y'); |
|
| 19 | -if (!isset($_GET['m'])) $_GET['m'] = date('n'); |
|
| 20 | -if (!isset($_GET['d'])) $_GET['d'] = date('j'); |
|
| 21 | -if (!isset($_GET['h'])) $_GET['h'] = date('H'); |
|
| 22 | -if (!isset($_GET['i'])) $_GET['i'] = date('i'); |
|
| 23 | -if (!isset($_GET['s'])) $_GET['s'] = date('s'); |
|
| 18 | +if (!isset($_GET['y'])) { |
|
| 19 | + $_GET['y'] = date('Y'); |
|
| 20 | +} |
|
| 21 | +if (!isset($_GET['m'])) { |
|
| 22 | + $_GET['m'] = date('n'); |
|
| 23 | +} |
|
| 24 | +if (!isset($_GET['d'])) { |
|
| 25 | + $_GET['d'] = date('j'); |
|
| 26 | +} |
|
| 27 | +if (!isset($_GET['h'])) { |
|
| 28 | + $_GET['h'] = date('H'); |
|
| 29 | +} |
|
| 30 | +if (!isset($_GET['i'])) { |
|
| 31 | + $_GET['i'] = date('i'); |
|
| 32 | +} |
|
| 33 | +if (!isset($_GET['s'])) { |
|
| 34 | + $_GET['s'] = date('s'); |
|
| 35 | +} |
|
| 24 | 36 | |
| 25 | 37 | $Unit = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
| 26 | 38 | |
@@ -56,8 +56,12 @@ |
||
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | -if (!isset($_GET['y'])) $_GET['y'] = date('Y'); |
|
| 60 | -if (!isset($_GET['m'])) $_GET['m'] = date('n'); |
|
| 59 | +if (!isset($_GET['y'])) { |
|
| 60 | + $_GET['y'] = date('Y'); |
|
| 61 | +} |
|
| 62 | +if (!isset($_GET['m'])) { |
|
| 63 | + $_GET['m'] = date('n'); |
|
| 64 | +} |
|
| 61 | 65 | |
| 62 | 66 | // Creata a month as usual |
| 63 | 67 | $Month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']); |
@@ -43,8 +43,9 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | function __dispatch($methodname) |
| 45 | 45 | { |
| 46 | - if (isset($this->__dispatch_map[$methodname])) |
|
| 47 | - return $this->__dispatch_map[$methodname]; |
|
| 46 | + if (isset($this->__dispatch_map[$methodname])) { |
|
| 47 | + return $this->__dispatch_map[$methodname]; |
|
| 48 | + } |
|
| 48 | 49 | |
| 49 | 50 | return NULL; |
| 50 | 51 | } |
@@ -18,7 +18,9 @@ |
||
| 18 | 18 | |
| 19 | 19 | define('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKDAYS); |
| 20 | 20 | |
| 21 | -if ( !isset($_GET['year']) ) $_GET['year'] = date('Y'); |
|
| 21 | +if ( !isset($_GET['year']) ) { |
|
| 22 | + $_GET['year'] = date('Y'); |
|
| 23 | +} |
|
| 22 | 24 | |
| 23 | 25 | $Year = new Calendar_Year($_GET['year']); |
| 24 | 26 | |
@@ -22,12 +22,24 @@ |
||
| 22 | 22 | require_once CALENDAR_ROOT.'Second.php'; |
| 23 | 23 | |
| 24 | 24 | // Initialize if not set |
| 25 | -if (!isset($_POST['y'])) $_POST['y'] = date('Y'); |
|
| 26 | -if (!isset($_POST['m'])) $_POST['m'] = date('n'); |
|
| 27 | -if (!isset($_POST['d'])) $_POST['d'] = date('j'); |
|
| 28 | -if (!isset($_POST['h'])) $_POST['h'] = date('H'); |
|
| 29 | -if (!isset($_POST['i'])) $_POST['i'] = date('i'); |
|
| 30 | -if (!isset($_POST['s'])) $_POST['s'] = date('s'); |
|
| 25 | +if (!isset($_POST['y'])) { |
|
| 26 | + $_POST['y'] = date('Y'); |
|
| 27 | +} |
|
| 28 | +if (!isset($_POST['m'])) { |
|
| 29 | + $_POST['m'] = date('n'); |
|
| 30 | +} |
|
| 31 | +if (!isset($_POST['d'])) { |
|
| 32 | + $_POST['d'] = date('j'); |
|
| 33 | +} |
|
| 34 | +if (!isset($_POST['h'])) { |
|
| 35 | + $_POST['h'] = date('H'); |
|
| 36 | +} |
|
| 37 | +if (!isset($_POST['i'])) { |
|
| 38 | + $_POST['i'] = date('i'); |
|
| 39 | +} |
|
| 40 | +if (!isset($_POST['s'])) { |
|
| 41 | + $_POST['s'] = date('s'); |
|
| 42 | +} |
|
| 31 | 43 | ?> |
| 32 | 44 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 33 | 45 | <html> |
@@ -17,9 +17,15 @@ discard block |
||
| 17 | 17 | require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
| 18 | 18 | require_once CALENDAR_ROOT.'Day.php'; |
| 19 | 19 | |
| 20 | -if (!isset($_GET['y'])) $_GET['y'] = date('Y'); |
|
| 21 | -if (!isset($_GET['m'])) $_GET['m'] = date('m'); |
|
| 22 | -if (!isset($_GET['d'])) $_GET['d'] = date('d'); |
|
| 20 | +if (!isset($_GET['y'])) { |
|
| 21 | + $_GET['y'] = date('Y'); |
|
| 22 | +} |
|
| 23 | +if (!isset($_GET['m'])) { |
|
| 24 | + $_GET['m'] = date('m'); |
|
| 25 | +} |
|
| 26 | +if (!isset($_GET['d'])) { |
|
| 27 | + $_GET['d'] = date('d'); |
|
| 28 | +} |
|
| 23 | 29 | |
| 24 | 30 | // Build the month |
| 25 | 31 | $Month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']); |
@@ -103,8 +109,9 @@ discard block |
||
| 103 | 109 | '&d='.$Day->thisDay(); |
| 104 | 110 | |
| 105 | 111 | // isFirst() to find start of week |
| 106 | - if ( $Day->isFirst() ) |
|
| 107 | - echo ( "<tr>\n" ); |
|
| 112 | + if ( $Day->isFirst() ) { |
|
| 113 | + echo ( "<tr>\n" ); |
|
| 114 | + } |
|
| 108 | 115 | |
| 109 | 116 | if ( $Day->isSelected() ) { |
| 110 | 117 | echo ( "<td class=\"selected\">".$Day->thisDay()."</td>\n" ); |
@@ -115,9 +122,10 @@ discard block |
||
| 115 | 122 | } |
| 116 | 123 | |
| 117 | 124 | // isLast() to find end of week |
| 118 | - if ( $Day->isLast() ) |
|
| 119 | - echo ( "</tr>\n" ); |
|
| 120 | -} |
|
| 125 | + if ( $Day->isLast() ) { |
|
| 126 | + echo ( "</tr>\n" ); |
|
| 127 | + } |
|
| 128 | + } |
|
| 121 | 129 | ?> |
| 122 | 130 | <tr> |
| 123 | 131 | <td> |
@@ -21,9 +21,15 @@ discard block |
||
| 21 | 21 | require_once CALENDAR_ROOT.'Day.php'; |
| 22 | 22 | |
| 23 | 23 | // Initialize GET variables if not set |
| 24 | -if (!isset($_GET['y'])) $_GET['y'] = date('Y'); |
|
| 25 | -if (!isset($_GET['m'])) $_GET['m'] = date('m'); |
|
| 26 | -if (!isset($_GET['d'])) $_GET['d'] = date('d'); |
|
| 24 | +if (!isset($_GET['y'])) { |
|
| 25 | + $_GET['y'] = date('Y'); |
|
| 26 | +} |
|
| 27 | +if (!isset($_GET['m'])) { |
|
| 28 | + $_GET['m'] = date('m'); |
|
| 29 | +} |
|
| 30 | +if (!isset($_GET['d'])) { |
|
| 31 | + $_GET['d'] = date('d'); |
|
| 32 | +} |
|
| 27 | 33 | |
| 28 | 34 | // Build the month |
| 29 | 35 | $month = new Calendar_Month_Weekdays($_GET['y'], $_GET['m']); |
@@ -109,8 +115,9 @@ discard block |
||
| 109 | 115 | '&d='.$day->thisDay(); |
| 110 | 116 | |
| 111 | 117 | // isFirst() to find start of week |
| 112 | - if ($day->isFirst()) |
|
| 113 | - echo "<tr>\n"; |
|
| 118 | + if ($day->isFirst()) { |
|
| 119 | + echo "<tr>\n"; |
|
| 120 | + } |
|
| 114 | 121 | |
| 115 | 122 | if ($day->isSelected()) { |
| 116 | 123 | echo '<td class="selected">'.$day->thisDay().'</td>'."\n"; |
@@ -19,7 +19,9 @@ |
||
| 19 | 19 | |
| 20 | 20 | define('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKS); |
| 21 | 21 | |
| 22 | -if (!isset($_GET['year'])) $_GET['year'] = date('Y'); |
|
| 22 | +if (!isset($_GET['year'])) { |
|
| 23 | + $_GET['year'] = date('Y'); |
|
| 24 | +} |
|
| 23 | 25 | |
| 24 | 26 | $week_types = array( |
| 25 | 27 | 'n_in_year', |