public function planAction()
 {
     $group_id = $this->_request->getParam('g');
     $target_id = $this->_request->getParam('t');
     $level_id = $this->_request->getParam('l');
     $game_id = $this->_request->getParam('gm');
     if ($group_id && $target_id && $level_id && $game_id) {
         $plan_DB = new Application_Model_DbTable_Planing();
         $new_plan = array('group_id' => $group_id, 'target_id' => $target_id, 'level_id' => $level_id, 'game_id' => $game_id, 'create_date' => time());
         try {
             $plan_id = $plan_DB->insert($new_plan);
             $plans = $plan_DB->getAll($plan_id);
             $this->view->plan_id = $plan_id;
             $this->view->plans = $plans;
         } catch (Exception $ex) {
             die(json_encode(array('status' => 'danger', 'msg' => $this->lang->_('FAILED_DOC'))));
         }
     }
 }
Exemplo n.º 2
0
 public function planAction()
 {
     $group_id = $this->_request->getParam('g');
     $target_id = $this->_request->getParam('t');
     $game_id = $this->_request->getParam('gm');
     if ($group_id && $target_id && $game_id) {
         $plan_DB = new Application_Model_DbTable_Planing();
         //date_default_timezone_set('Asia/Jerusalem');
         $new_plan = array('groupID' => $group_id, 'gameID' => $game_id, 'date' => date('Y-m-d H:i:s'), 'fieldID' => $_SESSION['Default']['field']);
         try {
             $plan_id = $plan_DB->insert($new_plan);
             $plans = $plan_DB->getAll($plan_id);
             $this->view->plan_id = $plan_id;
             $this->view->plans = $plans;
             $this->_redirect('/groups/group/g/' . $group_id . '/t/' . $target_id . '/gm/' . $game_id);
         } catch (Exception $ex) {
             die(json_encode(array('status' => 'danger', 'msg' => $this->lang->_('FAILED_DOC'))));
         }
         $groups_DB = new Application_Model_DbTable_Group();
         $this->view->groupName = $groups_DB->getName($group_id);
     }
 }