/**
  * Get info about count tasks
  *
  * @return \Framework\Response\Response
  */
 public function getInfoAction()
 {
     $info = Task::check('all');
     $process = Task::check('p');
     $complited = Task::check('c');
     return $this->render('info.html', array('task' => $info, 'complited' => $complited, 'process' => $process));
 }
 /**
  * Update complited task
  */
 public function secondAction()
 {
     $second_id = $this->getRequest()->post('second_id');
     $complited_second_task = Task::first($second_id);
     echo json_encode(array('result' => $complited_second_task));
 }
예제 #3
0
 /**
  * Remove task
  * @param  \Todo\Model\Task $task
  * @return boolean
  */
 public function removeTask($task)
 {
     $query = 'DELETE FROM tasks WHERE id=:id';
     $id = $task->getId();
     $stmt = $this->conn->prepare($query);
     $stmt->bindParam('id', $id);
     return $stmt->execute();
 }