<?php

defined('BASEPATH') or exit('No direct script access allowed');

require_once 'Da_project.php';

class M_project extends Da_project
{

	public function __construct()
	{
		parent::__construct();
	}

	public function get_all()
	{
		$sql = "SELECT * FROM {$this->db_name}.project";
        $query = $this->db->query($sql);
        return $query;
	}

	public function get_all_year()
	{
		$sql = "SELECT date FROM {$this->db_name}.project
		GROUP BY date";
        $query = $this->db->query($sql);
        return $query;
	}

	public function get_all_user($id)
	{
		$sql = "SELECT * FROM {$this->db_name}.project
		Where user_id = $id";
        $query = $this->db->query($sql);
        return $query;
	}

	public function get_all_year_user($id)
	{
		$sql = "SELECT date FROM {$this->db_name}.project
		Where user_id = $id
		GROUP BY date";
        $query = $this->db->query($sql);
        return $query;
	}

	public function get_project_by_id($id){
		$sql = "SELECT * FROM {$this->db_name}.project
		Where project_id = $id";
        $query = $this->db->query($sql);
        return $query;
	}
}
