Tasks::getToDo PHP Method

getToDo() public method

public getToDo ( $order_by = null, $from_date = null )
    public function getToDo($order_by = null, $from_date = null)
    {
        if (is_null($order_by)) {
            $order_by = ' due_date ASC, due_time DESC ';
        }
        if (is_null($from_date)) {
            $from_date = time();
        } else {
            $from_date = strtotime($from_date);
        }
        $from_date = date('Y-m-d', $from_date);
        $q = $this->base_tasks_q . 'WHERE due_date >= :from AND status_id= :status_id ORDER BY ' . $order_by;
        $qresult = $this->basecoat->db->select($q, array('from' => $from_date, 'status_id' => $this->todo_status_id));
        if ($qresult < 0) {
            // Something went wrong
            $this->logError($qresult . ' ' . $this->basecoat->db->errorMsg . ' :: ' . $q);
            return $qresult;
        }
        $this->basecoat->db->fetchAll($tasks);
        return $tasks;
    }