Guest User

Untitled

a guest
May 24th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. $polls = $this->requestAction('/polls/activePoll');
  4.  
  5. $answers = array();
  6. foreach($polls['Answer'] as $key => $value){
  7. $answers[$value['id']] = $value['answer'];
  8. }
  9.  
  10. $responses = array();
  11. foreach($polls['Response'] as $key => $value){
  12. $responses[$value['answer_id']] = $responses[$value['answer_id']]+1; //cant set and write at the same time?
  13.  
  14. if($value['user_id'] == $session->read('Auth.User.id')){
  15. $voted = true;
  16. }
  17. }
  18. if($voted): ?>
  19.  
  20. ===
  21. Notice (8): Undefined index: 2 [APP\views\elements\poll.ctp, line 12]
  22. Notice (8): Undefined index: 1 [APP\views\elements\poll.ctp, line 12]
Add Comment
Please, Sign In to add comment