@@ -186,10 +186,10 @@ |
||
| 186 | 186 | $authorizedAccessCats = $this->_extcalPerm->getAuthorizedCat($user, 'extcal_cat_view'); |
| 187 | 187 | $count = count($authorizedAccessCats); |
| 188 | 188 | if ($count > 0) { |
| 189 | - $in = '(' . $authorizedAccessCats[0]; |
|
| 189 | + $in = '('.$authorizedAccessCats[0]; |
|
| 190 | 190 | array_shift($authorizedAccessCats); |
| 191 | 191 | foreach ($authorizedAccessCats as $authorizedAccessCat) { |
| 192 | - $in .= ',' . $authorizedAccessCat; |
|
| 192 | + $in .= ','.$authorizedAccessCat; |
|
| 193 | 193 | } |
| 194 | 194 | $in .= ')'; |
| 195 | 195 | $criteria->add(new \Criteria('cat_id', $in, 'IN')); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | //Kraven 30 |
| 22 | 22 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 23 | 23 | |
| 24 | -require_once XOOPS_ROOT_PATH . '/kernel/object.php'; |
|
| 24 | +require_once XOOPS_ROOT_PATH.'/kernel/object.php'; |
|
| 25 | 25 | |
| 26 | 26 | //class Event extends \XoopsObject |
| 27 | 27 | //class extcal_etablissement extends \XoopsObject |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | $title = $this->isNew() ? sprintf(_MD_EXTCAL_ETABLISSEMENT_ADD) : sprintf(_MD_EXTCAL_ETABLISSEMENT_EDIT); |
| 73 | 73 | |
| 74 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 74 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 75 | 75 | |
| 76 | 76 | $form = new \XoopsThemeForm($title, 'form', $action, 'post', true); |
| 77 | 77 | $form->setExtra('enctype="multipart/form-data"'); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $form->addElement(new \XoopsFormTextArea(_MD_EXTCAL_ETABLISSEMENT_HORAIRES, 'horaires', $this->getVar('horaires'), 3, 40)); |
| 91 | 91 | $form->addElement(new \XoopsFormTextArea(_MD_EXTCAL_ETABLISSEMENT_DIVERS, 'divers', $this->getVar('divers'), 5, 40)); |
| 92 | 92 | //$form->addElement( new \XoopsFormTextArea(_MD_EXTCAL_ETABLISSEMENT_TARIFS, 'tarifs', $this->getVar("tarifs"), 5, 40)); |
| 93 | - $form->addElement(new \XoopsFormText(_MD_EXTCAL_ETABLISSEMENT_TARIFS . ' ( ' . _MD_EXTCAL_DEVISE2 . ' )', 'tarifs', 20, 20, $this->getVar('tarifs')), false); |
|
| 93 | + $form->addElement(new \XoopsFormText(_MD_EXTCAL_ETABLISSEMENT_TARIFS.' ( '._MD_EXTCAL_DEVISE2.' )', 'tarifs', 20, 20, $this->getVar('tarifs')), false); |
|
| 94 | 94 | |
| 95 | 95 | //$form->addElement( new \XoopsFormTextArea(_MD_EXTCAL_ETABLISSEMENT_MAP, 'map', $this->getVar("map"), 5, 40)); |
| 96 | 96 | $form->addElement(new \XoopsFormText(_MD_EXTCAL_ETABLISSEMENT_MAP, 'map', 150, 255, $this->getVar('map')), false); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | //Logo |
| 99 | 99 | $file_tray = new \XoopsFormElementTray(sprintf(_MD_EXTCAL_FORM_IMG, 2), ''); |
| 100 | 100 | if ('' != $this->getVar('logo')) { |
| 101 | - $file_tray->addElement(new \XoopsFormLabel('', "<img src='" . XOOPS_URL . '/uploads/extcal/etablissement/' . $this->getVar('logo') . "' name='image' id='image' alt=''><br><br>")); |
|
| 101 | + $file_tray->addElement(new \XoopsFormLabel('', "<img src='".XOOPS_URL.'/uploads/extcal/etablissement/'.$this->getVar('logo')."' name='image' id='image' alt=''><br><br>")); |
|
| 102 | 102 | $check_del_img = new \XoopsFormCheckBox('', 'delimg'); |
| 103 | 103 | $check_del_img->addOption(1, _MD_EXTCAL_DEL_IMG); |
| 104 | 104 | $file_tray->addElement($check_del_img); |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | $file_img->setExtra("size ='40'"); |
| 111 | 111 | $file_tray->addElement($file_img); |
| 112 | - $msg = sprintf(_MD_EXTCAL_IMG_CONFIG, (int)(3145728 / 1000), 500, 500); |
|
| 113 | - $file_label = new \XoopsFormLabel('', '<br>' . $msg); |
|
| 112 | + $msg = sprintf(_MD_EXTCAL_IMG_CONFIG, (int) (3145728 / 1000), 500, 500); |
|
| 113 | + $file_label = new \XoopsFormLabel('', '<br>'.$msg); |
|
| 114 | 114 | $file_tray->addElement($file_label); |
| 115 | 115 | $form->addElement($file_tray); |
| 116 | 116 | $form->addElement(new \XoopsFormHidden('file', $this->getVar('logo'))); |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 22 | 22 | |
| 23 | 23 | // require_once __DIR__ . '/ExtcalPersistableObjectHandler.php'; |
| 24 | -require_once XOOPS_ROOT_PATH . '/class/uploader.php'; |
|
| 24 | +require_once XOOPS_ROOT_PATH.'/class/uploader.php'; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Class File. |
@@ -21,8 +21,8 @@ |
||
| 21 | 21 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 22 | 22 | |
| 23 | 23 | // require_once __DIR__ . '/ExtcalPersistableObjectHandler.php'; |
| 24 | -require_once __DIR__ . '/perm.php'; |
|
| 25 | -require_once __DIR__ . '/time.php'; |
|
| 24 | +require_once __DIR__.'/perm.php'; |
|
| 25 | +require_once __DIR__.'/time.php'; |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Class Category. |
@@ -21,12 +21,12 @@ discard block |
||
| 21 | 21 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 22 | 22 | |
| 23 | 23 | // require_once __DIR__ . '/ExtcalPersistableObjectHandler.php'; |
| 24 | -require_once __DIR__ . '/perm.php'; |
|
| 25 | -require_once __DIR__ . '/time.php'; |
|
| 26 | -require_once __DIR__ . '/config.php'; |
|
| 27 | -require_once __DIR__ . '/ExtDateTime.php'; |
|
| 28 | -require_once __DIR__ . '/utility.php'; |
|
| 29 | -require_once __DIR__ . '/../include/constantes.php'; |
|
| 24 | +require_once __DIR__.'/perm.php'; |
|
| 25 | +require_once __DIR__.'/time.php'; |
|
| 26 | +require_once __DIR__.'/config.php'; |
|
| 27 | +require_once __DIR__.'/ExtDateTime.php'; |
|
| 28 | +require_once __DIR__.'/utility.php'; |
|
| 29 | +require_once __DIR__.'/../include/constantes.php'; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Class Event. |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $this->initVar('event_etablissement', XOBJ_DTYPE_INT, 5, false); |
| 68 | 68 | $this->initVar('event_icone', XOBJ_DTYPE_TXTBOX, '', false); |
| 69 | 69 | |
| 70 | - $this->externalKey['cat_id'] = [ |
|
| 70 | + $this->externalKey['cat_id'] = [ |
|
| 71 | 71 | 'className' => 'Category', |
| 72 | 72 | 'getMethodeName' => 'getCat', |
| 73 | 73 | 'keyName' => 'cat', |
@@ -35,33 +35,33 @@ |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | switch (@$_GET['view']) { |
| 38 | - default: |
|
| 39 | - $_GET['view'] = 'calendar_year'; |
|
| 40 | - // no break |
|
| 41 | - case 'calendar_year': |
|
| 42 | - require_once CALENDAR_ROOT . 'Year.php'; |
|
| 43 | - $c = new Calendar_Year($_GET['y']); |
|
| 44 | - break; |
|
| 45 | - case 'calendar_month': |
|
| 46 | - require_once CALENDAR_ROOT . 'Month.php'; |
|
| 47 | - $c = new Calendar_Month($_GET['y'], $_GET['m']); |
|
| 48 | - break; |
|
| 49 | - case 'calendar_day': |
|
| 50 | - require_once CALENDAR_ROOT . 'Day.php'; |
|
| 51 | - $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
|
| 52 | - break; |
|
| 53 | - case 'calendar_hour': |
|
| 54 | - require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 55 | - $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
|
| 56 | - break; |
|
| 57 | - case 'calendar_minute': |
|
| 58 | - require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 59 | - $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
|
| 60 | - break; |
|
| 61 | - case 'calendar_second': |
|
| 62 | - require_once CALENDAR_ROOT . 'Second.php'; |
|
| 63 | - $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
|
| 64 | - break; |
|
| 38 | + default: |
|
| 39 | + $_GET['view'] = 'calendar_year'; |
|
| 40 | + // no break |
|
| 41 | + case 'calendar_year': |
|
| 42 | + require_once CALENDAR_ROOT . 'Year.php'; |
|
| 43 | + $c = new Calendar_Year($_GET['y']); |
|
| 44 | + break; |
|
| 45 | + case 'calendar_month': |
|
| 46 | + require_once CALENDAR_ROOT . 'Month.php'; |
|
| 47 | + $c = new Calendar_Month($_GET['y'], $_GET['m']); |
|
| 48 | + break; |
|
| 49 | + case 'calendar_day': |
|
| 50 | + require_once CALENDAR_ROOT . 'Day.php'; |
|
| 51 | + $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
|
| 52 | + break; |
|
| 53 | + case 'calendar_hour': |
|
| 54 | + require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 55 | + $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
|
| 56 | + break; |
|
| 57 | + case 'calendar_minute': |
|
| 58 | + require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 59 | + $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
|
| 60 | + break; |
|
| 61 | + case 'calendar_second': |
|
| 62 | + require_once CALENDAR_ROOT . 'Second.php'; |
|
| 63 | + $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
|
| 64 | + break; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | 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') { |
@@ -39,33 +39,33 @@ discard block |
||
| 39 | 39 | $_GET['view'] = 'calendar_year'; |
| 40 | 40 | // no break |
| 41 | 41 | case 'calendar_year': |
| 42 | - require_once CALENDAR_ROOT . 'Year.php'; |
|
| 42 | + require_once CALENDAR_ROOT.'Year.php'; |
|
| 43 | 43 | $c = new Calendar_Year($_GET['y']); |
| 44 | 44 | break; |
| 45 | 45 | case 'calendar_month': |
| 46 | - require_once CALENDAR_ROOT . 'Month.php'; |
|
| 46 | + require_once CALENDAR_ROOT.'Month.php'; |
|
| 47 | 47 | $c = new Calendar_Month($_GET['y'], $_GET['m']); |
| 48 | 48 | break; |
| 49 | 49 | case 'calendar_day': |
| 50 | - require_once CALENDAR_ROOT . 'Day.php'; |
|
| 50 | + require_once CALENDAR_ROOT.'Day.php'; |
|
| 51 | 51 | $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
| 52 | 52 | break; |
| 53 | 53 | case 'calendar_hour': |
| 54 | - require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 54 | + require_once CALENDAR_ROOT.'Hour.php'; |
|
| 55 | 55 | $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
| 56 | 56 | break; |
| 57 | 57 | case 'calendar_minute': |
| 58 | - require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 58 | + require_once CALENDAR_ROOT.'Minute.php'; |
|
| 59 | 59 | $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
| 60 | 60 | break; |
| 61 | 61 | case 'calendar_second': |
| 62 | - require_once CALENDAR_ROOT . 'Second.php'; |
|
| 62 | + require_once CALENDAR_ROOT.'Second.php'; |
|
| 63 | 63 | $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
| 64 | 64 | break; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | -echo 'Viewing: ' . @$_GET['view'] . '<br>'; |
|
| 68 | -echo 'The time is now: ' . date('Y M d H:i:s', $c->getTimestamp()) . '<br >'; |
|
| 67 | +echo 'Viewing: '.@$_GET['view'].'<br>'; |
|
| 68 | +echo 'The time is now: '.date('Y M d H:i:s', $c->getTimestamp()).'<br >'; |
|
| 69 | 69 | |
| 70 | 70 | $i = 1; |
| 71 | 71 | echo '<h1>First Iteration</h1>'; |
@@ -75,15 +75,15 @@ discard block |
||
| 75 | 75 | $c->build(); |
| 76 | 76 | while ($e = $c->fetch()) { |
| 77 | 77 | $class = strtolower(get_class($e)); |
| 78 | - $link = '&y=' . $e->thisYear() . '&m=' . $e->thisMonth() . '&d=' . $e->thisDay() . '&h=' . $e->thisHour() . '&i=' . $e->thisMinute() . '&s=' . $e->thisSecond(); |
|
| 79 | - $method = 'this' . str_replace('calendar_', '', $class); |
|
| 80 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $class . $link . '">' . $e->{$method}() . '</a> : '; |
|
| 78 | + $link = '&y='.$e->thisYear().'&m='.$e->thisMonth().'&d='.$e->thisDay().'&h='.$e->thisHour().'&i='.$e->thisMinute().'&s='.$e->thisSecond(); |
|
| 79 | + $method = 'this'.str_replace('calendar_', '', $class); |
|
| 80 | + echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$class.$link.'">'.$e->{$method}().'</a> : '; |
|
| 81 | 81 | if (0 == ($i % 10)) { |
| 82 | 82 | echo '<br>'; |
| 83 | 83 | } |
| 84 | 84 | ++$i; |
| 85 | 85 | } |
| 86 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
| 86 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
| 87 | 87 | |
| 88 | 88 | $i = 1; |
| 89 | 89 | echo '<h1>Second Iteration</h1>'; |
@@ -92,12 +92,12 @@ discard block |
||
| 92 | 92 | $start = getmicrotime(); |
| 93 | 93 | while ($e = $c->fetch()) { |
| 94 | 94 | $class = strtolower(get_class($e)); |
| 95 | - $link = '&y=' . $e->thisYear() . '&m=' . $e->thisMonth() . '&d=' . $e->thisDay() . '&h=' . $e->thisHour() . '&i=' . $e->thisMinute() . '&s=' . $e->thisSecond(); |
|
| 96 | - $method = 'this' . str_replace('calendar_', '', $class); |
|
| 97 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $class . $link . '">' . $e->{$method}() . '</a> : '; |
|
| 95 | + $link = '&y='.$e->thisYear().'&m='.$e->thisMonth().'&d='.$e->thisDay().'&h='.$e->thisHour().'&i='.$e->thisMinute().'&s='.$e->thisSecond(); |
|
| 96 | + $method = 'this'.str_replace('calendar_', '', $class); |
|
| 97 | + echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$class.$link.'">'.$e->{$method}().'</a> : '; |
|
| 98 | 98 | if (0 == ($i % 10)) { |
| 99 | 99 | echo '<br>'; |
| 100 | 100 | } |
| 101 | 101 | ++$i; |
| 102 | 102 | } |
| 103 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
| 103 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
@@ -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 | $start = getmicrotime(); |
@@ -16,8 +16,8 @@ discard block |
||
| 16 | 16 | if (!@include 'Calendar/Calendar.php') { |
| 17 | 17 | define('CALENDAR_ROOT', '../../'); |
| 18 | 18 | } |
| 19 | -require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
| 20 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 19 | +require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
| 20 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 21 | 21 | |
| 22 | 22 | if (!isset($_GET['y'])) { |
| 23 | 23 | $_GET['y'] = date('Y'); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | <anchor> |
| 49 | 49 | Back to Month View |
| 50 | 50 | <go href="<?php |
| 51 | - echo '?y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay() . '&mime=wml'; ?>"> |
|
| 51 | + echo '?y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay().'&mime=wml'; ?>"> |
|
| 52 | 52 | </anchor> |
| 53 | 53 | </p> |
| 54 | 54 | <table> |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $Day->build(); |
| 57 | 57 | while ($Hour = $Day->fetch()) { |
| 58 | 58 | echo "<tr>\n"; |
| 59 | - echo '<td>' . date('g a', $Hour->getTimestamp()) . "</td><td>Free time!</td>\n"; |
|
| 59 | + echo '<td>'.date('g a', $Hour->getTimestamp())."</td><td>Free time!</td>\n"; |
|
| 60 | 60 | echo "</tr>\n"; |
| 61 | 61 | } ?> |
| 62 | 62 | </table> |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | if ($Day->isEmpty()) { |
| 84 | 84 | echo "<td></td>\n"; |
| 85 | 85 | } elseif ($Day->isSelected()) { |
| 86 | - echo '<td><anchor><strong><u>' . $Day->thisDay() . "</u></strong>\n<go href=\"" . $_SERVER['PHP_SELF'] . '?viewday=true&y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay() . "&mime=wml\">\n</anchor></td>\n"; |
|
| 86 | + echo '<td><anchor><strong><u>'.$Day->thisDay()."</u></strong>\n<go href=\"".$_SERVER['PHP_SELF'].'?viewday=true&y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay()."&mime=wml\">\n</anchor></td>\n"; |
|
| 87 | 87 | } else { |
| 88 | - echo '<td><anchor>' . $Day->thisDay() . "\n<go href=\"?viewday=true&y=" . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay() . "&mime=wml\"></anchor></td>\n"; |
|
| 88 | + echo '<td><anchor>'.$Day->thisDay()."\n<go href=\"?viewday=true&y=".$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay()."&mime=wml\"></anchor></td>\n"; |
|
| 89 | 89 | } |
| 90 | 90 | if ($Day->isLast()) { |
| 91 | 91 | echo "</tr>\n"; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | <anchor> |
| 97 | 97 | << |
| 98 | 98 | <go href="<?php |
| 99 | - echo '?y=' . $Month->thisYear() . '&m=' . $Month->prevMonth() . '&d=' . $Month->thisDay() . '&mime=wml'; ?>"> |
|
| 99 | + echo '?y='.$Month->thisYear().'&m='.$Month->prevMonth().'&d='.$Month->thisDay().'&mime=wml'; ?>"> |
|
| 100 | 100 | </anchor> |
| 101 | 101 | </td> |
| 102 | 102 | <td></td> |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | <anchor> |
| 109 | 109 | >> |
| 110 | 110 | <go href="<?php |
| 111 | - echo '?y=' . $Month->thisYear() . '&m=' . $Month->nextMonth() . '&d=' . $Month->thisDay() . '&mime=wml'; ?>"> |
|
| 111 | + echo '?y='.$Month->thisYear().'&m='.$Month->nextMonth().'&d='.$Month->thisDay().'&mime=wml'; ?>"> |
|
| 112 | 112 | </anchor> |
| 113 | 113 | </td> |
| 114 | 114 | </tr> |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | <?php |
| 118 | 118 | } ?> |
| 119 | 119 | <p><a href="<?php echo $_SERVER['PHP_SELF']; ?>">Back to HTML</a></p> |
| 120 | - <?php echo '<p>Took: ' . (getmicrotime() - $start) . ' seconds</p>'; ?> |
|
| 120 | + <?php echo '<p>Took: '.(getmicrotime() - $start).' seconds</p>'; ?> |
|
| 121 | 121 | </wml> |
| 122 | 122 | <?php |
| 123 | 123 | #-----------------------------------------------------------------------------# |
@@ -141,14 +141,14 @@ discard block |
||
| 141 | 141 | <p> |
| 142 | 142 | <anchor> |
| 143 | 143 | <a href="<?php |
| 144 | - echo '?y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay(); ?>">Back to Month View</a> |
|
| 144 | + echo '?y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay(); ?>">Back to Month View</a> |
|
| 145 | 145 | </p> |
| 146 | 146 | <table> |
| 147 | 147 | <?php |
| 148 | 148 | $Day->build(); |
| 149 | 149 | while ($Hour = $Day->fetch()) { |
| 150 | 150 | echo "<tr>\n"; |
| 151 | - echo '<td>' . date('g a', $Hour->getTimestamp()) . "</td><td>Free time!</td>\n"; |
|
| 151 | + echo '<td>'.date('g a', $Hour->getTimestamp())."</td><td>Free time!</td>\n"; |
|
| 152 | 152 | echo "</tr>\n"; |
| 153 | 153 | } ?> |
| 154 | 154 | </table> |
@@ -175,9 +175,9 @@ discard block |
||
| 175 | 175 | if ($Day->isEmpty()) { |
| 176 | 176 | echo "<td></td>\n"; |
| 177 | 177 | } elseif ($Day->isSelected()) { |
| 178 | - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?viewday=true&y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay() . '&wml"><strong><u>' . $Day->thisDay() . "</u></strong></a></td>\n"; |
|
| 178 | + echo '<td><a href="'.$_SERVER['PHP_SELF'].'?viewday=true&y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay().'&wml"><strong><u>'.$Day->thisDay()."</u></strong></a></td>\n"; |
|
| 179 | 179 | } else { |
| 180 | - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?viewday=true&y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay() . '">' . $Day->thisDay() . "</a></td>\n"; |
|
| 180 | + echo '<td><a href="'.$_SERVER['PHP_SELF'].'?viewday=true&y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay().'">'.$Day->thisDay()."</a></td>\n"; |
|
| 181 | 181 | } |
| 182 | 182 | if ($Day->isLast()) { |
| 183 | 183 | echo "</tr>\n"; |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | <tr> |
| 187 | 187 | <td> |
| 188 | 188 | <a href="<?php |
| 189 | - echo '?y=' . $Month->thisYear() . '&m=' . $Month->prevMonth() . '&d=' . $Month->thisDay(); ?>"> |
|
| 189 | + echo '?y='.$Month->thisYear().'&m='.$Month->prevMonth().'&d='.$Month->thisDay(); ?>"> |
|
| 190 | 190 | <<</a> |
| 191 | 191 | </td> |
| 192 | 192 | <td></td> |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | <td></td> |
| 197 | 197 | <td> |
| 198 | 198 | <a href="<?php |
| 199 | - echo '?y=' . $Month->thisYear() . '&m=' . $Month->nextMonth() . '&d=' . $Month->thisDay(); ?>">>></a> |
|
| 199 | + echo '?y='.$Month->thisYear().'&m='.$Month->nextMonth().'&d='.$Month->thisDay(); ?>">>></a> |
|
| 200 | 200 | </td> |
| 201 | 201 | </tr> |
| 202 | 202 | </table> |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | <?php |
| 205 | 205 | } ?> |
| 206 | 206 | |
| 207 | - <?php echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; ?> |
|
| 207 | + <?php echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; ?> |
|
| 208 | 208 | </body> |
| 209 | 209 | </html> |
| 210 | 210 | <?php |
@@ -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,12 +15,12 @@ discard block |
||
| 15 | 15 | if (!@include 'Calendar/Calendar.php') { |
| 16 | 16 | define('CALENDAR_ROOT', '../../'); |
| 17 | 17 | } |
| 18 | -require_once CALENDAR_ROOT . 'Year.php'; |
|
| 19 | -require_once CALENDAR_ROOT . 'Month.php'; |
|
| 20 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 21 | -require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 22 | -require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 23 | -require_once CALENDAR_ROOT . 'Second.php'; |
|
| 18 | +require_once CALENDAR_ROOT.'Year.php'; |
|
| 19 | +require_once CALENDAR_ROOT.'Month.php'; |
|
| 20 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 21 | +require_once CALENDAR_ROOT.'Hour.php'; |
|
| 22 | +require_once CALENDAR_ROOT.'Minute.php'; |
|
| 23 | +require_once CALENDAR_ROOT.'Second.php'; |
|
| 24 | 24 | |
| 25 | 25 | // Initialize if not set |
| 26 | 26 | if (!isset($_POST['y'])) { |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | if (isset($_POST['update'])) { |
| 54 | 54 | $Second = new Calendar_Second($_POST['y'], $_POST['m'], $_POST['d'], $_POST['h'], $_POST['i'], $_POST['s']); |
| 55 | 55 | if (!$Second->isValid()) { |
| 56 | - $V =& $Second->getValidator(); |
|
| 56 | + $V = & $Second->getValidator(); |
|
| 57 | 57 | echo '<p>Validation failed:</p>'; |
| 58 | 58 | while ($error = $V->fetch()) { |
| 59 | - echo $error->toString() . '<br>'; |
|
| 59 | + echo $error->toString().'<br>'; |
|
| 60 | 60 | } |
| 61 | 61 | } else { |
| 62 | 62 | echo '<p>Validation success.</p>'; |
| 63 | - echo '<p>New timestamp is: ' . $Second->getTimestamp() . ' which could be used to update a database, for example'; |
|
| 63 | + echo '<p>New timestamp is: '.$Second->getTimestamp().' which could be used to update a database, for example'; |
|
| 64 | 64 | } |
| 65 | 65 | } else { |
| 66 | 66 | $Year = new Calendar_Year($_POST['y']); |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | $Year->build($selection); |
| 79 | 79 | while ($Child = $Year->fetch()) { |
| 80 | 80 | if ($Child->isSelected()) { |
| 81 | - echo '<option value="' . $Child->thisMonth() . '" selected>' . $Child->thisMonth() . "\n"; |
|
| 81 | + echo '<option value="'.$Child->thisMonth().'" selected>'.$Child->thisMonth()."\n"; |
|
| 82 | 82 | } else { |
| 83 | - echo '<option value="' . $Child->thisMonth() . '">' . $Child->thisMonth() . "\n"; |
|
| 83 | + echo '<option value="'.$Child->thisMonth().'">'.$Child->thisMonth()."\n"; |
|
| 84 | 84 | } |
| 85 | 85 | } ?> |
| 86 | 86 | </select> |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | $Month->build($selection); |
| 91 | 91 | while ($Child = $Month->fetch()) { |
| 92 | 92 | if ($Child->isSelected()) { |
| 93 | - echo '<option value="' . $Child->thisDay() . '" selected>' . $Child->thisDay() . "\n"; |
|
| 93 | + echo '<option value="'.$Child->thisDay().'" selected>'.$Child->thisDay()."\n"; |
|
| 94 | 94 | } else { |
| 95 | - echo '<option value="' . $Child->thisDay() . '">' . $Child->thisDay() . "\n"; |
|
| 95 | + echo '<option value="'.$Child->thisDay().'">'.$Child->thisDay()."\n"; |
|
| 96 | 96 | } |
| 97 | 97 | } ?> |
| 98 | 98 | </select> |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | $Day->build($selection); |
| 103 | 103 | while ($Child = $Day->fetch()) { |
| 104 | 104 | if ($Child->isSelected()) { |
| 105 | - echo '<option value="' . $Child->thisHour() . '" selected>' . $Child->thisHour() . "\n"; |
|
| 105 | + echo '<option value="'.$Child->thisHour().'" selected>'.$Child->thisHour()."\n"; |
|
| 106 | 106 | } else { |
| 107 | - echo '<option value="' . $Child->thisHour() . '">' . $Child->thisHour() . "\n"; |
|
| 107 | + echo '<option value="'.$Child->thisHour().'">'.$Child->thisHour()."\n"; |
|
| 108 | 108 | } |
| 109 | 109 | } ?> |
| 110 | 110 | </select> |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | $Hour->build($selection); |
| 115 | 115 | while ($Child = $Hour->fetch()) { |
| 116 | 116 | if ($Child->isSelected()) { |
| 117 | - echo '<option value="' . $Child->thisMinute() . '" selected>' . $Child->thisMinute() . "\n"; |
|
| 117 | + echo '<option value="'.$Child->thisMinute().'" selected>'.$Child->thisMinute()."\n"; |
|
| 118 | 118 | } else { |
| 119 | - echo '<option value="' . $Child->thisMinute() . '">' . $Child->thisMinute() . "\n"; |
|
| 119 | + echo '<option value="'.$Child->thisMinute().'">'.$Child->thisMinute()."\n"; |
|
| 120 | 120 | } |
| 121 | 121 | } ?> |
| 122 | 122 | </select> |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | $Minute->build($selection); |
| 127 | 127 | while ($Child = $Minute->fetch()) { |
| 128 | 128 | if ($Child->isSelected()) { |
| 129 | - echo '<option value="' . $Child->thisSecond() . '" selected>' . $Child->thisSecond() . "\n"; |
|
| 129 | + echo '<option value="'.$Child->thisSecond().'" selected>'.$Child->thisSecond()."\n"; |
|
| 130 | 130 | } else { |
| 131 | - echo '<option value="' . $Child->thisSecond() . '">' . $Child->thisSecond() . "\n"; |
|
| 131 | + echo '<option value="'.$Child->thisSecond().'">'.$Child->thisSecond()."\n"; |
|
| 132 | 132 | } |
| 133 | 133 | } ?> |
| 134 | 134 | </select> |
@@ -136,6 +136,6 @@ discard block |
||
| 136 | 136 | <?php |
| 137 | 137 | } |
| 138 | 138 | ?> |
| 139 | - <?php echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; ?> |
|
| 139 | + <?php echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; ?> |
|
| 140 | 140 | </body> |
| 141 | 141 | </html> |
@@ -39,33 +39,33 @@ |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | switch (@$_GET['view']) { |
| 42 | - default: |
|
| 43 | - $_GET['view'] = 'calendar_year'; |
|
| 44 | - // no break |
|
| 45 | - case 'calendar_year': |
|
| 46 | - require_once CALENDAR_ROOT . 'Year.php'; |
|
| 47 | - $c = new Calendar_Year($_GET['y']); |
|
| 48 | - break; |
|
| 49 | - case 'calendar_month': |
|
| 50 | - require_once CALENDAR_ROOT . 'Month.php'; |
|
| 51 | - $c = new Calendar_Month($_GET['y'], $_GET['m']); |
|
| 52 | - break; |
|
| 53 | - case 'calendar_day': |
|
| 54 | - require_once CALENDAR_ROOT . 'Day.php'; |
|
| 55 | - $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
|
| 56 | - break; |
|
| 57 | - case 'calendar_hour': |
|
| 58 | - require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 59 | - $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
|
| 60 | - break; |
|
| 61 | - case 'calendar_minute': |
|
| 62 | - require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 63 | - $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
|
| 64 | - break; |
|
| 65 | - case 'calendar_second': |
|
| 66 | - require_once CALENDAR_ROOT . 'Second.php'; |
|
| 67 | - $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
|
| 68 | - break; |
|
| 42 | + default: |
|
| 43 | + $_GET['view'] = 'calendar_year'; |
|
| 44 | + // no break |
|
| 45 | + case 'calendar_year': |
|
| 46 | + require_once CALENDAR_ROOT . 'Year.php'; |
|
| 47 | + $c = new Calendar_Year($_GET['y']); |
|
| 48 | + break; |
|
| 49 | + case 'calendar_month': |
|
| 50 | + require_once CALENDAR_ROOT . 'Month.php'; |
|
| 51 | + $c = new Calendar_Month($_GET['y'], $_GET['m']); |
|
| 52 | + break; |
|
| 53 | + case 'calendar_day': |
|
| 54 | + require_once CALENDAR_ROOT . 'Day.php'; |
|
| 55 | + $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
|
| 56 | + break; |
|
| 57 | + case 'calendar_hour': |
|
| 58 | + require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 59 | + $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
|
| 60 | + break; |
|
| 61 | + case 'calendar_minute': |
|
| 62 | + require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 63 | + $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
|
| 64 | + break; |
|
| 65 | + case 'calendar_second': |
|
| 66 | + require_once CALENDAR_ROOT . 'Second.php'; |
|
| 67 | + $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
|
| 68 | + break; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // Convert timestamp to human readable date |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | { |
| 10 | 10 | list($usec, $sec) = explode(' ', microtime()); |
| 11 | 11 | |
| 12 | - return (float)$usec + (float)$sec; |
|
| 12 | + return (float) $usec + (float) $sec; |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | // Switch to PEAR::Date engine |
@@ -43,27 +43,27 @@ discard block |
||
| 43 | 43 | $_GET['view'] = 'calendar_year'; |
| 44 | 44 | // no break |
| 45 | 45 | case 'calendar_year': |
| 46 | - require_once CALENDAR_ROOT . 'Year.php'; |
|
| 46 | + require_once CALENDAR_ROOT.'Year.php'; |
|
| 47 | 47 | $c = new Calendar_Year($_GET['y']); |
| 48 | 48 | break; |
| 49 | 49 | case 'calendar_month': |
| 50 | - require_once CALENDAR_ROOT . 'Month.php'; |
|
| 50 | + require_once CALENDAR_ROOT.'Month.php'; |
|
| 51 | 51 | $c = new Calendar_Month($_GET['y'], $_GET['m']); |
| 52 | 52 | break; |
| 53 | 53 | case 'calendar_day': |
| 54 | - require_once CALENDAR_ROOT . 'Day.php'; |
|
| 54 | + require_once CALENDAR_ROOT.'Day.php'; |
|
| 55 | 55 | $c = new Calendar_Day($_GET['y'], $_GET['m'], $_GET['d']); |
| 56 | 56 | break; |
| 57 | 57 | case 'calendar_hour': |
| 58 | - require_once CALENDAR_ROOT . 'Hour.php'; |
|
| 58 | + require_once CALENDAR_ROOT.'Hour.php'; |
|
| 59 | 59 | $c = new Calendar_Hour($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h']); |
| 60 | 60 | break; |
| 61 | 61 | case 'calendar_minute': |
| 62 | - require_once CALENDAR_ROOT . 'Minute.php'; |
|
| 62 | + require_once CALENDAR_ROOT.'Minute.php'; |
|
| 63 | 63 | $c = new Calendar_Minute($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i']); |
| 64 | 64 | break; |
| 65 | 65 | case 'calendar_second': |
| 66 | - require_once CALENDAR_ROOT . 'Second.php'; |
|
| 66 | + require_once CALENDAR_ROOT.'Second.php'; |
|
| 67 | 67 | $c = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
| 68 | 68 | break; |
| 69 | 69 | } |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | $date = new Date($c->getTimestamp()); |
| 73 | 73 | |
| 74 | 74 | echo '<h1>Using PEAR::Date engine</h1>'; |
| 75 | -echo 'Viewing: ' . @$_GET['view'] . '<br>'; |
|
| 76 | -echo 'The time is now: ' . $date->format('%Y %a %e %T') . '<br >'; |
|
| 75 | +echo 'Viewing: '.@$_GET['view'].'<br>'; |
|
| 76 | +echo 'The time is now: '.$date->format('%Y %a %e %T').'<br >'; |
|
| 77 | 77 | |
| 78 | 78 | $i = 1; |
| 79 | 79 | echo '<h1>First Iteration</h1>'; |
@@ -83,15 +83,15 @@ discard block |
||
| 83 | 83 | $c->build(); |
| 84 | 84 | while ($e = $c->fetch()) { |
| 85 | 85 | $class = strtolower(get_class($e)); |
| 86 | - $link = '&y=' . $e->thisYear() . '&m=' . $e->thisMonth() . '&d=' . $e->thisDay() . '&h=' . $e->thisHour() . '&i=' . $e->thisMinute() . '&s=' . $e->thisSecond(); |
|
| 87 | - $method = 'this' . str_replace('calendar_', '', $class); |
|
| 88 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $class . $link . '">' . $e->{$method}() . '</a> : '; |
|
| 86 | + $link = '&y='.$e->thisYear().'&m='.$e->thisMonth().'&d='.$e->thisDay().'&h='.$e->thisHour().'&i='.$e->thisMinute().'&s='.$e->thisSecond(); |
|
| 87 | + $method = 'this'.str_replace('calendar_', '', $class); |
|
| 88 | + echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$class.$link.'">'.$e->{$method}().'</a> : '; |
|
| 89 | 89 | if (0 == ($i % 10)) { |
| 90 | 90 | echo '<br>'; |
| 91 | 91 | } |
| 92 | 92 | ++$i; |
| 93 | 93 | } |
| 94 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
| 94 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
| 95 | 95 | |
| 96 | 96 | $i = 1; |
| 97 | 97 | echo '<h1>Second Iteration</h1>'; |
@@ -100,12 +100,12 @@ discard block |
||
| 100 | 100 | $start = getmicrotime(); |
| 101 | 101 | while ($e = $c->fetch()) { |
| 102 | 102 | $class = strtolower(get_class($e)); |
| 103 | - $link = '&y=' . $e->thisYear() . '&m=' . $e->thisMonth() . '&d=' . $e->thisDay() . '&h=' . $e->thisHour() . '&i=' . $e->thisMinute() . '&s=' . $e->thisSecond(); |
|
| 104 | - $method = 'this' . str_replace('calendar_', '', $class); |
|
| 105 | - echo '<a href="' . $_SERVER['PHP_SELF'] . '?view=' . $class . $link . '">' . $e->{$method}() . '</a> : '; |
|
| 103 | + $link = '&y='.$e->thisYear().'&m='.$e->thisMonth().'&d='.$e->thisDay().'&h='.$e->thisHour().'&i='.$e->thisMinute().'&s='.$e->thisSecond(); |
|
| 104 | + $method = 'this'.str_replace('calendar_', '', $class); |
|
| 105 | + echo '<a href="'.$_SERVER['PHP_SELF'].'?view='.$class.$link.'">'.$e->{$method}().'</a> : '; |
|
| 106 | 106 | if (0 == ($i % 10)) { |
| 107 | 107 | echo '<br>'; |
| 108 | 108 | } |
| 109 | 109 | ++$i; |
| 110 | 110 | } |
| 111 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
| 111 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|