@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * Create a new record |
| 100 | 100 | * |
| 101 | 101 | * @param mixed array of data |
| 102 | - * @return boolean |
|
| 102 | + * @return \Nette\Database\ResultSet |
|
| 103 | 103 | */ |
| 104 | 104 | public function create(array $data) |
| 105 | 105 | { |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | * Modify record |
| 114 | 114 | * |
| 115 | 115 | * @param int $id ID of record |
| 116 | - * @param array $db_data array of data |
|
| 117 | - * @return bool |
|
| 116 | + * @param array $data array of data |
|
| 117 | + * @return integer|null |
|
| 118 | 118 | */ |
| 119 | 119 | public function update($id, array $data) |
| 120 | 120 | { |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * Delete one or multiple record/s |
| 128 | 128 | * |
| 129 | 129 | * @param int ID/s of record |
| 130 | - * @return boolean |
|
| 130 | + * @return integer|null |
|
| 131 | 131 | */ |
| 132 | 132 | public function delete($ids) |
| 133 | 133 | { |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | /** |
| 496 | - * @return ActiveRow |
|
| 496 | + * @return \Nette\Database\IRow[] |
|
| 497 | 497 | */ |
| 498 | 498 | public function getMenuItems() |
| 499 | 499 | { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | public function create(array $data) |
| 105 | 105 | { |
| 106 | 106 | $data['guid'] = md5(uniqid()); |
| 107 | - $result = $this->getDatabase()->query('INSERT INTO ' . $this->getTable(), $data); |
|
| 107 | + $result = $this->getDatabase()->query('INSERT INTO '.$this->getTable(), $data); |
|
| 108 | 108 | |
| 109 | 109 | return $result; |
| 110 | 110 | } |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | if(isset($meeting_id)) { |
| 148 | 148 | $data = $this->getDatabase() |
| 149 | 149 | ->table($this->getTable()) |
| 150 | - ->where('deleted ? AND id ?', '0', $meeting_id) |
|
| 150 | + ->where('deleted ? AND id ?', '0', $meeting_id) |
|
| 151 | 151 | ->fetch(); |
| 152 | 152 | } else { |
| 153 | 153 | $data = $this->getDatabase() |
| 154 | 154 | ->table($this->getTable()) |
| 155 | - ->where('deleted', '0') |
|
| 155 | + ->where('deleted', '0') |
|
| 156 | 156 | ->fetchAll(); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -191,8 +191,8 @@ discard block |
||
| 191 | 191 | ->table('kk_provinces') |
| 192 | 192 | ->fetchAll(); |
| 193 | 193 | |
| 194 | - foreach($result as $data){ |
|
| 195 | - if($data['id'] == $selected_province){ |
|
| 194 | + foreach($result as $data) { |
|
| 195 | + if($data['id'] == $selected_province) { |
|
| 196 | 196 | $sel = "selected"; |
| 197 | 197 | } |
| 198 | 198 | else $sel = ""; |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** Public program same as getPrograms*/ |
| 208 | - public function getPublicPrograms($block_id){ |
|
| 208 | + public function getPublicPrograms($block_id) { |
|
| 209 | 209 | $result = $this->getDatabase() |
| 210 | 210 | ->query('SELECT progs.id AS id, |
| 211 | 211 | progs.name AS name, |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | else { |
| 222 | 222 | $html = "<table>\n"; |
| 223 | 223 | $html .= " <tr>\n"; |
| 224 | - foreach($result as $data){ |
|
| 224 | + foreach($result as $data) { |
|
| 225 | 225 | $html .= "<td class='category cat-".$data['style']."' style='text-align:center;'>\n"; |
| 226 | 226 | $html .= "<a class='programLink' rel='programDetail' href='#' rel='programDetail' title='".$this->program->getDetail($data['id'], 'program', $this->httpEncoding)."'>".$data['name']."</a>\n"; |
| 227 | 227 | $html .= "</td>\n"; |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | $days = array("pátek", "sobota", "neděle"); |
| 238 | 238 | $html = ""; |
| 239 | 239 | |
| 240 | - foreach($days as $dayKey => $dayVal){ |
|
| 240 | + foreach($days as $dayKey => $dayVal) { |
|
| 241 | 241 | $html .= "<table>\n"; |
| 242 | 242 | $html .= " <tr>\n"; |
| 243 | 243 | $html .= " <td class='day' colspan='2' >".$dayVal."</td>\n"; |
@@ -259,14 +259,14 @@ discard block |
||
| 259 | 259 | '0', $dayVal, $this->meetingId) |
| 260 | 260 | ->fetchAll(); |
| 261 | 261 | |
| 262 | - if(!$result){ |
|
| 262 | + if(!$result) { |
|
| 263 | 263 | $html .= "<td class='emptyTable' style='width:400px;'>Nejsou žádná aktuální data.</td>\n"; |
| 264 | 264 | } |
| 265 | - else{ |
|
| 266 | - foreach($result as $data){ |
|
| 265 | + else { |
|
| 266 | + foreach($result as $data) { |
|
| 267 | 267 | $html .= "<tr>\n"; |
| 268 | 268 | $html .= "<td class='time'>".$data['from']." - ".$data['to']."</td>\n"; |
| 269 | - if(($data['program'] == 1) && ($data['display_progs'] == 1)){ |
|
| 269 | + if(($data['program'] == 1) && ($data['display_progs'] == 1)) { |
|
| 270 | 270 | $html .= "<td class='category cat-".$data['style']."' class='daytime'>\n"; |
| 271 | 271 | $html .= "<div>\n"; |
| 272 | 272 | $html .= "<a class='programLink rel='programDetail' href='#' rel='programDetail' title='".$this->program->getDetail($data['id'], 'block', $this->httpEncoding)."'>".$data['name']."</a>\n"; |
@@ -314,14 +314,14 @@ discard block |
||
| 314 | 314 | |
| 315 | 315 | $html_row = ""; |
| 316 | 316 | |
| 317 | - if(!$result){ |
|
| 317 | + if(!$result) { |
|
| 318 | 318 | $html_row .= "<tr class='radek1'>"; |
| 319 | 319 | $html_row .= "<td><img class='edit' src='".IMG_DIR."icons/edit2.gif' /></td>\n"; |
| 320 | 320 | $html_row .= "<td><img class='edit' src='".IMG_DIR."icons/delete2.gif' /></td>\n"; |
| 321 | 321 | $html_row .= "<td colspan='11' class='emptyTable'>Nejsou k dispozici žádné položky.</td>"; |
| 322 | 322 | $html_row .= "</tr>"; |
| 323 | 323 | } else { |
| 324 | - foreach($result as $data){ |
|
| 324 | + foreach($result as $data) { |
|
| 325 | 325 | $html_row .= "<tr class='radek1'>"; |
| 326 | 326 | $html_row .= "\t\t\t<td><a href='process.php?id=".$data['id']."&cms=edit&page=meetings' title='Upravit'><img class='edit' src='".IMG_DIR."icons/edit.gif' /></a></td>\n"; |
| 327 | 327 | $html_row .= "\t\t\t<td><a href=\"javascript:confirmation('?id=".$data['id']."&cms=del', 'sraz: ".$data['place']." ".$data['start_date']." -> Opravdu SMAZAT tento sraz? Jste si jisti?')\" title='Odstranit'><img class='edit' src='".IMG_DIR."icons/delete.gif' /></a></td>\n"; |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | ->limit(1) |
| 391 | 391 | ->fetch(); |
| 392 | 392 | |
| 393 | - $this->setRegHeading($meeting->place . ' ' . $meeting->year); |
|
| 393 | + $this->setRegHeading($meeting->place.' '.$meeting->year); |
|
| 394 | 394 | $this->setRegClosing($meeting->close_reg); |
| 395 | 395 | $this->setRegOpening($meeting->open_reg); |
| 396 | 396 | |
@@ -194,8 +194,9 @@ discard block |
||
| 194 | 194 | foreach($result as $data){ |
| 195 | 195 | if($data['id'] == $selected_province){ |
| 196 | 196 | $sel = "selected"; |
| 197 | + } else { |
|
| 198 | + $sel = ""; |
|
| 197 | 199 | } |
| 198 | - else $sel = ""; |
|
| 199 | 200 | $html_select .= "<option value='".$data['id']."' ".$sel.">".$data['province_name']."</option>"; |
| 200 | 201 | } |
| 201 | 202 | |
@@ -205,7 +206,8 @@ discard block |
||
| 205 | 206 | } |
| 206 | 207 | |
| 207 | 208 | /** Public program same as getPrograms*/ |
| 208 | - public function getPublicPrograms($block_id){ |
|
| 209 | + public function getPublicPrograms($block_id) |
|
| 210 | + { |
|
| 209 | 211 | $result = $this->getDatabase() |
| 210 | 212 | ->query('SELECT progs.id AS id, |
| 211 | 213 | progs.name AS name, |
@@ -217,8 +219,9 @@ discard block |
||
| 217 | 219 | $block_id, '0') |
| 218 | 220 | ->fetchAll(); |
| 219 | 221 | |
| 220 | - if(!$result) $html = ""; |
|
| 221 | - else { |
|
| 222 | + if(!$result) { |
|
| 223 | + $html = ""; |
|
| 224 | + } else { |
|
| 222 | 225 | $html = "<table>\n"; |
| 223 | 226 | $html .= " <tr>\n"; |
| 224 | 227 | foreach($result as $data){ |
@@ -261,8 +264,7 @@ discard block |
||
| 261 | 264 | |
| 262 | 265 | if(!$result){ |
| 263 | 266 | $html .= "<td class='emptyTable' style='width:400px;'>Nejsou žádná aktuální data.</td>\n"; |
| 264 | - } |
|
| 265 | - else{ |
|
| 267 | + } else{ |
|
| 266 | 268 | foreach($result as $data){ |
| 267 | 269 | $html .= "<tr>\n"; |
| 268 | 270 | $html .= "<td class='time'>".$data['from']." - ".$data['to']."</td>\n"; |
@@ -273,8 +275,7 @@ discard block |
||
| 273 | 275 | $html .= "</div>\n"; |
| 274 | 276 | $html .= $this->getPublicPrograms($data['id']); |
| 275 | 277 | $html .= "</td>\n"; |
| 276 | - } |
|
| 277 | - else { |
|
| 278 | + } else { |
|
| 278 | 279 | $html .= "<td class='category cat-".$data['style']."'>"; |
| 279 | 280 | $html .= "<a class='programLink rel='programDetail' href='#' rel='programDetail' title='".$this->program->getDetail($data['id'], 'block', $this->httpEncoding)."'>".$data['name']."</a>\n"; |
| 280 | 281 | $html .= "</td>\n"; |
@@ -468,7 +469,8 @@ discard block |
||
| 468 | 469 | * @param integer $id |
| 469 | 470 | * @return string |
| 470 | 471 | */ |
| 471 | - public function getProvinceNameById($id) { |
|
| 472 | + public function getProvinceNameById($id) |
|
| 473 | + { |
|
| 472 | 474 | return $this->getDatabase() |
| 473 | 475 | ->table('kk_provinces') |
| 474 | 476 | ->select('province_name') |
@@ -27,10 +27,10 @@ discard block |
||
| 27 | 27 | public $dbColumns = array(); |
| 28 | 28 | |
| 29 | 29 | /** @var datetime at what registration opens */ |
| 30 | - public $regOpening = NULL; |
|
| 30 | + public $regOpening = null; |
|
| 31 | 31 | |
| 32 | 32 | /** @var datetime at what registration ends*/ |
| 33 | - public $regClosing = NULL; |
|
| 33 | + public $regClosing = null; |
|
| 34 | 34 | |
| 35 | 35 | /** @var string registration heading text */ |
| 36 | 36 | public $regHeading = ''; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | * |
| 143 | 143 | * @return string html table |
| 144 | 144 | */ |
| 145 | - public function getData($meeting_id = NULL) |
|
| 145 | + public function getData($meeting_id = null) |
|
| 146 | 146 | { |
| 147 | 147 | if(isset($meeting_id)) { |
| 148 | 148 | $data = $this->getDatabase() |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * Get programs |
| 55 | 55 | * |
| 56 | - * @param int $block_id ID of block |
|
| 57 | - * @param int $visitor_id ID of visitor |
|
| 56 | + * @param int $blockId ID of block |
|
| 58 | 57 | * @return string html |
| 59 | 58 | */ |
| 60 | 59 | public function getPrograms($blockId, $vid) |
@@ -250,7 +249,7 @@ discard block |
||
| 250 | 249 | } |
| 251 | 250 | |
| 252 | 251 | /** |
| 253 | - * @return Nette\Database\Table\ActiveRow |
|
| 252 | + * @return \Nette\Database\IRow[] |
|
| 254 | 253 | */ |
| 255 | 254 | public function all() |
| 256 | 255 | { |
@@ -393,6 +392,9 @@ discard block |
||
| 393 | 392 | return $programs; |
| 394 | 393 | } |
| 395 | 394 | |
| 395 | + /** |
|
| 396 | + * @param Context $database |
|
| 397 | + */ |
|
| 396 | 398 | public static function getPdfPrograms($id, $vid, $database){ |
| 397 | 399 | $result = $database |
| 398 | 400 | ->table('kk_programs') |
@@ -462,6 +464,9 @@ discard block |
||
| 462 | 464 | return $html; |
| 463 | 465 | } |
| 464 | 466 | |
| 467 | + /** |
|
| 468 | + * @param string $type |
|
| 469 | + */ |
|
| 465 | 470 | public function getDetail($id, $type, $httpEncoding) |
| 466 | 471 | { |
| 467 | 472 | $data = $this->database |
@@ -515,7 +520,7 @@ discard block |
||
| 515 | 520 | |
| 516 | 521 | /** |
| 517 | 522 | * @param integer $blockId |
| 518 | - * @return Row |
|
| 523 | + * @return \Nette\Database\IRow[] |
|
| 519 | 524 | */ |
| 520 | 525 | public function findByBlockId($blockId = null) |
| 521 | 526 | { |
@@ -488,7 +488,7 @@ |
||
| 488 | 488 | $inner_html = "<tr>\n"; |
| 489 | 489 | $inner_html .= " <td class=\"label\">Obsazenost programu:</td>\n"; |
| 490 | 490 | $inner_html .= " <td class=\"text\">".$countData['visitors']."/".$capacity."</td>\n"; |
| 491 | - $inner_html .= "</tr>\n"; |
|
| 491 | + $inner_html .= "</tr>\n"; |
|
| 492 | 492 | } |
| 493 | 493 | else $inner_html = ""; |
| 494 | 494 | |
@@ -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,14 +94,14 @@ 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']){ |
|
| 104 | + if($fullProgramData['visitors'] >= $data['capacity']) { |
|
| 105 | 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 { |
@@ -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,7 +149,7 @@ 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 | 154 | $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>".$fullProgramData['visitors']."/".$data['capacity']."</span> (kapacita programu je naplněna!)"; |
| 155 | 155 | } |
@@ -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 |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | * @param string disabled |
| 293 | 293 | * @return string html |
| 294 | 294 | */ |
| 295 | - public function getProgramsRegistration ($id, $disabled) |
|
| 295 | + public function getProgramsRegistration($id, $disabled) |
|
| 296 | 296 | { |
| 297 | 297 | $result = $this->database |
| 298 | 298 | ->table($this->getTable()) |
@@ -300,13 +300,13 @@ discard block |
||
| 300 | 300 | ->limit(10) |
| 301 | 301 | ->fetchAll(); |
| 302 | 302 | |
| 303 | - if(!$result){ |
|
| 303 | + if(!$result) { |
|
| 304 | 304 | $html = ""; |
| 305 | 305 | } |
| 306 | - else{ |
|
| 306 | + else { |
|
| 307 | 307 | $html = "<div>\n"; |
| 308 | 308 | $html .= "<input ".$disabled." checked type='radio' name='".$id."' value='0' /> Nebudu přítomen <br />\n"; |
| 309 | - foreach($result as $data){ |
|
| 309 | + foreach($result as $data) { |
|
| 310 | 310 | //// resim kapacitu programu a jeho naplneni navstevniky |
| 311 | 311 | $fullProgramData = $this->database |
| 312 | 312 | ->query('SELECT COUNT(visitor) AS visitors FROM `kk_visitor-program` AS visprog |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | if($data['display_in_reg'] == 0) $notDisplayedProg = "style='display:none;'"; |
| 319 | 319 | else $notDisplayedProg = ""; |
| 320 | 320 | |
| 321 | - if($fullProgramData['visitors'] >= $data['capacity']){ |
|
| 321 | + if($fullProgramData['visitors'] >= $data['capacity']) { |
|
| 322 | 322 | $html .= "<div ".$notDisplayedProg."><input disabled type='radio' name='".$id."' value='".$data['id']."' />\n"; |
| 323 | 323 | $fullProgramInfo = " (NELZE ZAPSAT - kapacita programu je již naplněna!)"; |
| 324 | 324 | } |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | WHERE visprog.program = ? AND vis.deleted = ?', |
| 361 | 361 | $programId, '0')->fetchAll(); |
| 362 | 362 | $i = 1; |
| 363 | - foreach($result as $data){ |
|
| 363 | + foreach($result as $data) { |
|
| 364 | 364 | $html .= $i.". ".$data['name']." ".$data['surname']." - ".$data['nick']."<br />"; |
| 365 | 365 | $i++; |
| 366 | 366 | } |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | ORDER BY `day`, `from` ASC', |
| 386 | 386 | $visitorId)->fetchAll(); |
| 387 | 387 | |
| 388 | - foreach($result as $progData){ |
|
| 388 | + foreach($result as $progData) { |
|
| 389 | 389 | $programs .= $progData['day'].", ".$progData['from']." - ".$progData['to'].""; |
| 390 | 390 | $programs .= "<div style='padding:5px 0px 5px 20px;'>- ".$progData['prog_name']."</div>"; |
| 391 | 391 | } |
@@ -393,20 +393,20 @@ discard block |
||
| 393 | 393 | return $programs; |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | - public static function getPdfPrograms($id, $vid, $database){ |
|
| 396 | + public static function getPdfPrograms($id, $vid, $database) { |
|
| 397 | 397 | $result = $database |
| 398 | 398 | ->table('kk_programs') |
| 399 | 399 | ->where('block ? AND deleted ?', $id, '0') |
| 400 | 400 | ->limit(10) |
| 401 | 401 | ->fetchAll(); |
| 402 | 402 | |
| 403 | - if(!$result){ |
|
| 403 | + if(!$result) { |
|
| 404 | 404 | $html = ""; |
| 405 | 405 | } else { |
| 406 | 406 | |
| 407 | 407 | $html = "<div class='program'>\n"; |
| 408 | 408 | |
| 409 | - foreach($result as $data){ |
|
| 409 | + foreach($result as $data) { |
|
| 410 | 410 | $rows = $database |
| 411 | 411 | ->table('kk_visitor-program') |
| 412 | 412 | ->where('program ? AND visitor ?', $data->id, $vid) |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | return $html; |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | - public function getProgramsLarge($id){ |
|
| 422 | + public function getProgramsLarge($id) { |
|
| 423 | 423 | $result = $this->database |
| 424 | 424 | ->query('SELECT progs.name AS name, |
| 425 | 425 | cat.style AS style |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | else { |
| 434 | 434 | $html = "<table>"; |
| 435 | 435 | $html .= " <tr>"; |
| 436 | - foreach($result as $data){ |
|
| 436 | + foreach($result as $data) { |
|
| 437 | 437 | $html .= "<td class='category cat-".$data['style']."' >".$data['name']."</td>\n"; |
| 438 | 438 | } |
| 439 | 439 | $html .= " </tr>\n"; |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | |
| 456 | 456 | if(!$result) $html = ""; |
| 457 | 457 | else { |
| 458 | - foreach($result as $data){ |
|
| 458 | + foreach($result as $data) { |
|
| 459 | 459 | $html .= $data['name'].",\n"; |
| 460 | 460 | } |
| 461 | 461 | } |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | public function getDetail($id, $type, $httpEncoding) |
| 466 | 466 | { |
| 467 | 467 | $data = $this->database |
| 468 | - ->table('kk_' . $type . 's') |
|
| 468 | + ->table('kk_'.$type.'s') |
|
| 469 | 469 | ->where('id ? AND deleted ?', $id, '0') |
| 470 | 470 | ->limit(1) |
| 471 | 471 | ->fetch(); |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | $tutor = $data['tutor']; |
| 476 | 476 | $email = $data['email']; |
| 477 | 477 | |
| 478 | - if($type == "program"){ |
|
| 478 | + if($type == "program") { |
|
| 479 | 479 | $capacity = $data['capacity']; |
| 480 | 480 | |
| 481 | 481 | $countData = $this->database |
@@ -114,8 +114,11 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | // pokud uz jednou bylo zaskrtnuto, nezaskrtavam znovu |
| 117 | - if(!$checked_flag) $checked = "checked='checked'"; |
|
| 118 | - else $checked = ""; |
|
| 117 | + if(!$checked_flag) { |
|
| 118 | + $checked = "checked='checked'"; |
|
| 119 | + } else { |
|
| 120 | + $checked = ""; |
|
| 121 | + } |
|
| 119 | 122 | |
| 120 | 123 | $html .= "<input ".$checked." type='radio' name='blck_".$blockId."' value='0' /> Nebudu přítomen <br />\n"; |
| 121 | 124 | $html .= $html_input; |
@@ -152,8 +155,7 @@ discard block |
||
| 152 | 155 | if($fullProgramData['visitors'] >= $data['capacity']){ |
| 153 | 156 | //$html .= "<input disabled type='radio' name='".$id."' value='".$data['id']."' />\n"; |
| 154 | 157 | $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>".$fullProgramData['visitors']."/".$data['capacity']."</span> (kapacita programu je naplněna!)"; |
| 155 | - } |
|
| 156 | - else { |
|
| 158 | + } else { |
|
| 157 | 159 | //$html .= "<input type='radio' name='".$id."' value='".$data['id']."' /> \n"; |
| 158 | 160 | $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>".$fullProgramData['visitors']."/".$data['capacity']."</span>"; |
| 159 | 161 | } |
@@ -196,7 +198,9 @@ discard block |
||
| 196 | 198 | |
| 197 | 199 | foreach($progSql as $progData){ |
| 198 | 200 | //nemoznost volit predsnemovni dikusi |
| 199 | - if($progData['id'] == 63) $notDisplayed = "style='display:none;'"; |
|
| 201 | + if($progData['id'] == 63) { |
|
| 202 | + $notDisplayed = "style='display:none;'"; |
|
| 203 | + } |
|
| 200 | 204 | //obsazenost raftu |
| 201 | 205 | /* |
| 202 | 206 | elseif($raftCountData['raft'] >= 18){ |
@@ -204,9 +208,13 @@ discard block |
||
| 204 | 208 | else $notDisplayed = ""; |
| 205 | 209 | } |
| 206 | 210 | */ |
| 207 | - else $notDisplayed = ""; |
|
| 211 | + else { |
|
| 212 | + $notDisplayed = ""; |
|
| 213 | + } |
|
| 208 | 214 | $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>"; |
|
| 215 | + if($progData['program'] == 1) { |
|
| 216 | + $programs .= "<div ".$notDisplayed.">".$this->getExportPrograms($progData['id'])."</div>"; |
|
| 217 | + } |
|
| 210 | 218 | $programs .= "<br />"; |
| 211 | 219 | } |
| 212 | 220 | } |
@@ -302,8 +310,7 @@ discard block |
||
| 302 | 310 | |
| 303 | 311 | if(!$result){ |
| 304 | 312 | $html = ""; |
| 305 | - } |
|
| 306 | - else{ |
|
| 313 | + } else{ |
|
| 307 | 314 | $html = "<div>\n"; |
| 308 | 315 | $html .= "<input ".$disabled." checked type='radio' name='".$id."' value='0' /> Nebudu přítomen <br />\n"; |
| 309 | 316 | foreach($result as $data){ |
@@ -315,14 +322,16 @@ discard block |
||
| 315 | 322 | $data['id'], '0')->fetch(); |
| 316 | 323 | |
| 317 | 324 | // nezobrazeni programu v registraci, v adminu zaskrtavatko u programu |
| 318 | - if($data['display_in_reg'] == 0) $notDisplayedProg = "style='display:none;'"; |
|
| 319 | - else $notDisplayedProg = ""; |
|
| 325 | + if($data['display_in_reg'] == 0) { |
|
| 326 | + $notDisplayedProg = "style='display:none;'"; |
|
| 327 | + } else { |
|
| 328 | + $notDisplayedProg = ""; |
|
| 329 | + } |
|
| 320 | 330 | |
| 321 | 331 | if($fullProgramData['visitors'] >= $data['capacity']){ |
| 322 | 332 | $html .= "<div ".$notDisplayedProg."><input disabled type='radio' name='".$id."' value='".$data['id']."' />\n"; |
| 323 | 333 | $fullProgramInfo = " (NELZE ZAPSAT - kapacita programu je již naplněna!)"; |
| 324 | - } |
|
| 325 | - else { |
|
| 334 | + } else { |
|
| 326 | 335 | $html .= "<div ".$notDisplayedProg."><input ".$disabled." type='radio' name='".$id."' value='".$data['id']."' /> \n"; |
| 327 | 336 | $fullProgramInfo = ""; |
| 328 | 337 | } |
@@ -369,7 +378,8 @@ discard block |
||
| 369 | 378 | } |
| 370 | 379 | } |
| 371 | 380 | |
| 372 | - public function getSelectedPrograms($visitorId) { |
|
| 381 | + public function getSelectedPrograms($visitorId) |
|
| 382 | + { |
|
| 373 | 383 | $programs = " <div style='border-bottom:1px solid black;text-align:right;'>vybrané programy</div>"; |
| 374 | 384 | |
| 375 | 385 | $result = $this->database |
@@ -393,7 +403,8 @@ discard block |
||
| 393 | 403 | return $programs; |
| 394 | 404 | } |
| 395 | 405 | |
| 396 | - public static function getPdfPrograms($id, $vid, $database){ |
|
| 406 | + public static function getPdfPrograms($id, $vid, $database) |
|
| 407 | + { |
|
| 397 | 408 | $result = $database |
| 398 | 409 | ->table('kk_programs') |
| 399 | 410 | ->where('block ? AND deleted ?', $id, '0') |
@@ -411,7 +422,9 @@ discard block |
||
| 411 | 422 | ->table('kk_visitor-program') |
| 412 | 423 | ->where('program ? AND visitor ?', $data->id, $vid) |
| 413 | 424 | ->fetchAll(); |
| 414 | - if($rows) $html .= $data['name']; |
|
| 425 | + if($rows) { |
|
| 426 | + $html .= $data['name']; |
|
| 427 | + } |
|
| 415 | 428 | } |
| 416 | 429 | $html .= "</div>\n"; |
| 417 | 430 | } |
@@ -419,7 +432,8 @@ discard block |
||
| 419 | 432 | return $html; |
| 420 | 433 | } |
| 421 | 434 | |
| 422 | - public function getProgramsLarge($id){ |
|
| 435 | + public function getProgramsLarge($id) |
|
| 436 | + { |
|
| 423 | 437 | $result = $this->database |
| 424 | 438 | ->query('SELECT progs.name AS name, |
| 425 | 439 | cat.style AS style |
@@ -429,8 +443,9 @@ discard block |
||
| 429 | 443 | LIMIT 10', |
| 430 | 444 | $id, '0')->fetchAll(); |
| 431 | 445 | |
| 432 | - if(!$result) $html = ""; |
|
| 433 | - else { |
|
| 446 | + if(!$result) { |
|
| 447 | + $html = ""; |
|
| 448 | + } else { |
|
| 434 | 449 | $html = "<table>"; |
| 435 | 450 | $html .= " <tr>"; |
| 436 | 451 | foreach($result as $data){ |
@@ -453,8 +468,9 @@ discard block |
||
| 453 | 468 | |
| 454 | 469 | $html = ''; |
| 455 | 470 | |
| 456 | - if(!$result) $html = ""; |
|
| 457 | - else { |
|
| 471 | + if(!$result) { |
|
| 472 | + $html = ""; |
|
| 473 | + } else { |
|
| 458 | 474 | foreach($result as $data){ |
| 459 | 475 | $html .= $data['name'].",\n"; |
| 460 | 476 | } |
@@ -489,8 +505,9 @@ discard block |
||
| 489 | 505 | $inner_html .= " <td class=\"label\">Obsazenost programu:</td>\n"; |
| 490 | 506 | $inner_html .= " <td class=\"text\">".$countData['visitors']."/".$capacity."</td>\n"; |
| 491 | 507 | $inner_html .= "</tr>\n"; |
| 508 | + } else { |
|
| 509 | + $inner_html = ""; |
|
| 492 | 510 | } |
| 493 | - else $inner_html = ""; |
|
| 494 | 511 | |
| 495 | 512 | $html = '<html><head><meta http-equiv="Content-Type" content="text/html; charset='.$httpEncoding.'" /></head><body><style>td.text {text-align:left;}</style><table class="form"><tr><td class="label">Program:</td><td class="text">'.$name.'</td></tr><tr><td class="label">Popis:</td><td class="text">'.$description.'</td></tr><tr><td class="label">Lektor:</td><td class="text">'.$tutor.'</td></tr><tr><td class="label">E-mail:</td><td class="text"><a href="mailto:'.$email.'" title="e-mail">'.$email.'</a></td></tr>'.$inner_html.'</table></body></html>'; |
| 496 | 513 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | * |
| 220 | 220 | * @return string html of a table |
| 221 | 221 | */ |
| 222 | - public function getData($program_id = NULL) |
|
| 222 | + public function getData($program_id = null) |
|
| 223 | 223 | { |
| 224 | 224 | if(isset($program_id)) { |
| 225 | 225 | $data = $this->database |
@@ -341,10 +341,10 @@ discard block |
||
| 341 | 341 | * @param int $programId ID of program |
| 342 | 342 | * @return string html or null |
| 343 | 343 | */ |
| 344 | - public function getProgramVisitors($programId = NULL) |
|
| 344 | + public function getProgramVisitors($programId = null) |
|
| 345 | 345 | { |
| 346 | 346 | if(!isset($programId)) { |
| 347 | - return NULL; |
|
| 347 | + return null; |
|
| 348 | 348 | } else { |
| 349 | 349 | $html = " <div style='border-bottom:1px solid black;text-align:right;'>účastníci</div>"; |
| 350 | 350 | |
@@ -195,8 +195,8 @@ discard block |
||
| 195 | 195 | /** |
| 196 | 196 | * Modify a visitor |
| 197 | 197 | * |
| 198 | - * @param int $visitor_id ID of a visitor |
|
| 199 | - * @param array $db_data Visitor's database data |
|
| 198 | + * @param int $ID_visitor ID of a visitor |
|
| 199 | + * @param array $DB_data Visitor's database data |
|
| 200 | 200 | * @param array $meals_data Data of meals |
| 201 | 201 | * @param array $programs_data Program's data |
| 202 | 202 | * @return mixed TRUE or array of errors |
@@ -246,8 +246,7 @@ discard block |
||
| 246 | 246 | /** |
| 247 | 247 | * Modify a visitor |
| 248 | 248 | * |
| 249 | - * @param int $visitor_id ID of a visitor |
|
| 250 | - * @param array $db_data Visitor's database data |
|
| 249 | + * @param array $DB_data Visitor's database data |
|
| 251 | 250 | * @param array $meals_data Data of meals |
| 252 | 251 | * @param array $programs_data Program's data |
| 253 | 252 | * @return mixed TRUE or array of errors |
@@ -300,6 +299,7 @@ discard block |
||
| 300 | 299 | * Delete one or multiple record/s |
| 301 | 300 | * |
| 302 | 301 | * @param int ID/s of record |
| 302 | + * @param integer $id |
|
| 303 | 303 | * @return boolean |
| 304 | 304 | */ |
| 305 | 305 | public function delete($id) |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | * |
| 318 | 318 | * @param int ID/s of record |
| 319 | 319 | * @param int 0 | 1 |
| 320 | - * @return boolean |
|
| 320 | + * @return integer|null |
|
| 321 | 321 | */ |
| 322 | 322 | public function checked($id, $value) |
| 323 | 323 | { |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | * |
| 388 | 388 | * @param int ID/s of visitor |
| 389 | 389 | * @param string type of payment (pay | advance) |
| 390 | - * @return string error message or true |
|
| 390 | + * @return integer|null error message or true |
|
| 391 | 391 | */ |
| 392 | 392 | public function payCharge($query_id, $type) |
| 393 | 393 | { |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | * Get recipients by ids |
| 411 | 411 | * |
| 412 | 412 | * @param mixed ID of visitor |
| 413 | - * @return mixed result |
|
| 413 | + * @return \Nette\Database\IRow[] result |
|
| 414 | 414 | */ |
| 415 | 415 | public function getRecipients($ids) |
| 416 | 416 | { |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | * Get visitor's programs |
| 427 | 427 | * |
| 428 | 428 | * @param int ID of visitor |
| 429 | - * @return mixed result |
|
| 429 | + * @return \Nette\Database\IRow[] result |
|
| 430 | 430 | */ |
| 431 | 431 | public function getVisitorPrograms($visitorId) |
| 432 | 432 | { |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | /** |
| 472 | - * @return Row |
|
| 472 | + * @return \Nette\Database\IRow[] |
|
| 473 | 473 | */ |
| 474 | 474 | public function all() |
| 475 | 475 | { |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Nette\Database\Context; |
| 6 | 6 | use Nette\Utils\Strings; |
| 7 | -use Tracy\Debugger; |
|
| 8 | 7 | use \Exception; |
| 9 | 8 | |
| 10 | 9 | /** |
@@ -244,14 +244,14 @@ |
||
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
| 247 | - * Modify a visitor |
|
| 248 | - * |
|
| 249 | - * @param int $visitor_id ID of a visitor |
|
| 250 | - * @param array $db_data Visitor's database data |
|
| 251 | - * @param array $meals_data Data of meals |
|
| 252 | - * @param array $programs_data Program's data |
|
| 253 | - * @return mixed TRUE or array of errors |
|
| 254 | - */ |
|
| 247 | + * Modify a visitor |
|
| 248 | + * |
|
| 249 | + * @param int $visitor_id ID of a visitor |
|
| 250 | + * @param array $db_data Visitor's database data |
|
| 251 | + * @param array $meals_data Data of meals |
|
| 252 | + * @param array $programs_data Program's data |
|
| 253 | + * @return mixed TRUE or array of errors |
|
| 254 | + */ |
|
| 255 | 255 | public function modifyByGuid($guid, $DB_data, $meals_data, $programs_data) |
| 256 | 256 | { |
| 257 | 257 | // for returning specific error |
@@ -154,11 +154,11 @@ discard block |
||
| 154 | 154 | // visitor's id is empty and i must add one |
| 155 | 155 | $meals_data['visitor'] = $ID_visitor; |
| 156 | 156 | |
| 157 | - if($ID_visitor){ |
|
| 157 | + if($ID_visitor) { |
|
| 158 | 158 | // gets data from database |
| 159 | 159 | $program_blocks = $this->Blocks->getProgramBlocks($DB_data['meeting']); |
| 160 | 160 | |
| 161 | - foreach($program_blocks as $DB_blocks_data){ |
|
| 161 | + foreach($program_blocks as $DB_blocks_data) { |
|
| 162 | 162 | $bindingsData = array( |
| 163 | 163 | 'visitor' => $ID_visitor, |
| 164 | 164 | 'program' => $programs_data[$DB_blocks_data['id']], |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | if($return) { |
| 177 | 177 | |
| 178 | 178 | // create meals for visitor |
| 179 | - if(!$return = $this->Meals->create($meals_data)){ |
|
| 179 | + if(!$return = $this->Meals->create($meals_data)) { |
|
| 180 | 180 | throw new Exception('Error while creating meals'); |
| 181 | 181 | } |
| 182 | 182 | } |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | $oldPrograms = $this->getVisitorPrograms($ID_visitor); |
| 230 | 230 | |
| 231 | 231 | // update old data to new existing |
| 232 | - foreach($programBlocks as $programBlock){ |
|
| 232 | + foreach($programBlocks as $programBlock) { |
|
| 233 | 233 | $data = array('program' => $programs_data[$programBlock->id]); |
| 234 | 234 | // read first value from array and shift it to the end |
| 235 | 235 | $oldProgram = array_shift($oldPrograms); |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $oldPrograms = $this->getVisitorPrograms($visitor->id); |
| 283 | 283 | |
| 284 | 284 | // update old data to new existing |
| 285 | - foreach($programBlocks as $programBlock){ |
|
| 285 | + foreach($programBlocks as $programBlock) { |
|
| 286 | 286 | $data = array('program' => $programs_data[$programBlock->id]); |
| 287 | 287 | // read first value from array and shift it to the end |
| 288 | 288 | $oldProgram = array_shift($oldPrograms); |
@@ -369,14 +369,14 @@ discard block |
||
| 369 | 369 | $search = $this->getSearch(); |
| 370 | 370 | |
| 371 | 371 | $query = ''; |
| 372 | - if($search){ |
|
| 373 | - $query = "AND (`code` REGEXP '" . $search . "' |
|
| 374 | - OR `group_num` REGEXP '" . $search . "' |
|
| 375 | - OR `name` REGEXP '" . $search . "' |
|
| 376 | - OR `surname` REGEXP '" . $search . "' |
|
| 377 | - OR `nick` REGEXP '" . $search . "' |
|
| 378 | - OR `city` REGEXP '" . $search . "' |
|
| 379 | - OR `group_name` REGEXP '" . $search . "')"; |
|
| 372 | + if($search) { |
|
| 373 | + $query = "AND (`code` REGEXP '".$search."' |
|
| 374 | + OR `group_num` REGEXP '" . $search."' |
|
| 375 | + OR `name` REGEXP '" . $search."' |
|
| 376 | + OR `surname` REGEXP '" . $search."' |
|
| 377 | + OR `nick` REGEXP '" . $search."' |
|
| 378 | + OR `city` REGEXP '" . $search."' |
|
| 379 | + OR `group_name` REGEXP '" . $search."')"; |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | return $query; |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | { |
| 394 | 394 | $billData = $this->getBill($query_id); |
| 395 | 395 | |
| 396 | - if($billData['bill'] < $this->Meeting->getPrice('cost')){ |
|
| 396 | + if($billData['bill'] < $this->Meeting->getPrice('cost')) { |
|
| 397 | 397 | $bill = array('bill' => $this->Meeting->getPrice($type)); |
| 398 | 398 | $payResult = $this->getDatabase() |
| 399 | 399 | ->table($this->getTable()) |
@@ -452,14 +452,14 @@ discard block |
||
| 452 | 452 | $programBlocks = $this->Blocks->getProgramBlocks($meetingId); |
| 453 | 453 | |
| 454 | 454 | // table is empty |
| 455 | - if(!$programBlocks){ |
|
| 455 | + if(!$programBlocks) { |
|
| 456 | 456 | $html .= "<div class='emptyTable' style='width:400px;'>Nejsou žádná aktuální data.</div>\n"; |
| 457 | 457 | } else { |
| 458 | - foreach($programBlocks as $block){ |
|
| 459 | - $html .= "<div class='block-" . $block->id . " ".Strings::webalize($block['day'])."'>".$block['day'].", ".$block['from']." - ".$block['to']." : ".$block['name']."</div>\n"; |
|
| 458 | + foreach($programBlocks as $block) { |
|
| 459 | + $html .= "<div class='block-".$block->id." ".Strings::webalize($block['day'])."'>".$block['day'].", ".$block['from']." - ".$block['to']." : ".$block['name']."</div>\n"; |
|
| 460 | 460 | // rendering programs in block |
| 461 | - if($block['program'] == 1){ |
|
| 462 | - $html .= "<div class='block-" . $block->id . " programs ".Strings::webalize($block['day'])." ".Strings::webalize($block['name'])."'>".$this->Programs->getPrograms($block['id'], $visitorId)."</div>"; |
|
| 461 | + if($block['program'] == 1) { |
|
| 462 | + $html .= "<div class='block-".$block->id." programs ".Strings::webalize($block['day'])." ".Strings::webalize($block['name'])."'>".$this->Programs->getPrograms($block['id'], $visitorId)."</div>"; |
|
| 463 | 463 | } |
| 464 | 464 | $html .= "<br />"; |
| 465 | 465 | } |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | checked |
| 491 | 491 | FROM kk_visitors AS vis |
| 492 | 492 | LEFT JOIN kk_provinces AS provs ON vis.province = provs.id |
| 493 | - WHERE meeting = ? AND deleted = ? ' . $this->buildSearchQuery() . ' |
|
| 493 | + WHERE meeting = ? AND deleted = ? ' . $this->buildSearchQuery().' |
|
| 494 | 494 | ORDER BY vis.id ASC', |
| 495 | 495 | $this->getMeetingId(), '0')->fetchAll(); |
| 496 | 496 | } |
@@ -531,8 +531,8 @@ discard block |
||
| 531 | 531 | ->group('email') |
| 532 | 532 | ->fetchAll(); |
| 533 | 533 | |
| 534 | - foreach($emails as $item){ |
|
| 535 | - $recipientMailAddresses .= $item['email'] . ",\n"; |
|
| 534 | + foreach($emails as $item) { |
|
| 535 | + $recipientMailAddresses .= $item['email'].",\n"; |
|
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | $recipientMailAddresses = rtrim($recipientMailAddresses, "\n,"); |
@@ -521,7 +521,8 @@ |
||
| 521 | 521 | * @param array $queryId |
| 522 | 522 | * @return string |
| 523 | 523 | */ |
| 524 | - public function getSerializedMailAddress(array $queryId = []) { |
|
| 524 | + public function getSerializedMailAddress(array $queryId = []) |
|
| 525 | + { |
|
| 525 | 526 | $recipientMailAddresses = ''; |
| 526 | 527 | |
| 527 | 528 | $emails = $this->getDatabase() |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | public function modify($ID_visitor, $DB_data, $meals_data, $programs_data) |
| 205 | 205 | { |
| 206 | 206 | // for returning specific error |
| 207 | - $error = array('visitor' => TRUE, 'meal' => TRUE, 'program' => TRUE); |
|
| 207 | + $error = array('visitor' => true, 'meal' => true, 'program' => true); |
|
| 208 | 208 | |
| 209 | 209 | $DB_data['code'] = |
| 210 | 210 | Strings::substring($DB_data['name'], 0, 1) |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | public function modifyByGuid($guid, $DB_data, $meals_data, $programs_data) |
| 256 | 256 | { |
| 257 | 257 | // for returning specific error |
| 258 | - $error = array('visitor' => TRUE, 'meal' => TRUE, 'program' => TRUE); |
|
| 258 | + $error = array('visitor' => true, 'meal' => true, 'program' => true); |
|
| 259 | 259 | |
| 260 | 260 | $DB_data['code'] = |
| 261 | 261 | Strings::substring($DB_data['name'], 0, 1) |
@@ -211,6 +211,8 @@ discard block |
||
| 211 | 211 | * @param string name |
| 212 | 212 | * @param mixed value |
| 213 | 213 | * @param var variable that match with value |
| 214 | + * @param string $name |
|
| 215 | + * @param integer $value |
|
| 214 | 216 | * @return string html of chceck box |
| 215 | 217 | */ |
| 216 | 218 | protected function renderHtmlCheckBox($name, $value, $checked_variable) |
@@ -266,7 +268,7 @@ discard block |
||
| 266 | 268 | } |
| 267 | 269 | |
| 268 | 270 | /** |
| 269 | - * @return Container |
|
| 271 | + * @return Nette\DI\Container |
|
| 270 | 272 | */ |
| 271 | 273 | protected function getContainer() |
| 272 | 274 | { |
@@ -405,6 +407,10 @@ discard block |
||
| 405 | 407 | return $this->getModel()->updateBy('guid', $guid, $data); |
| 406 | 408 | } |
| 407 | 409 | |
| 410 | + /** |
|
| 411 | + * @param string $key |
|
| 412 | + * @param integer $minutes |
|
| 413 | + */ |
|
| 408 | 414 | public function remember($key, $minutes, \Closure $callback) |
| 409 | 415 | { |
| 410 | 416 | // If the item exists in the cache we will just return this immediately |
@@ -447,7 +453,7 @@ discard block |
||
| 447 | 453 | } |
| 448 | 454 | |
| 449 | 455 | /** |
| 450 | - * @return string |
|
| 456 | + * @return boolean |
|
| 451 | 457 | */ |
| 452 | 458 | protected function getDebugMode() |
| 453 | 459 | { |
@@ -2,9 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Presenters; |
| 4 | 4 | |
| 5 | -use Nette, |
|
| 6 | - App\Model; |
|
| 7 | -use Nette\Utils\Strings; |
|
| 5 | +use Nette; |
|
| 6 | +use App\Model; |
|
| 8 | 7 | use Nette\Http\Request; |
| 9 | 8 | use App\Models\SunlightModel; |
| 10 | 9 | use Nette\Caching\Cache; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ]; |
| 49 | 49 | |
| 50 | 50 | protected $hours = [ |
| 51 | - 0 => "00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23" |
|
| 51 | + 0 => "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23" |
|
| 52 | 52 | ]; |
| 53 | 53 | |
| 54 | 54 | protected $minutes = [ |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $this->setBacklink($backlink); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if($meetingId){ |
|
| 83 | + if($meetingId) { |
|
| 84 | 84 | $_SESSION['meetingID'] = $meetingId; |
| 85 | 85 | } elseif(!isset($_SESSION['meetingID'])) { |
| 86 | 86 | $meeting = $this->getContainer()->getService('meeting'); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $template->visitDir = VISIT_DIR; |
| 121 | 121 | $template->expDir = EXP_DIR; |
| 122 | 122 | |
| 123 | - $template->categories = $this->remember('categories:all', 10, function () { |
|
| 123 | + $template->categories = $this->remember('categories:all', 10, function() { |
|
| 124 | 124 | return $this->getContainer()->getService('category')->all(); |
| 125 | 125 | }); |
| 126 | 126 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | $template->meeting = $meeting->getPlaceAndYear($_SESSION['meetingID']); |
| 131 | 131 | $template->menuItems = $meeting->getMenuItems(); |
| 132 | - $template->meeting_heading = $meeting->getRegHeading(); |
|
| 132 | + $template->meeting_heading = $meeting->getRegHeading(); |
|
| 133 | 133 | $template->meetingId = $this->getMeetingId(); |
| 134 | 134 | $template->backlinkUrl = $this->getBacklinkUrl(); |
| 135 | 135 | $template->backlink = $this->getBacklink(); |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $names = explode(',', $item->tutor); |
| 232 | 232 | |
| 233 | 233 | $i = 0; |
| 234 | - foreach ($mails as $mail) { |
|
| 234 | + foreach($mails as $mail) { |
|
| 235 | 235 | $mail = trim($mail); |
| 236 | 236 | $name = trim($names[$i]); |
| 237 | 237 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | // zaheshovane udaje, aby se nedali jen tak ziskat data z databaze |
| 245 | 245 | protected function formKeyHash($id, $meetingId) |
| 246 | 246 | { |
| 247 | - return ((int)$id . $meetingId) * 116 + 39147; |
|
| 247 | + return ((int) $id.$meetingId) * 116 + 39147; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /** |
@@ -410,12 +410,12 @@ discard block |
||
| 410 | 410 | // If the item exists in the cache we will just return this immediately |
| 411 | 411 | // otherwise we will execute the given Closure and cache the result |
| 412 | 412 | // of that execution for the given number of minutes in storage. |
| 413 | - if (! is_null($data = $this->getCache()->load($key))) { |
|
| 413 | + if(!is_null($data = $this->getCache()->load($key))) { |
|
| 414 | 414 | $items = []; |
| 415 | 415 | |
| 416 | 416 | foreach($data as $item) { |
| 417 | 417 | $object = new \stdClass(); |
| 418 | - foreach ($item as $key => $value) { |
|
| 418 | + foreach($item as $key => $value) { |
|
| 419 | 419 | $object->$key = $value; |
| 420 | 420 | } |
| 421 | 421 | $items[] = $object; |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | |
| 427 | 427 | $data = $callback(); |
| 428 | 428 | $serialized = []; |
| 429 | - foreach ($data as $item) { |
|
| 429 | + foreach($data as $item) { |
|
| 430 | 430 | $serialized[] = $item->toArray(); |
| 431 | 431 | } |
| 432 | 432 | |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | $key, |
| 435 | 435 | $serialized, |
| 436 | 436 | [ |
| 437 | - Cache::EXPIRE => $minutes . ' minutes', |
|
| 437 | + Cache::EXPIRE => $minutes.' minutes', |
|
| 438 | 438 | ] |
| 439 | 439 | ); |
| 440 | 440 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * category ID |
| 156 | 156 | * @var integer |
| 157 | 157 | */ |
| 158 | - protected $itemId = NULL; |
|
| 158 | + protected $itemId = null; |
|
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | 161 | * action what to do |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | * database connection |
| 198 | 198 | * @var string |
| 199 | 199 | */ |
| 200 | - protected $database = NULL; |
|
| 200 | + protected $database = null; |
|
| 201 | 201 | |
| 202 | 202 | /** |
| 203 | 203 | * debug mode |
@@ -300,6 +300,8 @@ |
||
| 300 | 300 | * @param array content of slect box |
| 301 | 301 | * @param var variable that match selected option |
| 302 | 302 | * @param string inline styling |
| 303 | + * @param string $name |
|
| 304 | + * @param string $inline_style |
|
| 303 | 305 | * @return string html of select box |
| 304 | 306 | */ |
| 305 | 307 | private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = NULL) |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Presenters; |
| 4 | 4 | |
| 5 | -use Nette\Database\Context; |
|
| 6 | 5 | use Nette\Http\Request; |
| 7 | 6 | use Tracy\Debugger; |
| 8 | 7 | use App\Services\Emailer; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $template->day_roll = $this->renderHtmlSelectBox('day', $this->days, null, 'width:172px;'); |
| 61 | 61 | $template->hour_roll = $this->renderHtmlSelectBox('start_hour', $this->hours, date('H')); |
| 62 | 62 | $template->minute_roll = $this->renderHtmlSelectBox('start_minute', $this->minutes, date('i')); |
| 63 | - $template->end_hour_roll = $this->renderHtmlSelectBox('end_hour', $this->hours, date('H')+1); |
|
| 63 | + $template->end_hour_roll = $this->renderHtmlSelectBox('end_hour', $this->hours, date('H') + 1); |
|
| 64 | 64 | $template->end_minute_roll = $this->renderHtmlSelectBox('end_minute', $this->minutes, date('i')); |
| 65 | 65 | // is program block check box |
| 66 | 66 | $template->program_checkbox = $this->renderHtmlCheckBox('program', 1, 0); |
@@ -92,13 +92,13 @@ discard block |
||
| 92 | 92 | $this->guardToGreaterThanFrom($data['from'], $data['to']); |
| 93 | 93 | $result = $this->getModel()->create($data); |
| 94 | 94 | |
| 95 | - Debugger::log('Creation of block successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 95 | + Debugger::log('Creation of block successfull, result: '.json_encode($result), Debugger::INFO); |
|
| 96 | 96 | |
| 97 | 97 | $this->flashMessage('Položka byla úspěšně vytvořena', 'ok'); |
| 98 | 98 | } catch(Exception $e) { |
| 99 | - Debugger::log('Creation of block with data ' . json_encode($data) . ' failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 99 | + Debugger::log('Creation of block with data '.json_encode($data).' failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 100 | 100 | |
| 101 | - $this->flashMessage('Creation of block failed, result: ' . $e->getMessage(), 'error'); |
|
| 101 | + $this->flashMessage('Creation of block failed, result: '.$e->getMessage(), 'error'); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | $this->redirect($this->getBacklink() ?: 'Block:listing'); |
@@ -128,13 +128,13 @@ discard block |
||
| 128 | 128 | $this->guardToGreaterThanFrom($data['from'], $data['to']); |
| 129 | 129 | $result = $this->getModel()->update($id, $data); |
| 130 | 130 | |
| 131 | - Debugger::log('Modification of block id ' . $id . ' with data ' . json_encode($data) . ' successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 131 | + Debugger::log('Modification of block id '.$id.' with data '.json_encode($data).' successfull, result: '.json_encode($result), Debugger::INFO); |
|
| 132 | 132 | |
| 133 | 133 | $this->flashMessage('Položka byla úspěšně upravena.', 'ok'); |
| 134 | 134 | } catch(Exception $e) { |
| 135 | - Debugger::log('Modification of block id ' . $id . ' failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 135 | + Debugger::log('Modification of block id '.$id.' failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 136 | 136 | |
| 137 | - $this->flashMessage('Modification of block id ' . $id . ' failed, result: ' . $e->getMessage(), 'error'); |
|
| 137 | + $this->flashMessage('Modification of block id '.$id.' failed, result: '.$e->getMessage(), 'error'); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | $this->redirect($this->getBacklink() ?: 'Block:listing'); |
@@ -150,13 +150,13 @@ discard block |
||
| 150 | 150 | $data = $this->getRequest()->getPost(); |
| 151 | 151 | $result = $this->updateByGuid($id, $data); |
| 152 | 152 | |
| 153 | - Debugger::log('Modification of block annotation id ' . $id . ' with data ' . json_encode($data) . ' successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 153 | + Debugger::log('Modification of block annotation id '.$id.' with data '.json_encode($data).' successfull, result: '.json_encode($result), Debugger::INFO); |
|
| 154 | 154 | |
| 155 | 155 | $this->flashMessage('Položka byla úspěšně upravena.', 'ok'); |
| 156 | 156 | } catch(Exception $e) { |
| 157 | - Debugger::log('Modification of block annotation guid ' . $id . ' failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 157 | + Debugger::log('Modification of block annotation guid '.$id.' failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 158 | 158 | |
| 159 | - $this->flashMessage('Modification of block annotation guid ' . $id . ' failed, result: ' . $e->getMessage(), 'error'); |
|
| 159 | + $this->flashMessage('Modification of block annotation guid '.$id.' failed, result: '.$e->getMessage(), 'error'); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $this->redirect('Block:annotation', $id); |
@@ -170,11 +170,11 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | try { |
| 172 | 172 | $result = $this->getModel()->delete($id); |
| 173 | - Debugger::log('Destroying of block successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 173 | + Debugger::log('Destroying of block successfull, result: '.json_encode($result), Debugger::INFO); |
|
| 174 | 174 | $this->flashMessage('Položka byla úspěšně smazána.', 'ok'); |
| 175 | 175 | } catch(Exception $e) { |
| 176 | - Debugger::log('Destroying of block failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 177 | - $this->flashMessage('Destroying of block failed, result: ' . $e->getMessage(), 'error'); |
|
| 176 | + Debugger::log('Destroying of block failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 177 | + $this->flashMessage('Destroying of block failed, result: '.$e->getMessage(), 'error'); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | $this->redirect('Block:listing'); |
@@ -193,11 +193,11 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | $this->getEmailer()->tutor($recipients, $tutors->guid, 'block'); |
| 195 | 195 | |
| 196 | - Debugger::log('Sending email to block tutor successfull, result: ' . json_encode($recipients) . ', ' . $tutors->guid, Debugger::INFO); |
|
| 196 | + Debugger::log('Sending email to block tutor successfull, result: '.json_encode($recipients).', '.$tutors->guid, Debugger::INFO); |
|
| 197 | 197 | $this->flashMessage('Email lektorovi byl odeslán..', 'ok'); |
| 198 | 198 | } catch(Exception $e) { |
| 199 | - Debugger::log('Sending email to block tutor failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 200 | - $this->flashMessage('Email lektorovi nebyl odeslán, result: ' . $e->getMessage(), 'error'); |
|
| 199 | + Debugger::log('Sending email to block tutor failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 200 | + $this->flashMessage('Email lektorovi nebyl odeslán, result: '.$e->getMessage(), 'error'); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | $this->redirect('Block:edit', $id); |
@@ -304,13 +304,13 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = NULL) |
| 306 | 306 | { |
| 307 | - if(isset($inline_style) && $inline_style != NULL){ |
|
| 307 | + if(isset($inline_style) && $inline_style != NULL) { |
|
| 308 | 308 | $style = " style='".$inline_style."'"; |
| 309 | 309 | } else { |
| 310 | 310 | $style = ""; |
| 311 | 311 | } |
| 312 | 312 | $html_select = "<select name='".$name."'".$style.">"; |
| 313 | - foreach ($select_content as $key => $value) { |
|
| 313 | + foreach($select_content as $key => $value) { |
|
| 314 | 314 | if($key == $selected_option) { |
| 315 | 315 | $selected = 'selected'; |
| 316 | 316 | } else { |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * @var integer |
| 25 | 25 | */ |
| 26 | - private $blockId = NULL; |
|
| 26 | + private $blockId = null; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @var Emailer |
@@ -302,9 +302,9 @@ discard block |
||
| 302 | 302 | * @param string inline styling |
| 303 | 303 | * @return string html of select box |
| 304 | 304 | */ |
| 305 | - private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = NULL) |
|
| 305 | + private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = null) |
|
| 306 | 306 | { |
| 307 | - if(isset($inline_style) && $inline_style != NULL){ |
|
| 307 | + if(isset($inline_style) && $inline_style != null){ |
|
| 308 | 308 | $style = " style='".$inline_style."'"; |
| 309 | 309 | } else { |
| 310 | 310 | $style = ""; |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | |
| 631 | 631 | |
| 632 | 632 | /** |
| 633 | - * @return PHPExcel |
|
| 633 | + * @return \PHPExcel |
|
| 634 | 634 | */ |
| 635 | 635 | protected function getExcel() |
| 636 | 636 | { |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | } |
| 639 | 639 | |
| 640 | 640 | /** |
| 641 | - * @param PHPExcel $excel |
|
| 641 | + * @param \PHPExcel $excel |
|
| 642 | 642 | * @return $this |
| 643 | 643 | */ |
| 644 | 644 | protected function setExcel(\PHPExcel $excel) |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | class ExportPresenter extends BasePresenter |
| 20 | 20 | { |
| 21 | 21 | |
| 22 | - const TEMPLATE_DIR = __DIR__ . '/../templates/Export/'; |
|
| 22 | + const TEMPLATE_DIR = __DIR__.'/../templates/Export/'; |
|
| 23 | 23 | const TEMPLATE_EXT = 'latte'; |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $this->redirect('Export:listing'); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - switch($type){ |
|
| 112 | + switch($type) { |
|
| 113 | 113 | case "summary": |
| 114 | 114 | $templateName = 'evidence_summary'; |
| 115 | 115 | // specific mPDF settings |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $attendances = $this->getModel()->attendance(); |
| 149 | 149 | |
| 150 | 150 | // prepare header |
| 151 | - $attendanceHeader = $attendances[0]['place'] . ' ' . $attendances[0]['year']; |
|
| 151 | + $attendanceHeader = $attendances[0]['place'].' '.$attendances[0]['year']; |
|
| 152 | 152 | |
| 153 | 153 | // set header |
| 154 | 154 | $this->getPdf()->SetHeader($attendanceHeader.'|sraz VS|Prezenční listina'); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | public function renderMealTicket() |
| 171 | 171 | { |
| 172 | 172 | // output file name |
| 173 | - $this->filename= 'vlastni_stravenky.pdf'; |
|
| 173 | + $this->filename = 'vlastni_stravenky.pdf'; |
|
| 174 | 174 | $templateName = 'meal_ticket'; |
| 175 | 175 | |
| 176 | 176 | $mealTickets = $this->getModel()->mealTicket(); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | $nameList = $this->getModel()->nameList(); |
| 199 | 199 | |
| 200 | 200 | // prepare header |
| 201 | - $namelistHeader = $nameList[0]['place'] . " " . $nameList[0]['year']; |
|
| 201 | + $namelistHeader = $nameList[0]['place']." ".$nameList[0]['year']; |
|
| 202 | 202 | |
| 203 | 203 | // set header |
| 204 | 204 | $this->getPdf()->SetHeader($namelistHeader.'|sraz VS|Jméno, Příjmení, Přezdívka'); |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public function renderProgram($type, $id) |
| 220 | 220 | { |
| 221 | - $programMethod = 'renderProgram' . Strings::firstUpper($type); |
|
| 221 | + $programMethod = 'renderProgram'.Strings::firstUpper($type); |
|
| 222 | 222 | |
| 223 | 223 | call_user_func([$this, $programMethod], $id); |
| 224 | 224 | } |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $this->filename = 'vlastni_programy.pdf'; |
| 235 | 235 | $templateName = 'program_cards'; |
| 236 | 236 | |
| 237 | - $this->getPdf()->SetWatermarkImage(IMG_DIR . 'logos/watermark.jpg', 0.1, ''); |
|
| 237 | + $this->getPdf()->SetWatermarkImage(IMG_DIR.'logos/watermark.jpg', 0.1, ''); |
|
| 238 | 238 | $this->getPdf()->showWatermarkImage = true; |
| 239 | 239 | |
| 240 | 240 | $parameters = [ |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | { |
| 256 | 256 | $largeProgram = $this->getModel()->largeProgram(); |
| 257 | 257 | |
| 258 | - $this->filename = Strings::toAscii($largeProgram['place'] . $largeProgram['year'] . '-program') . '.pdf'; |
|
| 258 | + $this->filename = Strings::toAscii($largeProgram['place'].$largeProgram['year'].'-program').'.pdf'; |
|
| 259 | 259 | $templateName = 'program_large'; |
| 260 | 260 | |
| 261 | 261 | $meetingHeader = $largeProgram['place']." ".$largeProgram['year']; |
@@ -283,9 +283,9 @@ discard block |
||
| 283 | 283 | { |
| 284 | 284 | $templateName = 'program_public'; |
| 285 | 285 | $publicProgram = $this->getModel()->publicProgram(); |
| 286 | - $this->filename = Strings::toAscii($publicProgram['place'] . $publicProgram['year'] . '-program' . '.pdf'); |
|
| 286 | + $this->filename = Strings::toAscii($publicProgram['place'].$publicProgram['year'].'-program'.'.pdf'); |
|
| 287 | 287 | |
| 288 | - $meetingHeader = $publicProgram['place'] . ' ' . $publicProgram['year']; |
|
| 288 | + $meetingHeader = $publicProgram['place'].' '.$publicProgram['year']; |
|
| 289 | 289 | |
| 290 | 290 | $parameters = [ |
| 291 | 291 | 'header' => $meetingHeader, |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | ]; |
| 320 | 320 | |
| 321 | 321 | $exportBlocks = []; |
| 322 | - foreach ($days as $day) { |
|
| 322 | + foreach($days as $day) { |
|
| 323 | 323 | $exportBlocks[$day] = $this->getBlockModel()->getExportBlocks($this->meetingId, $day); |
| 324 | 324 | } |
| 325 | 325 | |
@@ -406,9 +406,9 @@ discard block |
||
| 406 | 406 | if(!$namesStringified) { |
| 407 | 407 | $badges = $this->getModel()->nameBadges(); |
| 408 | 408 | } else { |
| 409 | - $namesStringified = preg_replace('/\s+/','',$namesStringified); |
|
| 409 | + $namesStringified = preg_replace('/\s+/', '', $namesStringified); |
|
| 410 | 410 | |
| 411 | - $names = explode(',',$namesStringified); |
|
| 411 | + $names = explode(',', $namesStringified); |
|
| 412 | 412 | foreach($names as $name) { |
| 413 | 413 | $badge['nick'] = $name; |
| 414 | 414 | $badges[] = $badge; |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | $this->getPdf()->setMargins(15, 15, 10, 5); |
| 419 | - $this->getPdf()->SetWatermarkImage(IMG_DIR . 'logos/watermark-waves.jpg', 0.1, ''); |
|
| 419 | + $this->getPdf()->SetWatermarkImage(IMG_DIR.'logos/watermark-waves.jpg', 0.1, ''); |
|
| 420 | 420 | $this->getPdf()->showWatermarkImage = TRUE; |
| 421 | 421 | |
| 422 | 422 | $parameters = [ |
@@ -524,13 +524,13 @@ discard block |
||
| 524 | 524 | $i = 2; |
| 525 | 525 | foreach($visitors as $data) { |
| 526 | 526 | foreach($cellValues as $cell => $value) { |
| 527 | - $list->setCellValue($cell . $i, $data[$value]); |
|
| 527 | + $list->setCellValue($cell.$i, $data[$value]); |
|
| 528 | 528 | } |
| 529 | 529 | $i++; |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | // stahnuti souboru |
| 533 | - $filename = 'export-MS-'.date('Y-m-d',time()).'.xlsx'; |
|
| 533 | + $filename = 'export-MS-'.date('Y-m-d', time()).'.xlsx'; |
|
| 534 | 534 | |
| 535 | 535 | $excel->setActiveSheetIndex(0); |
| 536 | 536 | |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | { |
| 559 | 559 | $template = $this->getTemplate(); |
| 560 | 560 | |
| 561 | - foreach ($parameters as $parameter => $value) { |
|
| 561 | + foreach($parameters as $parameter => $value) { |
|
| 562 | 562 | $template->{$parameter} = $value; |
| 563 | 563 | } |
| 564 | 564 | |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | $template = $this->getTemplate(); |
| 581 | 581 | |
| 582 | 582 | /* debugging */ |
| 583 | - if($this->debugMode){ |
|
| 583 | + if($this->debugMode) { |
|
| 584 | 584 | echo $template; |
| 585 | 585 | exit('DEBUG_MODE'); |
| 586 | 586 | } else { |
@@ -417,7 +417,7 @@ |
||
| 417 | 417 | |
| 418 | 418 | $this->getPdf()->setMargins(15, 15, 10, 5); |
| 419 | 419 | $this->getPdf()->SetWatermarkImage(IMG_DIR . 'logos/watermark-waves.jpg', 0.1, ''); |
| 420 | - $this->getPdf()->showWatermarkImage = TRUE; |
|
| 420 | + $this->getPdf()->showWatermarkImage = true; |
|
| 421 | 421 | |
| 422 | 422 | $parameters = [ |
| 423 | 423 | 'result' => $badges, |
@@ -121,7 +121,6 @@ |
||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | - * @param integer $id |
|
| 125 | 124 | * @return void |
| 126 | 125 | */ |
| 127 | 126 | public function actionUpdate($guid) |
@@ -110,11 +110,11 @@ discard block |
||
| 110 | 110 | $guid = $this->getVisitorService()->create($postData); |
| 111 | 111 | $result = $this->sendRegistrationSummary($postData, $guid); |
| 112 | 112 | |
| 113 | - Debugger::log('Creation of registration('. $guid .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 114 | - $this->flashMessage('Registrace(' . $guid . ') byla úspěšně založena.', 'ok'); |
|
| 113 | + Debugger::log('Creation of registration('.$guid.') successfull, result: '.json_encode($result), Debugger::INFO); |
|
| 114 | + $this->flashMessage('Registrace('.$guid.') byla úspěšně založena.', 'ok'); |
|
| 115 | 115 | } catch(Exception $e) { |
| 116 | - Debugger::log('Creation of registration('. $guid .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 117 | - $this->flashMessage('Creation of registration failed, result: ' . $e->getMessage(), 'error'); |
|
| 116 | + Debugger::log('Creation of registration('.$guid.') failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 117 | + $this->flashMessage('Creation of registration failed, result: '.$e->getMessage(), 'error'); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | $this->redirect('Registration:check', $guid); |
@@ -132,11 +132,11 @@ discard block |
||
| 132 | 132 | $result = $this->getVisitorService()->update($guid, $postData); |
| 133 | 133 | $result = $this->sendRegistrationSummary($postData, $guid); |
| 134 | 134 | |
| 135 | - Debugger::log('Modification of registration('. $guid .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 136 | - $this->flashMessage('Registrace(' . $guid . ') byla úspěšně upravena.', 'ok'); |
|
| 135 | + Debugger::log('Modification of registration('.$guid.') successfull, result: '.json_encode($result), Debugger::INFO); |
|
| 136 | + $this->flashMessage('Registrace('.$guid.') byla úspěšně upravena.', 'ok'); |
|
| 137 | 137 | } catch(Exception $e) { |
| 138 | - Debugger::log('Modification of registration('. $guid .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 139 | - $this->flashMessage('Modification of registration(' . $guid . ') failed, result: ' . $e->getMessage(), 'error'); |
|
| 138 | + Debugger::log('Modification of registration('.$guid.') failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 139 | + $this->flashMessage('Modification of registration('.$guid.') failed, result: '.$e->getMessage(), 'error'); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | $this->redirect('Registration:check', $guid); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $template->province = $this->getMeetingModel()->renderHtmlProvinceSelect(null); |
| 165 | 165 | $template->programs = $this->getVisitorModel()->renderProgramSwitcher($this->getMeetingId(), null); |
| 166 | 166 | $template->meetingId = $this->getMeetingId(); |
| 167 | - $template->cost = $this->getMeetingModel()->getPrice('cost'); |
|
| 167 | + $template->cost = $this->getMeetingModel()->getPrice('cost'); |
|
| 168 | 168 | |
| 169 | 169 | if($this->getUserservice()->isLoggedIn()) { |
| 170 | 170 | $userDetail = $this->getUserModel()->getUserDetail(); |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $template->data['email'] = $skautisUser->Email; |
| 184 | 184 | $template->data['street'] = $skautisUser->Street; |
| 185 | 185 | $template->data['city'] = $skautisUser->City; |
| 186 | - $template->data['postal_code'] = preg_replace('/\s+/','',$skautisUser->Postcode); |
|
| 186 | + $template->data['postal_code'] = preg_replace('/\s+/', '', $skautisUser->Postcode); |
|
| 187 | 187 | $template->data['birthday'] = $skautisUser->Birthday; |
| 188 | 188 | $template->data['group_name'] = $skautisUserUnit->DisplayName; |
| 189 | 189 | $template->data['group_num'] = $skautisUserUnit->RegistrationNumber; |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $template->meals = $this->getMealModel()->renderHtmlMealsSelect($mealData, $this->disabled); |
| 234 | 234 | $template->province = $this->getMeetingModel()->renderHtmlProvinceSelect($data->province); |
| 235 | 235 | $template->programs = $this->getVisitorModel()->renderProgramSwitcher($data->meeting, $data->id); |
| 236 | - $template->cost = $this->getMeetingModel()->getPrice('cost'); |
|
| 236 | + $template->cost = $this->getMeetingModel()->getPrice('cost'); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /** |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | - * @param integer|string $ids |
|
| 199 | + * @param integer|string $id |
|
| 200 | 200 | * @return void |
| 201 | 201 | */ |
| 202 | 202 | public function actionPay($id) |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /** |
| 221 | - * @param string|interger $ids |
|
| 221 | + * @param string|interger $id |
|
| 222 | 222 | * @return void |
| 223 | 223 | */ |
| 224 | 224 | public function actionAdvance($id) |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /** |
| 364 | - * @return Latte |
|
| 364 | + * @return \Nette\Application\UI\ITemplate |
|
| 365 | 365 | */ |
| 366 | 366 | protected function createMailTemplate() |
| 367 | 367 | { |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | class VisitorPresenter extends BasePresenter |
| 26 | 26 | { |
| 27 | 27 | |
| 28 | - const TEMPLATE_DIR = __DIR__ . '/../templates/visitor/'; |
|
| 28 | + const TEMPLATE_DIR = __DIR__.'/../templates/visitor/'; |
|
| 29 | 29 | const TEMPLATE_EXT = 'latte'; |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | $guid = $this->getVisitorService()->create($postData); |
| 104 | 104 | $result = $this->sendRegistrationSummary($postData, $guid); |
| 105 | 105 | |
| 106 | - Debugger::log('Creation of visitor('. $guid .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 107 | - $this->flashMessage('Účastník(' . $guid . ') byl úspěšně upraven.', 'ok'); |
|
| 106 | + Debugger::log('Creation of visitor('.$guid.') successfull, result: '.json_encode($result), Debugger::INFO); |
|
| 107 | + $this->flashMessage('Účastník('.$guid.') byl úspěšně upraven.', 'ok'); |
|
| 108 | 108 | } catch(Exception $e) { |
| 109 | - Debugger::log('Creation of visitor('. $guid .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 110 | - $this->flashMessage('Creation of visitor failed, result: ' . $e->getMessage(), 'error'); |
|
| 109 | + Debugger::log('Creation of visitor('.$guid.') failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 110 | + $this->flashMessage('Creation of visitor failed, result: '.$e->getMessage(), 'error'); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | $this->redirect('Visitor:listing'); |
@@ -130,11 +130,11 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | //$result = $this->sendRegistrationSummary($visitor, $guid); |
| 132 | 132 | |
| 133 | - Debugger::log('Modification of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 134 | - $this->flashMessage('Účastník(' . $id . ') byl úspěšně upraven.', 'ok'); |
|
| 133 | + Debugger::log('Modification of visitor('.$id.') successfull, result: '.json_encode($result), Debugger::INFO); |
|
| 134 | + $this->flashMessage('Účastník('.$id.') byl úspěšně upraven.', 'ok'); |
|
| 135 | 135 | } catch(Exception $e) { |
| 136 | - Debugger::log('Modification of visitor('. $id .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 137 | - $this->flashMessage('Modification of visitor failed, result: ' . $e->getMessage(), 'error'); |
|
| 136 | + Debugger::log('Modification of visitor('.$id.') failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 137 | + $this->flashMessage('Modification of visitor failed, result: '.$e->getMessage(), 'error'); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | $this->redirect('Visitor:listing'); |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | try { |
| 150 | 150 | $result = $this->getVisitorService()->delete($id); |
| 151 | 151 | |
| 152 | - Debugger::log('Destroying of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 152 | + Debugger::log('Destroying of visitor('.$id.') successfull, result: '.json_encode($result), Debugger::INFO); |
|
| 153 | 153 | $this->flashMessage('Položka byla úspěšně smazána', 'ok'); |
| 154 | 154 | } catch(Exception $e) { |
| 155 | - Debugger::log('Destroying of visitor('. $id .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 156 | - $this->flashMessage('Destroying of visitor failed, result: ' . $e->getMessage(), 'error'); |
|
| 155 | + Debugger::log('Destroying of visitor('.$id.') failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 156 | + $this->flashMessage('Destroying of visitor failed, result: '.$e->getMessage(), 'error'); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | $this->redirect('Visitor:listing'); |
@@ -185,11 +185,11 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | $result = $this->getEmailer()->sendMail($recipient, $subject, (string) $template, $bcc); |
| 187 | 187 | |
| 188 | - Debugger::log('E-mail was send successfully, result: ' . json_encode($result), Debugger::INFO); |
|
| 188 | + Debugger::log('E-mail was send successfully, result: '.json_encode($result), Debugger::INFO); |
|
| 189 | 189 | $this->flashMessage('E-mail byl úspěšně odeslán', 'ok'); |
| 190 | 190 | } catch(Exception $e) { |
| 191 | - Debugger::log('Sending of e-mail failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 192 | - $this->flashMessage('Sending of e-mail failed, result: ' . $e->getMessage(), 'error'); |
|
| 191 | + Debugger::log('Sending of e-mail failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 192 | + $this->flashMessage('Sending of e-mail failed, result: '.$e->getMessage(), 'error'); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | $this->redirect('Visitor:listing'); |
@@ -207,11 +207,11 @@ discard block |
||
| 207 | 207 | $recipients = $visitor->getRecipients($id); |
| 208 | 208 | $this->getEmailer()->sendPaymentInfo($recipients, 'advance'); |
| 209 | 209 | |
| 210 | - Debugger::log('Visitor: Action pay for id ' . $id . ' successfull, result: ' . $e->getMessage(), Debugger::INFO); |
|
| 210 | + Debugger::log('Visitor: Action pay for id '.$id.' successfull, result: '.$e->getMessage(), Debugger::INFO); |
|
| 211 | 211 | $this->flashMessage('Platba byla zaplacena.', 'ok'); |
| 212 | 212 | } catch(Exception $e) { |
| 213 | - Debugger::log('Visitor: Action pay for id ' . $id . ' failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 214 | - $this->flashMessage('Visitor: Action pay for id ' . $id . ' failed, result: ' . $e->getMessage(), 'error'); |
|
| 213 | + Debugger::log('Visitor: Action pay for id '.$id.' failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 214 | + $this->flashMessage('Visitor: Action pay for id '.$id.' failed, result: '.$e->getMessage(), 'error'); |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | $this->redirect('Visitor:listing'); |
@@ -229,11 +229,11 @@ discard block |
||
| 229 | 229 | $recipients = $visitor->getRecipients($id); |
| 230 | 230 | $this->getEmailer()->sendPaymentInfo($recipients, 'advance'); |
| 231 | 231 | |
| 232 | - Debugger::log('Visitor: Action advance for id ' . $id . ' successfull, result: ' . $e->getMessage(), Debugger::INFO); |
|
| 232 | + Debugger::log('Visitor: Action advance for id '.$id.' successfull, result: '.$e->getMessage(), Debugger::INFO); |
|
| 233 | 233 | $this->flashMessage('Záloha byla zaplacena.', 'ok'); |
| 234 | 234 | } catch(Exception $e) { |
| 235 | - Debugger::log('Visitor: Action advance for id ' . $id . ' failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 236 | - $this->flashMessage('Visitor: Action advance for id ' . $id . ' failed, result: ' . $e->getMessage(), 'error'); |
|
| 235 | + Debugger::log('Visitor: Action advance for id '.$id.' failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 236 | + $this->flashMessage('Visitor: Action advance for id '.$id.' failed, result: '.$e->getMessage(), 'error'); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | $this->redirect('Visitor:listing'); |
@@ -249,11 +249,11 @@ discard block |
||
| 249 | 249 | { |
| 250 | 250 | try { |
| 251 | 251 | $result = $this->getModel()->checked($id, '1'); |
| 252 | - Debugger::log('Check of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 252 | + Debugger::log('Check of visitor('.$id.') successfull, result: '.json_encode($result), Debugger::INFO); |
|
| 253 | 253 | $this->flashMessage('Položka byla úspěšně zkontrolována', 'ok'); |
| 254 | 254 | } catch(Exception $e) { |
| 255 | - Debugger::log('Check of visitor('. $id .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 256 | - $this->flashMessage('Check of visitor failed, result: ' . $e->getMessage(), 'error'); |
|
| 255 | + Debugger::log('Check of visitor('.$id.') failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 256 | + $this->flashMessage('Check of visitor failed, result: '.$e->getMessage(), 'error'); |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | $this->redirect('Visitor:listing'); |
@@ -269,11 +269,11 @@ discard block |
||
| 269 | 269 | { |
| 270 | 270 | try { |
| 271 | 271 | $result = $this->getModel()->checked($id, 0); |
| 272 | - Debugger::log('Uncheck of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 272 | + Debugger::log('Uncheck of visitor('.$id.') successfull, result: '.json_encode($result), Debugger::INFO); |
|
| 273 | 273 | $this->flashMessage('Položka byla nastavena jako nekontrolována', 'ok'); |
| 274 | 274 | } catch(Exception $e) { |
| 275 | - Debugger::log('Uncheck of visitor('. $id .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 276 | - $this->flashMessage('Uncheck of visitor failed, result: ' . $e->getMessage(), 'error'); |
|
| 275 | + Debugger::log('Uncheck of visitor('.$id.') failed, result: '.$e->getMessage(), Debugger::ERROR); |
|
| 276 | + $this->flashMessage('Uncheck of visitor failed, result: '.$e->getMessage(), 'error'); |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | $this->redirect('Visitor:listing'); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | protected function sendRegistrationSummary(array $visitor, $guid) |
| 386 | 386 | { |
| 387 | 387 | $recipient = [ |
| 388 | - $visitor['email'] => $visitor['name']. ' ' . $visitor['surname'], |
|
| 388 | + $visitor['email'] => $visitor['name'].' '.$visitor['surname'], |
|
| 389 | 389 | ]; |
| 390 | 390 | |
| 391 | 391 | $code4bank = $this->calculateCode4Bank($visitor); |
@@ -2,10 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Routers; |
| 4 | 4 | |
| 5 | -use Nette, |
|
| 6 | - Nette\Application\Routers\RouteList, |
|
| 7 | - Nette\Application\Routers\Route, |
|
| 8 | - Nette\Application\Routers\SimpleRouter; |
|
| 5 | +use Nette; |
|
| 6 | +use Nette\Application\Routers\RouteList; |
|
| 7 | +use Nette\Application\Routers\Route; |
|
| 9 | 8 | |
| 10 | 9 | |
| 11 | 10 | /** |