@@ -35,32 +35,32 @@ |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | switch (@$_GET['view']) { |
38 | - default: |
|
39 | - $_GET['view'] = 'calendar_year'; |
|
40 | - case 'calendar_year': |
|
41 | - require_once CALENDAR_ROOT . 'Year.php'; |
|
42 | - $c = new Calendar_Year($_GET['y']); |
|
43 | - break; |
|
44 | - case 'calendar_month': |
|
45 | - require_once CALENDAR_ROOT . 'Month.php'; |
|
46 | - $c = new Calendar_Month($_GET['y'], $_GET['m']); |
|
47 | - break; |
|
48 | - case 'calendar_day': |
|
49 | - require_once CALENDAR_ROOT . 'Day.php'; |
|
50 | - $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
|
51 | - break; |
|
52 | - case 'calendar_hour': |
|
53 | - require_once CALENDAR_ROOT . 'Hour.php'; |
|
54 | - $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
|
55 | - break; |
|
56 | - case 'calendar_minute': |
|
57 | - require_once CALENDAR_ROOT . 'Minute.php'; |
|
58 | - $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
|
59 | - break; |
|
60 | - case 'calendar_second': |
|
61 | - require_once CALENDAR_ROOT . 'Second.php'; |
|
62 | - $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
|
63 | - break; |
|
38 | + default: |
|
39 | + $_GET['view'] = 'calendar_year'; |
|
40 | + case 'calendar_year': |
|
41 | + require_once CALENDAR_ROOT . 'Year.php'; |
|
42 | + $c = new Calendar_Year($_GET['y']); |
|
43 | + break; |
|
44 | + case 'calendar_month': |
|
45 | + require_once CALENDAR_ROOT . 'Month.php'; |
|
46 | + $c = new Calendar_Month($_GET['y'], $_GET['m']); |
|
47 | + break; |
|
48 | + case 'calendar_day': |
|
49 | + require_once CALENDAR_ROOT . 'Day.php'; |
|
50 | + $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
|
51 | + break; |
|
52 | + case 'calendar_hour': |
|
53 | + require_once CALENDAR_ROOT . 'Hour.php'; |
|
54 | + $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
|
55 | + break; |
|
56 | + case 'calendar_minute': |
|
57 | + require_once CALENDAR_ROOT . 'Minute.php'; |
|
58 | + $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
|
59 | + break; |
|
60 | + case 'calendar_second': |
|
61 | + require_once CALENDAR_ROOT . 'Second.php'; |
|
62 | + $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
|
63 | + break; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | echo 'Viewing: ' . @$_GET['view'] . '<br>'; |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | list($usec, $sec) = explode(' ', microtime()); |
10 | 10 | |
11 | - return (float)$usec + (float)$sec; |
|
11 | + return (float) $usec + (float) $sec; |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | if (!@include 'Calendar/Calendar.php') { |
@@ -38,33 +38,33 @@ discard block |
||
38 | 38 | default: |
39 | 39 | $_GET['view'] = 'calendar_year'; |
40 | 40 | case 'calendar_year': |
41 | - require_once CALENDAR_ROOT . 'Year.php'; |
|
41 | + require_once CALENDAR_ROOT.'Year.php'; |
|
42 | 42 | $c = new Calendar_Year($_GET['y']); |
43 | 43 | break; |
44 | 44 | case 'calendar_month': |
45 | - require_once CALENDAR_ROOT . 'Month.php'; |
|
45 | + require_once CALENDAR_ROOT.'Month.php'; |
|
46 | 46 | $c = new Calendar_Month($_GET['y'], $_GET['m']); |
47 | 47 | break; |
48 | 48 | case 'calendar_day': |
49 | - require_once CALENDAR_ROOT . 'Day.php'; |
|
49 | + require_once CALENDAR_ROOT.'Day.php'; |
|
50 | 50 | $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
51 | 51 | break; |
52 | 52 | case 'calendar_hour': |
53 | - require_once CALENDAR_ROOT . 'Hour.php'; |
|
53 | + require_once CALENDAR_ROOT.'Hour.php'; |
|
54 | 54 | $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
55 | 55 | break; |
56 | 56 | case 'calendar_minute': |
57 | - require_once CALENDAR_ROOT . 'Minute.php'; |
|
57 | + require_once CALENDAR_ROOT.'Minute.php'; |
|
58 | 58 | $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
59 | 59 | break; |
60 | 60 | case 'calendar_second': |
61 | - require_once CALENDAR_ROOT . 'Second.php'; |
|
61 | + require_once CALENDAR_ROOT.'Second.php'; |
|
62 | 62 | $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
63 | 63 | break; |
64 | 64 | } |
65 | 65 | |
66 | -echo 'Viewing: ' . @$_GET['view'] . '<br>'; |
|
67 | -echo 'The time is now: ' . date('Y M d H:i:s', $c->getTimestamp()) . '<br >'; |
|
66 | +echo 'Viewing: '.@$_GET['view'].'<br>'; |
|
67 | +echo 'The time is now: '.date('Y M d H:i:s', $c->getTimestamp()).'<br >'; |
|
68 | 68 | |
69 | 69 | $i = 1; |
70 | 70 | echo '<h1>First Iteration</h1>'; |
@@ -74,15 +74,15 @@ discard block |
||
74 | 74 | $c->build(); |
75 | 75 | while ($e = $c->fetch()) { |
76 | 76 | $class = strtolower(get_class($e)); |
77 | - $link = '&y=' . $e->thisYear() . '&m=' . $e->thisMonth() . '&d=' . $e->thisDay() . '&h=' . $e->thisHour() . '&i=' . $e->thisMinute() . '&s=' . $e->thisSecond(); |
|
78 | - $method = 'this' . str_replace('calendar_', '', $class); |
|
79 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $class . $link . '">' . $e->{$method}() . '</a> : '; |
|
77 | + $link = '&y='.$e->thisYear().'&m='.$e->thisMonth().'&d='.$e->thisDay().'&h='.$e->thisHour().'&i='.$e->thisMinute().'&s='.$e->thisSecond(); |
|
78 | + $method = 'this'.str_replace('calendar_', '', $class); |
|
79 | + echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$class.$link.'">'.$e->{$method}().'</a> : '; |
|
80 | 80 | if (($i % 10) == 0) { |
81 | 81 | echo '<br>'; |
82 | 82 | } |
83 | 83 | ++$i; |
84 | 84 | } |
85 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
85 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
86 | 86 | |
87 | 87 | $i = 1; |
88 | 88 | echo '<h1>Second Iteration</h1>'; |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | $start = getmicrotime(); |
92 | 92 | while ($e = $c->fetch()) { |
93 | 93 | $class = strtolower(get_class($e)); |
94 | - $link = '&y=' . $e->thisYear() . '&m=' . $e->thisMonth() . '&d=' . $e->thisDay() . '&h=' . $e->thisHour() . '&i=' . $e->thisMinute() . '&s=' . $e->thisSecond(); |
|
95 | - $method = 'this' . str_replace('calendar_', '', $class); |
|
96 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $class . $link . '">' . $e->{$method}() . '</a> : '; |
|
94 | + $link = '&y='.$e->thisYear().'&m='.$e->thisMonth().'&d='.$e->thisDay().'&h='.$e->thisHour().'&i='.$e->thisMinute().'&s='.$e->thisSecond(); |
|
95 | + $method = 'this'.str_replace('calendar_', '', $class); |
|
96 | + echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$class.$link.'">'.$e->{$method}().'</a> : '; |
|
97 | 97 | if (($i % 10) == 0) { |
98 | 98 | echo '<br>'; |
99 | 99 | } |
100 | 100 | ++$i; |
101 | 101 | } |
102 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
102 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | { |
7 | 7 | list($usec, $sec) = explode(' ', microtime()); |
8 | 8 | |
9 | - return (float)$usec + (float)$sec; |
|
9 | + return (float) $usec + (float) $sec; |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | $start = getmicrotime(); |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | define('CALENDAR_ROOT', '../../'); |
16 | 16 | } |
17 | 17 | |
18 | -require_once CALENDAR_ROOT . 'Year.php'; |
|
19 | -require_once CALENDAR_ROOT . 'Month/Weeks.php'; |
|
18 | +require_once CALENDAR_ROOT.'Year.php'; |
|
19 | +require_once CALENDAR_ROOT.'Month/Weeks.php'; |
|
20 | 20 | |
21 | 21 | define('CALENDAR_MONTH_STATE', CALENDAR_USE_MONTH_WEEKS); |
22 | 22 | |
@@ -124,20 +124,20 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | echo "<td>\n<table class=\"month\">\n"; |
127 | - echo '<caption class="month">' . date('F', $Month->thisMonth(true)) . '</caption>'; |
|
128 | - echo '<colgroup><col class="weekNumbers"><col span="7"></colgroup>' . "\n"; |
|
127 | + echo '<caption class="month">'.date('F', $Month->thisMonth(true)).'</caption>'; |
|
128 | + echo '<colgroup><col class="weekNumbers"><col span="7"></colgroup>'."\n"; |
|
129 | 129 | echo "<tr>\n<th>Week</th><th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th><th>S</th>\n</tr>"; |
130 | 130 | $Month->build(); |
131 | 131 | while ($Week = $Month->fetch()) { |
132 | 132 | echo "<tr>\n"; |
133 | - echo '<td>' . $Week->thisWeek($_GET['week_type']) . "</td>\n"; |
|
133 | + echo '<td>'.$Week->thisWeek($_GET['week_type'])."</td>\n"; |
|
134 | 134 | $Week->build(); |
135 | 135 | |
136 | 136 | while ($Day = $Week->fetch()) { |
137 | 137 | if ($Day->isEmpty()) { |
138 | 138 | echo "<td> </td>\n"; |
139 | 139 | } else { |
140 | - echo '<td>' . $Day->thisDay() . "</td>\n"; |
|
140 | + echo '<td>'.$Day->thisDay()."</td>\n"; |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | { |
7 | 7 | list($usec, $sec) = explode(' ', microtime()); |
8 | 8 | |
9 | - return (float)$usec + (float)$sec; |
|
9 | + return (float) $usec + (float) $sec; |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | $start = getmicrotime(); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | if (!@include 'Calendar/Calendar.php') { |
15 | 15 | define('CALENDAR_ROOT', '../../'); |
16 | 16 | } |
17 | -require_once CALENDAR_ROOT . 'Week.php'; |
|
17 | +require_once CALENDAR_ROOT.'Week.php'; |
|
18 | 18 | |
19 | 19 | if (!isset($_GET['y'])) { |
20 | 20 | $_GET['y'] = date('Y'); |
@@ -42,19 +42,19 @@ discard block |
||
42 | 42 | </head> |
43 | 43 | <body> |
44 | 44 | <h1>Paging Weeks</h1> |
45 | -<h2>Week: <?php echo $Week->thisWeek() . ' ' . date('F Y', $Week->thisMonth(true)); ?></h2> |
|
45 | +<h2>Week: <?php echo $Week->thisWeek().' '.date('F Y', $Week->thisMonth(true)); ?></h2> |
|
46 | 46 | <?php |
47 | 47 | $Week->build(); |
48 | 48 | while ($Day = $Week->fetch()) { |
49 | - echo '<p>' . date('jS F', $Day->thisDay(true)) . "</p>\n"; |
|
49 | + echo '<p>'.date('jS F', $Day->thisDay(true))."</p>\n"; |
|
50 | 50 | } |
51 | 51 | $days = $Week->fetchAll(); |
52 | 52 | |
53 | 53 | $prevWeek = $Week->prevWeek('array'); |
54 | -$prevWeekLink = $_SERVER['PHP_SELF'] . '?y=' . $prevWeek['year'] . '&m=' . $prevWeek['month'] . '&d=' . $prevWeek['day']; |
|
54 | +$prevWeekLink = $_SERVER['PHP_SELF'].'?y='.$prevWeek['year'].'&m='.$prevWeek['month'].'&d='.$prevWeek['day']; |
|
55 | 55 | |
56 | 56 | $nextWeek = $Week->nextWeek('array'); |
57 | -$nextWeekLink = $_SERVER['PHP_SELF'] . '?y=' . $nextWeek['year'] . '&m=' . $nextWeek['month'] . '&d=' . $nextWeek['day']; |
|
57 | +$nextWeekLink = $_SERVER['PHP_SELF'].'?y='.$nextWeek['year'].'&m='.$nextWeek['month'].'&d='.$nextWeek['day']; |
|
58 | 58 | ?> |
59 | 59 | <p><a href="<?php echo $prevWeekLink; ?>"><<</a> | <a href="<?php echo $nextWeekLink; ?>">>></a></p> |
60 | 60 | </body> |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | { |
8 | 8 | list($usec, $sec) = explode(' ', microtime()); |
9 | 9 | |
10 | - return (float)$usec + (float)$sec; |
|
10 | + return (float) $usec + (float) $sec; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | $start = getmicrotime(); |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | if (!@include 'Calendar/Calendar.php') { |
19 | 19 | define('CALENDAR_ROOT', '../../'); |
20 | 20 | } |
21 | -require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
22 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
21 | +require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
22 | +require_once CALENDAR_ROOT.'Day.php'; |
|
23 | 23 | |
24 | 24 | // Initialize GET variables if not set |
25 | 25 | if (!isset($_GET['y'])) { |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | |
48 | 48 | // Construct strings for next/previous links |
49 | 49 | $PMonth = $month->prevMonth('object'); // Get previous month as object |
50 | -$prev = $_SERVER['PHP_SELF'] . '?y=' . $PMonth->thisYear() . '&m=' . $PMonth->thisMonth() . '&d=' . $PMonth->thisDay(); |
|
50 | +$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay(); |
|
51 | 51 | $NMonth = $month->nextMonth('object'); |
52 | -$next = $_SERVER['PHP_SELF'] . '?y=' . $NMonth->thisYear() . '&m=' . $NMonth->thisMonth() . '&d=' . $NMonth->thisDay(); |
|
52 | +$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay(); |
|
53 | 53 | |
54 | 54 | $thisDate = new Date($month->thisMonth('timestamp')); |
55 | 55 | ?> |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | <?php |
117 | 117 | while ($day = $month->fetch()) { |
118 | 118 | // Build a link string for each day |
119 | - $link = $_SERVER['PHP_SELF'] . '?y=' . $day->thisYear() . '&m=' . $day->thisMonth() . '&d=' . $day->thisDay(); |
|
119 | + $link = $_SERVER['PHP_SELF'].'?y='.$day->thisYear().'&m='.$day->thisMonth().'&d='.$day->thisDay(); |
|
120 | 120 | |
121 | 121 | // isFirst() to find start of week |
122 | 122 | if ($day->isFirst()) { |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | if ($day->isSelected()) { |
127 | - echo '<td class="selected">' . $day->thisDay() . '</td>' . "\n"; |
|
127 | + echo '<td class="selected">'.$day->thisDay().'</td>'."\n"; |
|
128 | 128 | } elseif ($day->isEmpty()) { |
129 | - echo '<td> </td>' . "\n"; |
|
129 | + echo '<td> </td>'."\n"; |
|
130 | 130 | } else { |
131 | - echo '<td><a href="' . $link . '">' . $day->thisDay() . '</a></td>' . "\n"; |
|
131 | + echo '<td><a href="'.$link.'">'.$day->thisDay().'</a></td>'."\n"; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | // isLast() to find end of week |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | </tr> |
149 | 149 | </table> |
150 | 150 | <?php |
151 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
151 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
152 | 152 | ?> |
153 | 153 | </body> |
154 | 154 | </html> |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | { |
8 | 8 | list($usec, $sec) = explode(' ', microtime()); |
9 | 9 | |
10 | - return (float)$usec + (float)$sec; |
|
10 | + return (float) $usec + (float) $sec; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | $start = getmicrotime(); |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | if (!@include 'Calendar/Calendar.php') { |
19 | 19 | define('CALENDAR_ROOT', '../../'); |
20 | 20 | } |
21 | -require_once CALENDAR_ROOT . 'Month/Weeks.php'; |
|
22 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
21 | +require_once CALENDAR_ROOT.'Month/Weeks.php'; |
|
22 | +require_once CALENDAR_ROOT.'Day.php'; |
|
23 | 23 | |
24 | 24 | // Initialize GET variables if not set |
25 | 25 | if (!isset($_GET['y'])) { |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | |
49 | 49 | // Construct strings for next/previous links |
50 | 50 | $PMonth = $Month->prevMonth('object'); // Get previous month as object |
51 | -$prev = $_SERVER['PHP_SELF'] . '?y=' . $PMonth->thisYear() . '&m=' . $PMonth->thisMonth() . '&d=' . $PMonth->thisDay(); |
|
51 | +$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay(); |
|
52 | 52 | $NMonth = $Month->nextMonth('object'); |
53 | -$next = $_SERVER['PHP_SELF'] . '?y=' . $NMonth->thisYear() . '&m=' . $NMonth->thisMonth() . '&d=' . $NMonth->thisDay(); |
|
53 | +$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay(); |
|
54 | 54 | ?> |
55 | 55 | <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> |
56 | 56 | <html> |
@@ -124,19 +124,19 @@ discard block |
||
124 | 124 | while ($Day = $Week->fetch()) { |
125 | 125 | |
126 | 126 | // Build a link string for each day |
127 | - $link = $_SERVER['PHP_SELF'] . '?y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay(); |
|
127 | + $link = $_SERVER['PHP_SELF'].'?y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay(); |
|
128 | 128 | |
129 | 129 | // Check to see if day is selected |
130 | 130 | if ($Day->isSelected()) { |
131 | - echo '<td class="selected">' . $Day->thisDay() . '</td>' . "\n"; |
|
131 | + echo '<td class="selected">'.$Day->thisDay().'</td>'."\n"; |
|
132 | 132 | // Check to see if day is empty |
133 | 133 | } elseif ($Day->isEmpty()) { |
134 | - echo '<td class="empty">' . $Day->thisDay() . '</td>' . "\n"; |
|
134 | + echo '<td class="empty">'.$Day->thisDay().'</td>'."\n"; |
|
135 | 135 | } else { |
136 | - echo '<td><a href="' . $link . '">' . $Day->thisDay() . '</a></td>' . "\n"; |
|
136 | + echo '<td><a href="'.$link.'">'.$Day->thisDay().'</a></td>'."\n"; |
|
137 | 137 | } |
138 | 138 | } |
139 | - echo '</tr>' . "\n"; |
|
139 | + echo '</tr>'."\n"; |
|
140 | 140 | } |
141 | 141 | ?> |
142 | 142 | <tr> |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | </tr> |
151 | 151 | </table> |
152 | 152 | <?php |
153 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
153 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
154 | 154 | ?> |
155 | 155 | </body> |
156 | 156 | </html> |
@@ -5,19 +5,19 @@ |
||
5 | 5 | if (!@include 'Calendar/Calendar.php') { |
6 | 6 | define('CALENDAR_ROOT', '../../'); |
7 | 7 | } |
8 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
9 | -require_once CALENDAR_ROOT . 'Decorator/Weekday.php'; |
|
8 | +require_once CALENDAR_ROOT.'Day.php'; |
|
9 | +require_once CALENDAR_ROOT.'Decorator/Weekday.php'; |
|
10 | 10 | |
11 | 11 | $Day = new Calendar_Day(date('Y'), date('n'), date('d')); |
12 | 12 | $WeekDay = new Calendar_Decorator_Weekday($Day); |
13 | 13 | // $WeekDay->setFirstDay(0); // Make Sunday first Day |
14 | 14 | |
15 | -echo 'Yesterday: ' . $WeekDay->prevWeekDay() . '<br>'; |
|
16 | -echo 'Today: ' . $WeekDay->thisWeekDay() . '<br>'; |
|
17 | -echo 'Tomorrow: ' . $WeekDay->nextWeekDay() . '<br>'; |
|
15 | +echo 'Yesterday: '.$WeekDay->prevWeekDay().'<br>'; |
|
16 | +echo 'Today: '.$WeekDay->thisWeekDay().'<br>'; |
|
17 | +echo 'Tomorrow: '.$WeekDay->nextWeekDay().'<br>'; |
|
18 | 18 | |
19 | 19 | $WeekDay->build(); |
20 | 20 | echo 'Hours today:<br>'; |
21 | 21 | while ($Hour = $WeekDay->fetch()) { |
22 | - echo $Hour->thisHour() . '<br>'; |
|
22 | + echo $Hour->thisHour().'<br>'; |
|
23 | 23 | } |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | if (!@include 'Calendar/Calendar.php') { |
6 | 6 | define('CALENDAR_ROOT', '../../'); |
7 | 7 | } |
8 | -require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
9 | -require_once CALENDAR_ROOT . 'Decorator/Uri.php'; |
|
8 | +require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
9 | +require_once CALENDAR_ROOT.'Decorator/Uri.php'; |
|
10 | 10 | |
11 | 11 | if (!isset($_GET['jahr'])) { |
12 | 12 | $_GET['jahr'] = date('Y'); |
@@ -18,17 +18,17 @@ discard block |
||
18 | 18 | // Build the month |
19 | 19 | $Calendar = new Calendar_Month_Weekdays($_GET['jahr'], $_GET['monat']); |
20 | 20 | |
21 | -echo '<p>The current month is ' . $Calendar->thisMonth() . ' of year ' . $Calendar->thisYear() . '</p>'; |
|
21 | +echo '<p>The current month is '.$Calendar->thisMonth().' of year '.$Calendar->thisYear().'</p>'; |
|
22 | 22 | |
23 | 23 | $Uri = new Calendar_Decorator_Uri($Calendar); |
24 | 24 | $Uri->setFragments('jahr', 'monat'); |
25 | 25 | // $Uri->setSeperator('/'); // Default is & |
26 | 26 | // $Uri->setScalar(); // Omit variable names |
27 | -echo "<pre>Previous Uri:\t" . $Uri->prev('month') . "\n"; |
|
28 | -echo "This Uri:\t" . $Uri->this('month') . "\n"; |
|
29 | -echo "Next Uri:\t" . $Uri->next('month') . "\n</pre>"; |
|
27 | +echo "<pre>Previous Uri:\t".$Uri->prev('month')."\n"; |
|
28 | +echo "This Uri:\t".$Uri->this('month')."\n"; |
|
29 | +echo "Next Uri:\t".$Uri->next('month')."\n</pre>"; |
|
30 | 30 | ?> |
31 | 31 | <p> |
32 | - <a href="<?php echo $_SERVER['PHP_SELF'] . '?' . $Uri->prev('month'); ?>">Prev</a> : |
|
33 | - <a href="<?php echo $_SERVER['PHP_SELF'] . '?' . $Uri->next('month'); ?>">Next</a> |
|
32 | + <a href="<?php echo $_SERVER['PHP_SELF'].'?'.$Uri->prev('month'); ?>">Prev</a> : |
|
33 | + <a href="<?php echo $_SERVER['PHP_SELF'].'?'.$Uri->next('month'); ?>">Next</a> |
|
34 | 34 | </p> |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | { |
8 | 8 | list($usec, $sec) = explode(' ', microtime()); |
9 | 9 | |
10 | - return (float)$usec + (float)$sec; |
|
10 | + return (float) $usec + (float) $sec; |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | $start = getmicrotime(); |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | if (!@include 'Calendar/Calendar.php') { |
16 | 16 | define('CALENDAR_ROOT', '../../'); |
17 | 17 | } |
18 | -require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
19 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
18 | +require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
19 | +require_once CALENDAR_ROOT.'Day.php'; |
|
20 | 20 | |
21 | 21 | if (!isset($_GET['y'])) { |
22 | 22 | $_GET['y'] = date('Y'); |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | |
34 | 34 | // Construct strings for next/previous links |
35 | 35 | $PMonth = $Month->prevMonth('object'); // Get previous month as object |
36 | -$prev = $_SERVER['PHP_SELF'] . '?y=' . $PMonth->thisYear() . '&m=' . $PMonth->thisMonth() . '&d=' . $PMonth->thisDay(); |
|
36 | +$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay(); |
|
37 | 37 | $NMonth = $Month->nextMonth('object'); |
38 | -$next = $_SERVER['PHP_SELF'] . '?y=' . $NMonth->thisYear() . '&m=' . $NMonth->thisMonth() . '&d=' . $NMonth->thisDay(); |
|
38 | +$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay(); |
|
39 | 39 | ?> |
40 | 40 | <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"> |
41 | 41 | <html> |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | while ($Day = $Month->fetch()) { |
111 | 111 | |
112 | 112 | // Build a link string for each day |
113 | - $link = $_SERVER['PHP_SELF'] . '?y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay(); |
|
113 | + $link = $_SERVER['PHP_SELF'].'?y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay(); |
|
114 | 114 | |
115 | 115 | // isFirst() to find start of week |
116 | 116 | if ($Day->isFirst()) { |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | if ($Day->isSelected()) { |
121 | - echo '<td class="selected">' . $Day->thisDay() . "</td>\n"; |
|
121 | + echo '<td class="selected">'.$Day->thisDay()."</td>\n"; |
|
122 | 122 | } elseif ($Day->isEmpty()) { |
123 | 123 | echo "<td> </td>\n"; |
124 | 124 | } else { |
125 | - echo '<td><a href="' . $link . '">' . $Day->thisDay() . "</a></td>\n"; |
|
125 | + echo '<td><a href="'.$link.'">'.$Day->thisDay()."</a></td>\n"; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | // isLast() to find end of week |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | </tr> |
143 | 143 | </table> |
144 | 144 | <?php |
145 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
145 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
146 | 146 | ?> |
147 | 147 | </body> |
148 | 148 | </html> |
@@ -6,9 +6,9 @@ discard block |
||
6 | 6 | if (!@include 'Calendar/Calendar.php') { |
7 | 7 | define('CALENDAR_ROOT', '../../'); |
8 | 8 | } |
9 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
10 | -require_once CALENDAR_ROOT . 'Hour.php'; |
|
11 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
9 | +require_once CALENDAR_ROOT.'Day.php'; |
|
10 | +require_once CALENDAR_ROOT.'Hour.php'; |
|
11 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
12 | 12 | |
13 | 13 | // Decorator to "attach" functionality to selected hours |
14 | 14 | |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | FROM |
55 | 55 | diary |
56 | 56 | WHERE |
57 | - eventtime >= '" . $Day->thisDay(true) . "' |
|
57 | + eventtime >= '" . $Day->thisDay(true)."' |
|
58 | 58 | AND |
59 | - eventtime < '" . $Day->nextDay(true) . "';"; |
|
59 | + eventtime < '" . $Day->nextDay(true)."';"; |
|
60 | 60 | |
61 | 61 | // An array simulating data from a database |
62 | 62 | $result = array( |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | // If the hour is selected, call the decorator method... |
114 | 114 | if ($Hour->isSelected()) { |
115 | - echo '<td bgcolor="silver">' . $Hour->getEntry() . "</td>\n"; |
|
115 | + echo '<td bgcolor="silver">'.$Hour->getEntry()."</td>\n"; |
|
116 | 116 | } else { |
117 | 117 | echo "<td> </td>\n"; |
118 | 118 | } |