@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ->limit(10) |
| 66 | 66 | ->fetchAll(); |
| 67 | 67 | |
| 68 | - if(!$blocks){ |
|
| 68 | + if(!$blocks) { |
|
| 69 | 69 | $html = ""; |
| 70 | 70 | } else { |
| 71 | 71 | /* |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $checked_flag = false; |
| 82 | 82 | $html_input = ""; |
| 83 | - foreach($blocks as $data){ |
|
| 83 | + foreach($blocks as $data) { |
|
| 84 | 84 | // full program capacity with visitors |
| 85 | 85 | $fullProgramData = $this->database |
| 86 | 86 | ->query('SELECT COUNT(visitor) AS visitors FROM `kk_visitor-program` AS visprog |
@@ -94,21 +94,21 @@ discard block |
||
| 94 | 94 | ->where('program ? AND visitor ?', $data['id'], $vid) |
| 95 | 95 | ->fetch(); |
| 96 | 96 | |
| 97 | - if($program){ |
|
| 97 | + if($program) { |
|
| 98 | 98 | $checked = "checked='checked'"; |
| 99 | 99 | $checked_flag = true; |
| 100 | 100 | } else { |
| 101 | 101 | $checked = ""; |
| 102 | 102 | } |
| 103 | 103 | // if the capacity is full |
| 104 | - if($fullProgramData['visitors'] >= $data['capacity']){ |
|
| 105 | - $html_input .= "<input id='".$data['id'].$blockId."' ".$checked." disabled type='radio' name='blck_".$blockId."' value='".$data['id']."' />\n"; |
|
| 104 | + if($fullProgramData['visitors'] >= $data['capacity']) { |
|
| 105 | + $html_input .= "<input id='" . $data['id'] . $blockId . "' " . $checked . " disabled type='radio' name='blck_" . $blockId . "' value='" . $data['id'] . "' />\n"; |
|
| 106 | 106 | $fullProgramInfo = " (NELZE ZAPSAT - kapacita programu je již naplněna!)"; |
| 107 | 107 | } else { |
| 108 | - $html_input .= "<input id='".$data['id'].$blockId."' ".$checked." type='radio' name='blck_".$blockId."' value='".$data['id']."' /> \n"; |
|
| 108 | + $html_input .= "<input id='" . $data['id'] . $blockId . "' " . $checked . " type='radio' name='blck_" . $blockId . "' value='" . $data['id'] . "' /> \n"; |
|
| 109 | 109 | $fullProgramInfo = ""; |
| 110 | 110 | } |
| 111 | - $html_input .= '<label for="'.$data['id'].$blockId.'">'.$data['name'].'</label>'; |
|
| 111 | + $html_input .= '<label for="' . $data['id'] . $blockId . '">' . $data['name'] . '</label>'; |
|
| 112 | 112 | $html_input .= $fullProgramInfo; |
| 113 | 113 | $html_input .= "<br />\n"; |
| 114 | 114 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | if(!$checked_flag) $checked = "checked='checked'"; |
| 118 | 118 | else $checked = ""; |
| 119 | 119 | |
| 120 | - $html .= "<input ".$checked." type='radio' name='blck_".$blockId."' value='0' /> Nebudu přítomen <br />\n"; |
|
| 120 | + $html .= "<input " . $checked . " type='radio' name='blck_" . $blockId . "' value='0' /> Nebudu přítomen <br />\n"; |
|
| 121 | 121 | $html .= $html_input; |
| 122 | 122 | |
| 123 | 123 | $html .= "</div>\n"; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $html = ""; |
| 139 | 139 | } else { |
| 140 | 140 | $html = "<table>\n"; |
| 141 | - foreach($exportPrograms as $data){ |
|
| 141 | + foreach($exportPrograms as $data) { |
|
| 142 | 142 | $html .= "<tr>"; |
| 143 | 143 | //// resim kapacitu programu a jeho naplneni navstevniky |
| 144 | 144 | $fullProgramData = $this->database |
@@ -149,16 +149,16 @@ discard block |
||
| 149 | 149 | AND vis.deleted = ?', |
| 150 | 150 | $data['id'], '0')->fetch(); |
| 151 | 151 | |
| 152 | - if($fullProgramData['visitors'] >= $data['capacity']){ |
|
| 152 | + if($fullProgramData['visitors'] >= $data['capacity']) { |
|
| 153 | 153 | //$html .= "<input disabled type='radio' name='".$id."' value='".$data['id']."' />\n"; |
| 154 | - $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>".$fullProgramData['visitors']."/".$data['capacity']."</span> (kapacita programu je naplněna!)"; |
|
| 154 | + $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>" . $fullProgramData['visitors'] . "/" . $data['capacity'] . "</span> (kapacita programu je naplněna!)"; |
|
| 155 | 155 | } |
| 156 | 156 | else { |
| 157 | 157 | //$html .= "<input type='radio' name='".$id."' value='".$data['id']."' /> \n"; |
| 158 | - $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>".$fullProgramData['visitors']."/".$data['capacity']."</span>"; |
|
| 158 | + $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>" . $fullProgramData['visitors'] . "/" . $data['capacity'] . "</span>"; |
|
| 159 | 159 | } |
| 160 | 160 | $html .= "<td style='min-width:270px;'>"; |
| 161 | - $html .= "<a rel='programDetail' href='".PRJ_DIR."program/?id=".$data['id']."&cms=edit&page=export' title='".$data['name']."'>".$data['name']."</a>\n"; |
|
| 161 | + $html .= "<a rel='programDetail' href='" . PRJ_DIR . "program/?id=" . $data['id'] . "&cms=edit&page=export' title='" . $data['name'] . "'>" . $data['name'] . "</a>\n"; |
|
| 162 | 162 | $html .= "</td>"; |
| 163 | 163 | $html .= "<td>"; |
| 164 | 164 | $html .= $fullProgramInfo; |
@@ -188,13 +188,13 @@ discard block |
||
| 188 | 188 | ->order('day ASC, from ASC') |
| 189 | 189 | ->fetchAll(); |
| 190 | 190 | |
| 191 | - if(!$progSql){ |
|
| 191 | + if(!$progSql) { |
|
| 192 | 192 | $programs .= "<div class='emptyTable' style='width:400px;'>Nejsou žádná aktuální data.</div>\n"; |
| 193 | 193 | } else { |
| 194 | 194 | //// prasarnicka kvuli programu raftu - resim obsazenost dohromady u dvou polozek |
| 195 | 195 | //$raftCountSql = "SELECT COUNT(visitor) AS raft FROM `kk_visitor-program` WHERE program='56|57'"; |
| 196 | 196 | |
| 197 | - foreach($progSql as $progData){ |
|
| 197 | + foreach($progSql as $progData) { |
|
| 198 | 198 | //nemoznost volit predsnemovni dikusi |
| 199 | 199 | if($progData['id'] == 63) $notDisplayed = "style='display:none;'"; |
| 200 | 200 | //obsazenost raftu |
@@ -205,8 +205,8 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | */ |
| 207 | 207 | else $notDisplayed = ""; |
| 208 | - $programs .= "<div ".$notDisplayed.">".$progData['day'].", ".$progData['from']." - ".$progData['to']." : ".$progData['name']."</div>\n"; |
|
| 209 | - if($progData['program'] == 1) $programs .= "<div ".$notDisplayed.">".$this->getExportPrograms($progData['id'])."</div>"; |
|
| 208 | + $programs .= "<div " . $notDisplayed . ">" . $progData['day'] . ", " . $progData['from'] . " - " . $progData['to'] . " : " . $progData['name'] . "</div>\n"; |
|
| 209 | + if($progData['program'] == 1) $programs .= "<div " . $notDisplayed . ">" . $this->getExportPrograms($progData['id']) . "</div>"; |
|
| 210 | 210 | $programs .= "<br />"; |
| 211 | 211 | } |
| 212 | 212 | } |
@@ -307,20 +307,20 @@ discard block |
||
| 307 | 307 | ->fetchAll(); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - public static function getPdfPrograms($id, $vid, $database){ |
|
| 310 | + public static function getPdfPrograms($id, $vid, $database) { |
|
| 311 | 311 | $result = $database |
| 312 | 312 | ->table('kk_programs') |
| 313 | 313 | ->where('block ? AND deleted ?', $id, '0') |
| 314 | 314 | ->limit(10) |
| 315 | 315 | ->fetchAll(); |
| 316 | 316 | |
| 317 | - if(!$result){ |
|
| 317 | + if(!$result) { |
|
| 318 | 318 | $html = ""; |
| 319 | 319 | } else { |
| 320 | 320 | |
| 321 | 321 | $html = "<div class='program'>\n"; |
| 322 | 322 | |
| 323 | - foreach($result as $data){ |
|
| 323 | + foreach($result as $data) { |
|
| 324 | 324 | $rows = $database |
| 325 | 325 | ->table('kk_visitor-program') |
| 326 | 326 | ->where('program ? AND visitor ?', $data->id, $vid) |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | return $html; |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | - public function getProgramsLarge($id){ |
|
| 336 | + public function getProgramsLarge($id) { |
|
| 337 | 337 | $result = $this->database |
| 338 | 338 | ->query('SELECT progs.name AS name, |
| 339 | 339 | cat.style AS style |
@@ -347,8 +347,8 @@ discard block |
||
| 347 | 347 | else { |
| 348 | 348 | $html = "<table>"; |
| 349 | 349 | $html .= " <tr>"; |
| 350 | - foreach($result as $data){ |
|
| 351 | - $html .= "<td class='category cat-".$data['style']."' >".$data['name']."</td>\n"; |
|
| 350 | + foreach($result as $data) { |
|
| 351 | + $html .= "<td class='category cat-" . $data['style'] . "' >" . $data['name'] . "</td>\n"; |
|
| 352 | 352 | } |
| 353 | 353 | $html .= " </tr>\n"; |
| 354 | 354 | $html .= "</table>\n"; |
@@ -369,8 +369,8 @@ discard block |
||
| 369 | 369 | |
| 370 | 370 | if(!$result) $html = ""; |
| 371 | 371 | else { |
| 372 | - foreach($result as $data){ |
|
| 373 | - $html .= $data['name'].",\n"; |
|
| 372 | + foreach($result as $data) { |
|
| 373 | + $html .= $data['name'] . ",\n"; |
|
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | return $html; |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | $formPrograms = []; |
| 285 | 285 | |
| 286 | - foreach ($visitorPrograms as $visitorProgram) { |
|
| 286 | + foreach($visitorPrograms as $visitorProgram) { |
|
| 287 | 287 | if($visitorProgram->program !== 0) { |
| 288 | 288 | $program = $this->getProgramRepository()->find($visitorProgram->program); |
| 289 | 289 | $formPrograms['blck_' . $program->block] = $visitorProgram->program; |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | */ |
| 329 | 329 | protected function convertToDateTime($datetime): DateTime |
| 330 | 330 | { |
| 331 | - if (is_string($datetime)) { |
|
| 331 | + if(is_string($datetime)) { |
|
| 332 | 332 | $datetime = new DateTime($datetime); |
| 333 | 333 | } |
| 334 | 334 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | { |
| 236 | 236 | $programBlocks = $this->fetchProgramBlocks(); |
| 237 | 237 | |
| 238 | - foreach ($programBlocks as $block) { |
|
| 238 | + foreach($programBlocks as $block) { |
|
| 239 | 239 | |
| 240 | 240 | $programsInBlock = $this->getProgramRepository()->findByBlockId($block->id); |
| 241 | 241 | |
@@ -243,13 +243,13 @@ discard block |
||
| 243 | 243 | 0 => 'Nebudu přítomen' |
| 244 | 244 | ]; |
| 245 | 245 | |
| 246 | - foreach ($programsInBlock as $program) { |
|
| 246 | + foreach($programsInBlock as $program) { |
|
| 247 | 247 | $programs[$program->id] = $program->name; |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | $form->addRadioList( |
| 251 | 251 | 'blck_' . $block->id, |
| 252 | - $block->day . ', ' . $block->from .' - ' . $block->to .' : ' . $block->name, |
|
| 252 | + $block->day . ', ' . $block->from . ' - ' . $block->to . ' : ' . $block->name, |
|
| 253 | 253 | $programs |
| 254 | 254 | )->setDefaultValue(0) |
| 255 | 255 | ->setDisabled($this->filterFilledCapacity($programs)); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | 'ano' => 'ano', |
| 270 | 270 | ]; |
| 271 | 271 | |
| 272 | - foreach ($this->fetchMeals() as $name => $label) { |
|
| 272 | + foreach($this->fetchMeals() as $name => $label) { |
|
| 273 | 273 | $this->setMealField($name); |
| 274 | 274 | $form->addSelect($name, $label . ':', $yesNoArray); |
| 275 | 275 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | { |
| 401 | 401 | $programBlocks = $this->fetchProgramBlocks(); |
| 402 | 402 | |
| 403 | - foreach ($programBlocks as $block) { |
|
| 403 | + foreach($programBlocks as $block) { |
|
| 404 | 404 | $programFieldName = 'blck_' . $block->id; |
| 405 | 405 | $this->setProgramField($programFieldName); |
| 406 | 406 | } |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | { |
| 416 | 416 | $meals = $this->fetchMeals(); |
| 417 | 417 | |
| 418 | - foreach ($meals as $name => $label) { |
|
| 418 | + foreach($meals as $name => $label) { |
|
| 419 | 419 | $this->setMealField($name); |
| 420 | 420 | } |
| 421 | 421 | |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | { |
| 466 | 466 | return array_keys( |
| 467 | 467 | array_filter($programs, function($name, $id) { |
| 468 | - if ($id) { |
|
| 468 | + if($id) { |
|
| 469 | 469 | $visitorsOnProgram = $this->getProgramRepository()->countVisitors($id); |
| 470 | 470 | $programCapacity = $this->getProgramRepository()->find($id)->capacity; |
| 471 | 471 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | // visitor's id is empty and i must add one |
| 164 | 164 | $meals_data['visitor'] = $ID_visitor; |
| 165 | 165 | |
| 166 | - if($ID_visitor){ |
|
| 166 | + if($ID_visitor) { |
|
| 167 | 167 | // gets data from database |
| 168 | 168 | $program_blocks = $this->Blocks->getProgramBlocks($DB_data['meeting']); |
| 169 | 169 | |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | */ |
| 450 | 450 | protected function convertToDateTime($datetime): DateTime |
| 451 | 451 | { |
| 452 | - if (is_string($datetime)) { |
|
| 452 | + if(is_string($datetime)) { |
|
| 453 | 453 | $datetime = new DateTime($datetime); |
| 454 | 454 | } |
| 455 | 455 | |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | ->group('email') |
| 500 | 500 | ->fetchAll(); |
| 501 | 501 | |
| 502 | - foreach($emails as $item){ |
|
| 502 | + foreach($emails as $item) { |
|
| 503 | 503 | $recipientMailAddresses .= $item['email'] . ",\n"; |
| 504 | 504 | } |
| 505 | 505 | |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | $guid = $this->getVisitorRepository()->create($visitor); |
| 101 | 101 | $result = $this->sendRegistrationSummary($visitor, $guid); |
| 102 | 102 | |
| 103 | - $this->logInfo('Creation of visitor('. $guid .') successfull, result: ' . json_encode($result)); |
|
| 103 | + $this->logInfo('Creation of visitor(' . $guid . ') successfull, result: ' . json_encode($result)); |
|
| 104 | 104 | $this->flashSuccess('Účastník(' . $guid . ') byl úspěšně vytvořen.'); |
| 105 | 105 | } catch(Exception $e) { |
| 106 | - $this->logError('Creation of visitor('. $guid .') failed, result: ' . $e->getMessage()); |
|
| 106 | + $this->logError('Creation of visitor(' . $guid . ') failed, result: ' . $e->getMessage()); |
|
| 107 | 107 | $this->flashError('Creation of visitor failed, result: ' . $e->getMessage()); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -122,10 +122,10 @@ discard block |
||
| 122 | 122 | $result = $this->getVisitorRepository()->update($id, $visitor); |
| 123 | 123 | $result = $this->sendRegistrationSummary($visitor, $id); |
| 124 | 124 | |
| 125 | - $this->logInfo('Modification of visitor('. $id .') successfull, result: ' . json_encode($result)); |
|
| 125 | + $this->logInfo('Modification of visitor(' . $id . ') successfull, result: ' . json_encode($result)); |
|
| 126 | 126 | $this->flashSuccess('Účastník(' . $id . ') byl úspěšně upraven.'); |
| 127 | 127 | } catch(Exception $e) { |
| 128 | - $this->logError('Modification of visitor('. $id .') failed, result: ' . $e->getMessage()); |
|
| 128 | + $this->logError('Modification of visitor(' . $id . ') failed, result: ' . $e->getMessage()); |
|
| 129 | 129 | $this->flashFailure('Modification of visitor failed, result: ' . $e->getMessage()); |
| 130 | 130 | $result = false; |
| 131 | 131 | } |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | try { |
| 143 | 143 | $result = $this->getVisitorRepository()->delete($id); |
| 144 | 144 | |
| 145 | - $this->logInfo('Destroying of visitor('. $id .') successfull, result: ' . json_encode($result)); |
|
| 145 | + $this->logInfo('Destroying of visitor(' . $id . ') successfull, result: ' . json_encode($result)); |
|
| 146 | 146 | $this->flashSuccess('Položka byla úspěšně smazána'); |
| 147 | 147 | } catch(Exception $e) { |
| 148 | - $this->logError('Destroying of visitor('. $id .') failed, result: ' . $e->getMessage()); |
|
| 148 | + $this->logError('Destroying of visitor(' . $id . ') failed, result: ' . $e->getMessage()); |
|
| 149 | 149 | $this->flashFailure('Destroying of visitor failed, result: ' . $e->getMessage()); |
| 150 | 150 | } |
| 151 | 151 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $this->logInfo('E-mail was send successfully, result: ' . json_encode($result)); |
| 182 | 182 | $this->flashSuccess('E-mail byl úspěšně odeslán'); |
| 183 | 183 | } catch(Exception $e) { |
| 184 | - $this->logError('Sending of e-mail failed, result: ' . $e->getMessage()); |
|
| 184 | + $this->logError('Sending of e-mail failed, result: ' . $e->getMessage()); |
|
| 185 | 185 | $this->flashFailure('Sending of e-mail failed, result: ' . $e->getMessage()); |
| 186 | 186 | } |
| 187 | 187 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | json_encode($id), |
| 242 | 242 | $e->getMessage(), |
| 243 | 243 | ]); |
| 244 | - $this->flashFailure('Zaplacení zálohy pro účastníka s id '.json_encode($id).' neprošlo: '.$e->getMessage()); |
|
| 244 | + $this->flashFailure('Zaplacení zálohy pro účastníka s id ' . json_encode($id) . ' neprošlo: ' . $e->getMessage()); |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | $this->redirect(self::REDIRECT_DEFAULT); |
@@ -257,10 +257,10 @@ discard block |
||
| 257 | 257 | { |
| 258 | 258 | try { |
| 259 | 259 | $result = $this->getVisitorRepository()->setChecked($id); |
| 260 | - $this->logInfo('Check of visitor('. $id .') successfull, result: ' . json_encode($result)); |
|
| 260 | + $this->logInfo('Check of visitor(' . $id . ') successfull, result: ' . json_encode($result)); |
|
| 261 | 261 | $this->flashSuccess('Položka byla úspěšně zkontrolována'); |
| 262 | 262 | } catch(Exception $e) { |
| 263 | - $this->logError('Check of visitor('. $id .') failed, result: ' . $e->getMessage()); |
|
| 263 | + $this->logError('Check of visitor(' . $id . ') failed, result: ' . $e->getMessage()); |
|
| 264 | 264 | $this->flashFailure('Check of visitor failed, result: ' . $e->getMessage()); |
| 265 | 265 | } |
| 266 | 266 | |
@@ -277,10 +277,10 @@ discard block |
||
| 277 | 277 | { |
| 278 | 278 | try { |
| 279 | 279 | $result = $this->getVisitorRepository()->setUnchecked($id); |
| 280 | - $this->logInfo('Uncheck of visitor('. $id .') successfull, result: ' . json_encode($result)); |
|
| 280 | + $this->logInfo('Uncheck of visitor(' . $id . ') successfull, result: ' . json_encode($result)); |
|
| 281 | 281 | $this->flashSuccess('Položka byla nastavena jako nekontrolována'); |
| 282 | 282 | } catch(Exception $e) { |
| 283 | - $this->logError('Uncheck of visitor('. $id .') failed, result: ' . $e->getMessage()); |
|
| 283 | + $this->logError('Uncheck of visitor(' . $id . ') failed, result: ' . $e->getMessage()); |
|
| 284 | 284 | $this->flashFailure('Uncheck of visitor failed, result: ' . $e->getMessage()); |
| 285 | 285 | } |
| 286 | 286 | |