コード例 #1
0
ファイル: ItemList.php プロジェクト: paolopr/todolist
 /**
  * Get completed records
  * @return array Completed items
  */
 public function getCompleted()
 {
     $query = 'SELECT * FROM todo WHERE active = 0 AND completed = 1 ORDER BY due_date';
     return Connect::getEntries($query);
 }
コード例 #2
0
ファイル: Item.php プロジェクト: paolopr/todolist
 /**
  * Set current db entry inactive and create updated entry
  * @return [type] [description]
  */
 public function update()
 {
     $this->mostRecent = 1;
     $this->revision++;
     if (empty($this->refId)) {
         $this->refId = $this->itemId;
     }
     $query = "UPDATE todo SET active = 0 AND date_updated = NOW() WHERE list_item_id = {$this->itemId}";
     Connect::update($query);
     $this->create();
 }
コード例 #3
0
ファイル: Process.php プロジェクト: paolopr/todolist
 /**
  * Restore a task that has been marked as completed
  * - Validate data
  * - set query statement
  * - excute and redirect
  * @param  array $post $_POST data
  * @return none
  */
 public function restore($post)
 {
     $this->itemId = Validate::isNumber($post['itemId']);
     $query = "UPDATE todo SET completed = 0 , active = 1, date_updated = NOW() WHERE list_item_id = {$this->itemId}";
     Connect::executeQuery($query);
     RouteCtrl::routeTo('/main/Task%20Restored');
 }