Permalink
Browse files

team approve

  • Loading branch information...
1 parent 0f3be06 commit 84b75dd58957dbff527120a2858b5387b9535606 @wooki committed Dec 14, 2012
Showing with 15 additions and 4 deletions.
  1. +14 −3 application/controllers/missions.php
  2. +1 −1 application/views/missions/approve.php
@@ -58,9 +58,20 @@ public function approve($slug=false) {
}
// update players state to acknowledge they are on this page
- $player->state = 'mission-approve';
- Game::update_player($game, $player);
-
+ $player->state = 'mission-approve';
+
+ // set the players vote IF there is one
+ $vote = $this->post('vote');
+ if ($vote != false) {
+ $player->vote = $vote;
+ }
+ Game::update_player($game, $player);
+
+
+ // check if we have all votes
+ if
+
+ // finally save the game
Game::save($game, $games_list);
// set view data
@@ -19,7 +19,7 @@
<?php } ?>
<? if ($player->vote == '') { ?>
- <?= form_open('missions/vote/'.$game->slug, array('class' => 'vote')) ?>
+ <?= form_open('missions/approve/'.$game->slug, array('class' => 'vote')) ?>
<?= form_hidden('vote', ''); ?>
<p>Vote to approve or reject the leaders team</p>

0 comments on commit 84b75dd

Please sign in to comment.