|
@@ 225-234 (lines=10) @@
|
| 222 |
|
$oldPrograms = $this->getVisitorPrograms($ID_visitor); |
| 223 |
|
|
| 224 |
|
// update old data to new existing |
| 225 |
|
foreach($programBlocks as $programBlock) { |
| 226 |
|
$data = array('program' => $programs_data[$programBlock->id]); |
| 227 |
|
// read first value from array and shift it to the end |
| 228 |
|
$oldProgram = array_shift($oldPrograms); |
| 229 |
|
|
| 230 |
|
$result = $this->database |
| 231 |
|
->table('kk_visitor-program') |
| 232 |
|
->where('visitor ? AND id ?', $ID_visitor, (empty($oldProgram)) ? $oldProgram : $oldProgram->id) |
| 233 |
|
->update($data); |
| 234 |
|
} |
| 235 |
|
|
| 236 |
|
return $ID_visitor; |
| 237 |
|
} |
|
@@ 273-282 (lines=10) @@
|
| 270 |
|
$oldPrograms = $this->getVisitorPrograms($visitor->id); |
| 271 |
|
|
| 272 |
|
// update old data to new existing |
| 273 |
|
foreach($programBlocks as $programBlock) { |
| 274 |
|
$data = array('program' => $programs_data[$programBlock->id]); |
| 275 |
|
// read first value from array and shift it to the end |
| 276 |
|
$oldProgram = array_shift($oldPrograms); |
| 277 |
|
|
| 278 |
|
$result = $this->getDatabase() |
| 279 |
|
->table('kk_visitor-program') |
| 280 |
|
->where('visitor ? AND id ?', $visitor->id, (empty($oldProgram)) ? $oldProgram : $oldProgram->id) |
| 281 |
|
->update($data); |
| 282 |
|
} |
| 283 |
|
|
| 284 |
|
return $guid; |
| 285 |
|
} |